:root {
    --primary: #0061ff;
    --primary-dark: #004ecc;
    --primary-darker: #003db3;
    --primary-deep: #002d85;
    --primary-light: #3380ff;
    --primary-lighter: #66a0ff;
    --primary-pale: #99bfff;
    --primary-frost: #cce0ff;
    --primary-glow: rgba(0, 97, 255, 0.35);

    --accent-teal: #0d9488;
    --accent-cyan: #0891b2;
    --accent-indigo: #6366f1;
    --accent-violet: #7c3aed;
    --accent-amber: #f59e0b;

    --surface: rgba(255, 255, 255, 0.1);
    --surface-strong: rgba(255, 255, 255, 0.16);
    --surface-hover: rgba(255, 255, 255, 0.22);
    --border: rgba(255, 255, 255, 0.22);
    --border-soft: rgba(255, 255, 255, 0.12);

    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.78);
    --text-faint: rgba(255, 255, 255, 0.55);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --shadow-sm: 0 4px 16px rgba(0, 45, 133, 0.2);
    --shadow-md: 0 12px 40px rgba(0, 45, 133, 0.28);
    --shadow-lg: 0 20px 60px rgba(0, 29, 85, 0.35);

    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: 0.2s ease;
}

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

body {
    font-family: var(--font);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 60% at 10% 0%, rgba(102, 160, 255, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 90% 100%, rgba(0, 61, 179, 0.4) 0%, transparent 55%),
        linear-gradient(155deg, var(--primary-deep) 0%, var(--primary-darker) 25%, var(--primary) 55%, var(--primary-light) 100%);
    background-attachment: fixed;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

.page {
    position: relative;
    z-index: 1;
    max-width: 1040px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.page--narrow {
    max-width: 560px;
    text-align: center;
}

/* Header */

.header {
    text-align: center;
    margin-bottom: 32px;
}

.header__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--border-soft);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-frost);
    margin-bottom: 12px;
}

.header__title {
    margin: 0 0 8px;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.header__subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Cards */

.card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(0, 97, 255, 0.35);
    font-size: 16px;
    flex-shrink: 0;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn--primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-lighter) 0%, var(--primary-light) 100%);
    box-shadow: 0 6px 28px var(--primary-glow);
}

.btn--secondary {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid var(--border);
}

.btn--secondary:hover:not(:disabled) {
    background: var(--surface-hover);
}

.btn--accent {
    background: linear-gradient(135deg, var(--primary-pale) 0%, var(--primary-lighter) 100%);
    color: var(--primary-deep);
    box-shadow: 0 4px 20px rgba(153, 191, 255, 0.3);
}

.btn--accent:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-frost) 0%, var(--primary-pale) 100%);
}

.btn--cta {
    background: linear-gradient(135deg, var(--accent-amber) 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
    font-weight: 700;
}

.btn--cta:hover:not(:disabled) {
    background: linear-gradient(135deg, #fbbf24 0%, var(--accent-amber) 100%);
    box-shadow: 0 6px 28px rgba(245, 158, 11, 0.45);
}

.btn--block {
    display: flex;
    width: 100%;
}

.btn--lg {
    padding: 16px 28px;
    font-size: 16px;
    border-radius: var(--radius-md);
}

/* Form elements */

.input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(0, 45, 133, 0.35);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input::placeholder {
    color: var(--text-faint);
}

.input:focus {
    border-color: var(--primary-lighter);
    box-shadow: 0 0 0 3px rgba(102, 160, 255, 0.25);
}

.file-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 28px 20px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: rgba(0, 45, 133, 0.2);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.file-upload:hover {
    border-color: var(--primary-lighter);
    background: rgba(0, 61, 255, 0.15);
}

.file-upload__icon {
    font-size: 32px;
    opacity: 0.8;
}

.file-upload__text {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.file-upload__text strong {
    color: var(--primary-frost);
}

.file-upload input[type="file"] {
    display: none;
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.form-row .input {
    flex: 1;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

/* Session badge */

.session-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(0, 97, 255, 0.3) 0%, rgba(51, 128, 255, 0.15) 100%);
    border: 1px solid var(--border);
}

.session-badge__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.session-badge__id {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--primary-frost);
    font-variant-numeric: tabular-nums;
}

.session-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.session-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.session-meta__item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-soft);
}

.session-meta__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.session-meta__value {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Status pill */

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    background: rgba(0, 97, 255, 0.25);
    border: 1px solid var(--border-soft);
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-frost);
    margin-bottom: 20px;
}

.status-pill::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-lighter);
    box-shadow: 0 0 8px var(--primary-lighter);
    animation: pulse 2s ease infinite;
}

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

/* Players */

.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    font-size: 14px;
    font-weight: 700;
}

.players {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 8px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-soft);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition);
}

.player-chip:hover {
    background: var(--surface-hover);
}

.player-chip__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.players--empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    border-radius: var(--radius-sm);
    background: rgba(0, 45, 133, 0.2);
    border: 1px dashed var(--border-soft);
}

/* Stats */

.stats-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(0, 97, 255, 0.35) 0%, rgba(51, 128, 255, 0.2) 100%);
    border: 1px solid var(--border);
}

.stats-summary__value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-frost);
    line-height: 1;
}

.stats-summary__label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stats-block {
    padding: 18px;
    margin-bottom: 14px;
    border-radius: var(--radius-md);
    background: rgba(0, 45, 133, 0.25);
    border: 1px solid var(--border-soft);
}

.stats-block__title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.stats-block__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    margin-bottom: 12px;
    border-radius: var(--radius-pill);
    background: rgba(102, 160, 255, 0.25);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-frost);
}

.answer-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
    transition: background var(--transition);
}

.answer-row__text {
    flex: 1;
    font-size: 14px;
    min-width: 0;
}

.answer-row__meta {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.answer-row__bar-wrap {
    width: 80px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}

.answer-row__bar {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    transition: width 0.4s ease;
}

.answer-row--correct {
    background: linear-gradient(135deg, rgba(0, 97, 255, 0.4) 0%, rgba(51, 128, 255, 0.25) 100%);
    border-color: var(--primary-lighter);
}

.answer-row--correct .answer-row__text {
    font-weight: 700;
    color: var(--primary-frost);
}

.answer-row--correct .answer-row__bar {
    background: linear-gradient(90deg, var(--primary-frost) 0%, var(--primary-pale) 100%);
}

.empty-state {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Player page — answers grid */

.answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.answer-btn {
    padding: 22px 16px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    color: #ffffff;
    background: linear-gradient(145deg, var(--primary-light) 0%, var(--primary) 100%);
    box-shadow: 0 4px 16px rgba(0, 97, 255, 0.35);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
    line-height: 1.3;
    min-height: 80px;
}

.answer-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.08);
    box-shadow: 0 6px 24px rgba(0, 97, 255, 0.45);
}

/* Quiz question */

.question-text {
    font-size: clamp(1.15rem, 3.5vw, 1.5rem);
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 4px;
    color: var(--text);
}

.question-code {
    display: block;
    margin: 12px 0 4px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
    font-size: 0.82em;
    font-weight: 400;
    line-height: 1.55;
    text-align: left;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.question-code code {
    display: block;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
}

.quiz-status {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
}

.quiz-status--waiting {
    background: rgba(0, 97, 255, 0.2);
    color: var(--primary-frost);
    font-style: italic;
}

.quiz-status--sent {
    background: linear-gradient(135deg, rgba(0, 97, 255, 0.3) 0%, rgba(51, 128, 255, 0.2) 100%);
    border: 1px solid var(--border);
}

.quiz-status--sent .quiz-status__answer {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-frost);
    margin-bottom: 8px;
}

.quiz-status--finished {
    background: linear-gradient(135deg, rgba(102, 160, 255, 0.3) 0%, rgba(0, 97, 255, 0.2) 100%);
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-frost);
}

/* Utilities */

.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.hidden { display: none !important; }

/* ── Host page: light layout, blue as accent ── */

body.host-page {
    color: #1e293b;
    background:
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(0, 97, 255, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50% 30% at 0% 100%, rgba(99, 102, 241, 0.06) 0%, transparent 55%),
        #f1f5f9;
}

body.host-page::before {
    display: none;
}

body.host-page .header__badge {
    background: rgba(0, 97, 255, 0.1);
    border-color: rgba(0, 97, 255, 0.2);
    color: var(--primary);
}

body.host-page .header__title {
    color: #0f172a;
}

body.host-page .header__subtitle {
    color: #64748b;
}

body.host-page .card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    backdrop-filter: none;
}

body.host-page .card:hover {
    border-color: #cbd5e1;
}

body.host-page .card__title {
    color: #0f172a;
}

body.host-page .card__icon {
    background: rgba(0, 97, 255, 0.1);
}

body.host-page .file-upload {
    background: #f8fafc;
    border-color: #cbd5e1;
}

body.host-page .file-upload:hover {
    border-color: var(--primary);
    background: rgba(0, 97, 255, 0.04);
}

body.host-page .file-upload__text {
    color: #64748b;
}

body.host-page .file-upload__text strong {
    color: var(--primary);
}

body.host-page .btn--primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
}

body.host-page .btn--secondary {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #334155;
}

body.host-page .btn--secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

body.host-page .session-badge {
    background: linear-gradient(135deg, rgba(0, 97, 255, 0.08) 0%, rgba(99, 102, 241, 0.06) 100%);
    border-color: rgba(0, 97, 255, 0.2);
}

body.host-page .session-meta__item {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.host-page .session-meta__label {
    color: #64748b;
}

body.host-page .session-meta__value {
    color: var(--primary);
}

body.host-page .session-badge__label {
    color: #64748b;
}

body.host-page .session-badge__id {
    color: var(--primary);
}

body.host-page .badge-count {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-indigo) 100%);
    color: #ffffff;
}

body.host-page .player-chip {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #334155;
}

body.host-page .player-chip:hover {
    background: #f1f5f9;
}

body.host-page .player-chip__avatar {
    color: #ffffff;
}

body.host-page .player-chip__avatar--0 { background: linear-gradient(135deg, var(--primary-light), var(--primary)); }
body.host-page .player-chip__avatar--1 { background: linear-gradient(135deg, #22d3ee, var(--accent-cyan)); }
body.host-page .player-chip__avatar--2 { background: linear-gradient(135deg, #818cf8, var(--accent-indigo)); }
body.host-page .player-chip__avatar--3 { background: linear-gradient(135deg, #2dd4bf, var(--accent-teal)); }

body.host-page .players--empty {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
}

body.host-page .stats-summary {
    background: linear-gradient(135deg, rgba(0, 97, 255, 0.08) 0%, rgba(13, 148, 136, 0.06) 100%);
    border-color: #e2e8f0;
}

body.host-page .stats-summary__value {
    color: var(--primary);
}

body.host-page .stats-summary__label {
    color: #64748b;
}

body.host-page .stats-block {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.host-page .stats-block__title {
    color: #0f172a;
    text-align: left;
}

body.host-page .stats-block__title .question-code {
    margin-top: 10px;
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.host-page .stats-block__status {
    background: rgba(0, 97, 255, 0.1);
    color: var(--primary);
}

body.host-page .answer-row {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.host-page .answer-row__text {
    color: #334155;
}

body.host-page .answer-row__meta {
    color: #64748b;
}

body.host-page .answer-row__bar-wrap {
    background: #e2e8f0;
}

body.host-page .answer-row--correct {
    background: rgba(0, 97, 255, 0.08);
    border-color: rgba(0, 97, 255, 0.3);
}

body.host-page .answer-row--correct .answer-row__text {
    color: var(--primary-dark);
    font-weight: 700;
}

body.host-page .empty-state {
    color: #94a3b8;
}

/* ── Player page: blue bg, white quiz card ── */

body.player-page .page.page--narrow {
    max-width: 760px;
}

body.player-page .card#quiz,
body.player-page #quiz.card {
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-lg);
    color: #0f172a;
    max-width: 760px;
    width: 100%;
    padding: 36px 40px;
}

body.player-page .question-text {
    color: #0f172a;
    font-size: clamp(1.2rem, 4vw, 1.55rem);
    padding: 4px 0 8px;
    text-align: left;
}

body.player-page .question-code {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.player-page #joinBox.card {
    background: rgba(255, 255, 255, 0.14);
}

body.player-page .input {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    border-color: rgba(255, 255, 255, 0.4);
}

body.player-page .input::placeholder {
    color: #94a3b8;
}

body.player-page .question-text:empty {
    display: none;
}

body.player-page .answers:empty {
    margin-top: 0;
}

body.player-page .quiz-status--waiting {
    background: #f1f5f9;
    color: #64748b;
    margin-top: 0;
}

body.player-page .quiz-status--waiting:empty {
    display: none;
}

body.player-page .quiz-status--sent {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

body.player-page .quiz-status--sent .quiz-status__answer {
    color: #0f172a;
}

body.player-page .quiz-status--finished {
    background: linear-gradient(135deg, rgba(0, 97, 255, 0.1) 0%, rgba(99, 102, 241, 0.08) 100%);
    color: var(--primary);
}

body.player-page .answer-btn--result {
    cursor: default;
    pointer-events: none;
    opacity: 0.55;
}

body.player-page .answer-btn--result:hover {
    transform: none;
    filter: none;
    box-shadow: 0 4px 16px rgba(0, 97, 255, 0.35);
}

body.player-page .answer-btn--correct {
    opacity: 1;
    background: linear-gradient(145deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
    outline: 3px solid #86efac;
    outline-offset: 2px;
}

body.player-page .answer-btn--player-wrong {
    opacity: 1;
    background: linear-gradient(145deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
    outline: 3px solid #fca5a5;
    outline-offset: 2px;
}

body.player-page .answer-btn--player-correct {
    opacity: 1;
}

body.player-page .answer-btn--player-selected {
    opacity: 1;
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* ── Wheel page ── */

body.wheel-page {
    color: #1e293b;
    background:
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(0, 97, 255, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50% 30% at 0% 100%, rgba(99, 102, 241, 0.06) 0%, transparent 55%),
        #f1f5f9;
}

body.wheel-page::before {
    display: none;
}

body.wheel-page .header__badge {
    background: rgba(0, 97, 255, 0.1);
    border-color: rgba(0, 97, 255, 0.2);
    color: var(--primary);
}

body.wheel-page .header__title {
    color: #0f172a;
}

body.wheel-page .header__subtitle {
    color: #64748b;
}

body.wheel-page .card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    backdrop-filter: none;
}

body.wheel-page .card:hover {
    border-color: #cbd5e1;
}

body.wheel-page .card__title {
    color: #0f172a;
}

body.wheel-page .card__icon {
    background: rgba(0, 97, 255, 0.1);
}

body.wheel-page .input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

body.wheel-page .input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 97, 255, 0.15);
}

body.wheel-page .btn--secondary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

body.wheel-page .btn--secondary:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.page--wide {
    max-width: 1120px;
}

.wheel-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.wheel-panel {
    margin-bottom: 0;
}

.wheel-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.wheel-textarea {
    min-height: 280px;
    resize: vertical;
    line-height: 1.5;
}

.wheel-entry-count {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.wheel-panel__actions {
    margin-top: 16px;
}

.wheel-hint {
    margin: 14px 0 0;
    font-size: 13px;
    color: #94a3b8;
}

.wheel-stage-card {
    margin-bottom: 0;
}

.wheel-stage {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 12px 12px 24px;
}

.wheel-pointer {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 3;
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 24px solid #0f172a;
    transform: translateX(-50%);
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.25));
}

.wheel-outer {
    position: relative;
    width: min(100%, 420px);
    aspect-ratio: 1;
}

.wheel-rotator {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow:
        0 0 0 6px #ffffff,
        0 0 0 10px #e2e8f0,
        var(--shadow-md);
    will-change: transform;
}

.wheel-svg {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    width: 22%;
    aspect-ratio: 1;
    padding: 0;
    border: 4px solid #ffffff;
    border-radius: 50%;
    background: #000000;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.wheel-center:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.04);
    box-shadow: 0 10px 28px rgba(0, 97, 255, 0.25);
}

.wheel-center:active:not(:disabled) {
    transform: translate(-50%, -50%) scale(0.98);
}

.wheel-center:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.wheel-center__icon {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 50%;
    pointer-events: none;
}

.wheel-result {
    margin-top: 8px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(0, 97, 255, 0.08) 0%, rgba(99, 102, 241, 0.06) 100%);
    border: 1px solid rgba(0, 97, 255, 0.18);
    text-align: center;
}

.wheel-result__label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.wheel-result__value {
    display: block;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 800;
    color: var(--primary);
    word-break: break-word;
}

.wheel-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wheel-modal.hidden {
    display: none;
}

.wheel-celebration {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.wheel-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.wheel-modal__dialog {
    position: relative;
    z-index: 2;
    width: min(100%, 420px);
    padding: 32px 28px 24px;
    border-radius: var(--radius-lg);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: wheel-modal-in 0.35s cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes wheel-modal-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.wheel-modal__emoji {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 8px;
}

.wheel-modal__label {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.wheel-modal__winner {
    margin: 0 0 24px;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--primary);
    word-break: break-word;
}

body.wheel-modal-open {
    overflow: hidden;
}

body.wheel-page .btn--primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    box-shadow: 0 4px 20px var(--primary-glow);
}

body.wheel-page .btn--primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-lighter) 0%, var(--primary-light) 100%);
}

@media (max-width: 600px) {
    .page {
        padding: 20px 16px 36px;
    }

    .form-row {
        flex-direction: column;
    }

    .answers {
        grid-template-columns: 1fr;
    }

    .answer-row__bar-wrap {
        display: none;
    }

    .card {
        padding: 18px;
    }

    body.player-page #quiz.card {
        padding: 24px 20px;
    }

    .wheel-layout {
        grid-template-columns: 1fr;
    }

    .wheel-textarea {
        min-height: 180px;
    }
}
