/* ==========================================================================
   Montana — "How to play" video tutorial page.
   The video itself is drawn on a canvas by js/tutorial.js; this file only
   styles the page shell and the player controls.
   ========================================================================== */

:root {
    --bg-0: #060a14;
    --bg-1: #0b1224;
    --panel: rgba(17, 25, 48, 0.82);
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --text: #eef2ff;
    --text-soft: #c3cbe4;
    --muted: #8f9bbd;
    --gold: #f5c451;
    --gold-2: #ffe29a;
    --loss: #f87171;
    --font-ui: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Georgia", "Times New Roman", serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(1200px 700px at 50% -10%, #16224a 0%, var(--bg-0) 60%) fixed, var(--bg-0);
    color: var(--text);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
}

.tutorial {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 16px 40px;
}

.tutorial-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.tutorial-header h1 {
    flex: 1;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(20px, 3.2vw, 30px);
    color: var(--gold-2);
    text-align: center;
}

.tutorial-back {
    color: var(--text-soft);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    white-space: nowrap;
}

.tutorial-back:hover,
.tutorial-back:focus-visible {
    color: var(--text);
    border-color: var(--gold);
}

.tutorial-lang {
    display: flex;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    overflow: hidden;
}

.tutorial-lang button {
    background: transparent;
    color: var(--muted);
    border: 0;
    padding: 8px 12px;
    font: 600 13px var(--font-ui);
    cursor: pointer;
}

.tutorial-lang button.is-active {
    background: var(--gold);
    color: #1a1406;
}

.tutorial-player {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.tutorial-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}

.tutorial-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.tutorial-stage:fullscreen {
    border-radius: 0;
    aspect-ratio: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-stage:fullscreen canvas {
    width: min(100vw, calc(100vh * 16 / 9));
    height: auto;
    aspect-ratio: 16 / 9;
}

.tutorial-big-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 88px;
    height: 88px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid rgba(255, 226, 154, 0.8);
    background: rgba(6, 10, 20, 0.72);
    color: var(--gold-2);
    font-size: 34px;
    cursor: pointer;
    box-shadow: 0 0 0 10px rgba(245, 196, 81, 0.12);
    transition: transform 0.2s, background 0.2s;
}

.tutorial-big-play span {
    display: inline-block;
    transform: translateX(3px);
}

.tutorial-big-play:hover,
.tutorial-big-play:focus-visible {
    transform: translate(-50%, -50%) scale(1.06);
    background: rgba(6, 10, 20, 0.88);
}

.tutorial-rec {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    font: 600 13px var(--font-ui);
}

.tutorial-rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--loss);
    animation: rec-blink 1s infinite;
}

@keyframes rec-blink {
    50% { opacity: 0.25; }
}

.tutorial-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 2px 4px;
    flex-wrap: wrap;
}

.tc-btn,
.tc-speed {
    min-width: 40px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font: 600 14px var(--font-ui);
    cursor: pointer;
}

.tc-btn:hover,
.tc-btn:focus-visible,
.tc-speed:hover {
    border-color: var(--gold);
}

.tc-toggle.is-on {
    background: rgba(245, 196, 81, 0.18);
    border-color: var(--gold);
    color: var(--gold-2);
}

.tc-speed option {
    background: var(--bg-1);
}

.tc-time {
    font: 600 13px var(--font-ui);
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
    min-width: 88px;
}

.tc-progress {
    position: relative;
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    height: 36px;
}

.tc-progress input[type="range"] {
    width: 100%;
    margin: 0;
    accent-color: var(--gold);
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.tc-ticks {
    position: absolute;
    inset: 0 8px;
    pointer-events: none;
}

.tc-ticks span {
    position: absolute;
    top: 9px;
    width: 2px;
    height: 6px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 1px;
}

.tutorial-chapters ol {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
}

.tutorial-chapters button {
    width: 100%;
    display: flex;
    gap: 8px;
    align-items: baseline;
    text-align: left;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    font: 13px var(--font-ui);
    cursor: pointer;
}

.tutorial-chapters button small {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.tutorial-chapters button:hover,
.tutorial-chapters button:focus-visible {
    border-color: var(--line-strong);
    color: var(--text);
}

.tutorial-chapters button.is-active {
    border-color: var(--gold);
    color: var(--gold-2);
    background: rgba(245, 196, 81, 0.1);
}

.tutorial-download {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.tutorial-download-btn {
    padding: 10px 16px;
    border-radius: 12px;
    border: 0;
    background: linear-gradient(180deg, var(--gold-2), var(--gold));
    color: #1a1406;
    font: 700 14px var(--font-ui);
    cursor: pointer;
}

.tutorial-download-btn.is-recording {
    background: var(--loss);
    color: #fff;
}

.tutorial-note {
    flex: 1 1 260px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 560px) {
    .tutorial-header h1 {
        display: none;
    }

    .tutorial-header {
        justify-content: space-between;
    }

    .tc-time {
        min-width: 0;
    }

    .tutorial-big-play {
        width: 64px;
        height: 64px;
        font-size: 26px;
    }
}
