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

html,
body {
    min-height: 100%;
    overscroll-behavior: none;
    touch-action: manipulation;
}

:root {
    --bg-base: #1c2a1c;
    --bg-deep: #12190f;
    --glass-bg: rgba(38, 54, 31, 0.56);
    --glass-border: rgba(200, 162, 74, 0.14);
    --glass-highlight: rgba(200, 162, 74, 0.08);
    --text-primary: #e9dfc4;
    --text-secondary: rgba(233, 223, 196, 0.72);
    --text-muted: rgba(233, 223, 196, 0.52);
    --accent-cyan: #e6c877;
    --accent-blue: #7a4324;
    --accent-amber: #c8a24a;
    --accent-gold: #e6c877;
    --accent-green: #54d48a;
    --accent-red: #ff7d8f;
    --shadow-card: 0 28px 70px rgba(10, 13, 8, 0.42);
    --font-main: 'Outfit', system-ui, sans-serif;
}

body {
    font-family: var(--font-main);
    color: var(--text-primary);
    background:
        radial-gradient(circle at 14% 18%, rgba(230, 200, 119, 0.22), transparent 34%),
        radial-gradient(circle at 84% 12%, rgba(122, 67, 36, 0.26), transparent 30%),
        radial-gradient(circle at 50% 88%, rgba(200, 162, 74, 0.18), transparent 24%),
        linear-gradient(150deg, var(--bg-base) 0%, #20301c 50%, var(--bg-deep) 100%);
    overflow: hidden;
    position: relative;
}

#particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.ambient {
    position: fixed;
    width: 28rem;
    height: 28rem;
    border-radius: 999px;
    filter: blur(72px);
    opacity: 0.22;
    z-index: 0;
    pointer-events: none;
}

.ambient-one {
    top: -8rem;
    left: -7rem;
    background: linear-gradient(135deg, rgba(230, 200, 119, 0.9), rgba(122, 67, 36, 0.66));
}

.ambient-two {
    right: -8rem;
    bottom: -8rem;
    background: linear-gradient(135deg, rgba(200, 162, 74, 0.72), rgba(122, 67, 36, 0.56));
}

.screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.glass-card,
.glass-strip {
    background: linear-gradient(180deg, rgba(200, 162, 74, 0.11), rgba(200, 162, 74, 0.04));
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.glass-card {
    position: relative;
    z-index: 2;
    padding: 2rem;
    border-radius: 2rem;
}

.glass-card::before,
.glass-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--glass-highlight), transparent 40%);
    border-radius: inherit;
    pointer-events: none;
}

.glass-strip {
    position: relative;
    border-radius: 1.6rem;
    padding: 1rem 1.15rem;
}

.eyebrow {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.start-card {
    width: min(92vw, 560px);
    text-align: center;
}

.game-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    margin-bottom: 1rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(200, 162, 74, 0.2), rgba(230, 200, 119, 0.15));
    font-size: 2.4rem;
    box-shadow: inset 0 1px 0 rgba(200, 162, 74, 0.08);
}

h1,
.help-card h2,
.result-card h2 {
    letter-spacing: -0.04em;
}

h1 {
    font-size: clamp(2.2rem, 4.5vw, 3.3rem);
    line-height: 1;
    margin-bottom: 0.7rem;
}

.subtitle {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.theme-section {
    margin-bottom: 1rem;
    text-align: left;
}

.theme-section label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.theme-input,
.phone-hint {
    font: inherit;
}

.theme-input {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    background: rgba(200, 162, 74, 0.06);
    color: var(--text-primary);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.theme-input:focus {
    outline: none;
    border-color: rgba(230, 200, 119, 0.64);
    background: rgba(200, 162, 74, 0.09);
    transform: translateY(-1px);
}

.mode-buttons {
    display: grid;
    gap: 0.75rem;
}

.btn-primary,
.btn-secondary,
.btn-accent,
.btn-text,
.btn-walk-away,
.lifeline-btn,
.answer-btn {
    font: inherit;
}

.btn-primary,
.btn-secondary,
.btn-accent,
.btn-text,
.btn-walk-away,
.lifeline-btn {
    border-radius: 999px;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn-primary,
.btn-secondary,
.btn-accent,
.btn-text,
.btn-walk-away {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(230, 200, 119, 0.9), rgba(122, 67, 36, 0.9));
    color: #2b2416;
    font-weight: 800;
}

.btn-secondary,
.btn-text {
    background: rgba(200, 162, 74, 0.06);
    border-color: var(--glass-border);
    color: var(--text-primary);
}

.btn-accent {
    background: rgba(200, 162, 74, 0.18);
    border-color: rgba(200, 162, 74, 0.34);
    color: var(--text-primary);
}

.btn-text {
    margin-top: 0.8rem;
    color: var(--text-secondary);
}

.back-link {
    margin-top: 1rem;
}

.back-link a {
    color: var(--text-secondary);
    text-decoration: none;
}

.back-link a:hover {
    color: var(--text-primary);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-accent:hover,
.btn-text:hover,
.btn-walk-away:hover,
.lifeline-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(200, 162, 74, 0.22);
}

.help-card,
.loading-card,
.lifeline-card,
.result-card,
.confirm-card {
    text-align: center;
}

.help-card {
    width: min(92vw, 700px);
    text-align: left;
}

.loading-card,
.lifeline-card,
.result-card,
.confirm-card {
    width: min(92vw, 560px);
}

.help-card h2 {
    margin-bottom: 1rem;
}

.help-list {
    list-style: none;
    display: grid;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.help-list li {
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(200, 162, 74, 0.05);
    border: 1px solid rgba(200, 162, 74, 0.08);
    line-height: 1.55;
}

.loading-card {
    display: grid;
    gap: 1.2rem;
    place-items: center;
}

.spinner {
    width: 3.8rem;
    height: 3.8rem;
    border-radius: 50%;
    border: 4px solid rgba(200, 162, 74, 0.14);
    border-top-color: var(--accent-cyan);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#game-screen {
    align-items: stretch;
    justify-content: stretch;
    padding: 1rem;
    overflow: auto;
}

.game-shell {
    width: min(1440px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 1rem;
    min-height: calc(100vh - 2rem);
}

.prize-ladder {
    width: 100%;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.prize-list {
    display: grid;
    gap: 0.45rem;
    flex: 1;
}

.prize-item {
    padding: 0.75rem 0.95rem;
    border-radius: 1rem;
    background: rgba(200, 162, 74, 0.05);
    border: 1px solid rgba(200, 162, 74, 0.08);
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: right;
}

.prize-item.current {
    background: linear-gradient(135deg, rgba(200, 162, 74, 0.95), rgba(230, 200, 119, 0.92));
    border-color: rgba(200, 162, 74, 0.28);
    color: #1c2a1c;
    box-shadow: 0 12px 24px rgba(200, 162, 74, 0.24);
}

.prize-item.safe-haven {
    color: var(--accent-gold);
    border-color: rgba(230, 200, 119, 0.28);
}

.prize-item.safe-haven.current {
    color: #1c2a1c;
}

.prize-item.completed {
    color: rgba(84, 212, 138, 0.78);
}

.play-stage {
    display: grid;
    grid-template-rows: auto auto auto auto;
    gap: 1rem;
    align-content: start;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.lifelines {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.lifeline-btn {
    min-width: 3.5rem;
    min-height: 3.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(200, 162, 74, 0.12);
    background: rgba(200, 162, 74, 0.06);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.lifeline-btn:disabled,
.lifeline-btn.used {
    opacity: 0.34;
    cursor: not-allowed;
}

.lifeline-icon,
.lifeline-text {
    font-weight: 700;
}

.timer-section {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.timer-controls {
    display: flex;
    gap: 0.4rem;
}

.timer-control-btn {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 1px solid rgba(200, 162, 74, 0.16);
    background: rgba(200, 162, 74, 0.08);
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.timer-control-btn:hover {
    background: rgba(200, 162, 74, 0.18);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.timer-control-btn:active {
    transform: scale(0.95);
}

.timer-container {
    position: relative;
    width: 4.8rem;
    height: 4.8rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.timer-container.paused {
    opacity: 0.65;
    filter: grayscale(40%);
}

.timer-container.stopped {
    opacity: 0.8;
}

.timer-svg {
    position: absolute;
    inset: 0;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: rgba(200, 162, 74, 0.08);
    stroke-width: 4;
}

.timer-progress {
    fill: none;
    stroke: var(--accent-cyan);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 163.36;
    stroke-dashoffset: calc(163.36 * (1 - var(--timer-progress, 1)));
    transition: stroke 0.25s ease;
}

.timer-progress.warning {
    stroke: var(--accent-amber);
}

.timer-progress.danger {
    stroke: var(--accent-red);
}

.timer-progress.stopped {
    stroke: var(--text-muted) !important;
    stroke-dashoffset: 0 !important;
}

.timer-text {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.question-area {
    width: 100%;
}

.question-number {
    margin-bottom: 0.85rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.question-text {
    font-size: clamp(1.5rem, 3vw, 2.45rem);
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.answer-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 1rem 1.1rem;
    border-radius: 1.4rem;
    border: 1px solid rgba(200, 162, 74, 0.12);
    background: linear-gradient(180deg, rgba(200, 162, 74, 0.09), rgba(200, 162, 74, 0.04));
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.answer-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: rgba(230, 200, 119, 0.34);
}

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

.answer-btn.hidden {
    display: none;
}

.answer-btn.selected {
    background: linear-gradient(135deg, rgba(200, 162, 74, 0.24), rgba(200, 162, 74, 0.12));
    border-color: rgba(200, 162, 74, 0.44);
}

.answer-btn.correct {
    background: linear-gradient(135deg, rgba(84, 212, 138, 0.28), rgba(84, 212, 138, 0.14));
    border-color: rgba(84, 212, 138, 0.48);
}

.answer-btn.wrong {
    background: linear-gradient(135deg, rgba(255, 125, 143, 0.22), rgba(255, 125, 143, 0.1));
    border-color: rgba(255, 125, 143, 0.44);
}

.answer-letter {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(200, 162, 74, 0.12);
    color: var(--accent-gold);
    font-weight: 900;
    flex-shrink: 0;
}

.answer-text {
    font-size: 1rem;
    line-height: 1.4;
}

.btn-walk-away {
    justify-self: start;
    width: auto;
    padding-inline: 1.2rem;
    background: rgba(255, 125, 143, 0.12);
    border-color: rgba(255, 125, 143, 0.28);
    color: #ffd7de;
}

.lifeline-content {
    margin: 1rem 0 1.4rem;
    padding: 1rem;
    border-radius: 1.2rem;
    background: rgba(200, 162, 74, 0.05);
    border: 1px solid rgba(200, 162, 74, 0.08);
}

.lifeline-animation,
.result-icon {
    font-size: 3.5rem;
    margin-bottom: 0.8rem;
}

.audience-chart {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 0.8rem;
    min-height: 10rem;
}

.audience-bar {
    display: grid;
    gap: 0.45rem;
    justify-items: center;
}

.bar-fill {
    width: 3.4rem;
    border-radius: 0.9rem 0.9rem 0 0;
    background: linear-gradient(180deg, rgba(230, 200, 119, 0.92), rgba(122, 67, 36, 0.84));
    display: flex;
    align-items: end;
    justify-content: center;
    padding-bottom: 0.35rem;
    color: #2b2416;
    font-size: 0.82rem;
    font-weight: 800;
}

.bar-label {
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 700;
}

.phone-hint {
    color: var(--text-primary);
    font-size: 1.04rem;
    line-height: 1.55;
}

.result-message,
.result-details,
.confirm-card p {
    color: var(--text-secondary);
    line-height: 1.55;
}

.result-amount {
    margin: 0.85rem 0;
    font-size: clamp(2.6rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    color: var(--accent-gold);
}

.result-details {
    margin-bottom: 1.3rem;
}

.confirm-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.2rem;
}

@media (max-width: 1080px) {
    body {
        overflow: auto;
    }

    #game-screen {
        padding-bottom: 1.25rem;
    }

    .game-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .prize-ladder {
        order: 2;
    }

    .prize-list {
        grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
    }
}

@media (max-width: 720px) {
    .glass-card {
        padding: 1.35rem;
        border-radius: 1.5rem;
    }

    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .lifelines {
        justify-content: space-between;
    }

    .timer-container {
        align-self: center;
    }

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

    .btn-walk-away {
        width: 100%;
        justify-self: stretch;
    }
}
