@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&family=Space+Grotesk:wght@700&display=swap');

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

:root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --surface2: #1a1a28;
    --border: #2a2a3a;
    --text: #e8e8f0;
    --text-dim: #8888a0;
    --red: #ff3b5c;
    --red-glow: rgba(255, 59, 92, 0.3);
    --red-dim: #cc2040;
    --blue: #3b8bff;
    --blue-glow: rgba(59, 139, 255, 0.3);
    --blue-dim: #2060cc;
    --gold: #ffd700;
    --radius: 12px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── TOP NAV ─── */

.topnav {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    text-decoration: none;
}

.nav-logo .clash { color: var(--red); }
.nav-logo .room { color: var(--blue); }

.nav-links {
    display: flex;
    gap: 1.5rem;
    margin-left: 2rem;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-auth {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-btn {
    padding: 0.4rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.nav-btn:hover { border-color: var(--blue); }
.nav-btn.primary { background: linear-gradient(135deg, var(--red), var(--blue)); border: none; color: white; font-weight: 600; }

.nav-user {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
}

.nav-stats { color: var(--text-dim); font-size: 0.75rem; }

.nav-logout {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
}

.nav-logout:hover { color: var(--red); }

/* ─── AUTH MODAL ─── */

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.auth-overlay.active { opacity: 1; }

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    width: 380px;
    max-width: 90%;
    position: relative;
}

.auth-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 0.7rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.95rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.auth-tab.active { color: var(--text); border-bottom-color: var(--blue); }

.auth-form { display: flex; flex-direction: column; gap: 0.75rem; }
.auth-form.hidden { display: none; }

.auth-form input {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.auth-form input:focus { border-color: var(--blue); }
.auth-form input::placeholder { color: var(--text-dim); }

.auth-submit {
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--red), var(--blue));
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    margin-top: 0.5rem;
}

.auth-error { color: var(--red); font-size: 0.8rem; min-height: 1.2rem; }

/* ─── LANDING PAGE ─── */

.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 50px);
    padding: 2rem 1rem;
}

.hero { text-align: center; }

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-top: 3rem;
    letter-spacing: -2px;
}

.logo .clash { color: var(--red); }
.logo .room { color: var(--blue); }

.tagline {
    color: var(--text-dim);
    font-size: 1.2rem;
    margin-top: 0.5rem;
    font-weight: 400;
}

.mode-select {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.mode-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    width: 220px;
}

.mode-card:hover {
    border-color: var(--red);
    box-shadow: 0 0 30px var(--red-glow);
    transform: translateY(-2px);
}

.mode-card.selected {
    border-color: var(--red);
    box-shadow: 0 0 30px var(--red-glow);
}

.mode-card .icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.mode-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.mode-card p {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.topic-section {
    margin-top: 2.5rem;
    width: 100%;
    max-width: 600px;
}

.topic-section h2 {
    font-size: 1rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    text-align: center;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.topic-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    text-align: center;
    color: var(--text);
}

.topic-chip:hover {
    border-color: var(--blue);
    box-shadow: 0 0 20px var(--blue-glow);
}

.topic-chip.selected {
    border-color: var(--blue);
    background: rgba(59, 139, 255, 0.1);
    box-shadow: 0 0 20px var(--blue-glow);
}

.custom-topic {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem 1.2rem;
    color: var(--text);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 1rem;
}

.custom-topic:focus {
    border-color: var(--blue);
}

.custom-topic::placeholder {
    color: var(--text-dim);
}

.side-select {
    margin-top: 2rem;
    text-align: center;
    display: none;
}

.side-select.visible { display: block; }

.side-select h2 {
    font-size: 1rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.side-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.side-btn {
    padding: 0.8rem 2rem;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.side-btn.for-btn:hover, .side-btn.for-btn.selected {
    border-color: var(--blue);
    box-shadow: 0 0 20px var(--blue-glow);
    background: rgba(59, 139, 255, 0.1);
}

.side-btn.against-btn:hover, .side-btn.against-btn.selected {
    border-color: var(--red);
    box-shadow: 0 0 20px var(--red-glow);
    background: rgba(255, 59, 92, 0.1);
}

.start-btn {
    margin-top: 2.5rem;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    background: linear-gradient(135deg, var(--red), var(--blue));
    color: white;
    letter-spacing: 1px;
    transition: all 0.3s;
    text-transform: uppercase;
    display: none;
}

.start-btn.visible { display: inline-block; }

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px var(--red-glow), 0 0 40px var(--blue-glow);
}

/* ─── SETTINGS ROW ─── */

.settings-row {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}

.setting-group { text-align: center; }
.setting-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.vis-buttons { display: flex; gap: 0.5rem; }

.vis-btn {
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.vis-btn.selected { border-color: var(--gold); color: var(--gold); background: rgba(255,215,0,0.08); }

.round-select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
}

/* ─── LIVE PREVIEW (landing) ─── */

.live-preview {
    margin-top: 4rem;
    width: 100%;
    max-width: 700px;
}

.live-preview h2 {
    font-size: 1rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    text-align: center;
}

.live-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.live-card, .live-card-lg {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.live-card:hover, .live-card-lg:hover {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255,215,0,0.1);
}

.live-topic, .live-card-topic {
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.live-meta, .live-card-info {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.live-badge, .live-card-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.live-badge.live, .live-card-status.live { background: var(--red); color: white; }
.live-badge.waiting, .live-card-status.waiting { background: var(--gold); color: #000; }

.see-all {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: var(--blue);
    text-decoration: none;
    font-size: 0.85rem;
}

.no-debates { text-align: center; color: var(--text-dim); padding: 1rem; }

/* ─── LIVE PAGE ─── */

.page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-header { text-align: center; margin-bottom: 2rem; }
.page-header h1 { font-family: 'Space Grotesk', sans-serif; font-size: 2rem; margin-bottom: 0.5rem; }
.page-header p { color: var(--text-dim); }

.live-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.live-card-lg { padding: 1.5rem; }

.live-card-status {
    display: inline-block;
    margin-bottom: 0.5rem;
}

.live-card-topic {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.live-card-players {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.live-card-players .player.red { color: var(--red); font-weight: 600; }
.live-card-players .player.blue { color: var(--blue); font-weight: 600; }
.live-card-players .vs { color: var(--text-dim); font-size: 0.8rem; }

.live-card-info { font-size: 0.8rem; color: var(--text-dim); display: flex; gap: 1.5rem; }

.empty-state { text-align: center; padding: 3rem; color: var(--text-dim); }
.loading { text-align: center; padding: 2rem; color: var(--text-dim); }

/* ─── PROFILE ─── */

.profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.profile-username {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.profile-email { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 1.5rem; }

.profile-stats { display: flex; justify-content: center; gap: 2rem; }

.stat { text-align: center; }
.stat-num { display: block; font-size: 1.8rem; font-weight: 700; }
.stat-num.wins { color: #4caf50; }
.stat-num.losses { color: var(--red); }
.stat-num.draws { color: var(--text-dim); }
.stat-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

.debates-section h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.debate-list { display: flex; flex-direction: column; gap: 0.5rem; }

.debate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.2rem;
}

.debate-item-topic {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.debate-item-topic:hover { color: var(--blue); }

.debate-item-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.result-badge {
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: 700;
    font-size: 0.7rem;
}

.result-badge.win { background: rgba(76,175,80,0.2); color: #4caf50; }
.result-badge.loss { background: rgba(255,59,92,0.2); color: var(--red); }
.result-badge.draw { background: rgba(136,136,160,0.2); color: var(--text-dim); }

.debate-item-actions { display: flex; gap: 0.5rem; }

.action-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}

.action-btn:hover { border-color: var(--blue); }
.action-btn.danger:hover { border-color: var(--red); color: var(--red); }

/* ─── CO-PILOT ─── */

.copilot-area {
    padding: 0.5rem 1rem;
    border-top: 1px dashed var(--border);
}

.copilot-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    color: var(--gold);
    font-size: 0.75rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.copilot-btn:hover { border-color: var(--gold); }

.copilot-suggestion {
    font-size: 0.8rem;
    color: var(--gold);
    padding: 0.5rem 0;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s;
}

.copilot-suggestion.visible { opacity: 1; }

/* ─── ARENA META ─── */

.arena-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.arena-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: var(--surface2);
    color: var(--text-dim);
    text-transform: uppercase;
}

.arena-status.live {
    background: var(--red);
    color: white;
    animation: pulse 2s infinite;
}

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

.arena-logo { text-decoration: none; }

.msg-username {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.spec-count {
    background: var(--surface2);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.3rem;
}

/* ─── ADMIN ─── */

.admin-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.2rem 1.5rem;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.stat-val { display: block; font-size: 2rem; font-weight: 700; color: var(--gold); }
.stat-lbl { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.admin-tab {
    padding: 0.7rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    border-bottom: 2px solid transparent;
}

.admin-tab.active { color: var(--text); border-bottom-color: var(--gold); }

.admin-panel.hidden { display: none; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    color: var(--text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid rgba(42,42,58,0.5);
    vertical-align: middle;
}

.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

.role-select {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    color: var(--text);
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.role-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.role-badge.superadmin { background: rgba(255,215,0,0.15); color: var(--gold); }
.role-badge.admin { background: rgba(59,139,255,0.15); color: var(--blue); }
.role-badge.user { background: var(--surface2); color: var(--text-dim); }

.ban-badge { color: var(--red); font-weight: 700; font-size: 0.75rem; }
.ok-badge { color: #4caf50; font-size: 0.75rem; }
.text-dim { color: var(--text-dim); font-size: 0.8rem; }

.status-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.live { background: var(--red); color: white; }
.status-badge.waiting { background: var(--gold); color: #000; }
.status-badge.finished { background: var(--surface2); color: var(--text-dim); }

.debate-link { color: var(--text); text-decoration: none; }
.debate-link:hover { color: var(--blue); }

.action-btn.small {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}

a.verdict-btn { text-decoration: none; }

/* ─── GUEST RESTRICTIONS ─── */

.mode-card.locked {
    opacity: 0.4;
    position: relative;
}

.mode-card.locked::after {
    content: 'Sign Up';
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mode-card.locked:hover {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255,215,0,0.15);
}

.guest-upsell {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255,215,0,0.05);
    border: 1px solid rgba(255,215,0,0.2);
    border-radius: 10px;
    text-align: center;
}

.guest-upsell p {
    color: var(--gold);
    font-size: 0.9rem;
}

/* ─── PERSONA CARDS ─── */

.p-panel.hidden { display: none; }

.persona-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.persona-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.persona-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255,215,0,0.1);
}

.persona-card-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.persona-card-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.persona-card-bars {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.mini-bar { flex: 1; }
.mini-label { font-size: 0.6rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.mini-track { height: 4px; background: var(--surface2); border-radius: 2px; margin-top: 2px; }
.mini-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }

.persona-card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.persona-card-actions {
    display: flex;
    gap: 0.4rem;
}

/* ─── PERSONA FORM ─── */

.persona-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.form-group {
    flex: 1;
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    color: var(--text);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--blue);
}

.form-group textarea { resize: vertical; }

.form-group input[type="range"] {
    width: 100%;
    accent-color: var(--gold);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    cursor: pointer;
}

@media (max-width: 600px) {
    .form-row { flex-direction: column; gap: 0; }
    .persona-grid { grid-template-columns: 1fr; }
}

/* ─── PERSONA PICKER (landing page) ─── */

.persona-pick {
    margin-top: 2rem;
    width: 100%;
    max-width: 700px;
}

.persona-pick h2 {
    font-size: 1rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    text-align: center;
}

.persona-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
}

.persona-option {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.persona-option:hover {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(255,215,0,0.1);
}

.persona-option.selected {
    border-color: var(--gold);
    background: rgba(255,215,0,0.08);
    box-shadow: 0 0 15px rgba(255,215,0,0.15);
}

.persona-option-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--gold);
    margin-bottom: 0.2rem;
}

.persona-option-desc {
    font-size: 0.7rem;
    color: var(--text-dim);
    line-height: 1.3;
}

/* ─── ARENA ─── */

.arena {
    display: none;
    flex-direction: column;
    height: 100vh;
}

.arena.active {
    display: flex;
}

.arena-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.arena-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    cursor: pointer;
}

.arena-logo .clash { color: var(--red); }
.arena-logo .room { color: var(--blue); }

.arena-topic {
    font-size: 0.95rem;
    color: var(--text-dim);
    text-align: center;
    flex: 1;
    padding: 0 1rem;
}

.arena-topic strong {
    color: var(--text);
}

.round-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.round-num {
    background: var(--surface2);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
    color: var(--gold);
}

.arena-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.corner {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.corner.red-corner {
    border-right: 1px solid var(--border);
}

.corner-header {
    padding: 0.6rem 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    flex-shrink: 0;
}

.red-corner .corner-header {
    background: rgba(255, 59, 92, 0.08);
    color: var(--red);
    border-bottom: 2px solid var(--red);
}

.blue-corner .corner-header {
    background: rgba(59, 139, 255, 0.08);
    color: var(--blue);
    border-bottom: 2px solid var(--blue);
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 95%;
    animation: msgIn 0.3s ease;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.red-corner .message {
    background: rgba(255, 59, 92, 0.08);
    border: 1px solid rgba(255, 59, 92, 0.15);
    align-self: flex-start;
}

.blue-corner .message {
    background: rgba(59, 139, 255, 0.08);
    border: 1px solid rgba(59, 139, 255, 0.15);
    align-self: flex-start;
}

.message.system-msg {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-style: italic;
    text-align: center;
    align-self: center;
    font-size: 0.8rem;
}

.typing-indicator {
    display: none;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    font-style: italic;
}

.typing-indicator.visible {
    display: block;
}

.input-area {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    background: var(--surface);
    flex-shrink: 0;
}

.input-area.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.msg-input {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    resize: none;
    min-height: 42px;
    max-height: 120px;
}

.msg-input:focus {
    border-color: var(--blue);
}

.send-btn {
    background: linear-gradient(135deg, var(--red), var(--blue));
    border: none;
    border-radius: 8px;
    padding: 0 1.2rem;
    color: white;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: transform 0.15s;
}

.send-btn:hover { transform: scale(1.05); }

/* ─── VERDICT / SCORING ─── */

.verdict-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.verdict-overlay.active {
    display: flex;
}

.verdict-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem 3rem;
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: verdictIn 0.4s ease;
}

@keyframes verdictIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.verdict-card h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.verdict-card .winner-text {
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
}

.verdict-card .reasoning {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: left;
}

.verdict-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.verdict-btn {
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.verdict-btn:hover {
    border-color: var(--blue);
}

.verdict-btn.primary {
    background: linear-gradient(135deg, var(--red), var(--blue));
    border: none;
    color: white;
    font-weight: 600;
}

/* ─── SPECTATOR ─── */

.spectator-panel {
    display: none;
    width: 280px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    flex-direction: column;
    flex-shrink: 0;
}

.spectator-panel.active {
    display: flex;
}

.spectator-header {
    padding: 0.6rem 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    color: var(--gold);
}

.spectator-votes {
    display: flex;
    padding: 0.75rem;
    gap: 0.5rem;
}

.vote-btn {
    flex: 1;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    text-align: center;
}

.vote-btn.vote-red:hover { border-color: var(--red); background: rgba(255,59,92,0.1); }
.vote-btn.vote-blue:hover { border-color: var(--blue); background: rgba(59,139,255,0.1); }

.vote-bar {
    display: flex;
    height: 6px;
    margin: 0 0.75rem 0.75rem;
    border-radius: 3px;
    overflow: hidden;
    background: var(--surface2);
}

.vote-bar .red-fill {
    background: var(--red);
    transition: width 0.3s;
}

.vote-bar .blue-fill {
    background: var(--blue);
    transition: width 0.3s;
}

.spectator-chat {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.spec-msg {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    background: var(--surface2);
    border-radius: 6px;
    color: var(--text-dim);
}

.spec-msg .spec-name {
    color: var(--gold);
    font-weight: 600;
}

.spec-input-area {
    padding: 0.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.4rem;
}

.spec-input {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    color: var(--text);
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.spec-send {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.8rem;
    color: var(--text);
    cursor: pointer;
    font-size: 0.8rem;
}

/* ─── SCROLLBAR ─── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── RESPONSIVE ─── */

@media (max-width: 768px) {
    .logo { font-size: 2.5rem; }
    .mode-select { flex-direction: column; align-items: center; }
    .topic-grid { grid-template-columns: repeat(2, 1fr); }

    .arena-body { flex-direction: column; }
    .corner.red-corner { border-right: none; border-bottom: 1px solid var(--border); }
    .corner { min-height: 0; }
    .spectator-panel { width: 100%; max-height: 200px; border-left: none; border-top: 1px solid var(--border); }

    .arena-topic { display: none; }
    .verdict-card { padding: 1.5rem; }
}

/* ── SHARE MODAL ── */
.share-overlay{position:fixed;inset:0;background:rgba(0,0,0,.7);z-index:9999;display:none;align-items:center;justify-content:center;}
.share-overlay.active{display:flex;}
.share-modal{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:2rem;max-width:400px;width:90%;text-align:center;position:relative;animation:pop .2s ease-out;}
@keyframes pop{from{transform:scale(.9);opacity:0;}to{transform:scale(1);opacity:1;}}
.share-close{position:absolute;top:10px;right:14px;background:none;border:none;color:var(--text-dim);font-size:24px;cursor:pointer;}
.share-close:hover{color:var(--text);}
.share-modal h3{font-family:'Space Grotesk',sans-serif;font-size:1.4rem;color:var(--gold);margin-bottom:0.5rem;}
.share-desc{font-size:0.85rem;color:var(--text-dim);margin-bottom:1rem;line-height:1.5;}
.share-url-row{display:flex;gap:0.5rem;margin-bottom:1.2rem;}
.share-url{flex:1;background:var(--bg);border:1px solid var(--border);color:var(--text);font-family:'Inter',sans-serif;font-size:0.85rem;padding:0.6rem 0.8rem;border-radius:8px;outline:none;}
.share-copy{background:var(--gold);color:#000;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:0.85rem;padding:0.6rem 1.2rem;border:none;border-radius:8px;cursor:pointer;white-space:nowrap;}
.share-copy:hover{background:#e6c200;}
.share-copy.copied{background:#4caf50;color:#fff;}
#shareQR{display:block;margin:0 auto 1rem;border-radius:8px;background:#fff;padding:8px;}
.share-actions{display:flex;gap:0.5rem;justify-content:center;margin-bottom:1rem;}
.share-link-btn{display:inline-block;padding:0.5rem 1rem;border-radius:8px;font-size:0.8rem;font-weight:600;text-decoration:none;border:1px solid var(--border);color:var(--text);transition:all .15s;}
.share-link-btn:hover{border-color:var(--gold);color:var(--gold);}
.share-hint{font-size:0.75rem;color:var(--text-dim);margin-top:0.5rem;}
.tts-toggle{background:none;border:1px solid var(--text-dim);color:var(--text-dim);font-family:'Inter',sans-serif;font-size:0.75rem;font-weight:600;padding:0.3rem 0.8rem;border-radius:6px;cursor:pointer;transition:all .15s;}
.tts-toggle:hover{background:rgba(255,255,255,.05);}
.tts-toggle.active{border-color:var(--gold);color:var(--gold);background:rgba(255,215,0,.08);}
.share-btn{background:none;border:1px solid var(--gold);color:var(--gold);font-family:'Inter',sans-serif;font-size:0.75rem;font-weight:600;padding:0.3rem 0.8rem;border-radius:6px;cursor:pointer;transition:all .15s;}
.share-btn:hover{background:rgba(255,215,0,.1);}
