/* Karnex guild site. Theme: Horde red and onyx, from the Red and Onyx crest: gunmetal steel, crimson, ember (docs/branding.md). */
:root {
  --night: #0a0809; --night-soft: #120e10; --panel: #161113; --panel-bright: #1f171a;
  --ink: #f6f1f1; --muted: #b3a3a5; --line: rgba(214, 170, 170, 0.16);
  --red: #d4142f; --red-soft: #ff4a5f; --crimson-deep: #7d0a1b; --ember: #ff6a3d; --rim: #ff5a6e;
  /* Polished gunmetal like the crest: bright top, dark horizon band, bright lower half. */
  --chrome: linear-gradient(180deg, #ffffff 0%, #f1eeee 30%, #c4bcbd 46%, #4d4547 52%, #cfc8c9 60%, #f7f4f4 78%, #ada4a6 100%);
  --font-display: "Oxanium", system-ui, sans-serif;
  --font-forever: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --max: 1140px;
  --radius: 10px;
  /* Item quality colors (WoW). */
  --q-poor: #9d9d9d; --q-common: #ffffff; --q-uncommon: #1eff00; --q-rare: #0070dd; --q-epic: #a335ee; --q-legendary: #ff8000;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 50% 0%, #2c0a11 0%, var(--night) 60%) fixed, var(--night);
  color: var(--ink); font-family: var(--font-body); line-height: 1.6;
}
a { color: var(--red-soft); }
img { max-width: 100%; }
main { flex: 1; width: 100%; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(10, 8, 9, 0.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 30px; height: 40px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(212, 20, 47, 0.5)); }
.brand span {
  font-family: var(--font-forever); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.08em;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 600;
  color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 6px;
}
.nav a:hover, .nav a:focus-visible { color: var(--ink); background: var(--panel-bright); outline: none; }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--red); border-radius: 0; }
.nav a.nav-discord { color: #fff; background: linear-gradient(135deg, var(--red-soft), var(--red) 55%, var(--crimson-deep)); margin-left: 6px; }
.nav a.nav-discord:hover { box-shadow: 0 0 18px rgba(212, 20, 47, 0.5); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.15em; font-weight: 700;
  padding: 14px 26px; border-radius: 8px; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-size: 0.9rem;
}
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--red-soft), var(--red) 55%, var(--crimson-deep)); box-shadow: 0 0 24px rgba(212, 20, 47, 0.4); }
.btn-primary:hover, .btn-primary:focus-visible { box-shadow: 0 0 36px rgba(255, 106, 61, 0.6); outline: none; }
.btn-ghost { color: var(--ink); border-color: var(--line); background: rgba(22, 17, 19, 0.6); }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--red); outline: none; }

/* ---------- Hero (home) ---------- */
.hero { text-align: center; padding: 40px 16px 24px; }
.crest { width: min(240px, 58vw); height: auto; filter: drop-shadow(0 0 30px rgba(212, 20, 47, 0.4)); }
.title {
  font-family: var(--font-forever); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.1;
  font-size: clamp(1.55rem, 8.4vw, 3.3rem); margin: 14px 0 0; white-space: nowrap;
  /* Red rim light and crimson glow, as on the crest's feathers, plus a dark drop for depth. */
  filter: drop-shadow(0 0 0.6px var(--rim)) drop-shadow(0 0 1.4px rgba(255, 90, 110, 0.9)) drop-shadow(0 3px 3px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 16px rgba(200, 16, 40, 0.55));
}
.title .title-inner { display: inline-block; }
.title .word { display: inline-block; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* One big infinity sign, exactly as wide as the title. */
.title .ornament { display: block; width: 100%; height: auto; margin-top: 0.12em; }
.kicker { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.3em; color: var(--red-soft); font-size: 0.8rem; margin: 14px 0 0; }
.hero p.lead { color: var(--muted); max-width: 560px; margin: 12px auto 28px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 36px 0; }
.section-title {
  font-family: var(--font-forever); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: clamp(1.3rem, 4.5vw, 1.8rem);
  margin: 0 0 6px; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 0.6px var(--rim)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8));
}
.section-sub { color: var(--muted); margin: 0 0 22px; }
.page-head { padding: 34px 0 8px; }
.page-head .kicker { margin: 0 0 4px; }

.panel { background: linear-gradient(180deg, var(--panel-bright), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); }

/* Stats strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 18px; text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-size: 2rem; line-height: 1.1; color: var(--ink); }
.stat span { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.72rem; color: var(--muted); }

/* Class mix bars */
.classmix { padding: 18px; display: grid; gap: 10px; }
.classmix .row { display: grid; grid-template-columns: 90px 1fr 32px; align-items: center; gap: 10px; font-size: 0.9rem; }
.classmix .bar { height: 10px; border-radius: 5px; background: rgba(214, 170, 170, 0.12); overflow: hidden; }
.classmix .bar i { display: block; height: 100%; border-radius: 5px; }
.classmix .count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Member cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card {
  display: flex; align-items: center; gap: 12px; padding: 12px; text-decoration: none; color: inherit;
  background: linear-gradient(180deg, var(--panel-bright), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius);
  border-left: 3px solid var(--cc, var(--line)); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
a.card:hover, a.card:focus-visible { border-color: var(--cc); box-shadow: 0 0 18px color-mix(in srgb, var(--cc) 30%, transparent); transform: translateY(-1px); outline: none; }
.avatar {
  flex: none; width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--night-soft);
  border: 1px solid color-mix(in srgb, var(--cc, #b3a3a5) 60%, transparent);
}
.avatar.placeholder {
  display: grid; place-items: center; font-family: var(--font-forever); font-weight: 700; font-size: 1.5rem; color: var(--cc);
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--cc) 25%, transparent), var(--night-soft) 70%);
}
.card .who { min-width: 0; }
.card .name { font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .name small { color: var(--muted); font-weight: 400; }
.card .meta { font-size: 0.85rem; color: var(--muted); line-height: 1.35; }
.card .meta .cls { color: var(--cc); font-weight: 600; }
.card .rank { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.68rem; color: var(--red-soft); }
.lvl { margin-left: auto; flex: none; text-align: center; font-family: var(--font-display); }
.lvl b { display: block; font-size: 1.3rem; line-height: 1; }
.lvl span { font-size: 0.6rem; letter-spacing: 0.15em; color: var(--muted); text-transform: uppercase; }

/* Roster controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.controls input, .controls select {
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
.controls input { flex: 1 1 220px; }
.controls select { flex: 0 1 180px; }
.controls input:focus, .controls select:focus { outline: none; border-color: var(--red); }
.count-line { color: var(--muted); font-size: 0.9rem; margin: -6px 0 14px; }

/* ---------- Member page ---------- */
.member-hero { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: center; padding: 24px 0 8px; }
@media (min-width: 820px) { .member-hero { grid-template-columns: minmax(280px, 420px) 1fr; } }
.render {
  position: relative; min-height: 280px; display: grid; place-items: end center; overflow: hidden;
  background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--cc) 28%, transparent), transparent 70%), var(--panel);
}
.render { height: clamp(320px, 60vw, 480px); }
.render img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; transform: scale(1.9); transform-origin: 50% 40%; display: block; }
.render .placeholder-big { padding: 60px 0; font-family: var(--font-forever); font-size: 6rem; color: var(--cc); opacity: 0.8; }
.member-name { font-family: var(--font-forever); font-weight: 700; font-size: clamp(2rem, 7vw, 3rem); line-height: 1.05; margin: 0;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 0.6px var(--rim)) drop-shadow(0 3px 3px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 14px rgba(200, 16, 40, 0.45)); }
.member-sub { font-size: 1.1rem; margin: 6px 0 14px; }
.member-sub .cls { color: var(--cc); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.chip { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip b { color: var(--ink); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 820px) { .grid-2 { grid-template-columns: 1fr 1.4fr; } }
.box { padding: 18px; }
.box h2 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.85rem; color: var(--red-soft); margin: 0 0 14px; }
.prof { margin: 0 0 12px; }
.prof .top { display: flex; justify-content: space-between; font-size: 0.92rem; }
.prof .top span { color: var(--muted); font-variant-numeric: tabular-nums; }
.prof .bar { height: 8px; border-radius: 4px; background: rgba(214, 170, 170, 0.12); overflow: hidden; margin-top: 4px; }
.prof .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--crimson-deep), var(--red), var(--ember)); }
.gear { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.gear li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; background: rgba(10, 8, 9, 0.45); border: 1px solid var(--line); min-width: 0; }
.gear .icon { flex: none; width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--qc); background: var(--night-soft) center / cover no-repeat; }
.gear .item { min-width: 0; display: flex; flex-direction: column; }
.gear .iname { display: block; color: var(--qc); font-weight: 600; font-size: 0.9rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gear .islot { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.q-poor { --qc: var(--q-poor); } .q-common { --qc: var(--q-common); } .q-uncommon { --qc: var(--q-uncommon); }
.q-rare { --qc: var(--q-rare); } .q-epic { --qc: var(--q-epic); } .q-legendary { --qc: var(--q-legendary); }
.empty { color: var(--muted); font-style: italic; margin: 0; }
.back { display: inline-block; margin: 20px 0 0; font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }

/* Loading / notices */
.notice { padding: 22px; text-align: center; color: var(--muted); }
.skeleton { height: 82px; border-radius: var(--radius); background: linear-gradient(90deg, var(--panel) 0%, var(--panel-bright) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } a.card { transition: none; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0; color: var(--muted); font-size: 0.85rem; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--ink); }
.updated { font-size: 0.8rem; color: var(--muted); }

@media (max-width: 560px) {
  .nav a:not(.nav-discord) { padding: 8px 6px; letter-spacing: 0.08em; }
  .brand span { display: none; }
  .classmix .row { grid-template-columns: 76px 1fr 28px; }
}

/* ---------- Home: Discord count, leaderboard, activity, recruitment ---------- */
.discord-live { display: inline-flex; align-items: center; gap: 8px; margin: 16px 0 0; font-size: 0.9rem; color: var(--muted); }
.discord-live[hidden] { display: none; }
.discord-live .dot { width: 9px; height: 9px; border-radius: 50%; background: #3ba55d; box-shadow: 0 0 10px #3ba55d; }
.home-split { align-items: start; }
@media (min-width: 820px) { .home-split { grid-template-columns: 1.2fr 1fr; gap: 28px; } }
.board, .feed { list-style: none; margin: 0; padding: 8px; display: grid; gap: 4px; }
.board li, .feed li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; min-width: 0; }
.board li:nth-child(odd), .feed li:nth-child(odd) { background: rgba(10, 8, 9, 0.35); }
.board .place { width: 22px; flex: none; text-align: center; font-family: var(--font-display); color: var(--muted); }
.board li:nth-child(-n+3) .place { color: var(--red-soft); font-weight: 700; }
.avatar-sm { width: 36px; height: 36px; border-radius: 6px; font-size: 1rem; }
.board .who, .feed .who { flex: 1; min-width: 0; line-height: 1.3; }
.board .who a, .feed .who a { text-decoration: none; font-weight: 600; }
.board .who small, .feed .who small { color: var(--muted); }
.board .bar { display: block; height: 5px; border-radius: 3px; margin-top: 5px; background: rgba(214, 170, 170, 0.12); overflow: hidden; }
.board .bar i { display: block; height: 100%; background: var(--cc); }
.board .lv { font-family: var(--font-display); font-size: 1.15rem; flex: none; }
.feed .ev-icon { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-size: 0.8rem; color: var(--cc); border: 1px solid color-mix(in srgb, var(--cc) 50%, transparent); }
.feed .who small { display: block; font-size: 0.78rem; }
.feed li.empty { display: block; }
.recruit { display: grid; gap: 20px; padding: 24px; align-items: center; background: radial-gradient(ellipse at 0% 0%, rgba(212, 20, 47, 0.18), transparent 60%), linear-gradient(180deg, var(--panel-bright), var(--panel)); }
@media (min-width: 900px) { .recruit { grid-template-columns: 1.3fr 1fr auto; } }
.recruit .section-sub { margin-bottom: 12px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); }
.steps b { color: var(--ink); }

/* ---------- Crafters ---------- */
.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.prof-card h2 { display: flex; justify-content: space-between; align-items: baseline; }
.prof-card h2 small { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.05em; }
.prof-card .top a { text-decoration: none; font-weight: 600; }

/* ======================================================================
   Tabbed layout (Joe, 2026-11-14): crest on top, tabs, and every view in
   one night-black see-through glass box. public/js/app.js swaps views.
   ====================================================================== */
body { background:
  radial-gradient(ellipse 70% 45% at 50% 0%, rgba(150, 12, 32, 0.45), transparent 70%),
  radial-gradient(ellipse 60% 40% at 50% 100%, rgba(90, 8, 20, 0.25), transparent 70%),
  var(--night) fixed; }
.hero { padding: 28px 16px 18px; transition: padding 0.3s; }
.crest-link { display: inline-block; }
.crest { transition: width 0.3s; }
/* Other tabs: a smaller crest so the data sits higher on the screen. */
body:not([data-tab="home"]) .hero { padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { .hero, .crest { transition: none; } }

.shell { max-width: 1100px; padding-bottom: 8px; }
.tabs {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 0 0; background: linear-gradient(180deg, var(--night) 70%, transparent);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem; font-weight: 600;
  color: var(--muted); text-decoration: none; padding: 12px 18px; border-radius: 10px 10px 0 0;
  border: 1px solid transparent; border-bottom: 0; transition: color 0.15s, background 0.15s;
}
.tab:hover, .tab:focus-visible { color: var(--ink); background: rgba(8, 6, 7, 0.5); outline: none; }
.tab:focus-visible { box-shadow: inset 0 0 0 2px var(--red-soft); }
.tab[aria-selected="true"] {
  color: var(--ink); background: rgba(6, 5, 6, 0.72); border-color: rgba(255, 90, 110, 0.28);
  box-shadow: inset 0 2px 0 var(--red), 0 -6px 18px rgba(212, 20, 47, 0.18);
}
.tab-discord { margin-left: auto; color: #fff; background: linear-gradient(135deg, var(--red-soft), var(--red) 55%, var(--crimson-deep)); border-radius: 8px; margin-bottom: 6px; padding: 9px 14px; align-self: center; }
.tab-discord:hover { box-shadow: 0 0 16px rgba(212, 20, 47, 0.55); background: linear-gradient(135deg, var(--red-soft), var(--red) 55%, var(--crimson-deep)); }
.tab-discord .online { margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); font-size: 0.68rem; letter-spacing: 0.06em; }
.tab-discord .online::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #3ba55d; box-shadow: 0 0 6px #3ba55d; vertical-align: 1px; }

/* The night-black see-through box. */
.glass {
  position: relative; min-height: 360px; padding: clamp(16px, 3vw, 30px);
  background: rgba(6, 5, 6, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(120%); backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(255, 90, 110, 0.28); border-radius: 0 12px 12px 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 40px rgba(212, 20, 47, 0.08);
  outline: none; opacity: 0; transform: translateY(6px); transition: opacity 0.22s ease, transform 0.22s ease;
}
.glass.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .glass { transition: none; transform: none; } }
.glass > section + section, .glass .grid-2 + section { margin-top: 30px; }
.glass .lead { color: var(--muted); margin: 0 0 20px; max-width: 640px; }
.glass .section-sub.small { font-size: 0.85rem; margin: 18px 0 0; }
.glass .more { margin: 14px 0 0; }
.view-head { margin: 0 0 16px; }

/* Inside the glass, inner pieces are slightly lighter see-through tiles instead of solid panels. */
.glass .stats { margin: 0 0 30px; }
.glass .stat, .glass .board, .glass .feed, .glass .classmix, .glass .card, .glass .prof-card, .glass .sub-box, .glass .gear li, .glass .render {
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); border-radius: var(--radius);
}
.glass .card { border-left: 3px solid var(--cc, var(--line)); }
.glass .board li:nth-child(odd), .glass .feed li:nth-child(odd) { background: rgba(0, 0, 0, 0.3); }
.glass .controls input, .glass .controls select { background: rgba(0, 0, 0, 0.45); }
.glass .prof-card, .glass .sub-box { padding: 16px; }
.prof-card h3, .sub-box h3, .join h3.label {
  display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 12px;
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.82rem; color: var(--red-soft);
}
.prof-card h3 small { color: var(--muted); }
.member-split { margin-top: 18px; }
@media (min-width: 820px) { .member-split { grid-template-columns: 1fr 1.5fr; } }
.member-hero { padding: 8px 0 0; }
.member-hero .kicker { margin: 0 0 6px; }
.member-name span { font-size: 0.55em; }
.back { margin: 0 0 12px; }

/* Join tab */
.join { display: grid; gap: 28px; }
@media (min-width: 820px) { .join { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.join .kicker { margin: 0 0 4px; }
.join p { color: var(--muted); }
.join .steps { margin: 0 0 20px; }
.join .discord-live { display: flex; margin-top: 14px; }

.footer { margin-top: 24px; }
@media (max-width: 560px) {
  .tab { padding: 11px 12px; letter-spacing: 0.08em; font-size: 0.74rem; }
  .tab-discord { padding: 8px 10px; }
  .glass { border-radius: 0 0 12px 12px; }
}
.gear .iname a { color: inherit; text-decoration: none; }
.gear .iname a:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .tab-discord .online { display: none; }
  .glass .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .glass .stat { padding: 12px 8px; }
  .glass .stat b { font-size: 1.6rem; }
}
@media (max-width: 400px) { .tab { padding: 11px 9px; letter-spacing: 0.05em; } }

/* Title kept on top on every tab, same size everywhere (Joe, 2026-11-14). */
.title { font-size: clamp(1.05rem, 4.6vw, 1.6rem); margin-top: 8px; } /* the Roster size, on every page (Joe) */
.title .ornament { margin-top: 0.08em; }
.hero .kicker { font-size: 0.7rem; margin-top: 8px; letter-spacing: 0.26em; }
.hero { padding: 14px 16px 8px; }
/* Crest at the Roster size on every page too (Joe). */
.crest { width: min(100px, 28vw); }
body:not([data-tab="home"]) .hero .kicker { margin-top: 6px; }

/* Recently online */
.online-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.online-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); border-left: 3px solid var(--cc); min-width: 0; }
.online-list span { min-width: 0; line-height: 1.25; }
.online-list a, .online-list span > span { font-weight: 600; text-decoration: none; }
.online-list small { display: block; color: var(--muted); font-size: 0.78rem; }
@media (max-width: 560px) { .online-list { grid-template-columns: 1fr 1fr; } }
.online-list em { font-style: normal; color: var(--muted); font-size: 0.85rem; }
.online-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .online-list { gap: 6px; }
  .online-list li { padding: 6px 8px; gap: 8px; }
  .online-list em { display: none; }
  .online-list .avatar-sm { width: 30px; height: 30px; }
  .online-list span { font-size: 0.9rem; }
  .online-list small { font-size: 0.72rem; }
}

/* Events tab (Officers/GM only): calendar, details, form */
.cal { margin: 8px 0 24px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cal-head h3 { margin: 0; font-size: 18px; }
.cal-nav { background: rgba(0, 0, 0, .3); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 32px; font-size: 20px; cursor: pointer; }
.cal-nav:hover { border-color: var(--red-soft); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-w { font-size: 12px; color: var(--muted); text-align: center; padding: 2px 0; text-transform: uppercase; letter-spacing: .06em; }
.cal-day { min-height: 92px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, .22); cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:hover:not(.past) { border-color: var(--red-soft); }
.cal-day.other { opacity: .45; }
.cal-day.past { cursor: default; opacity: .55; }
.cal-day.today { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.cal-num { font-size: 12px; color: var(--muted); }
.cal-ev { display: block; width: 100%; text-align: left; font: inherit; font-size: 12px; line-height: 1.25; padding: 2px 5px; border-radius: 5px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); background: rgba(212, 20, 47, .55); border: 1px solid rgba(255, 74, 95, .6); }
.cal-ev.future { background: rgba(212, 20, 47, .14); border-style: dashed; }
.cal-ev.pending { background: rgba(179, 163, 165, .18); border: 1px dashed var(--muted); }
.cal-key { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.cal-key .cal-ev { display: inline-block; width: auto; cursor: default; }
@media (max-width: 640px) {
  .cal-day { min-height: 58px; }
  .cal-ev { font-size: 0; padding: 0; height: 6px; } /* phones: a colored bar per event; tap it for details */
  .cal-key .cal-ev { font-size: 12px; padding: 2px 5px; height: auto; }
}
.events-tab { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .events-tab { grid-template-columns: 1fr; } }
.ev-details { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .25); align-self: start; }
.ev-title { margin: 0 0 6px; }
.ev-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ev-counts { margin: 6px 0; }
.ev-form { display: grid; gap: 10px; }
.ev-form label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.ev-repeat { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: flex; gap: 18px; margin: 0; }
.ev-repeat legend { font-size: 14px; color: var(--muted); padding: 0 4px; }
.ev-repeat label { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.ev-repeat input { width: auto; }
.ev-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ev-row label { flex: 1 1 120px; }
.ev-form input:not([type=radio]), .ev-form select, .ev-form textarea { background: var(--night); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; font: inherit; width: 100%; box-sizing: border-box; }
.ev-msg { min-height: 1.4em; margin: 0; }
.ev-msg.err { color: var(--red-soft); }
.events-tab .muted, .cal .muted { color: var(--muted); font-size: 14px; }

/* the Events tab stays hidden unless app.js reveals it for Officers/GM */
.tab[hidden] { display: none !important; }

/* Home: upcoming events (public; from Karnex Bot) */
.up-list { list-style: none; margin: 0; padding: 8px; display: grid; gap: 4px; }
.up-list li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; min-width: 0; }
.up-list li:nth-child(odd) { background: rgba(10, 8, 9, 0.35); }
.up-date { flex: 0 0 48px; display: grid; justify-items: center; line-height: 1.05; padding: 4px 0; border: 1px solid var(--line); border-radius: 8px;
  color: var(--red-soft); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
.up-date b { font-size: 20px; color: var(--ink); letter-spacing: 0; }
.up-list .who { flex: 1; min-width: 0; line-height: 1.3; }
.up-list .who a { text-decoration: none; font-weight: 600; }
.up-list .who small { display: block; color: var(--muted); }
.up-weekly { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Home feed: newly equipped gear, colored by quality */
.gear-link { color: var(--qc); font-weight: 600; text-decoration: none; }
.gear-link:hover { text-decoration: underline; }

/* Gear tab */
.gear-feed { grid-template-columns: 1fr; }
.gear-feed li { gap: 12px; }
.gear-feed .item { flex: 1; min-width: 0; }
.gear-who { flex: 0 1 40%; min-width: 0; text-align: right; line-height: 1.3; }
.gear-who .who-name a { color: var(--cc, var(--ink)); text-decoration: none; font-weight: 600; }
.gear-who .who-name { color: var(--cc, var(--ink)); font-weight: 600; }
.gear-who small { display: block; color: var(--muted); }
.gear-stats { margin-bottom: 16px; }
.gear-feed li.notice { display: block; text-align: center; }
@media (max-width: 560px) { .gear-feed li { flex-wrap: wrap; } .gear-who { flex-basis: 100%; text-align: left; padding-left: 48px; } }
@media (max-width: 560px) { body[data-tab="gear"] .controls select { flex: 1 1 calc(50% - 5px); } }
