/* ========================================
   SPY GAME — Firebase Edition (Next.js/shadcn look)
   ======================================== */

:root {
    --background: #242a27;
    --foreground: #e8ece9;
    --card: #1d2220;
    --card-foreground: #e8ece9;
    --primary: #3f5c4e;
    --primary-foreground: #f3f8f5;
    --secondary: #353d39;
    --secondary-foreground: #d7deda;
    --muted: #414a45;
    --muted-foreground: #a8b4ae;
    --accent: #a0ed3c;
    --accent-foreground: #161a16;
    --accent-dim: #8bd433;
    --destructive: #ef4444;
    --destructive-foreground: #f3f8f5;
    --border: #414a45;
    --border-soft: rgba(232, 236, 233, 0.09);
    --ring: #a0ed3c;
    --radius: 0.75rem;
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --shadow-glow: 0 0 24px rgba(160, 237, 60, 0.25), 0 0 60px rgba(160, 237, 60, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---- Hacker Grid Background ---- */
.hacker-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(160, 237, 60, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(160, 237, 60, 0.05) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, black 40%, transparent 100%);
}

/* ---- Scan Line ---- */
.scan-line {
    position: fixed;
    left: 0;
    right: 0;
    height: 6px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(160, 237, 60, 0.16),
        transparent
    );
    filter: blur(1px);
    animation: scan 5s linear infinite;
}
@keyframes scan {
    0% {
        top: -10%;
        opacity: 0;
    }
    12% {
        opacity: 1;
    }
    88% {
        opacity: 1;
    }
    100% {
        top: 110%;
        opacity: 0;
    }
}

/* ---- Decorative blurred glows ---- */
.glow-orb {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
}
.glow-orb--accent {
    width: 34rem;
    height: 34rem;
    top: -14rem;
    right: -10rem;
    background: radial-gradient(circle, rgba(160, 237, 60, 0.28), transparent 70%);
}
.glow-orb--green {
    width: 30rem;
    height: 30rem;
    bottom: -12rem;
    left: -10rem;
    background: radial-gradient(circle, rgba(63, 92, 78, 0.55), transparent 70%);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--muted);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--muted-foreground);
}

/* ========================================
   UTILITY LAYOUT
   ======================================== */

.page {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem 4rem;
}
.page-center {
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 64rem;
    margin: 0 auto;
}
.container-sm {
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
}
.container-xs {
    width: 100%;
    max-width: 22rem;
    margin: 0 auto;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    .grid-2--left-wide {
        grid-template-columns: 1.4fr 1fr;
    }
}
.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 760px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.flex {
    display: flex;
}
.flex-col {
    flex-direction: column;
}
.flex-wrap {
    flex-wrap: wrap;
}
.flex-1 {
    flex: 1;
}
.items-center {
    align-items: center;
}
.items-start {
    align-items: flex-start;
}
.items-end {
    align-items: flex-end;
}
.justify-center {
    justify-content: center;
}
.justify-between {
    justify-content: space-between;
}
.justify-end {
    justify-content: flex-end;
}

.w-full {
    width: 100%;
}
.hidden {
    display: none !important;
}
.text-center {
    text-align: center;
}
.text-left {
    text-align: left;
}
.text-right {
    text-align: right;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* ---- Typography ---- */
.font-mono {
    font-family: var(--font-mono);
}
.font-black {
    font-weight: 900;
}
.font-bold {
    font-weight: 700;
}
.font-medium {
    font-weight: 500;
}
.italic {
    font-style: italic;
}
.uppercase {
    text-transform: uppercase;
}
.tracking-widest {
    letter-spacing: 0.15em;
}
.tracking-tighter {
    letter-spacing: -0.04em;
}
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.leading-tight {
    line-height: 1.15;
}
.leading-none {
    line-height: 1;
}
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

.text-accent { color: var(--accent); }
.text-destructive { color: var(--destructive); }
.text-foreground { color: var(--foreground); }
.text-background { color: var(--background); }
.text-muted-foreground { color: var(--muted-foreground); }
.text-primary-foreground { color: var(--primary-foreground); }

.bg-background { background-color: var(--background); }
.bg-card { background-color: var(--card); }
.bg-accent { background-color: var(--accent); }
.bg-destructive { background-color: var(--destructive); }
.bg-muted { background-color: var(--muted); }

.border { border: 1px solid var(--border); }
.border-accent { border-color: var(--accent); }
.border-destructive { border-color: var(--destructive); }

.divider {
    height: 1px;
    background: var(--border-soft);
}

/* ========================================
   STICKY HEADER
   ======================================== */

.header {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    background: rgba(29, 34, 32, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
}
.header-inner {
    max-width: 64rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
}
.header-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.header-nav a {
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
}
.header-nav a:hover {
    color: var(--foreground);
}
.header-nav a.active {
    color: var(--accent);
}

.network-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    border: 1px solid rgba(160, 237, 60, 0.25);
    background: rgba(160, 237, 60, 0.06);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.network-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(160, 237, 60, 0.8);
    animation: pulse 2s ease-in-out infinite;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 0.5rem;
}
.back-link:hover {
    color: var(--foreground);
}

/* ========================================
   BRAND
   ======================================== */

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: 0.625rem;
    transform: rotate(-12deg);
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}
.brand-mark svg {
    color: var(--accent-foreground);
}
.brand-mark--sm {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
}
.brand-mark--sm svg {
    width: 1.35rem;
    height: 1.35rem;
}
.brand-mark--lg {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1rem;
}
.brand-mark--lg svg {
    width: 2.75rem;
    height: 2.75rem;
}

.brand-float {
    display: inline-block;
    animation: brandFloat 7s ease-in-out infinite;
}
.brand-float .brand-mark {
    animation: brandGlow 7s ease-in-out infinite;
}
@keyframes brandGlow {
    0%,
    100% {
        box-shadow: var(--shadow-glow);
    }
    50% {
        box-shadow: 0 0 16px rgba(160, 237, 60, 0.12), 0 0 40px rgba(160, 237, 60, 0.04);
    }
}
@keyframes brandFloat {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(0, -14px) scale(1.08);
    }
}

.brand-word {
    font-size: 1rem;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.04em;
    color: var(--foreground);
    text-transform: uppercase;
    line-height: 1;
}
.brand-word--accent {
    color: var(--accent);
}
.brand-word--sm {
    font-size: 0.875rem;
}
.brand-word--lg {
    font-size: 4.25rem;
    letter-spacing: -0.03em;
    text-transform: none;
    font-style: italic;
    color: var(--foreground);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--foreground);
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) {
    border-color: var(--muted-foreground);
}
.btn:disabled,
.btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-accent {
    background: var(--accent);
    color: var(--accent-foreground);
    border-color: var(--accent);
    font-weight: 700;
}
.btn-accent:hover:not(:disabled) {
    background: var(--accent-dim);
    border-color: var(--accent-dim);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
    border-color: var(--secondary);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--muted);
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--foreground);
    background: transparent;
}
.btn-outline:hover:not(:disabled) {
    background: var(--secondary);
}

.btn-ghost {
    border-color: transparent;
    color: var(--muted-foreground);
}
.btn-ghost:hover:not(:disabled) {
    color: var(--foreground);
    background: var(--secondary);
}

.btn-destructive {
    background: var(--destructive);
    color: var(--destructive-foreground);
    border-color: var(--destructive);
}
.btn-destructive:hover:not(:disabled) {
    background: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}
.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    border-radius: 0.625rem;
}
.btn-icon {
    padding: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
}
.kick-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.kick-btn:hover {
    border-color: rgba(239, 68, 68, 0.4) !important;
    background: rgba(239, 68, 68, 0.12) !important;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem 0.25rem;
}
.card-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted-foreground);
}
.card-title svg {
    color: var(--accent);
}
.card-sub {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}
.card-content {
    padding: 1rem 1.5rem 1.5rem;
}
.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-soft);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.2rem 0.625rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--secondary);
    color: var(--muted-foreground);
}
.badge-accent {
    background: rgba(160, 237, 60, 0.1);
    color: var(--accent);
    border: 1px solid rgba(160, 237, 60, 0.25);
}
.badge-destructive {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ========================================
   FORM CONTROLS
   ======================================== */

.input {
    width: 100%;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(160, 237, 60, 0.15);
}
.input::placeholder {
    color: var(--muted-foreground);
}
.input.input-lg {
    padding: 0.875rem 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.select {
    width: 100%;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
}
.select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(160, 237, 60, 0.15);
}
.select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    margin-bottom: 0.375rem;
}

/* ---- Switch ---- */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.625rem 0;
}
.switch-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--foreground);
}
.switch-sub {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 0.125rem;
}
.switch {
    position: relative;
    display: inline-block;
    width: 2.625rem;
    height: 1.5rem;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-track {
    position: absolute;
    inset: 0;
    background: var(--muted);
    border-radius: 999px;
    transition: background 0.2s;
    cursor: pointer;
}
.switch-track::before {
    content: "";
    position: absolute;
    top: 0.1875rem;
    left: 0.1875rem;
    width: 1.125rem;
    height: 1.125rem;
    background: var(--secondary-foreground);
    border-radius: 50%;
    transition: transform 0.2s;
}
.switch input:checked + .switch-track {
    background: var(--accent);
}
.switch input:checked + .switch-track::before {
    transform: translateX(1.125rem);
    background: var(--accent-foreground);
}

/* ---- Stepper ---- */
.stepper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.stepper-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--secondary);
    color: var(--foreground);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.stepper-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}
.stepper-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.stepper-value {
    min-width: 2rem;
    text-align: center;
    font-size: 1.375rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* ---- Segmented ---- */
.segmented {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    padding: 0.25rem;
    gap: 0.25rem;
}
.segmented-btn {
    padding: 0.5rem 0.25rem;
    border-radius: 0.4375rem;
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.segmented-btn:hover {
    color: var(--foreground);
}
.segmented-btn.active {
    background: var(--card);
    color: var(--accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.segmented-wrap {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

/* ========================================
   AVATARS / PLAYERS
   ======================================== */

.avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--secondary);
    color: var(--secondary-foreground);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.avatar-accent {
    background: rgba(160, 237, 60, 0.12);
    color: var(--accent);
    border-color: rgba(160, 237, 60, 0.3);
}
.avatar-destructive {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.player-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.15s;
}
.player-row:hover {
    background: var(--secondary);
}
.player-meta {
    flex: 1;
    min-width: 0;
}
.player-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.player-tag {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.player-tag.host {
    color: var(--accent);
}
.player-tag.you {
    color: var(--accent);
}
.player-tag.classified {
    color: var(--muted-foreground);
}
.player-tag.open {
    color: var(--accent);
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.online {
    background: var(--accent);
    box-shadow: 0 0 6px rgba(160, 237, 60, 0.7);
}
.status-dot.offline {
    background: var(--destructive);
}
.status-dot.pending {
    background: #facc15;
}

/* ========================================
   TIMER PILL
   ======================================== */

.timer-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.875rem;
    border-radius: 999px;
    border: 1px solid rgba(160, 237, 60, 0.25);
    background: rgba(160, 237, 60, 0.06);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.timer-pill svg {
    color: var(--accent);
}
.timer-value.low {
    color: #facc15;
}
.timer-value.critical {
    color: #f87171;
    animation: pulse 1s ease-in-out infinite;
}
.timer-pill .timer-status-text {
    font-size: 0.625rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    font-weight: 600;
}
.timer-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--accent);
}
.timer-dot.low {
    background: #facc15;
}
.timer-dot.critical {
    background: #f87171;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ========================================
   LOCATION BOARD
   ======================================== */

.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.5rem;
}
@media (min-width: 900px) {
    .location-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.location-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-align: left;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--secondary);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.location-btn:hover:not(:disabled) {
    border-color: var(--muted-foreground);
}
.location-btn .loc-icon {
    font-size: 1.125rem;
    line-height: 1;
}
.location-btn.eliminated {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
    color: var(--muted-foreground);
    text-decoration: line-through;
}
.location-btn.excluded {
    border-color: var(--border);
    background: transparent;
    color: var(--muted-foreground);
}
.location-btn .cross {
    color: #f87171;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.location-btn .mark {
    color: var(--muted-foreground);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ========================================
   ROLE CARD
   ======================================== */

.role-card {
    perspective: 1200px;
    width: 100%;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.role-card-inner {
    position: relative;
    width: 100%;
    height: 16rem;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.role-card-inner.flipped {
    transform: rotateY(180deg);
}
.role-card-inner.pulse-border {
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: rgba(160, 237, 60, 0.25); }
    50% { border-color: rgba(160, 237, 60, 0.8); }
}

.role-card-front,
.role-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}
.role-card-front {
    background: linear-gradient(160deg, #2a312d, #1d2220);
}
.role-card-back {
    transform: rotateY(180deg);
    background: linear-gradient(160deg, #242b27, #1d2220);
    border: 1px solid rgba(160, 237, 60, 0.25);
}

.role-card-label {
    position: absolute;
    top: 1rem;
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    letter-spacing: 0.15em;
    padding: 0.25rem 1rem;
    border-radius: 999px;
    text-transform: uppercase;
}
.role-card-label.spy {
    background: rgba(127, 29, 29, 0.45);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.35);
}
.role-card-label.agent {
    background: rgba(160, 237, 60, 0.1);
    color: var(--accent);
    border: 1px solid rgba(160, 237, 60, 0.3);
}

.info-label {
    font-size: 0.6875rem;
    color: var(--muted-foreground);
    font-family: var(--font-mono);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.375rem;
}
.info-value {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--foreground);
}

/* ========================================
   VOTING
   ======================================== */

.progress-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.progress-track {
    height: 0.5rem;
    background: var(--secondary);
    border-radius: 999px;
    overflow: hidden;
    flex: 1;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(160, 237, 60, 0.5);
}
.progress-text {
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.vote-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
}
@media (min-width: 640px) {
    .vote-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.vote-card {
    position: relative;
    padding: 1.25rem 0.75rem;
    border-radius: 0.625rem;
    border: 1px solid var(--border);
    background: var(--card);
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-sans);
    -webkit-tap-highlight-color: transparent;
}
.vote-card:hover:not(:disabled) {
    border-color: var(--muted-foreground);
    background: var(--secondary);
}
.vote-card.selected {
    border-color: rgba(239, 68, 68, 0.55);
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.vote-card:disabled {
    cursor: default;
    opacity: 0.6;
}
.vote-card-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vote-card-count {
    font-size: 0.6875rem;
    color: var(--muted-foreground);
    margin-top: 0.25rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ========================================
   RESULTS / REVEALS
   ======================================== */

.result-banner {
    text-align: center;
    padding: 1.5rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    background: var(--card);
}
.result-banner--win {
    border-color: rgba(160, 237, 60, 0.35);
    background: rgba(160, 237, 60, 0.06);
}
.result-banner--lose {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(127, 29, 29, 0.18);
}

.reveal-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-soft);
    background: var(--card);
    opacity: 0;
    transition: opacity 0.5s;
}
.reveal-row.revealed {
    opacity: 1;
}
.reveal-row--spy {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(127, 29, 29, 0.16);
}

.loading-dots {
    display: flex;
    gap: 0.625rem;
    justify-content: center;
}
.loading-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 1.4s ease-in-out infinite;
}
.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}
.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes pulse-dot {
    0%, 80%, 100% {
        opacity: 0.25;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   HERO / HOME
   ======================================== */

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 3rem 0 2rem;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3125rem 0.875rem;
    border-radius: 999px;
    border: 1px solid rgba(160, 237, 60, 0.25);
    background: rgba(160, 237, 60, 0.06);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.hero-title {
    font-size: clamp(3rem, 10vw, 5.5rem);
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--foreground);
    animation: fadeInUp 0.9s ease-out both;
}
.hero-title .accent {
    color: #78b52c;
}
.hero-sub {
    font-size: 1rem;
    color: var(--muted-foreground);
    max-width: 34rem;
}

/* ========================================
   MANUAL / INFO PAGES
   ======================================== */

.manual-card {
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.manual-card h3 {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.manual-card p,
.manual-card li {
    font-size: 0.9375rem;
    color: var(--muted-foreground);
    line-height: 1.7;
}
.manual-card ul,
.manual-card ol {
    padding-left: 1.25rem;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.manual-card strong {
    color: var(--foreground);
}
.manual-card em {
    color: var(--muted-foreground);
}
.manual-card .manual-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.manual-step-num {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgba(160, 237, 60, 0.1);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 0.5rem;
}

/* ---- Tabs ---- */
.tab-btn {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.tab-btn:hover {
    color: var(--foreground);
    border-color: var(--muted-foreground);
}
.tab-btn.active {
    border-color: var(--accent);
    background: rgba(160, 237, 60, 0.1);
    color: var(--accent);
}

/* ---- Location grid card ---- */
.grid-card {
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1rem;
    transition: border-color 0.15s;
}
.grid-card h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    background: var(--secondary);
    color: var(--muted-foreground);
    font-size: 0.75rem;
    font-weight: 500;
}

/* ========================================
   MODAL
   ======================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.15s ease-out;
}
@media (min-width: 640px) {
    .modal-backdrop {
        align-items: center;
    }
}
.modal {
    width: 100%;
    max-width: 30rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: fadeInUp 0.2s ease-out;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-soft);
}
.modal-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--foreground);
}
.modal-title svg {
    color: var(--accent);
}
.modal-body {
    padding: 1.5rem;
}
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-soft);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   TOAST
   ======================================== */

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background: var(--card);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(160, 237, 60, 0.4);
    border-radius: 0.625rem;
    padding: 0.75rem 1.25rem;
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.2s ease-out;
    transition: opacity 0.3s;
}

/* ---- Chat (legacy, unused) ---- */
.chat-box {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: var(--card);
    min-height: 16rem;
    display: flex;
    flex-direction: column;
}
.chat-header {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    border-bottom: 1px solid var(--border-soft);
}
.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.chat-empty {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    text-align: center;
    padding: 2rem 0;
}
.chat-msg-name {
    font-weight: 700;
    color: var(--muted-foreground);
}
.chat-msg-name.me {
    color: var(--accent);
}
.chat-msg-text {
    color: var(--foreground);
    font-size: 0.875rem;
}
.chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border-soft);
}

/* ---- Misc ---- */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-soft);
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}
.footer-links a {
    color: var(--muted-foreground);
    text-decoration: none;
    transition: color 0.15s;
}
.footer-links a:hover {
    color: var(--accent);
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fade-in {
    animation: fadeIn 0.25s ease-out;
}
