:root {
    --bg-color: #0c0a0a;
    --text-color: #f1f5f9;
    --accent-red: #f43f5e;
    --accent-green: #10b981;
    --board-bg: #1e1b1b;
    --board-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    --btn-color: #e11d48;
    --btn-hover: #be123c;
    --track-bg: #332d2d;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s;
}

/* Atmosphere classes controlled by JS */
body.atmosphere-green {
    background-color: rgba(16, 185, 129, 0.1);
}

body.atmosphere-red {
    background-color: rgba(244, 63, 94, 0.15);
}

body.atmosphere-danger {
    background-color: rgba(244, 63, 94, 0.3);
    animation: pulse-danger 0.5s infinite alternate;
}

@keyframes pulse-danger {
    from {
        background-color: rgba(244, 63, 94, 0.2);
    }

    to {
        background-color: rgba(244, 63, 94, 0.4);
    }
}

.page-container {
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.seo-header {
    text-align: center;
    background: rgba(30, 27, 27, 0.8);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.seo-header h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-red);
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.seo-header p {
    font-size: 1rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.seo-header strong {
    color: var(--accent-red);
}

.game-wrapper {
    background: var(--board-bg);
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--board-shadow);
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-ui {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 700;
}

.timer-board {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-board .value {
    color: #fff;
    margin-left: 8px;
    font-weight: 900;
    font-size: 1.3rem;
    font-variant-numeric: tabular-nums;
}

.timer-board.warning .value {
    color: var(--accent-red);
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.5;
    }
}

.status-board {
    font-size: 1.2rem;
    font-weight: 900;
    padding: 5px 15px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #94a3b8;
}

.play-area {
    position: relative;
    background: #000;
    border-radius: 12px;
    padding: 20px;
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Doll Indicator */
.doll-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    height: 120px;
    justify-content: center;
}

.light {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #333;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: background-color 0.1s, box-shadow 0.1s;
}

.light.green {
    background: var(--accent-green);
    box-shadow: 0 0 30px var(--accent-green), inset 0 0 10px #fff;
}

.light.red {
    background: var(--accent-red);
    box-shadow: 0 0 40px var(--accent-red), inset 0 0 10px #fff;
}

.doll-face {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

.doll-face.red {
    color: var(--accent-red);
    transform: scale(1.1);
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Progress Track */
.track-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    padding-top: 10px;
}

.finish-line {
    position: absolute;
    right: 0;
    top: -15px;
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--accent-green);
}

.track {
    width: 100%;
    height: 40px;
    background: var(--track-bg);
    border-radius: 20px;
    position: relative;
    border: 2px solid #444;
    overflow: hidden;
}

.player-marker {
    position: absolute;
    left: 0%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    transition: left 0.1s linear;
    width: 30px;
    text-align: center;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.player-marker.dead {
    transform: translateY(-50%) rotate(90deg);
    filter: grayscale(1) brightness(0.5);
}

.track::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            #fff,
            #fff 5px,
            #000 5px,
            #000 10px);
}

/* Overlays */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.game-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    background: var(--board-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 85%;
}

.game-overlay.hidden .overlay-content {
    transform: scale(0.9);
}

.overlay-content h2 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 10px;
}

.result-content h2.win {
    color: var(--accent-green);
}

.result-content h2.lose {
    color: var(--accent-red);
}

.overlay-content p {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 25px;
    line-height: 1.5;
}

.btn-primary {
    background: var(--btn-color);
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.4);
    width: 100%;
}

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

.btn-primary:hover {
    background: var(--btn-hover);
}

/* Controls Area */
.controls-area {
    display: flex;
    justify-content: center;
    padding-top: 10px;
}

.action-btn {
    width: 100%;
    height: 100px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid #334155;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), inset 0 2px 5px rgba(255, 255, 255, 0.1);
    transition: transform 0.05s, border-color 0.1s, box-shadow 0.1s;
    color: #fff;
}

.action-btn:active,
.action-btn.active {
    transform: translateY(4px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), inset 0 4px 15px rgba(0, 0, 0, 0.5);
    border-color: #475569;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 2px;
}

.btn-subtext {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 5px;
}

.seo-article {
    background: rgba(30, 27, 27, 0.7);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    line-height: 1.6;
}

.seo-article h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #fff;
}

.seo-article ul {
    list-style-position: inside;
    color: #cbd5e1;
}

.seo-article li {
    margin-bottom: 10px;
}

.back-link {
    margin-top: 10px;
    margin-bottom: 30px;
}

.back-link a {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.back-link a:hover {
    color: #fff;
    text-decoration: underline;
}