/* ==========================================================================
   NextBall - Interactive tutorial (tutorial-play.js)
   Flat tiles, one orange accent, no glow (tokens: arena.css / pages-v4.css)
   ========================================================================== */

/* ---- local session: hide match-only chrome ---- */
body.nb-local-session #game-screen .game-topbar,
body.nb-local-session #game-screen .pool-hud,
body.nb-local-session #game-chat-panel,
body.nb-local-session #game-screen .controls-info,
body.nb-local-session #game-screen .btn-help-ingame,
body.nb-local-session #game-screen .game-rec,
body.nb-local-session #touch-chat,
body.nb-local-session #touch-quickchat,
body.nb-local-session #touch-leave,
body.nb-local-session #touch-sprint,
body.nb-local-session #touch-power,
body.nb-local-session #quick-chat-overlay { display: none !important; }
/* nothing from the menu floats over the drills */
body.tut-active #signup-nudge,
body.tut-active .social-panel,
body.tut-active .sp-toasts,
body.tut-active .btn-social,
body.tut-active .nb-announce { visibility: hidden !important; }

body.tut-card-on #goal-celebration { display: none !important; }

/* ---- key caps ---- */
.tut-key {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 24px; padding: 0 6px; margin: 0 1px;
    font: 700 12px/1 var(--f-display, 'Chakra Petch', sans-serif); letter-spacing: .02em;
    color: var(--fg-0, #fff); background: var(--bg-3, #242932);
    border: 1px solid var(--line-strong, rgba(255,255,255,.14)); border-bottom-width: 3px;
    border-radius: 4px; vertical-align: middle; text-transform: none; white-space: nowrap;
}
.tut-key-sm { min-width: 20px; height: 19px; padding: 0 5px; font-size: 10px; border-bottom-width: 2px; }
.tut-keygroup { display: inline-flex; gap: 2px; vertical-align: middle; }
.tut-or { margin: 0 5px; color: var(--fg-3, #666D79); font-size: 12px; }
.tut-unbound { color: var(--gold, #E4B13A); font-style: italic; }
.tut-tb {
    display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; padding: 0 7px;
    font: 700 12px/1 var(--f-display, 'Chakra Petch', sans-serif); color: var(--fg-0, #fff);
    background: var(--bg-3, #242932); border: 1px solid var(--line-strong, rgba(255,255,255,.14)); border-radius: 999px;
    vertical-align: middle;
}

/* ---- HUD (step card + actions) ---- */
.tut-hud {
    order: -1; flex: none;
    width: min(1280px, calc(100% - 16px));
    display: flex; align-items: stretch; gap: 8px;
    padding: 10px 0 2px;
    font-family: var(--f-body, 'Exo 2', sans-serif);
    position: relative; z-index: 35;
}
.tut-hud-card {
    flex: 1 1 auto; min-width: 0;
    background: var(--bg-1, #15181D);
    border: 1px solid var(--line, rgba(255,255,255,.07));
    border-left: 3px solid var(--orange, #FF6A13);
    border-radius: var(--r, 4px);
    padding: 8px 12px 10px;
    transition: border-color var(--t, 220ms ease-out);
}
.tut-hud-card.tut-enter { animation: tut-enter 260ms ease-out both; }
.tut-hud-card.is-done { border-left-color: var(--ok, #38D66B); }
.tut-hud-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.tut-eyebrow {
    font: 700 11px/1 var(--f-display, 'Chakra Petch', sans-serif); letter-spacing: .12em; text-transform: uppercase;
    color: var(--orange, #FF6A13);
}
.tut-progress { display: inline-flex; align-items: center; gap: 10px; }
.tut-progress-label { font: 700 11px/1 var(--f-display, 'Chakra Petch', sans-serif); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2, #9BA1AC); }
.tut-pips { display: inline-flex; gap: 3px; }
.tut-pips i { display: block; width: 18px; height: 4px; border-radius: 1px; background: var(--bg-4, #2F3641); }
.tut-pips i.on { background: var(--orange, #FF6A13); }
.tut-pips i.cur { background: var(--fg-0, #fff); }
.tut-hud-main { display: flex; align-items: center; gap: 12px; }
.tut-stepnum {
    flex: none; width: 38px; height: 38px; display: grid; place-items: center;
    background: var(--orange, #FF6A13); color: var(--orange-ink, #1A0900);
    font: 700 20px/1 var(--f-display, 'Chakra Petch', sans-serif); border-radius: var(--r, 4px);
    transition: background var(--t, 220ms ease-out);
}
.is-done .tut-stepnum { background: var(--ok, #38D66B); color: #06200F; animation: tut-pop 320ms ease-out both; }
.tut-copy { min-width: 0; flex: 1 1 auto; }
.tut-title {
    margin: 0 0 3px; font: 700 18px/1.1 var(--f-display, 'Chakra Petch', sans-serif);
    text-transform: uppercase; letter-spacing: .04em; color: var(--fg-0, #fff);
}
.tut-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--fg-1, #DDE0E6); }
.tut-text b { color: var(--fg-0, #fff); font-weight: 700; }
.tut-text .tut-ok { color: var(--ok, #38D66B); }
.tut-counter {
    flex: none; display: inline-flex; align-items: center; gap: 10px;
    padding: 7px 10px; background: var(--bg-2, #1B1F26); border: 1px solid var(--line, rgba(255,255,255,.07)); border-radius: var(--r, 4px);
    font: 700 12px/1 var(--f-display, 'Chakra Petch', sans-serif); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2, #9BA1AC);
}
.tut-counter b { color: var(--fg-0, #fff); font-size: 14px; }
.tut-counter-label { color: var(--fg-2, #9BA1AC); }
.tut-dots { display: inline-flex; gap: 4px; }
.tut-dots i { width: 10px; height: 10px; border-radius: 2px; background: var(--bg-4, #2F3641); }
.tut-dots i.on { background: var(--orange, #FF6A13); animation: tut-pop 240ms ease-out both; }

.tut-actions { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.tut-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 32px; padding: 0 12px; border-radius: var(--r, 4px);
    font: 700 12px/1 var(--f-display, 'Chakra Petch', sans-serif); letter-spacing: .06em; text-transform: uppercase;
    color: var(--fg-1, #DDE0E6); background: transparent; border: 1px solid var(--line-strong, rgba(255,255,255,.14));
    cursor: pointer; white-space: nowrap; transition: background var(--t-fast, 120ms), color var(--t-fast, 120ms), border-color var(--t-fast, 120ms);
}
.tut-btn:hover { background: var(--bg-3, #242932); color: var(--fg-0, #fff); }
.tut-btn:focus-visible { outline: 2px solid var(--orange, #FF6A13); outline-offset: 2px; }
.tut-btn-continue { background: var(--orange, #FF6A13); color: var(--orange-ink, #1A0900); border-color: var(--orange, #FF6A13); }
.tut-btn-continue:hover { background: var(--orange-hi, #FF8A45); color: var(--orange-ink, #1A0900); }
.tut-pause-ico { width: 9px; height: 10px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; box-sizing: border-box; }
.tut-actions .tut-btn.hidden, .tut-counter.hidden { display: none !important; }

/* ---- overlay layer (markers, zone, ghost arc) ---- */
.tut-layer { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 5; }

/* ---- freeze prompt ---- */
.tut-freeze {
    position: absolute; inset: 0; z-index: 15; pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    background: rgba(9, 11, 15, .58);
    animation: tut-fade 160ms ease-out both;
}
.tut-freeze.hidden { display: none; }
.tut-freeze-card {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
    min-width: 280px; max-width: min(440px, 86%);
    padding: 18px 26px 20px;
    background: var(--bg-1, #15181D); border: 1px solid var(--line-strong, rgba(255,255,255,.14));
    border-top: 3px solid var(--orange, #FF6A13); border-radius: var(--r-lg, 6px);
    animation: tut-rise 220ms ease-out both;
}
.tut-freeze-card.tut-shake { animation: tut-shake 320ms ease-in-out; }
.tut-freeze-eyebrow { font: 700 11px/1 var(--f-display, 'Chakra Petch', sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2, #9BA1AC); }
.tut-bigkey { display: flex; align-items: center; gap: 14px; color: var(--orange, #FF6A13); }
.tut-bigkey-cap {
    display: grid; place-items: center; min-width: 84px; height: 80px; padding: 0 16px;
    font: 700 44px/1 var(--f-display, 'Chakra Petch', sans-serif); color: var(--fg-0, #fff);
    background: var(--bg-3, #242932); border: 2px solid var(--orange, #FF6A13); border-bottom-width: 7px; border-radius: 8px;
    animation: tut-press 1.1s ease-in-out infinite;
}
.tut-bigkey-cap.is-touch { min-width: 80px; border-radius: 999px; font-size: 30px; border-bottom-width: 2px; }
.tut-arrow { font: 700 44px/1 var(--f-display, 'Chakra Petch', sans-serif); }
.tut-freeze-title { margin: 2px 0 0; font: 700 20px/1.2 var(--f-display, 'Chakra Petch', sans-serif); color: var(--fg-0, #fff); text-transform: uppercase; letter-spacing: .03em; }
.tut-freeze-title b { color: var(--orange, #FF6A13); }
.tut-freeze-sub { margin: 0; font: 400 14px/1.5 var(--f-body, 'Exo 2', sans-serif); color: var(--fg-1, #DDE0E6); max-width: 340px; }

/* on-screen button to press (mobile): above the dim, outlined + pulsing */
.touch-btn.tut-hot {
    opacity: 1 !important;
    outline: 3px solid var(--orange, #FF6A13); outline-offset: 5px;
    animation: tut-hot 1s ease-in-out infinite;
}

/* ---- big key prompt (on the pitch) ---- */
.tut-prompt {
    position: absolute; left: 50%; z-index: 16; pointer-events: none;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
    width: max-content; max-width: min(640px, calc(100% - 24px));
    padding: 16px 26px 18px;
    background: rgba(15, 17, 21, .94); border: 1px solid var(--line-strong, rgba(255,255,255,.14));
    border-top: 3px solid var(--orange, #FF6A13); border-radius: var(--r-lg, 6px);
    font-family: var(--f-body, 'Exo 2', sans-serif); color: var(--fg-0, #fff);
}
.tut-prompt.hidden, body.tut-frozen .tut-prompt, body.tut-card-on .tut-prompt { display: none; }
.tut-prompt.tut-pop-in { animation: tut-prompt-in 200ms ease-out both; }
.tut-prompt-eyebrow { font: 700 11px/1 var(--f-display, 'Chakra Petch', sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--orange, #FF6A13); }
.tut-prompt-eyebrow:empty { display: none; }
.tut-prompt-keys { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding-bottom: 4px; }
.tut-prompt-keys.hidden { display: none; }
.tut-prompt-copy { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tut-prompt-title { margin: 0; font: 700 22px/1.15 var(--f-display, 'Chakra Petch', sans-serif); text-transform: uppercase; letter-spacing: .03em; }
.tut-prompt-title:empty { display: none; }
.tut-prompt-text { margin: 0; max-width: 480px; font-size: 14px; line-height: 1.55; color: var(--fg-1, #DDE0E6); }
.tut-prompt-text:empty { display: none; }
.tut-prompt-text b { color: var(--fg-0, #fff); }
.tut-prompt-extra:empty { display: none; }
.tut-prompt-extra { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font: 700 12px/1 var(--f-display, 'Chakra Petch', sans-serif); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2, #9BA1AC); }
.tut-prompt-extra b { color: var(--fg-0, #fff); font-size: 14px; }
.tut-pnote { color: var(--fg-2, #9BA1AC); }

.tut-pcap {
    position: relative; display: inline-grid; place-items: center;
    min-width: 58px; height: 58px; padding: 0 12px;
    font: 700 28px/1 var(--f-display, 'Chakra Petch', sans-serif); color: var(--fg-0, #fff);
    background: var(--bg-3, #242932); border: 2px solid var(--orange, #FF6A13); border-bottom-width: 6px; border-radius: 7px;
}
.tut-pcap.is-wide { font-size: 22px; padding: 0 16px; }
.tut-pcap.is-touch { border-radius: 999px; border-bottom-width: 2px; font-size: 24px; min-width: 58px; }
.tut-pcap[data-hold] { margin-bottom: 14px; }
.tut-pcap[data-hold]::after {
    content: 'HOLD'; position: absolute; left: 50%; bottom: -21px; transform: translateX(-50%);
    font: 700 10px/1 var(--f-display, 'Chakra Petch', sans-serif); letter-spacing: .14em; color: var(--orange, #FF6A13);
}
.tut-psep { font: 700 26px/1 var(--f-display, 'Chakra Petch', sans-serif); color: var(--fg-2, #9BA1AC); }
.tut-psep.is-word { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.tut-pgroup { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.tut-pgroup > em { font: 700 10px/1 var(--f-display, 'Chakra Petch', sans-serif); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2, #9BA1AC); }
.tut-pgroup > span { display: inline-flex; align-items: center; gap: 8px; }

/* step intro: big, upper middle of the pitch */
.tut-prompt.is-big { top: 9%; }
/* docked: still big keys, low on the pitch, out of the way */
.tut-prompt.is-pill {
    bottom: 12px; top: auto; flex-direction: row; gap: 16px; padding: 10px 18px 10px 12px; text-align: left;
    border-top-width: 1px; border-left: 3px solid var(--orange, #FF6A13);
}
.tut-prompt.is-pill .tut-prompt-keys { padding-bottom: 0; flex-wrap: nowrap; gap: 8px; }
.tut-prompt.is-pill .tut-prompt-copy { align-items: flex-start; }
.tut-prompt.is-pill .tut-prompt-title { font-size: 16px; }
.tut-prompt.is-pill .tut-prompt-text { display: none; }
.tut-prompt.is-pill .tut-pcap { min-width: 46px; height: 46px; font-size: 22px; border-bottom-width: 5px; }
.tut-prompt.is-pill .tut-pcap.is-wide { font-size: 17px; }
.tut-prompt.is-pill .tut-pcap[data-hold] { margin-bottom: 12px; }
.tut-prompt.is-pill.no-keys { padding-left: 18px; }
/* TRY AGAIN: centred (the step is resetting anyway); heads-up / nice flashes: upper middle, clear of the play */
.tut-prompt.is-fail { top: 50%; transform: translate(-50%, -50%); }
.tut-prompt.is-fail.tut-pop-in { animation: tut-prompt-in-c 200ms ease-out both; }
.tut-prompt.is-warn, .tut-prompt.is-ok { top: 9%; }
.tut-prompt.is-fail { border-top-color: var(--gold, #E4B13A); }
.tut-prompt.is-fail .tut-prompt-eyebrow { display: none; }
.tut-prompt.is-fail .tut-prompt-title { font-size: 34px; color: var(--gold-hi, #F2CB6A); order: -1; }
.tut-prompt.is-fail .tut-prompt-copy { order: -1; }
.tut-prompt.is-fail .tut-prompt-text { font-size: 16px; color: var(--fg-0, #fff); }
.tut-prompt.is-warn { border-top-color: var(--gold, #E4B13A); }
.tut-prompt.is-warn .tut-prompt-eyebrow { color: var(--gold, #E4B13A); }
.tut-prompt.is-ok { border-top-color: var(--ok, #38D66B); }
.tut-prompt.is-ok .tut-prompt-eyebrow { color: var(--ok, #38D66B); }
.tut-prompt.is-ok .tut-prompt-title { font-size: 26px; }
@keyframes tut-prompt-in { from { opacity: 0; transform: translate(-50%, 8px) scale(.97); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes tut-prompt-in-c { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%); } }

.tut-foot {
    position: absolute; right: 10px; bottom: 8px; z-index: 6; pointer-events: none;
    display: flex; gap: 14px; font: 600 11px/1 var(--f-body, 'Exo 2', sans-serif); color: rgba(255,255,255,.55);
}
.tut-foot:empty { display: none; }

/* ---- modals (pause menu, completion) ---- */
.tut-modal {
    position: fixed; inset: 0; z-index: 60;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(9, 11, 15, .72);
    font-family: var(--f-body, 'Exo 2', sans-serif);
    animation: tut-fade 160ms ease-out both;
}
.tut-modal.hidden { display: none; }
.tut-modal-card {
    width: min(360px, 100%); max-height: calc(100% - 8px); overflow: auto;
    padding: 22px 22px 20px;
    background: var(--bg-1, #15181D); border: 1px solid var(--line-strong, rgba(255,255,255,.14));
    border-top: 3px solid var(--orange, #FF6A13); border-radius: var(--r-lg, 6px);
    animation: tut-rise 220ms ease-out both;
}
.tut-modal-title { margin: 6px 0 16px; font: 700 26px/1.05 var(--f-display, 'Chakra Petch', sans-serif); text-transform: uppercase; letter-spacing: .02em; color: var(--fg-0, #fff); }
.tut-menu { display: grid; gap: 8px; }
.tut-menu .btn { width: 100%; height: 42px; }
.tut-outline { border-color: var(--line-strong, rgba(255,255,255,.14)) !important; }

.tut-complete-card { width: min(520px, 100%); padding: 22px 24px 22px; }
.tut-complete-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.tut-complete-head .tut-modal-title { margin: 5px 0 0; font-size: 30px; }
.tut-complete-badge {
    flex: none; width: 52px; height: 52px; display: grid; place-items: center;
    background: var(--ok, #38D66B); color: #06200F; border-radius: var(--r, 4px);
    animation: tut-pop 360ms ease-out both;
}
.tut-learned {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1px;
    background: var(--line, rgba(255,255,255,.07)); border: 1px solid var(--line, rgba(255,255,255,.07)); border-radius: var(--r, 4px); overflow: hidden;
}
.tut-learned-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--bg-2, #1B1F26); min-height: 44px; }
.tut-learned-keys { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 88px; }
.tut-learned-label { font: 700 13px/1.2 var(--f-display, 'Chakra Petch', sans-serif); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-0, #fff); }
.tut-learned-label small { display: block; font: 500 11px/1.3 var(--f-body, 'Exo 2', sans-serif); text-transform: none; letter-spacing: 0; color: var(--fg-2, #9BA1AC); }
.tut-learned { margin-bottom: 14px; }
.tut-offer {
    display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 14px 16px;
    background: var(--bg-2, #1B1F26); border: 1px solid var(--line, rgba(255,255,255,.07)); border-left: 3px solid var(--gold, #E4B13A); border-radius: var(--r, 4px);
}
.tut-offer-copy { flex: 1 1 auto; min-width: 0; }
.tut-offer-eyebrow { font: 700 11px/1 var(--f-display, 'Chakra Petch', sans-serif); letter-spacing: .12em; text-transform: uppercase; color: var(--gold, #E4B13A); }
.tut-offer-title { margin: 6px 0 4px; font: 700 18px/1.2 var(--f-display, 'Chakra Petch', sans-serif); color: var(--fg-0, #fff); }
.tut-offer-title b { color: var(--gold-hi, #F2CB6A); letter-spacing: .04em; }
.tut-offer-sub { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--fg-2, #9BA1AC); }
.tut-offer-reward { flex: none; }
.tut-coin {
    display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
    background: var(--gold, #E4B13A); color: var(--gold-ink, #2A1A00); border: 3px solid var(--gold-hi, #F2CB6A);
    font: 700 20px/1 var(--f-display, 'Chakra Petch', sans-serif);
}
.tut-coin::before { content: '+'; font-size: 13px; margin-right: 1px; }
.tut-coin { grid-auto-flow: column; }
.tut-complete-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.tut-complete-actions .btn { height: 46px; font-size: 14px; }
.tut-complete-actions .tut-cta:only-child { grid-column: 1 / -1; }

/* How to Play modal: replay button */
.tut-replay-btn { gap: 8px; border: 1px solid var(--line-strong, rgba(255,255,255,.14)) !important; }
.tut-replay-btn.hidden { display: none !important; }
#tutorial-modal .tutorial-footer { justify-content: space-between; }

/* ---- motion ---- */
@keyframes tut-enter { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes tut-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tut-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes tut-pop { 0% { transform: scale(.6); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes tut-press { 0%, 70%, 100% { transform: translateY(0); border-bottom-width: 7px; } 80% { transform: translateY(4px); border-bottom-width: 3px; } }
@keyframes tut-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@keyframes tut-hot { 0%, 100% { outline-offset: 4px; transform: scale(1); } 50% { outline-offset: 8px; transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
    .tut-hud-card.tut-enter, .tut-freeze, .tut-freeze-card, .tut-modal, .tut-modal-card, .tut-bigkey-cap,
    .touch-btn.tut-hot, .tut-dots i.on, .is-done .tut-stepnum, .tut-complete-badge, .tut-prompt { animation: none !important; }
}

/* ---- small desktop windows ---- */
@media (max-width: 760px) {
    .tut-hud { flex-direction: column; }
    .tut-actions { flex-direction: row; justify-content: flex-end; }
    .tut-text { font-size: 13px; }
}

/* ---- mobile (canvas fills the screen, controls overlaid) ---- */
body.is-mobile .tut-hud {
    position: absolute; top: calc(env(safe-area-inset-top, 0px) + 6px); left: calc(env(safe-area-inset-left, 0px) + 8px); right: calc(env(safe-area-inset-right, 0px) + 8px);
    width: auto; padding: 0; gap: 6px; flex-direction: row; align-items: flex-start; pointer-events: none;
}
body.is-mobile .tut-hud-card { max-width: 58%; padding: 6px 10px 7px; background: rgba(21, 24, 29, .92); pointer-events: none; }
body.is-mobile .tut-hud-top { margin-bottom: 4px; }
body.is-mobile .tut-pips i { width: 12px; height: 3px; }
body.is-mobile .tut-stepnum { width: 28px; height: 28px; font-size: 15px; }
body.is-mobile .tut-title { font-size: 14px; margin-bottom: 1px; }
body.is-mobile .tut-text { font-size: 12px; line-height: 1.4; }
body.is-mobile .tut-hud-main { gap: 8px; }
body.is-mobile .tut-counter { padding: 5px 7px; gap: 6px; font-size: 10px; }
body.is-mobile .tut-actions { margin-left: auto; flex-direction: row; pointer-events: auto; }
body.is-mobile .tut-btn { height: 34px; padding: 0 10px; background: rgba(21, 24, 29, .92); }
body.is-mobile .tut-btn-label { display: none; }
body.is-mobile .tut-btn-continue { background: var(--orange, #FF6A13); }
body.is-mobile .tut-key, body.is-mobile .tut-tb { height: 20px; min-width: 20px; font-size: 11px; }
body.is-mobile.tut-active .touch-utility { display: none !important; }
body.is-mobile .tut-text { display: none; }
body.is-mobile .tut-hud-card { max-width: 46%; }
body.is-mobile .tut-prompt { max-width: min(470px, 58vw); padding: 10px 16px 12px; gap: 6px; }
body.is-mobile .tut-prompt.is-big, body.is-mobile .tut-prompt.is-warn, body.is-mobile .tut-prompt.is-ok { top: 22%; }
/* docked pill between the stick and the action buttons (never over a button) */
body.is-mobile .tut-prompt.is-pill {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); left: calc(env(safe-area-inset-left, 0px) + 180px); transform: none;
    max-width: calc(100% - 180px - 310px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); gap: 10px; padding: 7px 12px 7px 8px;
}
body.is-mobile .tut-prompt.is-pill.tut-pop-in { animation: tut-fade 160ms ease-out both; }
body.is-mobile .tut-prompt.is-pill .tut-prompt-title { font-size: 13px; }
body.is-mobile .tut-prompt-title { font-size: 17px; }
body.is-mobile .tut-prompt-text { font-size: 12px; line-height: 1.4; }
body.is-mobile .tut-prompt.is-fail .tut-prompt-title { font-size: 24px; }
body.is-mobile .tut-prompt.is-fail .tut-prompt-text { font-size: 13px; }
body.is-mobile .tut-pcap { min-width: 44px; height: 44px; font-size: 20px; }
body.is-mobile .tut-prompt.is-pill .tut-pcap { min-width: 36px; height: 36px; font-size: 16px; border-bottom-width: 2px; }
body.is-mobile .tut-psep:not(.is-word) { font-size: 18px; }
body.is-mobile .tut-psep.is-word { font-size: 10px; }
body.is-mobile .tut-freeze { align-items: flex-start; padding-top: 12vh; background: rgba(9, 11, 15, .45); }
body.is-mobile.tut-frozen .tut-hud-card { visibility: hidden; }
body.is-mobile .tut-freeze-card { min-width: 0; max-width: 46%; padding: 12px 16px 14px; gap: 7px; }
body.is-mobile .tut-bigkey-cap { min-width: 60px; height: 56px; font-size: 30px; }
body.is-mobile .tut-bigkey-cap.is-touch { min-width: 60px; height: 60px; font-size: 24px; }
body.is-mobile .tut-freeze-title { font-size: 15px; }
body.is-mobile .tut-freeze-sub { font-size: 12px; }

/* completion card on a landscape phone: two columns, fits 390px of height */
@media (max-height: 520px) {
    .tut-modal { padding: 8px; }
    .tut-complete-card { width: min(780px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; align-items: start; padding: 12px 14px; }
    .tut-complete-head { grid-column: 1 / -1; margin-bottom: 10px; gap: 10px; }
    .tut-complete-head .tut-modal-title { font-size: 22px; }
    .tut-complete-badge { width: 38px; height: 38px; }
    .tut-learned { grid-template-columns: 1fr; grid-row: span 2; margin-bottom: 0; }
    .tut-learned-row { min-height: 0; padding: 5px 10px; }
    .tut-learned-label small { display: inline; margin-left: 6px; }
    .tut-offer { margin-bottom: 10px; padding: 10px 12px; }
    .tut-offer-title { font-size: 15px; }
    .tut-offer-sub { font-size: 11.5px; }
    .tut-coin { width: 42px; height: 42px; font-size: 16px; }
    .tut-complete-actions { grid-template-columns: 1fr; gap: 6px; }
    .tut-complete-actions .btn { height: 40px; }
}

/* the same compact completion card when the phone is held upright and the page is turned (pseudo landscape):
   the media query above sees the tall portrait screen, html.m-short is the height the player actually has.
   (9 Oct 2026: the buttons were off screen there and the card could not be left) */
html.is-mobile.m-short .tut-modal { padding: 6px; }
html.is-mobile.m-short .tut-modal-card { max-height: 100%; }
html.is-mobile.m-short .tut-complete-card { width: min(780px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; align-items: start; padding: 10px 12px; }
html.is-mobile.m-short .tut-complete-head { grid-column: 1 / -1; margin-bottom: 8px; gap: 10px; }
html.is-mobile.m-short .tut-complete-head .tut-modal-title { font-size: 20px; margin-top: 3px; }
html.is-mobile.m-short .tut-complete-badge { width: 34px; height: 34px; }
html.is-mobile.m-short .tut-learned { grid-template-columns: 1fr; grid-row: span 2; margin-bottom: 0; }
html.is-mobile.m-short .tut-learned-row { min-height: 0; padding: 4px 8px; }
html.is-mobile.m-short .tut-learned-keys { min-width: 64px; }
html.is-mobile.m-short .tut-learned-label { font-size: 12px; }
html.is-mobile.m-short .tut-learned-label small { display: inline; margin-left: 6px; }
html.is-mobile.m-short .tut-offer { margin-bottom: 8px; padding: 8px 10px; gap: 10px; }
html.is-mobile.m-short .tut-offer-title { font-size: 14px; margin: 4px 0 2px; }
html.is-mobile.m-short .tut-offer-sub { font-size: 11px; line-height: 1.35; }
html.is-mobile.m-short .tut-coin { width: 38px; height: 38px; font-size: 15px; }
html.is-mobile.m-short .tut-complete-actions { grid-template-columns: 1fr; gap: 6px; }
html.is-mobile.m-short .tut-complete-actions .btn { height: 40px; }
@media (max-height: 400px) { html.is-mobile .tut-offer-sub { display: none; } }
html.is-mobile.m-short.pseudo-land .tut-offer-sub { display: none; }

/* phones: the step card stops before the scoreboard, the room's eye / settings buttons give their corner to Pause + Skip */
body.is-mobile .tut-hud-card { max-width: calc(50% - 128px); }
body.is-mobile .tut-eyebrow { display: none; }
body.is-mobile .tut-hud-top { justify-content: flex-start; }
body.is-mobile.tut-active .room-tools { display: none !important; }
body.is-mobile .tut-btn-skip { white-space: nowrap; }
