/* ═══════════════════════════════════════════════════
   TEAM VALOR - Dark fire/gold theme
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #0a0603;
  --bg-1: #15100a;
  --bg-2: #1f1810;
  --bg-3: #2a2015;
  --border: #4a3820;
  --gold: #f0b90b;
  --gold-bright: #ffd700;
  --gold-dim: #8a6b1f;
  --ember: #ff6b1a;
  --ember-glow: #ff4500;
  --blood: #8b0000;
  --white: #f5eee0;
  --gray: #9a8f80;
  --dim: #6b6055;
  --success: #4ade80;
  --danger: #ef4444;
  --purple: #c77dff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at top, rgba(255, 107, 26, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(240, 185, 11, 0.04) 0%, transparent 50%);
}

/* ─── ANIMATIONS ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
@keyframes glow {
  0%, 100% { text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 107, 26, 0.3); }
  50% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.7), 0 0 40px rgba(255, 107, 26, 0.5); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 107, 26, 0.2); }
  50% { box-shadow: 0 0 35px rgba(255, 107, 26, 0.4); }
}
.page { animation: fadeIn 0.3s ease-out; }
.skeleton {
  background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2));
  background-size: 400px 100%;
  animation: shimmer 1.2s infinite linear;
  border-radius: 4px; height: 1rem; margin-bottom: 0.5rem;
}

/* ─── TOAST ─── */
#toast-stack {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 500;
  display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none;
}
.toast {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--gold-dim); border-left: 4px solid var(--gold);
  color: var(--white); padding: 0.8rem 1.2rem; border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6), 0 0 20px rgba(255, 107, 26, 0.15);
  animation: fadeIn 0.3s; pointer-events: auto;
  font-size: 0.9rem; min-width: 240px;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }

/* ─── FIRE TITLE ─── */
.fire-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  color: var(--gold-bright);
  letter-spacing: 0.08em;
  text-shadow:
    0 0 10px rgba(255, 215, 0, 0.5),
    0 0 20px rgba(255, 107, 26, 0.4),
    0 0 40px rgba(255, 69, 0, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.8);
  background: linear-gradient(180deg, #fff6a0 0%, var(--gold-bright) 30%, #ff8c00 70%, var(--ember-glow) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  font-size: 2.5rem;
}
.fire-title.large { font-size: 5rem; line-height: 1.1; }

/* ─── LOGIN OVERLAY ─── */
.overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(ellipse at center, rgba(20, 10, 5, 0.98) 0%, rgba(0, 0, 0, 0.99) 100%);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.login-box {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 2px solid var(--gold-dim);
  border-radius: 12px;
  padding: 3rem 2.5rem;
  width: 400px; max-width: 90vw;
  box-shadow: 0 0 60px rgba(255, 107, 26, 0.3), inset 0 1px 0 rgba(240, 185, 11, 0.2);
  text-align: center;
}
.login-sub { color: var(--gray); margin: 1rem 0 2rem; font-style: italic; letter-spacing: 0.05em; }
.login-box input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--white);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}
.login-box input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.15); }
.login-error { color: var(--danger); min-height: 1.2em; margin-top: 0.8rem; font-size: 0.9rem; }
.guest-link { margin-top: 1.2rem; }
.guest-link a { color: var(--gray); font-size: 0.9rem; text-decoration: none; }
.guest-link a:hover { color: var(--gold); }

/* Discord sign-in button */
.discord-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.7rem;
  width: 100%;
  background: #5865f2; color: white;
  border: none; border-radius: 6px;
  padding: 0.85rem 1.2rem;
  font-family: inherit; font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: all 0.15s;
  margin-top: 0.8rem;
}
.discord-btn:hover { background: #4752c4; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(88, 101, 242, 0.4); }
.discord-icon { width: 22px; height: 18px; }

/* Claim-character banner */
.claim-banner {
  position: sticky; top: 0; z-index: 5;
  background: linear-gradient(90deg, rgba(88, 101, 242, 0.12), rgba(240, 185, 11, 0.08));
  border-bottom: 1px solid var(--gold-dim);
}
.claim-banner-inner {
  max-width: 1400px; margin: 0 auto; padding: 0.8rem 1.5rem;
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
}
.claim-banner-icon { font-size: 1.3rem; }
.claim-banner-text { color: var(--white); flex: 1; min-width: 200px; font-size: 0.95rem; }
#claim-char-select {
  background: var(--bg-3); color: var(--white);
  border: 1px solid var(--gold-dim); border-radius: 4px;
  padding: 0.4rem 0.6rem; font-family: inherit; font-size: 0.9rem;
  min-width: 200px;
}

/* Group builder controls */
.grp-mode-row {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  margin-bottom: 0.7rem;
}
.grp-mode-toggle {
  display: flex; align-items: center; gap: 0.4rem;
  cursor: pointer; color: var(--white);
  font-size: 0.9rem;
}
.grp-mode-toggle input[type="checkbox"] {
  width: 18px; height: 18px; cursor: pointer; accent-color: var(--gold);
}
#grp-target-date-label {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--gray); font-size: 0.9rem;
}
#grp-target-date {
  background: var(--bg-3); color: var(--white);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 0.4rem 0.6rem; font-family: inherit; font-size: 0.9rem;
}
.grp-custom-notes {
  width: 100%; min-height: 60px; max-height: 200px;
  background: var(--bg-3); color: var(--white);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 0.7rem 0.9rem;
  font-family: inherit; font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 0.8rem;
}
.grp-custom-notes:focus { outline: none; border-color: var(--gold); }
.grp-custom-notes::placeholder { color: var(--dim, #6b6055); font-style: italic; }

/* AI rationale display */
.ai-rationale {
  background: linear-gradient(180deg, rgba(240, 185, 11, 0.06), rgba(15, 22, 40, 0.4));
  border: 1px solid var(--gold-dim);
  border-left: 4px solid var(--gold);
  border-radius: 4px;
  padding: 0.9rem 1.2rem;
  margin: 1rem 0;
  color: var(--white);
  font-size: 0.95rem;
  line-height: 1.5;
}
.ai-rationale .ar-label {
  color: var(--gold); font-family: 'Cinzel', serif;
  font-size: 0.85rem; letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}
.ai-rationale .ar-bench {
  margin-top: 0.6rem; padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  color: var(--gray); font-size: 0.85rem;
}
.ai-rationale .ar-bench strong { color: #e84545; }

/* AI preset prompts */
.preset-prompts {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-bottom: 0.8rem;
}
.preset-btn {
  background: var(--bg-3); color: var(--gray);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 0.4rem 0.8rem;
  font-family: inherit; font-size: 0.82rem;
  cursor: pointer; transition: all 0.15s;
}
.preset-btn:hover { border-color: var(--gold); color: var(--white); background: rgba(240, 185, 11, 0.08); }

/* Wipe analyzer */
.wipe-selector {
  display: flex; gap: 0.6rem; margin-bottom: 0.8rem;
}
.wipe-selector select {
  background: var(--bg-3); color: var(--white);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 0.5rem 0.7rem; font-family: inherit;
}
.wipe-meta {
  color: var(--gray); font-size: 0.85rem; margin-bottom: 0.8rem;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--border);
}
.wipe-meta a { color: var(--gold); text-decoration: none; }
.wipe-meta a:hover { text-decoration: underline; }
.wipe-h { color: var(--gold); font-family: 'Cinzel', serif; margin: 0.8rem 0 0.4rem; }
.wipe-vod-deaths {
  background: rgba(88, 101, 242, 0.08);
  border-left: 3px solid #5865f2;
  padding: 0.7rem 1rem; border-radius: 4px;
  margin-bottom: 1rem; font-size: 0.9rem;
}
.wipe-vod-deaths strong { color: #5865f2; margin-right: 0.4rem; }
.wipe-vod-deaths a {
  color: var(--white); text-decoration: none;
  border-bottom: 1px dotted #5865f2;
}
.wipe-vod-deaths a:hover { color: #7983f5; }

/* Batch-save bar (shared by User Manager + Roster Manager) */
.batch-save-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 0.8rem;
  background: linear-gradient(90deg, rgba(240, 185, 11, 0.18), rgba(240, 185, 11, 0.05));
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 0.7rem 1rem;
  margin-bottom: 0.8rem;
  box-shadow: 0 2px 12px rgba(240, 185, 11, 0.2);
}
.batch-save-msg {
  flex: 1; color: var(--gold); font-weight: 600;
  font-size: 0.95rem;
}
.batch-save-bar .ghost-btn { max-width: 100px; }
.batch-save-bar .gold-btn { max-width: 140px; }
.roster-manager-table tr.dirty {
  background: rgba(240, 185, 11, 0.08);
  box-shadow: inset 3px 0 0 var(--gold);
}
.roster-manager-table tr.dirty input,
.roster-manager-table tr.dirty select {
  border-color: var(--gold);
}

/* User Manager additions */
.um-user-cell { display: flex; align-items: center; gap: 0.6rem; }
.um-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  color: var(--gray); background: var(--bg-3);
  flex-shrink: 0;
}
.um-avatar-placeholder { font-family: 'Cinzel', serif; }
.um-badge {
  display: inline-block;
  font-size: 0.7rem; padding: 0.18rem 0.5rem; border-radius: 3px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.um-badge.discord { color: #5865f2; border: 1px solid #5865f2; background: rgba(88, 101, 242, 0.1); }
.um-badge.legacy { color: var(--gray); border: 1px solid var(--border); background: var(--bg-3); }
.um-actions { display: flex; gap: 0.3rem; }
.um-role, .um-char {
  background: var(--bg-3); color: var(--white);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 0.3rem 0.5rem; font-size: 0.85rem; font-family: inherit;
}

/* ─── BUTTONS ─── */
.gold-btn {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold), #c4950a);
  color: #1a1005;
  border: none;
  padding: 0.85rem 1.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(255, 107, 26, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  width: 100%;
}
.gold-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255, 107, 26, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.gold-btn:active { transform: translateY(0); }
.ghost-btn {
  background: transparent;
  color: var(--gray);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 4px;
  cursor: pointer;
}
.ghost-btn:hover { color: var(--gold); border-color: var(--gold-dim); }

/* ─── HEADER ─── */
.site-header {
  background: linear-gradient(180deg, var(--bg-1) 0%, rgba(15, 10, 5, 0.97) 100%);
  border-bottom: 1px solid var(--border);
  /* No backdrop-filter here — it creates a containing block for fixed
     descendants, which would trap the mobile nav drawer inside the header's
     ~60px box instead of letting it fill the viewport. */
  position: sticky; top: 0; z-index: 130;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem; max-width: 1400px; margin: 0 auto;
}
.logo-block { display: flex; flex-direction: column; flex-shrink: 0; }
.brand {
  font-family: 'Cinzel', serif; font-weight: 900; font-size: 1.4rem;
  color: var(--gold); letter-spacing: 0.15em;
  text-shadow: 0 0 8px rgba(240, 185, 11, 0.5);
  white-space: nowrap;
}
.tag { color: var(--gray); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.main-nav { display: flex; gap: 1.1rem; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.main-nav .user-info { margin-left: 0.8rem; }
.nav-link {
  color: var(--white); text-decoration: none; font-size: 0.85rem;
  letter-spacing: 0.04em; transition: color 0.2s; position: relative;
  white-space: nowrap;
}
.nav-link::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--gold); transition: width 0.2s;
}
.nav-link:hover { color: var(--gold); }
.nav-link:hover::after { width: 100%; }
.user-info { display: flex; align-items: center; gap: 1rem; }
#user-badge { color: var(--gold); font-weight: 600; font-size: 0.9rem; }

/* ─── HERO ─── */
.hero {
  position: relative;
  padding: 3rem 2rem 4rem;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.fire-title { animation: glow 3s ease-in-out infinite; }
.hero-countdown { animation: pulseGlow 4s ease-in-out infinite; }
.hero-flames {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(255, 107, 26, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(255, 69, 0, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(240, 185, 11, 0.2) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; }
.hero-sub {
  color: var(--white); font-size: 1.2rem; letter-spacing: 0.2em;
  text-transform: uppercase; margin-top: 0.5rem; font-weight: 500;
}
.hero-sub span { color: var(--gold); }
.hero-team {
  font-family: 'Cinzel', serif; font-size: 2rem; font-weight: 700;
  color: var(--gold); letter-spacing: 0.25em; margin-top: 1.5rem;
  text-shadow: 0 0 20px rgba(240, 185, 11, 0.4);
}
.hero-countdown {
  margin-top: 3rem;
  display: inline-block;
  padding: 1.5rem 3rem;
  background: rgba(15, 10, 5, 0.7);
  border: 2px solid var(--gold-dim);
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(255, 107, 26, 0.2);
}
.countdown-label {
  color: var(--gold); font-size: 0.85rem; letter-spacing: 0.3em;
  text-transform: uppercase; margin-bottom: 0.5rem;
}
.countdown-timer {
  font-family: 'Cinzel', serif; font-size: 2.5rem; font-weight: 700;
  color: var(--white);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* ─── SECTIONS ─── */
.section {
  max-width: 1400px; margin: 0 auto; padding: 3rem 2rem;
}
.section-title {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 2rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
  text-shadow: 0 0 15px rgba(240, 185, 11, 0.3);
}

/* ─── PLAN ─── */
.plan-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem;
}
.plan-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.plan-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--ember), var(--gold));
}
.plan-day {
  font-family: 'Cinzel', serif; color: var(--gold); letter-spacing: 0.15em;
  font-weight: 700; font-size: 1.1rem; margin-bottom: 1rem; text-transform: uppercase;
}
.plan-content { color: var(--white); white-space: pre-line; }
.plan-content .boss-line { padding: 0.3rem 0; color: var(--white); }
.plan-content .boss-line::before { content: '– '; color: var(--ember); }

.plan-callouts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
.callout-box {
  background: rgba(15, 10, 5, 0.6);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 1.2rem 1.5rem;
}
.callout-title { color: var(--gold); font-weight: 700; letter-spacing: 0.1em; margin-bottom: 0.6rem; }
.callout-box ul { list-style: none; }
.callout-box li { padding: 0.2rem 0; color: var(--white); }
.callout-box li::before { content: '▸ '; color: var(--ember); }

/* ─── ROSTER ─── */
.roster-stats {
  display: flex; gap: 2rem; margin-bottom: 1.5rem;
  padding: 1rem 1.5rem; background: var(--bg-1);
  border: 1px solid var(--border); border-radius: 6px;
}
.roster-stats .stat { display: flex; flex-direction: column; }
.roster-stats .label { color: var(--gray); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; }
.roster-stats .value { color: var(--gold); font-weight: 700; font-size: 1.3rem; }
.roster-controls {
  display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: center;
}
.roster-search {
  flex: 1; min-width: 250px;
  background: var(--bg-3); border: 1px solid var(--border); color: var(--white);
  padding: 0.7rem 1rem; border-radius: 6px; font-family: inherit; font-size: 0.95rem;
  transition: all 0.2s;
}
.roster-search:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.15); }
.role-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.role-filter-btn {
  background: var(--bg-3); color: var(--gray); border: 1px solid var(--border);
  padding: 0.5rem 0.9rem; border-radius: 6px; cursor: pointer;
  font-family: inherit; font-size: 0.85rem; font-weight: 500;
  transition: all 0.2s;
}
.role-filter-btn:hover { color: var(--white); border-color: var(--gold-dim); }
.role-filter-btn.active {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1a1005; border-color: var(--gold); font-weight: 700;
}
.roster-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.6rem;
}
.roster-card { animation: fadeIn 0.25s; }
.roster-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  transition: all 0.2s;
}
.roster-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-dim);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.roster-card .name { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.2rem; }
.roster-card .spec { color: var(--gray); font-size: 0.85rem; }
.roster-card .role-badge {
  display: inline-block; margin-top: 0.5rem;
  padding: 0.15rem 0.5rem; border-radius: 3px;
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600;
}
.roster-card .trial-badge {
  display: inline-block; margin-left: 0.5rem;
  padding: 0.1rem 0.4rem; background: rgba(255, 107, 26, 0.2);
  border: 1px solid var(--ember); color: var(--ember);
  font-size: 0.65rem; letter-spacing: 0.1em; border-radius: 2px; font-weight: 700;
}
.roster-card .rl-badge {
  display: inline-block; margin-left: 0.5rem;
  padding: 0.1rem 0.4rem; background: rgba(240, 185, 11, 0.15);
  border: 1px solid var(--gold); color: var(--gold);
  font-size: 0.65rem; letter-spacing: 0.1em; border-radius: 2px; font-weight: 700;
}

/* ─── PERFORMANCE TABLE ─── */
.perf-table table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden;
  font-size: 0.88rem;
  table-layout: auto;
}
.perf-table td, .perf-table th { white-space: nowrap; }
.perf-table td:first-child { white-space: normal; }
.perf-table th {
  background: var(--bg-3); color: var(--gold); font-family: 'Cinzel', serif;
  padding: 0.6rem 0.6rem; text-align: left; font-size: 0.75rem;
  letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 2px solid var(--gold-dim);
}
.perf-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
.perf-table tr:nth-child(even) { background: rgba(30, 20, 10, 0.3); }
.perf-table tr:hover { background: rgba(240, 185, 11, 0.05); }
.perf-table .parse-high { color: var(--ember-glow); font-weight: 700; }
.perf-table .parse-mid { color: #3fc7eb; font-weight: 600; }
.perf-table .parse-low { color: var(--success); }
.perf-table .parse-min { color: var(--gray); }

/* ─── PROGRESSION ─── */
.prog-table table { width: 100%; border-collapse: collapse; background: var(--bg-1); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.prog-table th { background: var(--bg-3); color: var(--gold); padding: 0.7rem 0.8rem; text-align: left; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.1em; }
.prog-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); }
.prog-table .killed { color: var(--success); font-weight: 700; }
.prog-table .wiping { color: var(--danger); font-weight: 600; }

/* ─── AI TOOLS ─── */
.ai-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem;
}
.ai-card-stacked { margin-bottom: 1.5rem; }
.ai-card h3 { color: var(--gold); font-family: 'Cinzel', serif; margin-bottom: 0.5rem; letter-spacing: 0.05em; font-size: 1.2rem; }
.ai-card p { color: var(--gray); margin-bottom: 1rem; font-size: 0.9rem; }
.ai-card input, .ai-card textarea {
  width: 100%; background: var(--bg-3); border: 1px solid var(--border);
  color: var(--white); padding: 0.6rem 0.8rem; margin-bottom: 0.8rem;
  border-radius: 4px; font-family: inherit;
}
.ai-output {
  margin-top: 1rem; background: var(--bg); border: 1px solid var(--border);
  color: var(--white); padding: 1rem; border-radius: 4px; white-space: pre-wrap;
  font-family: 'Inter', sans-serif; font-size: 0.9rem; max-height: 500px; overflow-y: auto;
}
.ask-row { display: flex; gap: 0.8rem; margin-bottom: 0.8rem; }
.ask-row input { flex: 1; margin-bottom: 0; }

/* Group builder controls */
.group-controls {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.grp-count { color: var(--gold); font-weight: 600; font-size: 0.9rem; margin: 0 0.5rem; }

/* Grid of roster checkboxes — no scrolling */
.group-checkboxes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.3rem;
  margin-bottom: 1rem;
}
.group-checkboxes-grid label {
  display: flex; align-items: center;
  padding: 0.5rem 0.7rem;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer;
  transition: all 0.15s;
  font-size: 0.9rem;
  overflow: hidden;
}
.group-checkboxes-grid label:hover {
  border-color: var(--gold-dim); background: rgba(240, 185, 11, 0.05);
}
.group-checkboxes-grid label.checked {
  border-color: var(--gold-dim);
  background: linear-gradient(90deg, rgba(240, 185, 11, 0.08), rgba(20, 20, 30, 0.3));
}
.group-checkboxes-grid label.checked .grp-name { color: var(--class-color, var(--white)); font-weight: 600; }
.group-checkboxes-grid label:not(.checked) .grp-name { color: var(--gray); }
.group-checkboxes-grid label:not(.checked) { opacity: 0.5; }
.group-checkboxes-grid input { width: auto; margin-right: 0.6rem; margin-bottom: 0; accent-color: var(--gold); }
.group-checkboxes-grid .grp-role {
  margin-left: auto; font-size: 0.65rem; letter-spacing: 0.08em;
  padding: 0.1rem 0.35rem; border-radius: 2px; font-weight: 700; text-transform: uppercase;
  white-space: nowrap;
}
.group-checkboxes-grid .grp-spec-select {
  margin-left: 0.4rem; max-width: 130px; min-width: 100px;
  background: var(--bg-3); color: var(--white);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 0.15rem 0.3rem; font-size: 0.7rem; font-family: inherit;
  cursor: pointer;
}
.group-checkboxes-grid .grp-spec-select:focus { outline: none; border-color: var(--gold); }

/* Off-spec 'flex' badge on raid frame slots */
.rf-offspec {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.05rem 0.35rem; border-radius: 2px;
  background: rgba(240, 185, 11, 0.18);
  color: var(--gold);
  border: 1px solid var(--gold);
  vertical-align: middle;
}
.group-output { margin-top: 1rem; }

/* ─── RAID FRAME STYLE GROUPS ─── */
.raid-frames {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.raid-frame-group {
  background: linear-gradient(180deg, #0f1520 0%, #0a0e18 100%);
  border: 1px solid #2a3445;
  border-radius: 4px;
  padding: 0.4rem;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
  position: relative;
}
.raid-frame-group::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
.raid-frame-header {
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Cinzel', serif; color: var(--gold);
  font-size: 0.75rem; letter-spacing: 0.15em; font-weight: 700;
  padding: 0.35rem 0.6rem 0.5rem;
  text-transform: uppercase;
  border-bottom: 1px solid #2a3445; margin-bottom: 0.4rem;
}
.raid-frame-header .group-count {
  color: var(--gray); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.1em;
}
.raid-frame-slot {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: linear-gradient(90deg, rgba(20, 30, 50, 0.6), rgba(15, 22, 40, 0.3));
  border: 1px solid #1a2535;
  border-radius: 3px;
  margin-bottom: 0.25rem;
  gap: 0.5rem;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.raid-frame-slot::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--class-color, #888);
}
.raid-frame-slot:hover {
  background: linear-gradient(90deg, rgba(30, 50, 80, 0.7), rgba(25, 35, 60, 0.4));
  border-color: var(--gold-dim);
  transform: translateX(2px);
}
.rf-icon {
  width: 22px; height: 22px;
  background: var(--class-color, #888);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  color: #0a0603; font-weight: 900; font-size: 0.75rem;
  box-shadow: 0 0 8px var(--class-color, #888), inset 0 1px 0 rgba(255,255,255,0.3);
  margin-left: 0.25rem;
}
.rf-info {
  display: flex; flex-direction: column; line-height: 1.1; overflow: hidden;
}
.rf-name {
  font-weight: 700; font-size: 0.9rem; color: var(--class-color, #f5eee0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.rf-spec {
  font-size: 0.7rem; color: var(--gray); letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rf-role {
  font-size: 0.65rem; letter-spacing: 0.1em; font-weight: 700;
  padding: 0.1rem 0.35rem; border-radius: 2px; text-transform: uppercase;
}
.rf-hp-bar {
  grid-column: 1 / -1; height: 3px; background: #0a1018;
  border-radius: 2px; margin-top: 0.35rem; overflow: hidden;
}
.rf-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ff98, #4ade80);
  box-shadow: 0 0 8px rgba(0, 255, 152, 0.4);
}

/* Keep old group-card for backwards compat but we're not using it */
.group-card { display: none; }

/* ─── DRAG & DROP ─── */
.raid-frame-slot {
  cursor: grab;
}
.raid-frame-slot:active { cursor: grabbing; }
.raid-frame-slot.dragging {
  opacity: 0.35; transform: scale(0.95);
}
.raid-frame-slot.empty {
  background: rgba(15, 22, 40, 0.3);
  border: 1px dashed #2a3548;
  cursor: default;
  min-height: 38px;
  pointer-events: none;
}
.raid-frame-slot.empty::before { display: none; }
.raid-frame-slot.empty:hover {
  background: rgba(15, 22, 40, 0.3);
  border-color: #2a3548;
  transform: none;
}
.raid-frame-header .group-count.full {
  color: var(--success); font-weight: 600;
}
.raid-frame-slot.swap-target {
  outline: 2px dashed var(--gold);
  outline-offset: -2px;
  background: rgba(240, 185, 11, 0.12);
  box-shadow: 0 0 12px rgba(240, 185, 11, 0.35);
}
.raid-frame-slot.swap-target::after {
  content: '⇄'; position: absolute; top: 50%; right: 8px;
  transform: translateY(-50%); color: var(--gold);
  font-size: 1.2rem; font-weight: bold;
  text-shadow: 0 0 6px var(--gold);
  pointer-events: none;
}
.raid-frame-group.drop-hover {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(240, 185, 11, 0.3), inset 0 0 20px rgba(240, 185, 11, 0.08);
}
.raid-frame-group.drop-hover::before {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}
.raid-frame-slot-remove {
  position: absolute; top: 2px; right: 4px;
  color: var(--dim); font-size: 0.75rem; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity 0.15s; background: none; border: none; padding: 2px;
}
.raid-frame-slot:hover .raid-frame-slot-remove { opacity: 0.7; }
.raid-frame-slot-remove:hover { color: var(--danger); opacity: 1; }

/* Unassigned pool */
.unassigned-pool {
  background: linear-gradient(180deg, #1a1a28 0%, #101018 100%);
  border: 1px dashed #3a3a50;
  border-radius: 6px;
  padding: 0.8rem;
  margin-top: 1rem;
  min-height: 80px;
}
.unassigned-pool.drop-hover {
  border-color: var(--gold);
  background: rgba(240, 185, 11, 0.04);
}
.unassigned-header {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--gray); font-size: 0.85rem; letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 0.5rem;
}
.unassigned-header .up-count { color: var(--gold); }
.unassigned-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.3rem;
}
.unassigned-slots:empty::before {
  content: 'No unassigned players — everyone is placed.';
  color: var(--dim); font-size: 0.85rem; font-style: italic;
  grid-column: 1 / -1; text-align: center; padding: 0.5rem;
}

/* ─── ADMIN ─── */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem;
}
.admin-card h3 { color: var(--gold); font-family: 'Cinzel', serif; margin-bottom: 0.5rem; }
.admin-card p { color: var(--gray); margin-bottom: 1rem; font-size: 0.9rem; }
.admin-card label {
  display: block; color: var(--gray); font-size: 0.85rem;
  margin-bottom: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.admin-card input, .admin-card textarea {
  display: block; width: 100%;
  background: var(--bg-3); border: 1px solid var(--border); color: var(--white);
  padding: 0.6rem 0.8rem; margin-top: 0.3rem; border-radius: 4px;
  font-family: inherit; text-transform: none;
}
.admin-card textarea { min-height: 100px; resize: vertical; }

/* ─── LOGO LINK ─── */
.logo-block { text-decoration: none; display: block; }

/* ─── HERO GUILD ─── */
.hero-guild {
  font-family: 'Cinzel', serif; color: var(--gold-dim);
  font-size: 1rem; letter-spacing: 0.2em; font-style: italic; margin-top: 0.3rem;
}

/* ─── NAV ACTIVE ─── */
.nav-link.active { color: var(--gold); }
.nav-link.active::after { width: 100%; }

/* ─── DASHBOARD ─── */
.dashboard-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.dash-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.dash-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.dash-card-wide { grid-column: span 3; }
.dash-title {
  font-family: 'Cinzel', serif; color: var(--gold);
  font-size: 1.1rem; letter-spacing: 0.1em; margin-bottom: 1rem;
}
.plan-grid.compact .plan-card { padding: 1rem; }
@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: 1fr 1fr; } .dash-card-wide { grid-column: span 2; } }
@media (max-width: 700px) { .dashboard-grid { grid-template-columns: 1fr; } .dash-card-wide { grid-column: span 1; } }

.top-performer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.4rem 0; border-bottom: 1px solid var(--bg-3);
}
.top-performer:last-child { border: none; }
.top-performer .pname { font-weight: 600; }
.top-performer .pstat { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.top-performer .rank {
  display: inline-block; width: 22px; height: 22px;
  border-radius: 50%; background: var(--bg-3); color: var(--gold);
  text-align: center; line-height: 22px; font-size: 0.75rem; font-weight: 700;
  margin-right: 0.6rem;
}
.top-performer .rank.gold { background: linear-gradient(135deg, var(--gold), #c4950a); color: #1a1005; }
.top-performer .rank.silver { background: linear-gradient(135deg, #c0c0c0, #8b8b8b); color: #1a1005; }
.top-performer .rank.bronze { background: linear-gradient(135deg, #cd7f32, #8b5a2b); color: #1a1005; }

.kill-row {
  display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid var(--bg-3);
}
.kill-row:last-child { border: none; }
.kill-row .kboss { color: var(--white); font-weight: 500; }
.kill-row .kdiff { color: var(--purple); font-size: 0.85rem; font-weight: 700; }

.checklist { list-style: none; padding: 0; }
.checklist li {
  padding: 0.4rem 0 0.4rem 1.5rem; color: var(--white);
  position: relative; font-size: 0.95rem;
}
.checklist li::before {
  content: '✦'; position: absolute; left: 0;
  color: var(--ember); font-size: 0.9rem;
}

#dash-roster-stats .stat-row {
  display: flex; justify-content: space-between; padding: 0.35rem 0; border-bottom: 1px solid var(--bg-3);
}
#dash-roster-stats .stat-row:last-child { border: none; }

/* ─── ROSTER MANAGER ─── */
.roster-manager-scroll { overflow-x: auto; }
.roster-manager-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.roster-manager-table th {
  background: var(--bg-3); color: var(--gold); padding: 0.5rem 0.6rem;
  text-align: left; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 2px solid var(--gold-dim);
}
.roster-manager-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); }
.roster-manager-table input, .roster-manager-table select {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--white);
  padding: 0.35rem 0.5rem; border-radius: 3px; font-family: inherit;
  width: 100%; font-size: 0.85rem;
}
.roster-manager-table input[type="checkbox"] { width: auto; }
.roster-manager-table .tiny-btn {
  background: transparent; border: 1px solid var(--border); color: var(--gray);
  padding: 0.2rem 0.5rem; border-radius: 3px; font-size: 0.75rem; cursor: pointer;
  margin-right: 0.3rem;
}
.roster-manager-table .tiny-btn.save { color: var(--gold); border-color: var(--gold-dim); }
.roster-manager-table .tiny-btn.save:hover { background: rgba(240, 185, 11, 0.1); }
.roster-manager-table .tiny-btn.del { color: var(--danger); border-color: var(--danger); }
.roster-manager-table .tiny-btn.del:hover { background: rgba(239, 68, 68, 0.1); }
.roster-add-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-top: 0.5rem;
}
.user-add-grid {
  display: grid; grid-template-columns: 2fr 2fr 1fr auto; gap: 0.5rem;
}
.user-add-grid input, .user-add-grid select {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--white);
  padding: 0.5rem 0.7rem; border-radius: 4px; font-family: inherit;
}
.roster-add-grid input, .roster-add-grid select {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--white);
  padding: 0.5rem 0.7rem; border-radius: 4px; font-family: inherit;
}

/* ─── TRIALS PAGE ─── */
.page-sub {
  color: var(--gray); font-size: 0.95rem; margin-top: -1rem; margin-bottom: 1.5rem;
}
.trial-summary {
  display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.trial-summary .summary-pill {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border); padding: 0.8rem 1.2rem; border-radius: 6px;
  display: flex; flex-direction: column;
}
.trial-summary .summary-pill .num { color: var(--gold); font-size: 1.8rem; font-weight: 700; line-height: 1; }
.trial-summary .summary-pill .lbl { color: var(--gray); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.3rem; }

.trial-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.2rem;
}
.trial-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border); border-radius: 8px;
  padding: 1.2rem 1.4rem;
  position: relative; overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.trial-card:hover { transform: translateY(-2px); border-color: var(--gold-dim); }
.trial-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--rec-color, var(--gold));
}
.trial-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 0.9rem;
}
.trial-name {
  font-family: 'Cinzel', serif; font-size: 1.35rem; font-weight: 700; line-height: 1.2;
  color: var(--class-color, var(--white));
}
.trial-spec { color: var(--gray); font-size: 0.85rem; margin-top: 0.15rem; }
.trial-rec {
  padding: 0.35rem 0.8rem; border-radius: 4px; font-size: 0.75rem;
  font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  white-space: nowrap; border: 1px solid;
}
.rec-strong    { background: rgba(78, 204, 163, 0.15); color: var(--success); border-color: var(--success); --rec-color: var(--success); }
.rec-acceptable{ background: rgba(83, 168, 226, 0.15); color: var(--blue, #53a8e2); border-color: var(--blue, #53a8e2); --rec-color: var(--blue, #53a8e2); }
.rec-needs     { background: rgba(240, 185, 11, 0.15); color: var(--gold); border-color: var(--gold-dim); --rec-color: var(--gold); }
.rec-cut       { background: rgba(239, 68, 68, 0.15); color: var(--danger); border-color: var(--danger); --rec-color: var(--danger); }
.rec-none      { background: var(--bg-3); color: var(--gray); border-color: var(--border); --rec-color: var(--border); }

.trial-meta {
  display: flex; gap: 1.2rem; flex-wrap: wrap;
  color: var(--gray); font-size: 0.8rem; margin-bottom: 0.9rem;
  padding-bottom: 0.9rem; border-bottom: 1px solid var(--border);
}
.trial-meta .m-lbl { color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.7rem; }
.trial-meta .m-val { color: var(--white); font-weight: 600; }

.trial-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1.5rem;
  margin-bottom: 0.9rem;
}
.trial-stats .stat-line { display: flex; justify-content: space-between; font-size: 0.9rem; }
.trial-stats .stat-line .k { color: var(--gray); }
.trial-stats .stat-line .v { color: var(--white); font-weight: 600; font-variant-numeric: tabular-nums; }

.trial-reasons {
  list-style: none; padding: 0; font-size: 0.85rem;
}
.trial-reasons li {
  padding: 0.35rem 0; display: flex; justify-content: space-between; gap: 0.5rem;
  border-bottom: 1px solid var(--bg-3);
}
.trial-reasons li:last-child { border: none; }
.trial-reasons .r-metric {
  font-weight: 600; min-width: 80px;
}
.trial-reasons .r-note { color: var(--gray); text-align: right; flex: 1; }
.trial-reasons .r-metric.good { color: var(--success); }
.trial-reasons .r-metric.below { color: var(--danger); }

.trial-notes {
  margin-top: 0.8rem; padding: 0.6rem 0.8rem;
  background: var(--bg-3); border-left: 3px solid var(--gold-dim);
  font-size: 0.85rem; color: var(--white); font-style: italic; border-radius: 3px;
}

.trial-empty {
  grid-column: 1 / -1; text-align: center; padding: 3rem;
  color: var(--gray); font-style: italic;
}

/* ─── PLAYER DETAIL PAGE ─── */
.back-link {
  color: var(--gray); text-decoration: none; font-size: 0.9rem;
  display: inline-block; margin-bottom: 1rem; transition: color 0.2s;
}
.back-link:hover { color: var(--gold); }

.player-header {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border); border-radius: 8px;
  padding: 1.5rem 2rem; margin-bottom: 1rem;
  position: relative; overflow: hidden;
}
.player-header::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--class-color, var(--gold));
}
.player-header .ph-name {
  font-family: 'Cinzel', serif; font-size: 2.2rem; font-weight: 900;
  color: var(--class-color, var(--white)); line-height: 1;
  text-shadow: 0 0 20px var(--class-color-glow, rgba(255, 215, 0, 0.3));
}
.player-header .ph-spec { color: var(--gray); font-size: 1rem; margin-top: 0.4rem; }
.player-header .ph-badges { display: flex; gap: 0.5rem; margin-top: 0.8rem; flex-wrap: wrap; }
.player-header .ph-badge {
  padding: 0.25rem 0.6rem; border-radius: 3px; font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; border: 1px solid;
}

.player-controls {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.player-controls label { color: var(--gray); font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.player-controls select {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--white);
  padding: 0.4rem 0.7rem; border-radius: 4px; font-family: inherit;
}

.player-overview {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem; margin-bottom: 2rem;
}
.ov-tile {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border); border-radius: 6px;
  padding: 1rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.ov-tile .ov-lbl { color: var(--gray); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ov-tile .ov-val {
  color: var(--white); font-size: 1.5rem; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ov-tile .ov-cmp { color: var(--gray); font-size: 0.75rem; }
.ov-tile .ov-cmp.good { color: var(--success); }
.ov-tile .ov-cmp.bad { color: var(--danger); }

.player-section {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border); border-radius: 8px;
  padding: 1.5rem; margin-bottom: 1.5rem;
}
.player-section-title {
  font-family: 'Cinzel', serif; color: var(--gold); letter-spacing: 0.08em;
  font-size: 1.1rem; margin-bottom: 1rem;
}

/* Trend chart */
.player-trend-chart {
  display: flex; align-items: flex-end; gap: 0.5rem;
  min-height: 180px; padding: 1rem 0 2rem; position: relative;
  border-bottom: 1px solid var(--border);
}
.trend-bar {
  flex: 1; min-width: 40px; position: relative;
  background: linear-gradient(180deg, var(--gold-bright), var(--ember));
  border-radius: 3px 3px 0 0;
  transition: transform 0.2s;
  box-shadow: 0 0 15px rgba(255, 107, 26, 0.3);
}
.trend-bar:hover { transform: scaleY(1.02); filter: brightness(1.2); }
.trend-bar .trend-val {
  position: absolute; top: -1.4rem; left: 50%; transform: translateX(-50%);
  color: var(--white); font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.trend-bar .trend-lbl {
  position: absolute; bottom: -1.4rem; left: 50%; transform: translateX(-50%);
  color: var(--gray); font-size: 0.75rem; white-space: nowrap;
}

/* Boss grid */
.player-boss-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.7rem;
}
.boss-card {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.8rem 1rem;
}
.boss-card .b-name {
  color: var(--white); font-weight: 600; font-size: 0.95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.boss-card .b-diff { font-size: 0.75rem; letter-spacing: 0.1em; }
.boss-card .b-diff.heroic { color: var(--purple); }
.boss-card .b-diff.normal { color: var(--success); }
.boss-card .b-diff.mythic { color: var(--danger); }
.boss-card .b-stats {
  display: flex; justify-content: space-between; margin-top: 0.6rem;
  font-size: 0.85rem;
}
.boss-card .b-stats .bs-k { color: var(--gray); }
.boss-card .b-stats .bs-v { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.boss-card .b-rate {
  margin-top: 0.4rem; color: var(--gray); font-size: 0.75rem;
}
.boss-card .b-parse {
  font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* By-night cards */
.bynight-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.8rem;
}
.night-card {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.9rem 1rem;
}
.night-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem;
}
.night-date {
  font-family: 'Cinzel', serif; color: var(--gold);
  font-size: 1rem; letter-spacing: 0.05em;
}
.night-wcl {
  color: var(--gray); font-size: 0.75rem; text-decoration: none;
  border: 1px solid var(--border); padding: 0.15rem 0.5rem; border-radius: 4px;
  transition: all 0.15s;
}
.night-wcl:hover { color: var(--gold); border-color: var(--gold); }
.night-headline {
  color: var(--white); font-weight: 700; font-size: 1.1rem;
  font-variant-numeric: tabular-nums; margin-bottom: 0.5rem;
}
.night-stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.night-stats > div {
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.night-stats .ns-k { color: var(--gray); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; }
.night-stats .ns-v {
  color: var(--gold); font-weight: 600; font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.night-stats .ns-v.good { color: var(--success); }
.night-stats .ns-v.bad { color: var(--danger); }
.night-stats .ns-v small { font-size: 0.65rem; color: var(--danger); font-weight: 500; }
.night-bosses {
  display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem;
  padding-top: 0.6rem; border-top: 1px solid var(--border);
}
.night-boss {
  font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 3px;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--gray);
}
.night-boss small { color: var(--white); font-weight: 600; margin-left: 0.2rem; }
.night-boss.b-kill { border-color: var(--success); color: var(--success); }
.night-boss.b-kill small { color: var(--success); }
.night-boss.b-wipe { border-color: #555; color: #aaa; }

/* VOD recordings on night cards */
.night-vods {
  margin-top: 0.6rem; padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  align-items: center;
}
.night-vods .nv-label {
  color: var(--gray); font-size: 0.7rem;
  letter-spacing: 0.05em; text-transform: uppercase;
  margin-right: 0.2rem;
}
.nv-link {
  font-size: 0.78rem; padding: 0.2rem 0.6rem;
  border-radius: 3px; text-decoration: none;
  background: rgba(88, 101, 242, 0.12);
  color: #5865f2;
  border: 1px solid #5865f2;
  transition: all 0.15s;
}
.nv-link:hover {
  background: rgba(88, 101, 242, 0.25);
  color: #7983f5;
}
.nv-link.wipe {
  border-color: #888; color: #aaa; background: rgba(120, 120, 120, 0.1);
}
.nv-link.wipe:hover { color: #fff; border-color: #ccc; }

/* ═══════════ VODS PAGE ═══════════ */
.vod-filters {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-bottom: 1rem; align-items: center;
}
.vod-filters select, .vod-search {
  background: var(--bg-3); color: var(--white);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 0.5rem 0.7rem; font-size: 0.9rem;
  font-family: inherit;
}
.vod-search { flex: 1; min-width: 220px; }
.vod-stats {
  color: var(--gray); font-size: 0.85rem;
  margin-bottom: 1rem;
}
.vod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}
.vod-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
  display: flex; flex-direction: column;
}
.vod-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(240, 185, 11, 0.18);
}
.vod-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-3);
  overflow: hidden;
}
.vod-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s;
}
.vod-card:hover .vod-thumb img { transform: scale(1.04); }
.vod-thumb-fallback {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--gray); font-size: 2.5rem;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.15), rgba(15, 22, 40, 0.5));
}
.vod-thumb-fallback small {
  font-size: 0.75rem; margin-top: 0.4rem;
  text-align: center; padding: 0 0.6rem;
}
.vod-thumb-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  opacity: 0; transition: opacity 0.15s;
  pointer-events: none;
}
.vod-card:hover .vod-thumb-play { opacity: 1; }
.vod-thumb-dur {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: var(--white);
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}
.vod-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 3px;
}
.vod-badge.kill { background: rgba(74, 222, 128, 0.25); color: #4ade80; border: 1px solid #4ade80; }
.vod-badge.wipe { background: rgba(232, 69, 69, 0.25); color: #e84545; border: 1px solid #e84545; }
.vod-info {
  padding: 0.7rem 0.9rem 0.9rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.vod-title {
  color: var(--white); font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vod-title small { color: var(--gray); font-weight: 400; font-size: 0.8rem; }
.vod-meta {
  color: var(--gray); font-size: 0.8rem;
  display: flex; gap: 0.4rem; flex-wrap: wrap;
}
.vod-time { color: var(--gold); font-variant-numeric: tabular-nums; }

/* Modal player */
.vod-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.vod-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
}
.vod-modal-content {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--gold);
  border-radius: 8px;
  max-width: 1200px; width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 80px rgba(240, 185, 11, 0.3);
}
.vod-modal-close {
  position: absolute; top: 12px; right: 12px;
  z-index: 2;
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.7); color: var(--white);
  cursor: pointer; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
}
.vod-modal-close:hover { background: var(--danger); }
#vod-modal-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
}
#vod-modal-player iframe,
#vod-modal-player video {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important;
}
.vod-modal-meta {
  padding: 1rem 1.4rem;
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
}
.vod-modal-meta h3 {
  margin: 0; color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 1.1rem; letter-spacing: 0.05em;
}
.vod-modal-meta h3 small { color: var(--gray); font-family: inherit; font-size: 0.85rem; }
#vod-modal-sub { color: var(--gray); font-size: 0.85rem; flex: 1; }
.vod-modal-meta .ghost-btn { max-width: 180px; }

@media (max-width: 700px) {
  .vod-modal { padding: 0.5rem; }
  .vod-modal-meta { flex-direction: column; align-items: flex-start; }
}

/* Pulls table */
.pulls-table-wrap { max-height: 600px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; }
.pulls-table { width: 100%; border-collapse: collapse; }
.pulls-table th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-3); color: var(--gold);
  padding: 0.6rem 0.8rem; text-align: left; font-size: 0.8rem;
  letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 2px solid var(--gold-dim);
}
.pulls-table td {
  padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--border);
  font-size: 0.88rem; font-variant-numeric: tabular-nums;
}
.pulls-table tr:nth-child(even) { background: rgba(30, 20, 10, 0.2); }
.pulls-table tr:hover { background: rgba(240, 185, 11, 0.04); }
.pulls-table .k-kill { color: var(--success); font-weight: 700; }
.pulls-table .k-wipe { color: var(--danger); }
.pulls-table .k-died { color: var(--danger); text-align: center; }
.pulls-table .k-alive { color: var(--success); text-align: center; }

/* Damage taken list */
#player-dt-list { display: flex; flex-direction: column; gap: 0.3rem; }
.dt-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center;
  padding: 0.5rem 0.8rem; background: var(--bg-3);
  border-radius: 4px; font-size: 0.9rem;
}
.dt-row .dt-ability { color: var(--white); font-weight: 500; }
.dt-row .dt-ability.avoidable { color: var(--danger); }
.dt-row .dt-total { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.dt-row .dt-bar { width: 100px; height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.dt-row .dt-bar-fill { height: 100%; background: linear-gradient(90deg, var(--ember), var(--gold)); }

/* Refresh banner (sticky, top of page) */
.refresh-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: linear-gradient(90deg, var(--ember), var(--gold));
  color: #1a1005; font-weight: 700; text-align: center;
  padding: 0.4rem 1rem; font-size: 0.9rem;
  box-shadow: 0 2px 12px rgba(255, 107, 26, 0.4);
  animation: fadeIn 0.3s;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.refreshing {
  display: inline-block; color: var(--gold); font-weight: 600;
}
.refreshing::before {
  content: '⟳ '; display: inline-block; animation: spin 1s linear infinite;
}

/* Cache info bar */
.cache-bar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 1rem; margin-bottom: 1rem;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 4px; font-size: 0.85rem; color: var(--gray);
}
.cache-bar .ts { color: var(--white); }
.cache-bar button {
  margin-left: auto;
  background: transparent; border: 1px solid var(--border); color: var(--gold-dim);
  padding: 0.3rem 0.8rem; border-radius: 4px; cursor: pointer; font-family: inherit;
}
.cache-bar button:hover { color: var(--gold); border-color: var(--gold); }

/* Sortable columns */
.perf-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  position: relative;
  padding-right: 1.5rem;
}
.perf-table th.sortable:hover {
  background: rgba(240, 185, 11, 0.1);
  color: var(--gold-bright);
}
.sort-arrow {
  display: inline-block; width: 1rem; margin-left: 0.3rem;
  color: var(--gray); font-size: 0.7rem; opacity: 0.4;
}
.sort-arrow.active { color: var(--gold); opacity: 1; }
.perf-table th.sortable:hover .sort-arrow { opacity: 1; color: var(--gold); }

/* No-data rows */
.perf-table tr.no-data { opacity: 0.55; cursor: pointer; }
.perf-table tr.no-data:hover { opacity: 1; background: rgba(240, 185, 11, 0.04); }

/* Trial/RL badges in performance table */
.perf-trial-badge, .perf-rl-badge {
  display: inline-block; margin-left: 0.5rem;
  padding: 0.1rem 0.4rem; font-size: 0.65rem;
  letter-spacing: 0.1em; font-weight: 700;
  border-radius: 2px; border: 1px solid;
  vertical-align: middle;
}
.perf-trial-badge { background: rgba(255, 107, 26, 0.15); color: var(--ember); border-color: var(--ember); }
.perf-rl-badge { background: rgba(240, 185, 11, 0.15); color: var(--gold); border-color: var(--gold); }

/* Make performance rows look clickable */
.perf-table tr.clickable { cursor: pointer; }
.perf-table tr.clickable td:first-child::before { content: '▸ '; color: var(--gold-dim); opacity: 0.5; }
.perf-table tr.clickable:hover td:first-child::before { opacity: 1; }

/* ─── FOOTER ─── */
.site-footer {
  margin-top: 4rem; padding: 2rem; border-top: 1px solid var(--border);
  color: var(--gray); font-size: 0.85rem; text-align: center;
  display: flex; flex-direction: column; gap: 0.3rem;
}

/* ─── HAMBURGER + NAV DRAWER ─── */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 44px; height: 44px;
  padding: 0; cursor: pointer;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  transition: border-color 0.15s;
}
.nav-toggle:hover { border-color: var(--gold-dim); }
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--gold); border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 110;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.25s ease;
}
.nav-backdrop.open { display: block; opacity: 1; }

/* user-info now lives inside .main-nav so it carries into the drawer */
.user-info { display: flex; align-items: center; gap: 1rem; }

/* ─── TABLE SCROLL WRAPPER ─── */
.table-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 6px;
  /* subtle edge fade hint that there's more to scroll */
  background:
    linear-gradient(90deg, var(--bg) 30%, transparent),
    linear-gradient(90deg, transparent, var(--bg) 70%) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(240, 185, 11, 0.15), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(240, 185, 11, 0.15), transparent) 100% 0;
  background-repeat: no-repeat;
  background-size: 30px 100%, 30px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}

/* ─── TOAST / STICKY SAFE-AREAS ─── */
#toast-stack {
  bottom: max(2rem, env(safe-area-inset-bottom, 0px) + 1rem);
  right: max(1rem, env(safe-area-inset-right, 0px) + 1rem);
  left: max(1rem, env(safe-area-inset-left, 0px) + 1rem);
  align-items: flex-end;
}
.toast { max-width: min(360px, 100%); }

/* ─── RESPONSIVE: tablet (≤900px) ─── */
@media (max-width: 900px) {
  .trial-cards-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .roster-add-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── RESPONSIVE: drawer breakpoint (≤768px) ─── */
@media (max-width: 768px) {
  .fire-title.large { font-size: 2.6rem; }
  .header-inner { padding: 0.7rem 1rem; gap: 0.6rem; }
  .brand { font-size: 1.15rem; letter-spacing: 0.1em; }
  .tag { font-size: 0.65rem; }

  /* Show hamburger; hide horizontal nav and turn it into a slide-in drawer */
  .nav-toggle { display: inline-flex; }

  .main-nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(78vw, 300px);
    flex-direction: column; align-items: stretch;
    gap: 0;
    background: linear-gradient(180deg, var(--bg-1), var(--bg));
    border-left: 1px solid var(--gold-dim);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
    /* Header (z-index 130) sits visually above the drawer (120); the drawer's
       top is hidden behind it. Padding-top keeps content below the header. */
    padding: 4.5rem 1rem 2rem;
    padding-top: calc(4.5rem + env(safe-area-inset-top, 0px));
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px) + 1rem);
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 120;
  }
  .main-nav.open { transform: translateX(0); }

  .nav-link {
    display: block;
    padding: 0.95rem 0.6rem;
    border-bottom: 1px solid var(--bg-3);
    font-size: 1rem; letter-spacing: 0.06em;
    min-height: 44px;
  }
  .nav-link::after { display: none; }
  .nav-link.active {
    background: rgba(240, 185, 11, 0.08);
    border-left: 3px solid var(--gold);
    padding-left: calc(0.6rem - 3px);
  }
  .main-nav .user-info {
    margin-left: 0;
    margin-top: auto;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
    flex-direction: column; align-items: stretch; gap: 0.8rem;
  }
  .main-nav .user-info #user-badge {
    text-align: center;
    padding: 0.4rem;
    background: var(--bg-3); border-radius: 4px;
  }
  .main-nav .user-info .ghost-btn { width: 100%; padding: 0.7rem 1rem; min-height: 44px; }

  /* Layout collapses */
  .plan-grid, .plan-callouts, .admin-grid { grid-template-columns: 1fr; }
  .countdown-timer { font-size: 1.7rem; }
  .hero-countdown { padding: 1rem 1.4rem; margin-top: 2rem; }
  .hero { padding: 2rem 1rem 2.5rem; }
  .hero-team { font-size: 1.5rem; letter-spacing: 0.18em; }
  .hero-guild { font-size: 0.85rem; }
  .section { padding: 1.5rem 1rem; }
  .section-title { font-size: 1.5rem; letter-spacing: 0.1em; margin-bottom: 1.3rem; }

  /* Form inputs: 16px to prevent iOS auto-zoom on focus */
  input[type="text"], input[type="password"], input[type="email"],
  input[type="number"], input[type="search"], input[type="date"],
  input[type="tel"], input[type="url"], textarea, select {
    font-size: 16px;
  }

  /* Touch targets: 44px minimum */
  .ghost-btn { padding: 0.65rem 1rem; font-size: 0.9rem; min-height: 44px; }
  .role-filter-btn { padding: 0.7rem 1rem; font-size: 0.9rem; min-height: 44px; }
  .preset-btn { padding: 0.6rem 0.9rem; font-size: 0.88rem; min-height: 40px; }
  .att-status-toggle button { padding: 0.7rem 0.6rem; font-size: 0.9rem; min-height: 44px; flex: 1; }
  .att-status-toggle { width: 100%; }
  .gold-btn { padding: 0.95rem 1.2rem; min-height: 48px; max-width: none !important; }
  .role-filters { gap: 0.4rem; }

  /* Performance / progression / roster-manager / user-manager tables get
     a touch-friendly horizontal scroll on phones. */
  .perf-table, .prog-table { font-size: 0.85rem; }
  .perf-table table, .prog-table table { min-width: 560px; }
  .table-scroll-wrap, .roster-manager-scroll {
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border); border-radius: 6px;
  }

  /* Past-attendance grid: shrink padding so 3-4 dates are visible at once */
  .att-grid th, .att-grid td { padding: 0.35rem 0.4rem; font-size: 0.78rem; }
  .att-grid .att-name-col { min-width: 110px; }
  .att-grid .att-pct-col { min-width: 80px; left: 110px; }

  /* Attendance status row: full-width segmented buttons under the date */
  .att-status-row { grid-template-columns: 1fr; gap: 0.5rem; padding: 0.7rem; }
  .att-status-toggle { gap: 0.4rem; }
  .att-update-row { gap: 0.7rem; }
  .att-night-head { flex-direction: column; align-items: stretch; gap: 0.3rem; }

  /* Attendance card padding */
  .att-card { padding: 1rem; margin-bottom: 1rem; }
  .att-card-title { font-size: 1rem; }

  /* AI tools: stack rows */
  .ask-row { flex-direction: column; gap: 0.5rem; }
  .ask-row input { font-size: 16px; padding: 0.8rem 1rem; }
  .wipe-selector { flex-direction: column; gap: 0.5rem; }
  .wipe-selector select { width: 100%; padding: 0.8rem 0.7rem; }

  /* Group builder: make the controls row stack cleanly */
  .group-controls { flex-wrap: wrap; gap: 0.5rem; }
  .group-controls .ghost-btn,
  .group-controls .gold-btn { flex: 1 1 calc(50% - 0.25rem); margin-left: 0 !important; }
  .group-controls #grp-count { flex-basis: 100%; text-align: center; }
  .group-checkboxes-grid { grid-template-columns: 1fr 1fr; }

  /* Login box / claim banner */
  .login-box { padding: 2rem 1.5rem; }
  .claim-banner-inner { padding: 0.7rem 1rem; gap: 0.6rem; }
  .claim-banner-text { min-width: 100%; font-size: 0.9rem; }
  #claim-char-select { flex: 1; min-width: 0; padding: 0.7rem 0.6rem; }
  #claim-char-btn, #claim-skip-btn { max-width: none !important; flex: 1; min-height: 44px; }

  /* Roster manager: hide low-priority columns on phones, keep the essentials */
  .roster-manager-table th:nth-child(2),  /* Server */
  .roster-manager-table td:nth-child(2),
  .roster-manager-table th:nth-child(7),  /* Trial Start */
  .roster-manager-table td:nth-child(7),
  .roster-manager-table th:nth-child(8),  /* Notes */
  .roster-manager-table td:nth-child(8),
  .roster-manager-table th:nth-child(9),  /* Aliases */
  .roster-manager-table td:nth-child(9) { display: none; }
  #user-manager-table th:nth-child(5), /* Last Login */
  #user-manager-table td:nth-child(5) { display: none; }

  /* Player detail tweaks */
  .player-header { padding: 1.2rem 1.2rem; }
  .player-header .ph-name { font-size: 1.7rem; }
  .player-section { padding: 1rem; }
  .player-overview { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .ov-tile { padding: 0.7rem 0.8rem; }
  .ov-tile .ov-val { font-size: 1.2rem; }
  .player-trend-chart { gap: 0.25rem; min-height: 140px; }

  /* VOD tweaks */
  .vod-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .vod-filters { flex-direction: column; align-items: stretch; }
  .vod-filters select, .vod-search { width: 100%; padding: 0.8rem 0.7rem; }
  .vod-modal { padding: 0.5rem; }

  /* Trial cards single-column at narrow widths */
  .trial-cards-grid { grid-template-columns: 1fr; }
  .trial-card { padding: 1rem; }
  .trial-name { font-size: 1.2rem; }

  /* Roster cards a touch tighter */
  .roster-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .roster-stats { gap: 1rem; padding: 0.8rem 1rem; flex-wrap: wrap; }

  /* Toast positioning for phones */
  #toast-stack { left: 1rem; right: 1rem; }
  .toast { min-width: 0; width: 100%; max-width: 100%; }

  /* Sticky claim banner adapts to safe-area */
  .claim-banner { top: env(safe-area-inset-top, 0px); }
}

/* ─── RESPONSIVE: phone (≤480px) ─── */
@media (max-width: 480px) {
  .fire-title.large { font-size: 2.1rem; }
  .section { padding: 1.2rem 0.7rem; }
  .section-title { font-size: 1.25rem; padding-bottom: 0.6rem; margin-bottom: 1rem; }
  .hero { padding: 1.5rem 0.8rem 2rem; }
  .hero-sub { font-size: 0.95rem; letter-spacing: 0.15em; }
  .hero-team { font-size: 1.25rem; }
  .hero-countdown { padding: 0.8rem 1rem; margin-top: 1.5rem; }
  .countdown-label { font-size: 0.75rem; letter-spacing: 0.2em; }
  .countdown-timer { font-size: 1.4rem; }
  .att-card { padding: 0.8rem; }
  .vod-modal { padding: 0; }
  .vod-modal-content { border-radius: 0; max-height: 100vh; }
  .att-grid th, .att-grid td { padding: 0.3rem 0.3rem; font-size: 0.72rem; }
  .att-grid .att-name-col { min-width: 90px; font-size: 0.78rem; }
  .att-grid .att-pct-col { min-width: 64px; left: 90px; font-size: 0.78rem; }
  .group-checkboxes-grid { grid-template-columns: 1fr; }
}

/* ─── DESKTOP-ONLY hover affordance ─── */
@media (hover: none) {
  .roster-card:hover, .vod-card:hover, .trial-card:hover { transform: none; }
}

/* ─── GROUP BUILDER: tap-to-swap visual selection ─── */
.raid-frame-slot.tap-selected {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  background: linear-gradient(90deg, rgba(240, 185, 11, 0.18), rgba(255, 107, 26, 0.08));
  box-shadow: 0 0 18px rgba(240, 185, 11, 0.4);
}
.raid-frame-slot.tap-selected::after {
  content: '⇆ tap to swap';
  position: absolute; top: 50%; right: 8px;
  transform: translateY(-50%);
  color: var(--gold); font-size: 0.65rem;
  font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(240, 185, 11, 0.6);
  pointer-events: none;
}
.raid-frame-group.tap-target,
.unassigned-pool.tap-target {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(240, 185, 11, 0.25);
}

/* ═══════════ ATTENDANCE PAGE ═══════════ */
.att-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border); border-radius: 8px;
  padding: 1.5rem; margin-bottom: 1.5rem;
}
.att-card-title {
  font-family: 'Cinzel', serif; color: var(--gold);
  letter-spacing: 0.08em; font-size: 1.1rem; margin-bottom: 1rem;
}

/* Update availability section */
.att-update-row {
  display: grid; gap: 1rem;
}
.att-field {
  display: flex; flex-direction: column; gap: 0.4rem;
}
.att-field-lbl {
  color: var(--gray); font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.08em;
}
#att-player-select {
  background: var(--bg-3); color: var(--white);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 0.6rem 0.8rem; font-size: 0.95rem;
  font-family: inherit;
}
.att-status-buttons {
  display: flex; flex-direction: column; gap: 0.6rem;
  max-height: 60vh; overflow-y: auto;
  padding-right: 0.4rem;
}
.att-month-group {
  display: flex; flex-direction: column; gap: 0.4rem;
}
.att-month-head {
  font-family: 'Cinzel', serif; color: var(--gold);
  letter-spacing: 0.1em; text-transform: uppercase;
  font-size: 0.85rem; font-weight: 600;
  padding: 0.4rem 0.2rem 0.2rem;
  border-bottom: 1px solid var(--border);
  margin-top: 0.5rem;
  position: sticky; top: 0; background: var(--bg-2); z-index: 1;
}
.att-month-group:first-child .att-month-head { margin-top: 0; }
.att-status-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 1rem; align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0.6rem 0.9rem;
}
.att-status-date .asd-label {
  color: var(--white); font-weight: 600; font-size: 0.95rem;
}
.att-status-toggle { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.att-status-toggle button {
  background: var(--bg-1); color: var(--gray);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 0.4rem 0.8rem; font-size: 0.85rem;
  cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.att-status-toggle button:hover { border-color: var(--gold); color: var(--white); }
.att-status-toggle button.active.available { background: rgba(74, 222, 128, 0.18); color: #4ade80; border-color: #4ade80; }
.att-status-toggle button.active.tentative { background: rgba(240, 185, 11, 0.18); color: var(--gold); border-color: var(--gold); }
.att-status-toggle button.active.out { background: rgba(232, 69, 69, 0.18); color: #e84545; border-color: #e84545; }

/* Upcoming nights */
.att-upcoming-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.att-night-card {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 6px; padding: 1rem;
}
.att-night-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 0.7rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.att-night-date {
  font-family: 'Cinzel', serif; color: var(--gold);
  font-size: 1rem; letter-spacing: 0.05em;
}
.att-night-summary { font-size: 0.78rem; display: flex; gap: 0.7rem; }
.att-night-summary .ans-out { color: #e84545; }
.att-night-summary .ans-tent { color: var(--gold); }
.att-night-summary .ans-ok { color: #4ade80; }
.att-section {
  margin-top: 0.5rem;
}
.att-section .ats-lbl {
  color: var(--gray); font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 0.3rem;
}
.att-section .ats-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.att-chip {
  font-size: 0.78rem; padding: 0.18rem 0.5rem; border-radius: 3px;
  border: 1px solid var(--cc, var(--border));
  color: var(--cc, var(--white));
  background: var(--bg-2);
}
.att-chip.out { opacity: 0.85; border-style: dashed; }
.att-chip.tentative { opacity: 0.95; }
.att-chip.unknown { color: var(--gray); border-color: var(--border); background: transparent; }

/* Past attendance grid */
.att-legend { color: var(--gray); font-size: 0.85rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.att-cell-mini {
  font-size: 0.9rem; margin-right: 0.2rem;
}
.att-cell-mini.present { color: #4ade80; }
.att-cell-mini.out { color: #e84545; }
.att-cell-mini.tentative { color: var(--gold); }
.att-cell-mini.absent { color: #555; }
.att-grid-wrap {
  overflow: auto; border: 1px solid var(--border); border-radius: 6px;
  max-height: min(85vh, 1400px);
}
.att-grid {
  border-collapse: collapse; width: max-content; min-width: 100%;
}
.att-grid th, .att-grid td {
  padding: 0.4rem 0.6rem; border: 1px solid var(--border);
  font-size: 0.85rem; text-align: center;
}
.att-grid th {
  position: sticky; top: 0; background: var(--bg-2);
  color: var(--gold); font-family: 'Cinzel', serif;
  letter-spacing: 0.05em; font-weight: 600; z-index: 1;
}
.att-grid .att-name-col {
  position: sticky; left: 0; background: var(--bg-2);
  text-align: left; min-width: 140px; z-index: 1;
}
.att-grid thead .att-name-col { z-index: 2; }
.att-grid .att-pct-col {
  font-variant-numeric: tabular-nums; font-weight: 600;
  position: sticky; left: 140px; background: var(--bg-2); z-index: 1;
  min-width: 90px;
}
.att-grid .att-pct-col small { color: var(--gray); font-weight: 400; }
.att-grid .att-pct-col.good { color: #4ade80; }
.att-grid .att-pct-col.mid { color: var(--gold); }
.att-grid .att-pct-col.bad { color: #e84545; }
.att-grid .att-cell { font-weight: 600; }
.att-grid .att-cell.present { color: #4ade80; background: rgba(74, 222, 128, 0.07); }
.att-grid .att-cell.out { color: #e84545; background: rgba(232, 69, 69, 0.07); }
.att-grid .att-cell.tentative { color: var(--gold); background: rgba(240, 185, 11, 0.07); }
.att-grid .att-cell.absent { color: #444; }

@media (max-width: 700px) {
  .att-status-row { grid-template-columns: 1fr; }
  .att-night-head { flex-direction: column; gap: 0.3rem; }
}

/* Saved comps modal */
.saved-comps-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; align-items: center; justify-content: center; padding: 1rem; }
.saved-comps-modal-inner { background: #161616; border: 1px solid #333; border-radius: 8px; max-width: 720px; width: 100%; max-height: 80vh; overflow-y: auto; padding: 1.25rem; }
.saved-comps-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.comp-section { margin-bottom: 1.25rem; }
.comp-section h4 { margin: 0 0 0.5rem; color: var(--gold, #d4af37); border-bottom: 1px solid #333; padding-bottom: 0.35rem; }
.comp-row { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.6rem; border-bottom: 1px solid #222; }
.comp-row:hover { background: #1d1d1d; }
.comp-row-actions { display: flex; gap: 0.4rem; }
.comp-row-actions .ghost-btn { max-width: 80px; padding: 0.3rem 0.6rem; }

/* Role-mismatch warning badge on perf table (player has been playing different role than rostered) */
.role-mismatch { display: inline-block; margin-left: 0.35rem; color: #fbbf24; font-size: 0.85em; cursor: help; }

/* Performance page: difficulty transition banner */
.perf-transition-banner { background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.3); border-radius: 6px; padding: 0.6rem 0.9rem; margin: 0.5rem 0 0.8rem; color: #f5eee0; font-size: 0.9rem; }

/* ─────────── Hero card (player detail page) ─────────── */
.hero-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.2rem;
  align-items: center;
  padding: 1.2rem 1.4rem;
  background: linear-gradient(135deg, rgba(20,15,10,0.95), rgba(10,8,6,0.9));
  border: 1px solid var(--class-color, #444);
  border-radius: 10px;
  box-shadow: 0 0 30px var(--class-color-glow, transparent), inset 0 1px 0 rgba(255,255,255,0.04);
  margin-bottom: 1rem;
}
.hero-portrait {
  width: 76px; height: 76px;
  border-radius: 12px;
  border: 2px solid #888;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.hero-portrait-letter {
  font-family: Cinzel, serif;
  font-size: 2.4rem; font-weight: 700;
  color: var(--class-color, #f5eee0);
  text-shadow: 0 0 8px var(--class-color-glow, transparent);
}
.hero-info { min-width: 0; }
.hero-name-row { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.hero-card .ph-name {
  font-family: Cinzel, serif; font-size: 1.8rem; font-weight: 700;
  color: var(--class-color, #f5eee0); letter-spacing: 0.02em;
  margin: 0;
}
.hero-trait {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 0.18rem 0.5rem; border-radius: 999px;
  background: rgba(240,185,11,0.12); color: #f0b90b; border: 1px solid rgba(240,185,11,0.35);
}
.hero-card .ph-spec { color: var(--gray); font-size: 0.95rem; margin: 0.15rem 0 0.4rem; }
.hero-chips { display: flex; gap: 0.5rem; margin-top: 0.4rem; flex-wrap: wrap; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.6rem; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 6px;
  font-size: 0.8rem;
}
.hero-chip-lbl { color: var(--gray); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.68rem; }
.hero-chip-val { color: #f5eee0; font-weight: 600; }
.hero-score-block { text-align: center; padding: 0 0.4rem; }
.hero-score-num {
  font-family: Cinzel, serif; font-size: 3rem; font-weight: 900; line-height: 1;
}
.hero-score-lbl { color: var(--gray); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 0.25rem; }

.score-elite { color: #fbbf24; }
.score-good  { color: #4ade80; }
.score-mid   { color: #94a3b8; }
.score-low   { color: #ef4444; }

/* Behavioral row layout */
.behavioral-row {
  display: grid; grid-template-columns: minmax(320px, 1fr) minmax(400px, 1.5fr);
  gap: 1rem; margin-bottom: 1.2rem;
}
@media (max-width: 900px) { .behavioral-row { grid-template-columns: 1fr; } }

/* Behavioral score card */
.behavioral-card {
  background: linear-gradient(135deg, rgba(20,15,10,0.95), rgba(10,8,6,0.9));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
}
.bs-header { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; margin-bottom: 1rem; }
.bs-title { color: var(--gray); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.bs-overall { font-family: Cinzel, serif; font-size: 4rem; font-weight: 900; line-height: 1; }
.bs-trait { font-weight: 600; font-size: 0.95rem; }
.bs-bars { display: flex; flex-direction: column; gap: 0.55rem; }
.bs-bar-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 0.6rem; align-items: center; }
.bs-bar-label { color: #cfc8bd; font-size: 0.85rem; display: flex; gap: 0.4rem; align-items: center; }
.bs-bar-track { background: rgba(255,255,255,0.06); height: 8px; border-radius: 4px; overflow: hidden; }
.bs-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.bs-bar-fill.score-elite { background: linear-gradient(90deg, #f0b90b, #fbbf24); }
.bs-bar-fill.score-good  { background: linear-gradient(90deg, #16a34a, #4ade80); }
.bs-bar-fill.score-mid   { background: linear-gradient(90deg, #64748b, #94a3b8); }
.bs-bar-fill.score-low   { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.bs-bar-val { font-family: Cinzel, serif; font-weight: 700; font-size: 0.95rem; text-align: right; }
.bs-footer { color: var(--gray); font-size: 0.72rem; margin-top: 0.8rem; font-style: italic; }

/* Score evolution chart */
.score-evolution {
  background: linear-gradient(135deg, rgba(20,15,10,0.95), rgba(10,8,6,0.9));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.se-title { color: var(--gray); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.se-svg { width: 100%; height: 180px; }
.se-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem; padding: 1.5rem 0; min-height: 160px; }
.se-empty-title { color: var(--gray); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.se-empty-msg { color: #6b6055; font-size: 0.85rem; }
.se-summary { display: flex; justify-content: space-around; padding-top: 0.6rem; border-top: 1px solid rgba(255,255,255,0.06); }
.se-summary > div { text-align: center; }
.se-summary-lbl { display: block; color: var(--gray); font-size: 0.7rem; letter-spacing: 0.1em; }
.se-summary-val { display: block; font-family: Cinzel, serif; font-weight: 700; font-size: 1.1rem; margin-top: 0.15rem; }

/* Achievement chips on pulls */
.ach-chip {
  display: inline-block; padding: 0.1rem 0.45rem;
  margin-left: 0.3rem; font-size: 0.7rem; font-weight: 600;
  border-radius: 999px; border: 1px solid;
  letter-spacing: 0.02em;
}
.ach-kick    { background: rgba(96,165,250,0.12);  color: #60a5fa; border-color: rgba(96,165,250,0.35); }
.ach-survive { background: rgba(74,222,128,0.12);  color: #4ade80; border-color: rgba(74,222,128,0.35); }
.ach-dps     { background: rgba(251,191,36,0.12);  color: #fbbf24; border-color: rgba(251,191,36,0.35); }
.ach-hps     { background: rgba(167,139,250,0.12); color: #a78bfa; border-color: rgba(167,139,250,0.35); }
.ach-warn    { background: rgba(239,68,68,0.12);   color: #ef4444; border-color: rgba(239,68,68,0.35); }

/* ─────────── Recent Raid Nights cards (Carried.io recent-history vibe) ─────────── */
.night-cards { display: flex; flex-direction: column; gap: 0.75rem; }
.ncard {
  background: linear-gradient(135deg, rgba(20,15,10,0.92), rgba(10,8,6,0.85));
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid #4ade80;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.ncard-row1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.ncard-l { flex: 1; min-width: 0; }
.ncard-date-line { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; flex-wrap: wrap; }
.ncard-date { font-family: Cinzel, serif; font-weight: 600; font-size: 1rem; color: #f5eee0; }
.night-badge {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem; border-radius: 999px; border: 1px solid;
}
.night-badge-clean { background: rgba(74,222,128,0.12); color: #4ade80; border-color: rgba(74,222,128,0.4); }
.night-badge-mixed { background: rgba(251,191,36,0.12); color: #fbbf24; border-color: rgba(251,191,36,0.4); }
.night-badge-prog  { background: rgba(239,68,68,0.12); color: #ef4444; border-color: rgba(239,68,68,0.4); }
.ncard-bosses { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.ncard-boss {
  font-size: 0.8rem; padding: 0.15rem 0.5rem; border-radius: 4px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
}
.ncard-boss.b-kill { border-color: rgba(74,222,128,0.4); color: #4ade80; }
.ncard-boss.b-wipe { border-color: rgba(239,68,68,0.4); color: #ef9999; }
.ncard-boss small { color: var(--gray); font-weight: 400; margin-left: 0.2rem; }
.ncard-r { display: flex; align-items: center; gap: 0.8rem; flex-shrink: 0; }
.ncard-score {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: Cinzel, serif; font-weight: 900; font-size: 1.5rem;
  border: 2px solid currentColor;
  background: rgba(0,0,0,0.3);
}
.ncard-toggle { font-size: 0.78rem; padding: 0.35rem 0.7rem; }

.ncard-stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}
@media (max-width: 720px) { .ncard-stats { grid-template-columns: repeat(3, 1fr); } }
.ncs-tile { text-align: center; padding: 0.35rem 0.2rem; }
.ncs-icon { font-size: 1rem; }
.ncs-val { font-family: Cinzel, serif; font-weight: 700; font-size: 1.05rem; color: #f5eee0; line-height: 1.1; }
.ncs-lbl { color: var(--gray); font-size: 0.62rem; letter-spacing: 0.08em; margin-top: 0.15rem; text-transform: uppercase; }

.ncard-details { padding-top: 0.5rem; border-top: 1px solid rgba(255,255,255,0.06); }
.ncard-pulls-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.ncard-pull {
  font-size: 0.75rem; padding: 0.2rem 0.5rem;
  background: rgba(255,255,255,0.04); border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
}
.ncard-pull.b-kill { border-color: rgba(74,222,128,0.3); color: #4ade80; }
.ncard-pull.b-wipe { border-color: rgba(239,68,68,0.3); color: #ef9999; }
.ncard-actions { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.ncard-vods { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; font-size: 0.85rem; color: var(--gray); }
.ncard-vod {
  font-size: 0.78rem; padding: 0.2rem 0.55rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 4px;
  text-decoration: none;
}
.ncard-vod.kill { color: #4ade80; border-color: rgba(74,222,128,0.3); }
.ncard-vod.wipe { color: #ef9999; border-color: rgba(239,68,68,0.3); }
.ncard-vod:hover { background: rgba(255,255,255,0.08); }

/* Inline cache-refresh link button used inside the player cache bar */
.cache-refresh-link {
  background: none; border: none; color: var(--gold);
  cursor: pointer; padding: 0; font: inherit;
  text-decoration: underline; text-decoration-color: rgba(240,185,11,0.4);
}
.cache-refresh-link:hover { text-decoration-color: var(--gold); }

/* ─────────── Roster page: title row + edit affordances ─────────── */
.roster-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.roster-card { position: relative; }
.roster-card.editable { cursor: pointer; transition: transform 0.1s ease, box-shadow 0.1s ease; }
.roster-card.editable:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(240,185,11,0.15); }
.roster-card-edit {
  position: absolute; top: 0.35rem; right: 0.4rem;
  background: rgba(0,0,0,0.4); color: var(--gold); border: 1px solid rgba(240,185,11,0.3);
  width: 22px; height: 22px; border-radius: 4px;
  font-size: 0.85rem; line-height: 1; cursor: pointer; padding: 0;
  opacity: 0; transition: opacity 0.15s ease;
}
.roster-card.editable:hover .roster-card-edit { opacity: 1; }
.roster-card-edit:hover { background: rgba(240,185,11,0.2); }

/* ─────────── Roster modal (add / edit player) ─────────── */
.rm-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.rm-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.78); backdrop-filter: blur(4px); cursor: pointer; }
.rm-modal-inner {
  position: relative; z-index: 1;
  background: linear-gradient(180deg, #1a1410, #0a0805);
  border: 1px solid rgba(240,185,11,0.35);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 0 40px rgba(0,0,0,0.7), 0 0 60px rgba(240,185,11,0.06);
}
.rm-modal-close {
  position: absolute; top: 0.6rem; right: 0.8rem;
  background: none; border: none; color: var(--gray);
  font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0.2rem 0.4rem;
}
.rm-modal-close:hover { color: var(--white); }
.rm-modal-inner h3 { color: var(--gold); font-family: Cinzel, serif; letter-spacing: 0.05em; margin: 0 0 1rem; font-size: 1.3rem; }

.rm-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem 1rem; }
.rm-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.06em; }
.rm-form label.rm-full { grid-column: 1 / -1; }
.rm-form label.rm-toggle {
  flex-direction: row; align-items: center; gap: 0.5rem;
  font-size: 0.9rem; text-transform: none; letter-spacing: 0; color: var(--white);
  padding-top: 1.1rem;
}
.rm-form label.rm-toggle input { width: auto; margin: 0; }
.rm-form input[type=text], .rm-form input[type=date], .rm-form input[type=number], .rm-form select, .rm-form textarea {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  padding: 0.45rem 0.6rem;
  color: var(--white);
  font-family: Inter, sans-serif;
  font-size: 0.9rem;
}
.rm-form input:focus, .rm-form select:focus, .rm-form textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(240,185,11,0.15);
}
.rm-form input[readonly] { color: var(--gray); cursor: not-allowed; background: rgba(0,0,0,0.2); }
.rm-form textarea { resize: vertical; min-height: 50px; }
.rm-req { color: var(--danger); margin-left: 0.2rem; }
.rm-optional { color: #6b6055; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 0.7rem; }
.rm-locked-tag { color: #8b7a55; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 0.7rem; font-style: italic; }
.rm-modal-actions { grid-column: 1 / -1; display: flex; gap: 0.6rem; align-items: center; margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid rgba(255,255,255,0.08); }
.rm-modal-error { grid-column: 1 / -1; color: var(--danger); background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.3); padding: 0.5rem 0.7rem; border-radius: 5px; font-size: 0.85rem; }
@media (max-width: 540px) {
  .rm-form { grid-template-columns: 1fr; }
}

/* ─────────── Non-Roster / Fill-ins section on Performance page ─────────── */
.nonroster-tbl {
  width: 100%;
  border-collapse: collapse;
  background: rgba(20,15,10,0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
}
.nonroster-tbl th {
  text-align: left; padding: 0.55rem 0.7rem;
  background: rgba(0,0,0,0.4);
  color: var(--gray); font-family: Cinzel, serif; font-size: 0.7rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  cursor: pointer; user-select: none;
}
.nonroster-tbl th:hover { color: var(--gold); }
.nonroster-tbl td {
  padding: 0.5rem 0.7rem; border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.88rem; color: var(--white);
}
.nonroster-tbl tr:hover td { background: rgba(255,255,255,0.02); }
.pug-badge {
  display: inline-block; margin-left: 0.4rem;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 0.08rem 0.4rem; border-radius: 3px;
  background: rgba(148,163,184,0.12); color: #94a3b8;
  border: 1px solid rgba(148,163,184,0.3);
}
.nonroster-add { background: rgba(240,185,11,0.08); border-color: rgba(240,185,11,0.3); }
.nonroster-add:hover { background: rgba(240,185,11,0.2); }

/* ═══════════════════════════════════════════════════
   POLISH PASS — unify card / surface / spacing
   tokens across newer components so the site feels
   intentional and cohesive.
   ═══════════════════════════════════════════════════ */

/* Standardize all card surfaces on the same gradient + border treatment used by
   .admin-card and .player-section. Newer cards were using slightly different
   hardcoded rgba values — these overrides keep them consistent. */
.behavioral-card,
.score-evolution,
.ncard,
.rm-modal-inner,
.hero-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border-radius: 8px;
}
.behavioral-card,
.score-evolution {
  border: 1px solid var(--border);
}
.ncard {
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
}
.rm-modal-inner {
  border: 1px solid var(--gold);
  box-shadow: 0 0 50px rgba(0,0,0,0.8), 0 0 80px rgba(240, 185, 11, 0.08);
}
.hero-card {
  border: 1px solid var(--class-color, var(--border));
  box-shadow: 0 0 30px var(--class-color-glow, transparent),
              inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Section title cohesion — bs-title and se-title were tiny grey labels.
   Promote them visually to match the Cinzel-gold rhythm used everywhere else. */
.bs-title,
.se-title {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  text-align: left;
  align-self: flex-start;
}
.behavioral-card .bs-header { align-items: flex-start; gap: 0.4rem; }
.bs-overall { color: var(--white); }
.bs-trait { color: var(--gold); }

/* Hero card refinements — softer portrait, tighter chip presentation */
.hero-portrait {
  border-color: var(--class-color, var(--border));
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5),
              0 0 0 1px rgba(255,255,255,0.04);
}
.hero-portrait-letter { opacity: 0.92; }
.hero-chip {
  background: rgba(0,0,0,0.3);
  border-color: var(--border);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.hero-chip:hover { border-color: var(--gold-dim); background: rgba(0,0,0,0.5); }

/* Night cards — gentler hover, slightly tighter padding */
.ncard { transition: border-left-color 0.2s ease, background 0.15s ease; }
.ncard:hover { background: linear-gradient(180deg, var(--bg-2), var(--bg-2)); }
.night-badge { font-family: 'Cinzel', serif; }
.ncs-tile { padding: 0.4rem 0.2rem; }
.ncs-lbl { color: var(--gray); }

/* Non-roster table polish — make it visually match the perf table */
.nonroster-tbl {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: 8px;
}
.nonroster-tbl th { background: rgba(0,0,0,0.35); border-bottom: 1px solid var(--border); }
.nonroster-tbl td { border-bottom: 1px solid rgba(255,255,255,0.04); }

/* Roster card edit button — make it more discoverable, less fiddly */
.roster-card-edit {
  background: rgba(15, 12, 8, 0.85);
  border-color: var(--gold-dim);
  width: 26px; height: 26px;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.roster-card.editable:hover .roster-card-edit { opacity: 1; }
.roster-card-edit:hover { background: var(--gold); color: var(--bg); border-color: var(--gold); }

/* Roster page title row — better mobile behavior */
@media (max-width: 540px) {
  .roster-title-row { flex-direction: column; align-items: flex-start; }
  .roster-title-row button { max-width: 100%; width: 100%; }
}

/* Cache bar — give the inline "Cached X ago" pill a real container */
.cache-bar {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.cache-bar button {
  background: rgba(240,185,11,0.08);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
}
.cache-bar button:hover { background: rgba(240,185,11,0.2); border-color: var(--gold); }

/* Hero card mobile — stack portrait + info + score nicely */
@media (max-width: 720px) {
  .hero-card {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0.8rem 1rem;
  }
  .hero-score-block {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
  }
}

/* Defensives section — match the DT row style for consistency */
#player-defensives .dt-row { padding: 0.35rem 0; }
#player-defensives .dt-ability { font-size: 0.88rem; color: var(--white); }

/* Tighten the "no data" / empty placeholders across detail sections */
.player-section [style*="color:var(--gray)"][style*="padding"] {
  font-style: italic;
}

/* Boss notes editor — give it a touch of breathing room when expanded */
details.admin-card[open] { padding-bottom: 1.2rem; }
details.admin-card summary { padding-bottom: 0.4rem; }

/* Footer polish — make sure it doesn't sit jammed against content */
.site-footer { margin-top: 3rem; padding: 1.5rem 1rem; }

/* Reduce inline-style pollution: standardize "page sub" text */
.page-sub { color: var(--gray); font-size: 0.95rem; margin-bottom: 1.2rem; max-width: 70ch; }

/* ─────────── Inactive / On Break ─────────── */
.roster-inactive-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.roster-card.inactive { opacity: 0.55; filter: saturate(0.55); transition: opacity 0.15s ease, filter 0.15s ease; }
.roster-card.inactive:hover { opacity: 0.85; filter: saturate(0.8); }
.rc-inactive-meta { font-size: 0.75rem; color: var(--gray); margin-top: 0.5rem; font-style: italic; }
.rc-reason { font-size: 0.78rem; color: #cfc8bd; margin-top: 0.25rem; font-style: italic; opacity: 0.85; }

.perf-inactive-badge {
  display: inline-block; margin-left: 0.4rem;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em;
  padding: 0.1rem 0.42rem; border-radius: 3px;
  background: rgba(148,163,184,0.12); color: #94a3b8;
  border: 1px solid rgba(148,163,184,0.35);
}

.perf-inactive-alert {
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  margin: 0.5rem 0 0.8rem;
  color: #f5eee0;
  font-size: 0.9rem;
}
.inactive-alert-pill {
  display: inline-block; margin-left: 0.5rem;
  color: #cfc8bd; font-size: 0.85rem;
}

/* Active stat sub-line ("3 on break") */
.stat-sub {
  display: block; color: var(--gray); font-size: 0.65rem;
  letter-spacing: 0.08em; text-transform: uppercase; margin-top: 0.2rem;
}
