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

body {
    font-family: 'Georgia', serif;
    background: radial-gradient(circle at 10% 10%, rgba(96, 198, 255, 0.16), transparent 15%),
                radial-gradient(circle at 85% 20%, rgba(208, 106, 255, 0.12), transparent 18%),
                linear-gradient(135deg, #020611 0%, #081329 45%, #081220 100%);
    color: #eef2f7;
    min-height: 100vh;
    padding: 30px;
    line-height: 1.8;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 20%, rgba(255,255,255,0.06), transparent 22%),
                radial-gradient(circle at 85% 85%, rgba(72, 166, 166, 0.1), transparent 15%);
    pointer-events: none;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    background: rgba(8, 14, 28, 0.92);
    border: 1px solid rgba(111, 193, 210, 0.18);
    border-radius: 28px;
    padding: 45px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 0 30px rgba(7, 28, 58, 0.4);
    backdrop-filter: blur(14px);
}

.story-header {
    text-align: center;
    margin-bottom: 42px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(111, 193, 210, 0.18);
    position: relative;
}

.story-header::after {
    content: 'Investigation • Choices • Consequences';
    display: block;
    margin-top: 16px;
    color: rgba(238, 242, 247, 0.65);
    letter-spacing: 0.1em;
    font-size: 0.95em;
}

.story-header h1 {
    font-size: clamp(2.5rem, 3.5vw, 4rem);
    color: #7dd1e5;
    text-shadow: 0 0 30px rgba(125, 209, 229, 0.25);
    margin-bottom: 12px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.subtitle {
    color: #c6d3e5;
    font-style: italic;
    font-size: 1.15rem;
    letter-spacing: 0.05em;
}

.story-content {
    min-height: 440px;
    margin-bottom: 36px;
}

.story-text {
    background: linear-gradient(180deg, rgba(7, 15, 32, 0.95) 0%, rgba(11, 20, 44, 0.96) 100%);
    padding: 34px 34px 38px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 30px;
    font-size: 1.08rem;
    line-height: 1.9;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-shadow: inset 0 0 60px rgba(46, 119, 137, 0.1);
    position: relative;
}

.story-text.animate-entry {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeInUp 0.55s ease-out forwards;
}

.story-text.typing::after {
    content: '|';
    position: absolute;
    right: 30px;
    bottom: 28px;
    color: rgba(238, 242, 247, 0.85);
    font-size: 1.1rem;
    animation: blinkCaret 1s steps(2, start) infinite;
}

@keyframes blinkCaret {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

.story-text::before {
    content: 'Scene';
    position: absolute;
    top: 18px;
    left: 32px;
    color: rgba(125, 209, 229, 0.75);
    font-size: 0.9rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 18px;
}

.choice-btn {
    background: linear-gradient(145deg, rgba(16, 35, 62, 0.96), rgba(10, 24, 44, 0.96));
    border: 1px solid rgba(125, 209, 229, 0.18);
    color: #dce8f4;
    padding: 20px 24px;
    border-radius: 22px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Georgia', serif;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
    min-height: 88px;
    display: flex;
    align-items: center;
    line-height: 1.6;
}

.choice-btn.animate-entry {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.60s ease-out forwards;
}

.choice-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(180deg, #7dd1e5, rgba(125, 209, 229, 0.15));
    border-radius: 8px;
}

.choice-btn:hover {
    transform: translateY(-3px);
    border-color: rgba(125, 209, 229, 0.35);
    box-shadow: 0 20px 40px rgba(24, 95, 131, 0.22);
}

.choice-btn:hover::after {
    opacity: 1;
}

.choice-btn:active {
    transform: translateY(-1px);
}

.choice-btn span {
    margin-left: 12px;
}

.progress {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(125, 209, 229, 0.14);
}

#progress-text {
    color: #b5c7d8;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.restart-btn {
    background: linear-gradient(135deg, #e4b05b 0%, #c99d28 100%);
    border: 1px solid rgba(255, 225, 160, 0.35);
    color: #111821;
    padding: 14px 34px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Georgia', serif;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 10px;
}

.restart-btn:hover {
    background: linear-gradient(135deg, #f3ca72 0%, #e4b05b 100%);
    box-shadow: 0 16px 40px rgba(226, 176, 88, 0.45);
    transform: translateY(-2px);
}

.restart-btn:active {
    transform: translateY(0);
}

.restart-btn {
    animation: pulseGlow 3.5s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 16px 30px rgba(226, 176, 88, 0.25);
    }
    50% {
        box-shadow: 0 22px 45px rgba(226, 176, 88, 0.48);
    }
}

/* Ending screen styles */
.ending-screen {
    animation: fadeIn 0.8s ease-in;
}

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

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

.ending-type {
    display: inline-block;
    background: rgba(212, 175, 55, 0.16);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #ecd286;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 1rem;
}

/* Responsive design */
@media (max-width: 860px) {
    .choices {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 30px;
    }

    .story-header h1 {
        font-size: 2.7rem;
    }

    .story-text {
        font-size: 1rem;
        padding: 26px;
    }

    .choice-btn {
        padding: 18px 22px;
        font-size: 0.98rem;
        min-height: 86px;
    }
}

@media (max-width: 520px) {
    body {
        padding: 18px;
    }

    .container {
        padding: 24px;
        border-radius: 22px;
    }

    .story-header h1 {
        font-size: 2.1rem;
    }

    .story-text {
        font-size: 0.96rem;
        padding: 22px;
    }

    .choice-btn {
        padding: 16px 18px;
        font-size: 0.95rem;
        min-height: auto;
    }

    .restart-btn {
        width: 100%;
        padding: 14px 20px;
    }
}

/* Utility class for hidden elements */
.hidden {
    display: none;
}
