@property --page {
    syntax: "<color>";
    inherits: true;
    initial-value: #12100e;
}
@property --text {
    syntax: "<color>";
    inherits: true;
    initial-value: #f7efe2;
}
@property --glow {
    syntax: "<color>";
    inherits: true;
    initial-value: rgba(240, 180, 41, 0.08);
}
@property --btn-bg {
    syntax: "<color>";
    inherits: true;
    initial-value: rgba(18, 16, 14, 0.72);
}
@property --btn-text {
    syntax: "<color>";
    inherits: true;
    initial-value: #f7efe2;
}
@property --btn-line {
    syntax: "<color>";
    inherits: true;
    initial-value: rgba(244, 228, 200, 0.22);
}
@property --cabinet-top {
    syntax: "<color>";
    inherits: true;
    initial-value: #2c221c;
}
@property --cabinet-bottom {
    syntax: "<color>";
    inherits: true;
    initial-value: #1a1410;
}
@property --cabinet-line {
    syntax: "<color>";
    inherits: true;
    initial-value: rgba(240, 180, 41, 0.42);
}
@property --hint {
    syntax: "<color>";
    inherits: true;
    initial-value: #c4b49a;
}
@property --modal {
    syntax: "<color>";
    inherits: true;
    initial-value: #161310;
}
@property --overlay {
    syntax: "<color>";
    inherits: true;
    initial-value: rgba(10, 8, 6, 0.78);
}

:root {
    --page: #12100e;
    --text: #f7efe2;
    --glow: rgba(240, 180, 41, 0.08);
    --btn-bg: rgba(18, 16, 14, 0.72);
    --btn-text: #f7efe2;
    --btn-line: rgba(244, 228, 200, 0.22);
    --cabinet-top: #2c221c;
    --cabinet-bottom: #1a1410;
    --cabinet-line: rgba(240, 180, 41, 0.42);
    --hint: #c4b49a;
    --modal: #161310;
    --overlay: rgba(10, 8, 6, 0.78);
}

html[data-theme="light"] {
    --page: #f4efe6;
    --text: #1a1410;
    --glow: rgba(232, 93, 4, 0.1);
    --btn-bg: rgba(255, 250, 243, 0.92);
    --btn-text: #1a1410;
    --btn-line: rgba(44, 34, 28, 0.16);
    --cabinet-top: #fffaf3;
    --cabinet-bottom: #f3e6d2;
    --cabinet-line: rgba(44, 34, 28, 0.14);
    --hint: #6d5c4a;
    --modal: #fffaf3;
    --overlay: rgba(244, 239, 230, 0.82);
}

html {
    transition:
        --page 0.85s ease,
        --text 0.85s ease,
        --glow 0.85s ease,
        --btn-bg 0.85s ease,
        --btn-text 0.85s ease,
        --btn-line 0.85s ease,
        --cabinet-top 0.85s ease,
        --cabinet-bottom 0.85s ease,
        --cabinet-line 0.85s ease,
        --hint 0.85s ease,
        --modal 0.85s ease,
        --overlay 0.85s ease;
}

body {
    background:
        radial-gradient(ellipse 70% 40% at 50% 0%, var(--glow), transparent 58%),
        var(--page);
    color: var(--text);
}

.back-button button,
.fs-button button,
.how-play,
.action-btn {
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.85s ease;
}

.back-button button,
.fs-button button {
    background: var(--btn-bg);
    color: var(--btn-text);
    border-color: var(--btn-line);
}

.arcade-cabinet {
    background: linear-gradient(180deg, var(--cabinet-top) 0%, var(--cabinet-bottom) 100%);
    border-color: var(--cabinet-line);
}

.hint-bar,
.mobile-hint,
.how-intro,
.how-step-desc {
    color: var(--hint);
}

.how-overlay {
    background: var(--overlay);
}

.how-modal {
    background: var(--modal);
    border-color: var(--cabinet-line);
}

.how-step-title {
    color: var(--text);
}

.back-button button:hover,
.back-button button:focus-visible,
.fs-button button:hover,
.fs-button button:focus-visible,
.how-play:hover,
.how-play:focus-visible,
.action-btn:hover,
.action-btn:focus-visible {
    transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
    html {
        transition: none;
    }

    .back-button button:hover,
    .back-button button:focus-visible,
    .fs-button button:hover,
    .fs-button button:focus-visible,
    .how-play:hover,
    .how-play:focus-visible,
    .action-btn:hover,
    .action-btn:focus-visible {
        transform: none;
    }
}

html[data-theme="light"] .marquee {
    text-shadow: none;
}

html[data-theme="light"] canvas {
    background: #fffaf3;
}

html[data-motion="off"] .back-button button:hover,
html[data-motion="off"] .back-button button:focus-visible,
html[data-motion="off"] .fs-button button:hover,
html[data-motion="off"] .fs-button button:focus-visible,
html[data-motion="off"] .how-play:hover,
html[data-motion="off"] .how-play:focus-visible,
html[data-motion="off"] .action-btn:hover,
html[data-motion="off"] .action-btn:focus-visible {
    transform: none;
}

.play-time {
    position: fixed;
    top: max(0.75rem, env(safe-area-inset-top));
    left: 50%;
    z-index: 12;
    transform: translateX(-50%);
    pointer-events: none;
    font-family: "DM Sans", sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    color: #fff;
    background: rgba(8, 48, 46, 0.88);
    border: 2px solid #e6c56a;
    border-radius: 12px;
    padding: 0.5rem 0.95rem;
    font-variant-numeric: tabular-nums;
}

.play-time b {
    color: #f0d56a;
    font-weight: 700;
}

