
:root {
  color-scheme: dark;
  --bg: #120a08;
  --panel: #1a1020;
  --panel-alt: #281535;
  --text: #fff5fb;
  --muted: #dbc7de;
  --accent: #ff8a00;
  --accent-soft: #ffb347;
  --accent-2: #b43cff;
  --border: #5f2b5e;
  --danger: #d64862;
  --success: #2f9e6b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top, rgba(255,138,0,0.18), transparent 30%), linear-gradient(180deg, #050405 0%, var(--bg) 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.container { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; }
.topbar { border-bottom: 1px solid var(--border); background: rgba(12, 16, 30, 0.92); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0; gap: 1rem; }
.topbar nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 700; display:inline-flex; align-items:center; gap:0.75rem; min-width: 0; }
.brand img { width: auto; height: 64px; max-width: min(240px, 42vw); object-fit: contain; display:block; filter: drop-shadow(0 0 14px rgba(255,138,0,0.28)); }
.brand span { font-size: 1rem; letter-spacing: 0.02em; white-space: nowrap; }
.page-content { padding: 2rem 0 4rem; }
.hero-card, .panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
}
.hero-card { margin-top: 2rem; }
.hero-card.narrow { max-width: 560px; }
.actions, .actions-inline { margin-top: 1rem; display: flex; gap: 0.75rem; align-items: center; }
.actions-inline.wrap, .meta-row.wrap { flex-wrap: wrap; }
.button {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
}
.button:hover { background: linear-gradient(135deg, var(--accent-soft), #d46cff); }
.button.twitch { background: linear-gradient(135deg, #9147ff, var(--accent-2)); }
.button-secondary { background: transparent; border-color: var(--border); }
.button-secondary:hover { background: var(--panel-alt); }
.button-danger { background: var(--danger); }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
.align-start { align-items: start; }
.user-pill { padding: 0.45rem 0.7rem; border-radius: 999px; background: var(--panel-alt); border: 1px solid var(--border); }
ul { line-height: 1.75; color: var(--muted); }
p { color: var(--muted); line-height: 1.6; }
h1, h2, h3 { margin-top: 0; }
label span { display: block; margin-bottom: 0.4rem; font-weight: 700; }
input[type="text"], input[type="number"], input[type="url"], select, textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #101528;
  color: var(--text);
}
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid.compact { grid-template-columns: 1fr; }
.full-width { grid-column: 1 / -1; }
.checkbox-row { display: flex; align-items: center; gap: 0.7rem; color: var(--muted); }
.alert {
  border-radius: 12px;
  padding: 0.95rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.alert-success { background: rgba(47, 158, 107, 0.14); border-color: rgba(47, 158, 107, 0.4); }
.alert-error { background: rgba(214, 72, 98, 0.14); border-color: rgba(214, 72, 98, 0.4); }
.card-list { display: grid; gap: 1rem; }
.mini-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.compact-card { padding: 0.9rem 1rem; }
.meta-row { display: flex; gap: 1rem; color: var(--muted); font-size: 0.95rem; }
.event-list { display: grid; gap: 1rem; }
.event-row { border: 1px solid var(--border); border-radius: 14px; padding: 1rem; }
.help-text { font-size: 0.95rem; margin-top: 0; }
.stack-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mt-16 { margin-top: 1rem; }
.section-header { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
@media (max-width: 820px) {
  .grid-two, .form-grid { grid-template-columns: 1fr; }
  .stack-row, .mini-card, .topbar-inner { flex-direction: column; align-items: start; }
  .brand img { height: 48px; max-width: 180px; }
  .brand span { font-size: 0.95rem; }
}

.muted-text { color: var(--muted); }
.live-badge { display:inline-flex; align-items:center; padding:0.35rem 0.7rem; border-radius:999px; border:1px solid var(--border); font-size:0.85rem; font-weight:700; }
.live-badge.is-live { background: rgba(47, 158, 107, 0.18); border-color: rgba(47, 158, 107, 0.45); color: #8ef0b8; }
.live-badge.is-ended { background: rgba(214,72,98,0.18); border-color: rgba(214,72,98,0.45); color: #ff9aad; }
.board-panel { gap: 1rem; }
.bingo-grid { display:grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.bingo-square { position: relative; overflow: hidden; --stamp-rot: -6deg; --stamp-x: 0px; --stamp-y: 0px; --stamp-scale: 1; min-height: 110px; border-radius: 16px; border:1px solid var(--border); background: #101528; color: var(--text); padding: 0.9rem; font-weight:700; text-align:left; transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease; }
.bingo-square:hover { transform: translateY(-2px); }
.bingo-square .square-label { position: relative; z-index: 1; display: block; }
.bingo-square .stamp-overlay { position: absolute; top: 50%; left: 50%; width: min(88%, 220px); min-width: 126px; transform: translate(calc(-50% + var(--stamp-x)), calc(-50% + var(--stamp-y))) rotate(var(--stamp-rot)) scale(var(--stamp-scale)); transform-origin: center; border: 3px solid rgba(255, 111, 80, 0.88); border-radius: 999px; color: rgba(255, 111, 80, 0.92); padding: 0.38rem 1.1rem 0.34rem; font-size: clamp(1.05rem, 1.45vw, 1.4rem); font-weight: 900; letter-spacing: 0.14em; line-height: 1; text-transform: uppercase; text-align: center; white-space: nowrap; opacity: 0; pointer-events: none; mix-blend-mode: screen; text-shadow: 0 0 8px rgba(255, 111, 80, 0.12); box-shadow: 0 0 0 2px rgba(255, 111, 80, 0.14) inset; }
.bingo-square.marked { background: rgba(180,60,255,0.24); border-color: rgba(255,138,0,0.58); box-shadow: 0 0 0 1px rgba(255,138,0,0.28) inset, 0 0 16px rgba(255,138,0,0.10); }
.bingo-square.marked .stamp-overlay { opacity: 0.92; }
.bingo-square.free-square { background: rgba(47,158,107,0.22); border-color: rgba(47,158,107,0.45); }
.bingo-square.free-square .stamp-overlay { border-color: rgba(91, 243, 161, 0.95); color: rgba(191, 255, 225, 0.98); box-shadow: 0 0 0 2px rgba(91,243,161,0.18) inset; }
.bingo-square.newly-marked { animation: squarePulse 0.45s ease; }
.bingo-square.newly-marked .stamp-overlay { animation: stampImpact 0.38s ease; }
.bingo-square.winning-square { box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.5) inset, 0 0 18px rgba(255, 215, 0, 0.18); }
.bingo-square.winning-square .stamp-overlay { border-color: rgba(255, 214, 80, 0.96); color: rgba(255, 231, 148, 0.98); box-shadow: 0 0 0 2px rgba(255,214,80,0.16) inset; }
.bingo-banner { margin-top: 1rem; padding: 0.9rem 1rem; border-radius: 12px; background: rgba(255,138,0,0.16); border:1px solid rgba(255,138,0,0.4); font-weight:700; color:#fff0d9; }
.claim-list { display:grid; gap: 1rem; }
.claim-card details { margin: 0.75rem 0; }
.snapshot-grid { display:grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.35rem; margin-top:0.75rem; }
.snapshot-cell { border:1px solid var(--border); border-radius: 8px; padding: 0.45rem; font-size: 0.82rem; color: var(--muted); }
.snapshot-cell.marked { background: rgba(145,71,255,0.18); color: var(--text); }
@keyframes squarePulse { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes stampImpact { 0% { opacity: 0; transform: translate(calc(-50% + var(--stamp-x)), calc(-50% + var(--stamp-y))) rotate(calc(var(--stamp-rot) - 7deg)) scale(1.28); } 55% { opacity: 1; transform: translate(calc(-50% + var(--stamp-x)), calc(-50% + var(--stamp-y))) rotate(var(--stamp-rot)) scale(calc(var(--stamp-scale) * 0.96)); } 100% { opacity: 0.92; transform: translate(calc(-50% + var(--stamp-x)), calc(-50% + var(--stamp-y))) rotate(var(--stamp-rot)) scale(var(--stamp-scale)); } }
@media (max-width: 820px) {
  .bingo-grid, .snapshot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bingo-square { min-height: 84px; }
  .bingo-square .stamp-overlay { min-width: 108px; width: 84%; font-size: 0.98rem; padding: 0.34rem 0.75rem 0.3rem; }
}

.code-block {
    width: 100%;
    border: 1px solid rgba(128, 141, 255, 0.35);
    background: rgba(9, 14, 40, 0.96);
    color: #e8ecff;
    border-radius: 12px;
    padding: 14px;
    font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace;
}


.settings-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1rem; border:1px solid var(--border); border-radius: 14px; padding: 1rem; }
.settings-grid legend { padding: 0 0.4rem; color: var(--muted); }
.channel-hero { position: relative; overflow:hidden; background-size: cover; background-position: center; border-color: color-mix(in srgb, var(--channel-accent, var(--accent)) 45%, var(--border)); }
.channel-hero::before { content:''; position:absolute; inset:0; background: linear-gradient(135deg, rgba(12,16,30,0.92), rgba(12,16,30,0.78)); }
.channel-hero > * { position: relative; }
.channel-hero .button { background: var(--channel-accent, var(--accent)); }
.channel-hero.compact { margin-bottom: 1rem; }
.channel-hero-inner { display:flex; justify-content:space-between; align-items:center; gap:1rem; }
.qr-join-grid { display:grid; grid-template-columns: 1fr auto; gap: 1rem; align-items:center; }
.qr-image { width: 220px; height: 220px; border-radius: 16px; background:#fff; padding: 0.5rem; }
.qr-image.small { width: 120px; height: 120px; }
.two-column-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:1rem; }
.search-inline { display:flex; align-items:center; gap:0.75rem; color: var(--muted); }
.search-inline input { min-width: 250px; }
.overlay-shell { background: transparent; }
.overlay-header { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding: 1rem 1.25rem; border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--channel-accent, var(--accent)) 35%, #111 65%), rgba(15,18,32,0.92)); border:1px solid rgba(255,255,255,0.08); margin-bottom:1rem; }
.overlay-header h1 { margin-bottom:0.2rem; }
.overlay-join { display:flex; align-items:center; gap:1rem; }
.overlay-panel { background: rgba(23,27,46,0.88); backdrop-filter: blur(8px); }
@media (max-width: 820px) { .two-column-grid, .settings-grid, .qr-join-grid, .channel-hero-inner { grid-template-columns: 1fr; display:grid; } .qr-image { width: 180px; height: 180px; } .search-inline input { min-width: 0; width: 100%; } }

.name-with-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.display-name {
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.2;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  white-space: nowrap;
}
.badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  min-width: 1rem;
  font-size: 0.82rem;
  line-height: 1;
}
.badge-label { display: inline-flex; align-items: center; }
.badge-mode-icon { padding-inline: 0.38rem; }
.badge-mode-icon .badge-icon { width: auto; min-width: 0; font-size: 0.88rem; }
.badge-mode-icon .badge-label { display: none; }
.badge-mode-text .badge-icon { display: none; }

.badge-founder { background: rgba(255, 138, 0, 0.20); border-color: rgba(255, 138, 0, 0.4); }
.badge-verified { background: rgba(59, 130, 246, 0.18); border-color: rgba(59, 130, 246, 0.35); }
.badge-affiliate { background: rgba(168, 85, 247, 0.18); border-color: rgba(168, 85, 247, 0.35); }
.badge-partner { background: rgba(255, 109, 209, 0.20); border-color: rgba(255, 109, 209, 0.38); }
.badge-admin { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.35); }

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.compact-checkbox {
  margin: 0;
}
.badge-guest { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.28); }


/* Phase 18 profiles + visual polish */
.profile-link, .inline-link { color: var(--text); text-decoration: underline; text-underline-offset: 0.16em; }
.profile-link:hover, .inline-link:hover { color: var(--accent-soft); }
.profile-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(180,60,255,0.18), transparent 28%),
    radial-gradient(circle at bottom left, rgba(255,138,0,0.18), transparent 24%),
    var(--panel);
}
.profile-header { display:flex; gap:1.25rem; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.avatar-wrap { flex:0 0 auto; }
.profile-avatar, .profile-avatar-fallback {
  width: 96px; height: 96px; border-radius: 24px; border: 2px solid var(--border); object-fit: cover;
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
}
.profile-avatar-fallback {
  display:grid; place-items:center; font-size:2rem; font-weight:800;
  background: linear-gradient(135deg, rgba(255,138,0,0.35), rgba(180,60,255,0.35));
}
.profile-copy { flex:1 1 280px; min-width: 240px; }
.profile-copy .muted-text { margin: 0.2rem 0 0.7rem; }
.profile-stats-grid {
  margin-top: 1.25rem;
  display:grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.9rem;
}
.stat-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00)), var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  display:flex; flex-direction:column; gap:0.35rem;
}
.stat-card strong { font-size: 1.65rem; line-height:1; }
.stat-card span { color: var(--muted); font-size: 0.92rem; }
.three-column-grid {
  margin-top: 1.25rem;
  display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem;
}
.timeline-list { display:flex; flex-direction:column; gap:0.9rem; }
.timeline-item { display:flex; gap:0.85rem; align-items:flex-start; }
.timeline-dot {
  width: 12px; height: 12px; border-radius:999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex:0 0 12px; margin-top:0.35rem;
  box-shadow: 0 0 0 4px rgba(255,138,0,0.08);
}
.timeline-dot.status-approved { background: var(--success); box-shadow: 0 0 0 4px rgba(47,158,107,0.14); }
.timeline-dot.status-denied, .timeline-dot.status-rejected { background: var(--danger); box-shadow: 0 0 0 4px rgba(214,72,98,0.14); }
.subtle-text { color: rgba(255,245,251,0.66); font-size:0.88rem; }
.claim-list .mini-card, .timeline-item > div { min-width: 0; }
.muted-text { color: var(--muted); }
@media (max-width: 980px) {
  .profile-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .three-column-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .profile-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-header { align-items:flex-start; }
  .profile-avatar, .profile-avatar-fallback { width: 76px; height: 76px; border-radius: 20px; }
}


/* Phase 24 polish */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem 1rem;
}
.kv-grid dt {
  font-weight: 700;
  opacity: 0.9;
}
.kv-grid dd {
  margin: 0.2rem 0 0;
  opacity: 0.95;
  word-break: break-word;
}
.stack-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}
.stack-list li + li {
  margin-top: 0.35rem;
}


.bingo-square.free-square .square-label {
  display: none;
}

.checkbox-row small { display:block; font-weight:400; }

.compact-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1rem; }
@media (max-width: 820px) { .compact-grid { grid-template-columns: 1fr; } }


.achievement-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  font-size: 0.72rem;
  font-weight: 700;
  margin-right: 0.35rem;
}

.claim-card.is-processing { opacity: 0.72; pointer-events: none; }
.claim-card.is-processing::after { content: 'Reviewing...'; display: block; margin-top: 0.5rem; color: var(--muted); font-size: 0.9rem; }


/* Phase 44: Twitch-panel-friendly board view */
.twitch-panel-shell {
    border-color: color-mix(in srgb, var(--channel-accent, #9147ff) 40%, rgba(255,255,255,.18));
    overflow: hidden;
}
.panel-brand-row,
.panel-title-row,
.panel-player-row,
.panel-state-row,
.compact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}
.panel-brand-row {
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: .02em;
}
.panel-logo-mini {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: .75rem;
    background: rgba(255,255,255,.08);
}
.panel-title-row h1 {
    margin-bottom: .25rem;
    font-size: clamp(1.55rem, 5vw, 2.65rem);
}
.panel-mini-meta {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.panel-mini-meta span,
.panel-state-row .pill {
    font-size: .82rem;
}
.panel-join-grid,
.panel-board-layout,
.panel-mod-grid {
    display: grid;
    gap: 1rem;
}
.panel-join-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 1rem;
}
.panel-board-layout {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 320px);
    align-items: start;
    margin-top: 1rem;
}
.panel-board-card,
.panel-side-card {
    padding: 1rem;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 1.25rem;
    background: rgba(255,255,255,.055);
}
.panel-player-row h2,
.mod-panel-tools h2,
.mod-panel-tools h3 {
    margin-bottom: .25rem;
}
.panel-claim-status {
    display: block;
    min-height: 1.4rem;
    margin: .5rem 0;
}
.panel-bingo-grid.bingo-grid {
    gap: .45rem;
}
.panel-bingo-grid .bingo-square {
    min-height: 4.35rem;
    padding: .45rem;
    font-size: clamp(.72rem, 2.2vw, .93rem);
}
.panel-side-card .full-button {
    width: 100%;
    margin-top: .75rem;
}
.compact-list .mini-card,
.compact-claims-list .mini-card,
.compact-event-list .mini-card {
    padding: .75rem;
}
.panel-mod-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
    margin-top: 1rem;
}
.panel-search-input {
    width: 100%;
    margin: .5rem 0 .75rem;
}
.compact-event-list,
.compact-claims-list {
    max-height: 560px;
    overflow: auto;
    padding-right: .2rem;
}
.compact-form input[type="text"] {
    width: 100%;
}
@media (max-width: 900px) {
    .panel-board-layout,
    .panel-mod-grid {
        grid-template-columns: 1fr;
    }
    .panel-side-card {
        order: 2;
    }
}
@media (max-width: 520px) {
    .twitch-panel-shell {
        padding: .9rem;
        border-radius: 1rem;
    }
    .panel-bingo-grid .bingo-square {
        min-height: 3.35rem;
        border-radius: .65rem;
    }
    .panel-title-row,
    .panel-player-row {
        align-items: flex-start;
    }
}


.inline-form {
    display: inline-flex;
    margin: 0;
}

.empty-state {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

/* Mobile board polish */
.board-panel,
.panel-board-card {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.board-panel .bingo-grid,
.panel-bingo-grid.bingo-grid {
  grid-template-columns: repeat(5, minmax(52px, 1fr));
}
@media (max-width: 820px) {
  .board-panel .bingo-grid,
  .panel-bingo-grid.bingo-grid {
    grid-template-columns: repeat(5, minmax(50px, 1fr));
    gap: 0.35rem;
  }
  .board-panel .bingo-square,
  .panel-bingo-grid .bingo-square {
    min-height: clamp(58px, 17vw, 82px);
    padding: 0.42rem;
    border-radius: 0.75rem;
    font-size: clamp(0.62rem, 2.6vw, 0.82rem);
    line-height: 1.15;
    text-align: center;
  }
  .board-panel .bingo-square .stamp-overlay,
  .panel-bingo-grid .bingo-square .stamp-overlay {
    min-width: 0;
    width: 92%;
    padding: 0.25rem 0.35rem 0.22rem;
    font-size: clamp(0.56rem, 2.4vw, 0.78rem);
    letter-spacing: 0.08em;
    border-width: 2px;
  }
  .board-panel .stack-row,
  .panel-player-row {
    gap: 0.7rem;
  }
  .board-panel .actions-inline,
  .panel-player-row .button,
  #claim-bingo-button {
    width: 100%;
  }
}
@media (max-width: 360px) {
  .board-panel .bingo-grid,
  .panel-bingo-grid.bingo-grid {
    min-width: 282px;
  }
}


/* Phase 75 leaderboards and stats polish */
.leaderboard-hero h1{margin:0;font-size:clamp(1.7rem,4vw,2.6rem)}
.leaderboard-layout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-top:1rem}
.leaderboard-list{display:grid;gap:.65rem}
.leader-row{display:grid;grid-template-columns:auto 38px minmax(0,1fr) auto;align-items:center;gap:.7rem;text-decoration:none;color:inherit;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.04);border-radius:14px;padding:.7rem}
.leader-row:hover{background:rgba(255,255,255,.075)}
.leader-row img{width:38px;height:38px;border-radius:999px;object-fit:cover}
.leader-row strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.leader-row span:last-child{color:var(--muted, #c8c0dc);font-weight:700;font-size:.9rem}
.leader-rank{display:inline-flex;align-items:center;justify-content:center;width:2.4rem;height:2.4rem;border-radius:999px;background:rgba(124,58,237,.22);font-weight:900;color:#fff}
.profile-stats-grid .stat-card span{line-height:1.2}
@media(max-width:800px){.leaderboard-layout{grid-template-columns:1fr}.leader-row{grid-template-columns:auto 34px minmax(0,1fr);}.leader-row span:last-child{grid-column:3;color:var(--muted,#c8c0dc)}}
/* Phase 76 leaderboard timeframe filters */
.leaderboard-tabs{display:flex;flex-wrap:wrap;gap:.4rem;justify-content:flex-end;margin:.25rem 0}
.pill-link{display:inline-flex;align-items:center;border:1px solid var(--border);border-radius:999px;padding:.35rem .65rem;font-size:.85rem;color:var(--muted);text-decoration:none;background:rgba(255,255,255,.04)}
.pill-link.active,.pill-link:hover{color:var(--text);border-color:rgba(124,58,237,.65);background:rgba(124,58,237,.14)}

/* Phase 79 achievements directory */
.achievements-hero {
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 138, 0, 0.16), transparent 24%),
    radial-gradient(circle at 85% 5%, rgba(180, 60, 255, 0.22), transparent 28%),
    linear-gradient(135deg, rgba(22, 18, 42, 0.98), rgba(12, 16, 30, 0.98));
}
.achievements-hero h1 { margin: 0 0 .35rem; font-size: clamp(1.8rem, 4vw, 3rem); }
.achievements-hero p { max-width: 760px; }
.achievements-filter-panel { margin-top: 1rem; }
.achievement-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(150px, 1fr)) auto;
  gap: .85rem;
  align-items: end;
}
.achievement-filters label { display: grid; gap: .35rem; color: var(--muted); font-weight: 700; font-size: .9rem; }
.achievement-filters input,
.achievement-filters select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: .7rem .8rem;
}
.achievement-filters option { color: #120f20; }
.achievement-filter-actions { display: flex; gap: .5rem; align-items: center; }
.achievement-directory { display: grid; gap: 1.25rem; margin-top: 1rem; }
.achievement-category-block { display: grid; gap: .75rem; }
.achievement-category-header { padding-inline: .25rem; }
.achievement-category-header h2 { margin: 0 0 .2rem; }
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.achievement-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: .85rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: 1rem;
  background:
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  box-shadow: 0 16px 34px rgba(0,0,0,.18);
}
.achievement-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.achievement-card.is-locked { opacity: .72; filter: grayscale(.18); }
.achievement-card.is-earned { border-color: rgba(255, 138, 0, .34); }
.achievement-card.rarity-rare { border-color: rgba(103, 232, 249, .24); }
.achievement-card.rarity-epic { border-color: rgba(180, 60, 255, .42); }
.achievement-card.rarity-legendary { border-color: rgba(255, 187, 74, .48); }
.achievement-badge-wrap { display: grid; place-items: center; min-height: 170px; }
.achievement-badge-img {
  width: min(100%, 180px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.28));
}
.achievement-card.is-locked .achievement-badge-img { opacity: .55; }
.achievement-badge-fallback {
  width: 140px;
  height: 140px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: rgba(124,58,237,.2);
  border: 1px solid rgba(255,255,255,.12);
  font-weight: 900;
}
.achievement-card-copy { display: grid; gap: .55rem; }
.achievement-card-copy h3 { margin: 0; font-size: 1.15rem; }
.achievement-card-copy p { margin: 0; color: var(--muted); line-height: 1.4; }
.achievement-card-title-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.achievement-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .25rem .55rem;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
}
.achievement-status.earned { color: #fff1c7; border-color: rgba(255, 187, 74, .46); background: rgba(255, 138, 0, .16); }
.achievement-meta-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.achievement-meta-row span {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  border-radius: 999px;
  padding: .22rem .52rem;
  font-size: .78rem;
  font-weight: 800;
}
.achievement-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .85rem;
}
.profile-achievement-mini {
  display: flex;
  gap: .8rem;
  align-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: .75rem;
  background: rgba(255,255,255,.04);
}
.profile-achievement-mini img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.24));
}
.profile-achievement-mini p { margin: .15rem 0 0; }
@media (max-width: 1180px) {
  .achievement-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .achievement-filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .achievement-filters { grid-template-columns: 1fr; }
  .achievement-filter-actions { flex-direction: column; align-items: stretch; }
  .achievement-filter-actions .button { width: 100%; }
  .achievement-grid { grid-template-columns: 1fr; }
  .achievement-badge-wrap { min-height: 140px; }
  .achievement-badge-img { width: 150px; }
  .achievement-card-title-row { align-items: flex-start; flex-direction: column; gap: .45rem; }
}


/* Phase 80 achievement score system */
.score-card-main strong { color: #fff1c7; text-shadow: 0 0 18px rgba(168,85,247,.35); }
.achievement-score-summary { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; }
.achievement-score-summary > div { min-width: 150px; padding: .75rem .9rem; border: 1px solid rgba(168,85,247,.26); border-radius: 1rem; background: rgba(17,12,32,.72); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.achievement-score-summary strong { display: block; font-size: 1.35rem; color: #fff; }
.achievement-score-summary span { color: var(--muted); font-size: .82rem; }
.achievement-points-badge { position: absolute; top: .85rem; right: .85rem; z-index: 2; padding: .25rem .55rem; border-radius: 999px; border: 1px solid rgba(255,187,74,.38); background: rgba(255,138,0,.16); color: #ffe9ad; font-weight: 800; font-size: .78rem; }
.achievement-card.rarity-uncommon { border-color: rgba(74, 222, 128, .26); }
.achievement-card.rarity-special { border-color: rgba(45, 212, 191, .5); box-shadow: 0 20px 60px rgba(45,212,191,.08); }
.score-leader-row { grid-template-columns: auto 38px minmax(0,1fr) auto auto; }
@media(max-width:800px){.achievement-score-summary{justify-content:stretch}.achievement-score-summary>div{flex:1 1 100%}.score-leader-row{grid-template-columns:auto 34px minmax(0,1fr)}.score-leader-row span:nth-last-child(-n+2){grid-column:3}.achievement-points-badge{top:.6rem;right:.6rem}}
