/* The three hotbar tools share the game's gold frame and warm header. */
.cf-ranking-page,
.settings-overlay.cf-hub-overlay,
body > .cf-social-overlay.cf-directory-page {
  position: fixed; inset: 0; z-index: 10065;
  display: flex; align-items: center !important; justify-content: center;
  box-sizing: border-box; width: 100%; max-width: none; height: 100dvh; min-height: 0;
  margin: 0; padding: max(38px, env(safe-area-inset-top, 0px)) 10px max(12px, env(safe-area-inset-bottom, 0px)) !important;
  color: #f5e8c8; background: rgba(4, 10, 7, .94); backdrop-filter: blur(5px);
  font-family: inherit;
}
.cf-ranking-page[hidden], .cf-directory-page[hidden] { display: none !important; }
.cf-hub-panel,
.settings-panel.cf-hotbar-settings,
body > .cf-social-overlay.cf-directory-page > .cf-social-panel {
  position: relative; inset: auto; display: flex; flex-direction: column;
  box-sizing: border-box; width: min(100%, 520px) !important; max-width: 520px !important;
  height: 100% !important; max-height: 900px !important; min-height: 0 !important; margin: 0; padding: 0 !important;
  overflow: hidden; border: 2px solid #ecc450 !important; border-radius: 24px !important;
  background: linear-gradient(180deg, rgba(21,43,29,.91), rgba(5,18,11,.97)), url('/assets/profile-social-background-v20261025-1.webp') center / cover !important;
  box-shadow: 0 0 0 5px #4f391bb3, inset 0 0 0 3px #c58c3926, 0 18px 70px #0009 !important;
  animation: none !important;
}
:is(.cf-hub-panel,.cf-directory-page) * { box-sizing: border-box; }
.cf-hub-header,
.cf-ranking-panel > .cf-hub-header {
  flex: 0 0 auto; display: grid; grid-template-columns: 44px minmax(0,1fr) 44px;
  align-items: center; gap: 10px; min-height: 72px; padding: 10px 12px;
  border-bottom: 2px solid #d4b355; background: linear-gradient(180deg,#69421a,#301d0c);
  box-shadow: inset 0 2px #fff0b22b, 0 4px 12px #0005;
}
.cf-hub-header h1,
.cf-ranking-panel .cf-hub-header h1 {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  min-width: 0; margin: 0; color: #ffe7a0; font-size: 24px; line-height: 1.15;
  text-align: center; font-weight: 900; text-shadow: 0 2px 3px #1d0f08;
  white-space: normal; overflow: visible;
}
.cf-hub-header h1 > span { min-width: 0; overflow-wrap: anywhere; }
.cf-hub-header h1 > img { width: 32px; height: 32px; object-fit: contain; flex: 0 0 32px; filter: drop-shadow(0 2px 2px #0008); }
.cf-hub-icon-button,
.cf-ranking-panel > .cf-hub-header .cf-hub-icon-button {
  display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0;
  border: 1px solid #b4934b; border-radius: 14px; background: linear-gradient(180deg,#755223,#38240e);
  box-shadow: inset 0 1px #fff3bb55, 0 3px 7px #0004; color: #fff1b8;
  font-family: inherit; font-size: 30px; line-height: 1; cursor: pointer; touch-action: manipulation;
}
.cf-hub-icon-button > *, .cf-hub-header img { pointer-events: none; }
.cf-hub-scroll, .cf-ranking-scroll.cf-hub-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px;
  overscroll-behavior: contain; scrollbar-width: none;
}
.cf-hub-scroll::-webkit-scrollbar { display: none; }
:is(.cf-hub-panel,.cf-directory-page) button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
:is(.cf-hub-panel,.cf-directory-page) button:disabled { opacity: .55; cursor: default; }
:is(.cf-hub-panel,.cf-directory-page) :is(button,input):focus-visible { outline: 2px solid #ffe69c; outline-offset: 3px; }
:is(.cf-hub-panel,.cf-directory-page) button:active:not(:disabled) { filter: brightness(1.12); }
.cf-hub-primary {
  min-height: 44px; border: 1px solid #e6c76f; border-radius: 12px; padding: 10px 16px;
  color: #372309; background: linear-gradient(#ffe49a,#c99c42); box-shadow: inset 0 1px #fff1bd, 0 3px 7px #0003;
  font: inherit; font-weight: 900; font-size: 14px;
}
/* Search: separate query/results per directory. */
.cf-directory-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 14px; }
.cf-directory-tabs button { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 57px; padding: 8px; border: 1px solid #8b7844; border-radius: 14px; background: #10271b; color: #d2cbb2; font-size: 16px; font-weight: 850; }
.cf-directory-tabs button[aria-pressed=true] { border-color: #edca70; color: #ffedb4; background: linear-gradient(135deg,#725126,#3d2d17); box-shadow: inset 0 1px #ffeac331; }
.cf-directory-tabs img { width: 34px; height: 34px; object-fit: contain; pointer-events: none; }
.cf-directory-search { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.cf-directory-search input { min-width: 0; width: 100%; min-height: 46px; border: 1px solid #b59b5c99; border-radius: 12px; padding: 10px 12px; color: #fff0ce; background: #081a10; font-size: 16px; box-shadow: inset 0 2px 6px #0004; }
.cf-directory-search input::placeholder { color: #aaa98f; font-size: 14px; }
.cf-directory-scope { margin: 9px 2px 0; color: #bdbb9e; font-size: 12px; line-height: 1.5; }
.cf-directory-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 35px 20px; margin-top: 16px; border: 1px solid #b7a26343; border-radius: 18px; background: #07180f7a; text-align: center; }
.cf-directory-state > img { width: 78px; height: 78px; object-fit: contain; filter: drop-shadow(0 4px 4px #0008); }
.cf-directory-state b { font-size: 17px; color: #fbe8b3; }
.cf-directory-state p { margin: 0; max-width: 290px; font-size: 14px; line-height: 1.55; color: #b8bea8; }
.cf-directory-result-count { margin: 17px 2px 10px; color: #bdbb9e; font-size: 13px; }
.cf-directory-results { display: grid; gap: 10px; }
.cf-directory-card { display: grid; grid-template-columns: 58px minmax(0,1fr) 14px; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid #b7a26355; border-radius: 16px; background: linear-gradient(125deg,#263c2ce8,#102418e8); text-align: left; color: #f5e9ca; box-shadow: inset 0 1px #fff2ce0d; }
.cf-directory-avatar { display: block; width: 58px; height: 58px; border-radius: 13px; object-fit: contain; }
.cf-directory-player .cf-directory-avatar { object-fit: cover; border: 1px solid #c9a85f; }
.cf-directory-copy { display: grid; gap: 5px; min-width: 0; }
.cf-directory-copy > b { font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.cf-directory-copy small { font-size: 12px; line-height: 1.4; color: #b6bea6; overflow-wrap: anywhere; }
.cf-directory-copy .cf-directory-tag { width: fit-content; color: #edcc7b; letter-spacing: .06em; }
.cf-directory-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; color: #dccb9e; }
.cf-directory-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.cf-directory-meta img { width: 20px; height: 20px; object-fit: contain; }
.cf-directory-arrow { font-size: 27px; color: #d9bc77; }
.cf-directory-clan-hero { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 14px 12px 18px; text-align: center; }
.cf-directory-clan-hero > img { width: 84px; height: 84px; object-fit: contain; }
.cf-directory-clan-hero h2 { margin: 4px 0; color: #ffe5a4; font-size: 24px; overflow-wrap: anywhere; }
.cf-directory-clan-hero :is(p,small) { margin: 0; color: #cbbd91; }
.cf-directory-section { border: 1px solid #b7a26343; border-radius: 16px; padding: 14px; margin-bottom: 12px; background: #07180f77; }
.cf-directory-section h3 { margin: 0 0 10px; font-size: 16px; color: #f7df9e; }
.cf-directory-section p { color: #c8c6ae; line-height: 1.5; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cf-directory-section .cf-directory-card { grid-template-columns: 42px minmax(0,1fr) 12px; padding: 9px; gap: 9px; }
.cf-directory-section .cf-directory-avatar { width: 42px; height: 42px; }
/* Ranking uses the same hand-painted statistic art as player profiles. */
.cf-ranking-subtitle { margin: 0 0 14px; color: #bfbe9e; font-size: 14px; }
.cf-ranking-categories { gap: 10px; }
.cf-ranking-categories > button { grid-template-columns: 55px minmax(0,1fr) 20px; min-height: 78px; padding: 11px 12px; gap: 12px; border: 1px solid #c6ac645e; border-radius: 16px; background: linear-gradient(120deg,#293f2ddf,#102219e8); }
.cf-ranking-category-icon { width: 55px; height: 55px; padding: 3px; border: 0; background: none; }
.cf-ranking-category-icon img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 3px #0008); }
.cf-ranking-category-copy b { font-size: 16px; white-space: normal; overflow: visible; line-height: 1.3; }
.cf-ranking-category-copy small { margin-top: 3px; font-size: 12px; color: #b5bba3; white-space: normal; overflow: visible; line-height: 1.4; }
.cf-ranking-viewer { border-color: #d5b058; background: linear-gradient(130deg,#6b502433,#343c22a3); padding: 12px; }
.cf-ranking-viewer > small { margin: 0 0 9px; font-size: 13px; }
.cf-ranking-row { grid-template-columns: 30px minmax(0,1fr) minmax(65px,auto); gap: 9px; min-height: 76px; padding: 12px 10px; border-radius: 14px; background: #10261be8; }
.cf-ranking-row.is-podium { border-color: #c8a85b63; }
.cf-ranking-position { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 16px; }
.cf-ranking-position img { display: block; width: 29px; height: 29px; object-fit: contain; }
.cf-ranking-position[data-place="2"] img { filter: grayscale(1) brightness(1.25); }
.cf-ranking-position[data-place="3"] img { filter: sepia(.65) saturate(.75) brightness(.85); }
.cf-ranking-player { display: grid; grid-template-columns: 44px minmax(0,1fr); align-items: center; gap: 9px; }
.cf-ranking-player > span { display: grid; gap: 4px; min-width: 0; }
.cf-ranking-avatar { display: block; width: 44px; height: 48px; border: 1px solid #d6b260; border-radius: 10px; object-fit: cover; }
.cf-ranking-player b { font-size: 14px; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; overflow: visible; }
.cf-ranking-player small { display: flex; gap: 4px; align-items: center; color: #c5bd96; font-size: 12px; }
.cf-ranking-player small img { width: 17px; height: 17px; object-fit: contain; }
.cf-ranking-row > .cf-ranking-value { display: grid; gap: 3px; max-width: 145px; color: #f8dea1; font-size: 14px; line-height: 1.3; }
.cf-ranking-value > span { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: flex-end; overflow-wrap: anywhere; }
.cf-ranking-value img { width: 22px; height: 22px; flex: 0 0 22px; object-fit: contain; }
.cf-ranking-value small { color: #c2b48d; font-size: 12px; }
.cf-ranking-total { margin: 12px 2px; font-size: 12px; }
.cf-ranking-message { display: flex; align-items: center; flex-direction: column; gap: 14px; padding: 30px 15px; font-size: 15px; line-height: 1.5; }
.cf-ranking-message > img { width: 70px; height: 70px; object-fit: contain; }
/* Global settings: native audio/language/account handlers are preserved. */
.cf-settings-audio { padding: 14px; margin-bottom: 14px; border: 1px solid #c5ad6459; border-radius: 18px; background: #122b1bd6; }
.cf-settings-audio h2 { margin: 0 0 4px; font-size: 16px; color: #e8d5a5; }
.cf-settings-audio-row { display: grid; grid-template-columns: 50px minmax(0,1fr); gap: 8px 12px; align-items: center; padding: 14px 0 10px; }
.cf-settings-audio-row + .cf-settings-audio-row { margin-top: 12px; border-top: 1px solid #c4b57f26; }
.cf-settings-audio-row > img { grid-row: span 2; width: 50px; height: 55px; object-fit: contain; filter: drop-shadow(0 2px 3px #0008); }
.cf-settings-volume-copy { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-width: 0; }
.cf-settings-volume-copy b { font-size: 15px; color: #f3e4be; line-height: 1.3; }
.cf-settings-volume-copy output { color: #e4c878; font-size: 13px; white-space: nowrap; }
.cf-settings-audio-row input[type=range] { appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; height: 30px; margin: 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }
.cf-settings-audio-row input[type=range]::-webkit-slider-runnable-track { height: 8px; border: 1px solid #bda16075; border-radius: 8px; background: linear-gradient(to right,#e5bb56 var(--cf-volume),#091a10 var(--cf-volume)); }
.cf-settings-audio-row input[type=range]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 23px; height: 23px; margin-top: -9px; border: 2px solid #ffe9a3; border-radius: 50%; background: linear-gradient(#ecd28d,#a57b32); box-shadow: 0 2px 4px #0008; }
.cf-settings-audio-row input[type=range]::-moz-range-track { height: 8px; border: 1px solid #bda16075; border-radius: 8px; background: #091a10; }
.cf-settings-audio-row input[type=range]::-moz-range-progress { height: 8px; background: #e5bb56; }
.cf-settings-audio-row input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border: 2px solid #ffe9a3; border-radius: 50%; background: #d2ab58; }
.cf-settings-choice { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 88px; padding: 14px; margin-bottom: 12px; border: 1px solid #c5ad6459; border-radius: 18px; background: linear-gradient(120deg,#2e422f,#11271b); text-align: left; color: #f2e3bc; }
.cf-settings-choice > img { width: 48px; height: 48px; object-fit: contain; }
.cf-settings-choice > span:nth-child(2) { min-width: 0; display: grid; gap: 5px; }
.cf-settings-choice b { font-size: 16px; }
.cf-settings-choice small { color: #b6bba2; font-size: 12px; line-height: 1.5; }
.cf-settings-choice-tail { font-size: 18px; font-weight: 900; color: #eace83; }
.cf-settings-saved { color: #aeb49a; font-size: 12px; text-align: center; margin: 20px 0 4px; }
.cf-settings-languages > p { font-size: 14px; margin: 0 0 16px; color: #bebc9e; }
.cf-settings-language { display: grid; grid-template-columns: 43px minmax(0,1fr) 20px; align-items: center; gap: 12px; width: 100%; min-height: 65px; padding: 13px; margin-bottom: 10px; border: 1px solid #ae975957; border-radius: 14px; background: #11271c; color: #e8dec2; text-align: left; font-size: 16px; }
.cf-settings-language.active { border-color: #f3d281; background: linear-gradient(130deg,#74542799,#343c22); color: #ffebaa; }
.cf-settings-language-code { padding: 7px 3px; border: 1px solid #bea56366; border-radius: 8px; font-size: 13px; font-weight: 900; text-align: center; }
.cf-settings-account { width: 100%; min-width: 0; color: #f4e5bf; }
.cf-settings-account :is(input,textarea,button) { font-family: inherit; max-width: 100%; font-size: 15px; }
.cf-settings-account input { min-height: 44px; border: 1px solid #b5a05c; border-radius: 10px; background: #091b11; color: #f8eac5; padding: 10px 12px; }
.cf-settings-account button { min-height: 44px; border: 1px solid #caaa5c; border-radius: 10px; background: linear-gradient(#eacb7c,#ae8034) !important; color: #30200d; font-weight: 800; }
@media (max-width:390px) {
  .cf-hub-header, .cf-ranking-panel > .cf-hub-header { gap: 7px; padding-inline: 9px; }
  .cf-hub-header h1,.cf-ranking-panel .cf-hub-header h1 { font-size: 20px; gap: 6px; }
  .cf-hub-header h1 > img { width: 27px; height: 27px; flex-basis: 27px; }
  .cf-hub-scroll,.cf-ranking-scroll.cf-hub-scroll { padding: 12px; }
  .cf-ranking-row { grid-template-columns: 24px minmax(0,1fr) minmax(55px,auto); gap: 7px; padding: 10px 8px; }
  .cf-ranking-player { grid-template-columns: 35px minmax(0,1fr); gap: 6px; }
  .cf-ranking-avatar { width: 35px; height: 40px; }
  .cf-ranking-row > .cf-ranking-value { max-width: 100px; font-size: 13px; }
  .cf-directory-card { grid-template-columns: 47px minmax(0,1fr) 12px; padding: 10px; gap: 9px; }
  .cf-directory-avatar { width: 47px; height: 47px; }
  .cf-settings-volume-copy { gap: 6px; }
  .cf-settings-volume-copy b { font-size: 14px; }
}

.cf-settings-account .email-auth-result { color: #e4dabb !important; font-size: 14px; line-height: 1.55; margin-top: 16px; overflow-wrap: anywhere; }
@media (max-width:430px) {
  .cf-ranking-row { grid-template-columns: 26px minmax(0,1fr); gap: 6px 10px; }
  .cf-ranking-position { grid-row: span 2; }
  .cf-ranking-player { grid-template-columns: 44px minmax(0,1fr); gap: 9px; }
  .cf-ranking-avatar { width: 44px; height: 48px; }
  .cf-ranking-row > .cf-ranking-value { grid-column: 2; justify-self: end; max-width: none; font-size: 14px; }
  .cf-ranking-value > span { flex-wrap: nowrap; white-space: nowrap; }
  .cf-ranking-value small { white-space: nowrap; }
}
