/* One top bar for the homepage and the member pages. Two states on .topbar[data-state]: "out" (visitor) and "in" (member).
   Colours are the members palette written out, because each page names its variables differently. */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(3, 3, 5, .86); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(157, 124, 243, .16); font-family: 'Inter', system-ui, sans-serif; }
.topbar-in { max-width: 1212px; margin: 0 auto; padding: 8px 16px; min-height: 64px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.topbar[data-state="out"] .only-in, .topbar[data-state="in"] .only-out { display: none !important; }

.tb-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: 'Cinzel', Georgia, serif; font-weight: 900; font-size: 18px; letter-spacing: .3em; color: #d4af37; text-shadow: 0 0 10px rgba(212, 175, 55, .3); }
.tb-brand svg { width: 26px; height: 26px; flex: none; }

.tb-links { display: flex; gap: 20px; flex: 1; flex-wrap: wrap; align-items: center; }
.tb-links a { color: #b0b0c0; text-decoration: none; font-size: 14.5px; padding-block: 6px; border-bottom: 2px solid transparent; }
.tb-links a:hover { color: #f5f5f7; }
.tb-links a.on { color: #f5f5f7; border-bottom-color: #d4af37; }

.tb-lang { display: flex; border: 1px solid rgba(157, 124, 243, .3); border-radius: 999px; overflow: hidden; }
.tb-lang button { background: none; border: 0; color: #b0b0c0; font: 600 12.5px 'Inter', system-ui, sans-serif; letter-spacing: .06em; padding: 6px 11px; cursor: pointer; }
.tb-lang button[aria-pressed="true"] { background: rgba(157, 124, 243, .18); color: #f5f5f7; }

.tb-btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 4px; padding: 9px 16px; font: 600 14.5px 'Inter', system-ui, sans-serif; letter-spacing: .04em; text-decoration: none; cursor: pointer; background: linear-gradient(135deg, #9d7cf3, #6a49cc); color: #fff; box-shadow: 0 0 18px rgba(157, 124, 243, .25); }
.tb-btn:hover { background: linear-gradient(135deg, #b39af6, #9d7cf3); }
.tb-btn.ghost { background: transparent; border: 1px solid rgba(157, 124, 243, .4); color: #f5f5f7; box-shadow: none; }
.tb-btn.ghost:hover { border-color: #9d7cf3; }

.tb-me { position: relative; }
.tb-me-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid transparent; border-radius: 999px; padding: 3px 10px 3px 3px; color: #f5f5f7; font: 500 14px 'Inter', system-ui, sans-serif; cursor: pointer; }
.tb-me-btn:hover, .tb-me-btn[aria-expanded="true"] { border-color: rgba(157, 124, 243, .4); }
.tb-avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: #9d7cf3 center / cover; color: #0b0812; font-family: 'Cinzel', Georgia, serif; font-weight: 700; flex: none; }
.tb-dot { width: 8px; height: 8px; border-radius: 50%; background: #e0605a; display: inline-block; }
.tb-caret { color: #6e6e80; font-size: 11px; }
.tb-menu { position: absolute; right: 0; top: calc(100% + 6px); width: 200px; background: #12101b; border: 1px solid rgba(157, 124, 243, .4); border-radius: 6px; padding: 6px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 16px 40px rgba(0, 0, 0, .6); z-index: 25; }
.tb-menu[hidden] { display: none; }
.tb-menu a { color: #f5f5f7; text-decoration: none; font-size: 14px; padding: 7px 10px; border-radius: 4px; }
.tb-menu a:hover { background: rgba(157, 124, 243, .12); }
.tb-menu a.on { color: #d4af37; }
.tb-menu hr { border: 0; border-top: 1px solid #241f36; margin: 4px 0; }
.tb-menu a.tb-warden { color: #d4af37; } /* staff only */

/* Nothing may make the page wider than the screen (a too-wide row made phones open the page zoomed in, with the top bar narrower than the content). */
html, body { overflow-x: clip; }

/* 3-dot menu (built by topbar.js): phones only */
.tb-more { display: none; width: 34px; height: 34px; flex: none; place-items: center; padding: 0; background: none; border: 1px solid transparent; border-radius: 8px; color: #f5f5f7; cursor: pointer; }
.tb-more svg { width: 18px; height: 18px; }
.tb-more[aria-expanded="true"] { border-color: rgba(157, 124, 243, .4); background: rgba(157, 124, 243, .12); }
.tb-sheet { position: absolute; top: calc(100% + 4px); right: 8px; width: 210px; background: #12101b; border: 1px solid rgba(157, 124, 243, .4); border-radius: 10px; padding: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .65); display: flex; flex-direction: column; gap: 1px; z-index: 30; font-family: 'Inter', system-ui, sans-serif; }
.tb-sheet[hidden] { display: none; }
.topbar[data-state="out"] .tb-sheet .only-in, .topbar[data-state="in"] .tb-sheet .only-out { display: none !important; }
.tb-sheet .sh-label { font: 600 9.5px 'Inter', system-ui, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: #d4af37; padding: 4px 8px 2px; }
.tb-sheet .sh-link { display: flex; align-items: center; min-height: 34px; padding: 0 8px; border-radius: 6px; color: #f5f5f7; text-decoration: none; font-size: 13.5px; }
.tb-sheet .sh-link:hover, .tb-sheet .sh-link:active { background: rgba(157, 124, 243, .12); }
.tb-sheet .sh-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding: 2px 8px; margin-top: 3px; border-top: 1px solid #241f36; color: #b0b0c0; font-size: 12.5px; }
.tb-sheet .sh-lang { display: flex; border: 1px solid rgba(157, 124, 243, .3); border-radius: 999px; overflow: hidden; }
.tb-sheet .sh-lang button { background: none; border: 0; color: #b0b0c0; font: 600 11px 'Inter', system-ui, sans-serif; letter-spacing: .06em; padding: 4px 10px; cursor: pointer; }
.tb-sheet .sh-lang button[aria-pressed="true"] { background: rgba(157, 124, 243, .22); color: #f5f5f7; }
.tb-sheet .sh-login { display: flex; align-items: center; justify-content: center; min-height: 32px; margin: 4px 2px 2px; border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #9d7cf3, #6a49cc); }

/* Phones: one 52px row — brand, (bell + avatar when logged in), 3-dot menu */
@media (max-width: 700px) {
  .topbar-in { flex-wrap: nowrap; gap: 6px; padding: 0 16px; min-height: 52px; } /* same 16px edges as the page content */
  .tb-more { margin-right: -8px; } /* the dots, not the button box, line up with the content edge */
  .tb-brand { margin-right: auto; font-size: 13px; letter-spacing: .18em; gap: 8px; }
  .tb-brand svg { width: 20px; height: 20px; }
  .tb-links, .tb-lang, .tb-btn { display: none !important; }
  .tb-more { display: grid; }
  .tb-me-btn { padding: 2px; gap: 4px; }
  .tb-me-btn #tb-name, .tb-me-btn .tb-caret { display: none; }
  .tb-avatar { width: 28px; height: 28px; font-size: 13px; }
  .tb-menu { width: 180px; padding: 4px; }
  .tb-menu a { font-size: 12px; padding: 5px 8px; }
  .tb-menu hr { margin: 2px 0; }
}

/* Site banner (admin page → Settings → Site banner) */
.site-banner { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 8px 16px; background: linear-gradient(90deg, rgba(212,175,55,.08), rgba(212,175,55,.22), rgba(212,175,55,.08)); border-bottom: 1px solid rgba(212,175,55,.45); color: #f5f5f7; font-size: 14px; text-align: center; }
.site-banner button { background: none; border: 0; color: #b0b0c0; cursor: pointer; font-size: 14px; }
/* zoomed-in phones: the 3-dot sheet never runs off the left edge (2026-11-16) */
.tb-sheet, .tb-menu { max-width: calc(100vw - 16px); box-sizing: border-box; }
/* very narrow / zoomed-in phones: brand shrinks so bell, avatar and 3 dots always fit */
@media (max-width: 260px) {
  .topbar { padding-left: 10px !important; padding-right: 10px !important; gap: 6px; }
  .tb-brand { font-size: 10px; letter-spacing: .04em; gap: 4px; min-width: 0; white-space: nowrap; }
  .tb-brand svg { width: 14px; height: 14px; }
  .tb-brand { font-size: 9px; letter-spacing: .02em; flex: 0 1 auto; }
  .tb-avatar { width: 24px; height: 24px; font-size: 11px; }
  .tb-more { width: 26px; height: 26px; margin-right: -4px; }
}
/* Safari has no plain backdrop-filter: the bar was see-through and page text showed behind the logo (2026-11-16) */
@media (max-width: 700px) { .topbar { background: #050408 !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; } }
@media (max-width: 260px) {
  .topbar-in { padding-left: 0 !important; padding-right: 0 !important; gap: 4px; }
  .tb-brand { flex: none; font-size: 8.5px; letter-spacing: 0; gap: 3px; }
  .tb-brand svg { width: 12px; height: 12px; }
  .tb-me { margin-left: auto; }
}
