/* Tutorial overlay (js/tutorial.js). Nothing here blocks taps: the spotlight only darkens. */
.tut { position: fixed; inset: 0; z-index: 900; pointer-events: none; }
.tut-shade { position: absolute; inset: 0; background: rgba(6, 4, 14, .55); }
.tut-hole { position: absolute; border: 3px solid var(--accent); box-shadow: 0 0 0 9999px rgba(6, 4, 14, .58), 0 0 18px var(--accent), inset 0 0 12px rgba(255, 211, 77, .35);
  transition: left .2s steps(4), top .2s steps(4), width .2s steps(4), height .2s steps(4); animation: tut-pulse 1.2s steps(2) infinite; }
@keyframes tut-pulse { 50% { border-color: #fff3c4; } }
.tut-arrow { position: absolute; width: 20px; text-align: center; font-size: calc(22px * var(--ts, 1)); color: var(--accent); text-shadow: 2px 2px 0 #000; animation: tut-bounce .6s steps(2) infinite; }
@keyframes tut-bounce { 50% { transform: translateY(-6px); } }

.tut-box { position: absolute; pointer-events: auto; display: flex; gap: 10px; padding: 10px; color: var(--text);
  border: 8px solid transparent; border-image: var(--frm-gold) 8 / 8px stretch; background-color: rgba(23, 17, 44, .97); background-clip: padding-box; box-shadow: 4px 4px 0 #000;
  transition: top .25s steps(5), bottom .25s steps(5), left .25s steps(5), right .25s steps(5); }
.tut-guide { position: relative; flex: none; width: 76px; height: 76px; overflow: hidden; border: 3px solid #000; box-shadow: 0 0 0 2px var(--line2); background: #120e24; }
.tut-guide .scene { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.tut-guide canvas.creature { position: absolute; left: 4%; bottom: -6%; width: 92%; height: 92%; image-rendering: pixelated; animation: bob 1.2s steps(2) infinite; }
.tut-name { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-family: var(--font-head); font-size: calc(8px * var(--ts, 1)); line-height: 12px; color: #000; background: var(--accent); }
.tut-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.tut-count { font-family: var(--font-head); font-size: calc(8px * var(--ts, 1)); color: var(--dim); }
.tut-text { font-size: calc(20px * var(--ts, 1)); line-height: 1.25; min-height: 3.6em; cursor: pointer; }
.tut-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.tut-actions .btn.primary { animation: title-glow 1.6s steps(2) infinite; }
.tut-hint { font-size: calc(16px * var(--ts, 1)); color: var(--accent); animation: tut-pulse-t 1s steps(2) infinite; }
@keyframes tut-pulse-t { 50% { opacity: .5; } }
.tut-skip { margin-left: auto; }

/* Portrait: a wide strip at the top or bottom, away from the spotlight (bottom sits above the dock). */
.tut.portrait .tut-box { left: 8px; right: 8px; }
.tut.portrait .tut-box[data-pos="bottom"] { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.tut.portrait .tut-box[data-pos="top"] { top: calc(8px + env(safe-area-inset-top, 0px)); }
.tut.portrait .tut-box[data-pos="center"] { top: 50%; transform: translateY(-50%); }
/* Landscape: a column on the left or right, away from the spotlight. */
.tut.landscape .tut-box { top: 50%; transform: translateY(-50%); width: min(400px, 42vw); flex-direction: column; align-items: center; text-align: left; }
.tut.landscape .tut-box[data-pos="left"] { left: calc(10px + env(safe-area-inset-left, 0px)); }
.tut.landscape .tut-box[data-pos="right"] { right: calc(10px + env(safe-area-inset-right, 0px)); }
.tut.landscape .tut-box[data-pos="center"] { left: 50%; transform: translate(-50%, -50%); width: min(520px, 80vw); flex-direction: row; }
.tut.landscape .tut-box[data-pos="left"] .tut-body, .tut.landscape .tut-box[data-pos="right"] .tut-body { width: 100%; }
@media (max-height: 480px) and (orientation: landscape) {
  .tut.landscape .tut-box { flex-direction: row; width: min(460px, 48vw); padding: 6px; }
  .tut-guide { width: 56px; height: 56px; } .tut-text { font-size: calc(17px * var(--ts, 1)); min-height: 0; }
}

.tut-gift-pop { position: fixed; left: 50%; top: 22%; z-index: 950; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 16px;
  border: 8px solid transparent; border-image: var(--frm-gold) 8 / 8px stretch; background-color: rgba(23, 17, 44, .98); background-clip: padding-box; box-shadow: 4px 4px 0 #000, 0 0 30px rgba(255, 211, 77, .5);
  animation: tut-pop .35s steps(5); pointer-events: none; }
.tut-gift-pop b { font-family: var(--font-head); font-weight: normal; font-size: calc(11px * var(--ts, 1)); color: var(--accent); }
.tut-gifts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tut-gift { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: calc(17px * var(--ts, 1)); }
.tut-gift .icon { animation: bob .8s steps(2) infinite; }
.tut-gift-pop.out { opacity: 0; transition: opacity .5s; }
@keyframes tut-pop { from { transform: translateX(-50%) scale(.4); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
html.fx-off .tut-hole, html.fx-off .tut-arrow, html.fx-off .tut-guide canvas, html.fx-off .tut-actions .btn.primary, html.fx-off .tut-gift .icon { animation: none; }

/* Landscape with a wide spotlight: a strip above or below it. */
.tut.landscape .tut-box[data-pos="top"], .tut.landscape .tut-box[data-pos="bottom"] { left: 50%; transform: translateX(-50%); width: min(620px, 76vw); flex-direction: row; }
.tut.landscape .tut-box[data-pos="top"] { top: calc(6px + env(safe-area-inset-top, 0px)); bottom: auto; }
.tut.landscape .tut-box[data-pos="bottom"] { bottom: calc(6px + env(safe-area-inset-bottom, 0px)); top: auto; }
.tut.portrait .tut-box[data-pos="top"] { bottom: auto; } .tut.portrait .tut-box[data-pos="bottom"] { top: auto; }
/* Mini: no room anywhere, so only the words and the buttons in a slim strip. */
.tut.mini .tut-box { padding: 4px 8px; border-width: 5px; gap: 6px; align-items: center; }
.tut.mini .tut-guide, .tut.mini .tut-count { display: none; }
.tut.mini .tut-text { font-size: calc(15px * var(--ts, 1)); min-height: 0; }
.tut.mini .tut-body { flex-direction: row; align-items: center; gap: 8px; }
.tut.mini .tut-actions { flex-wrap: nowrap; } .tut.mini .tut-hint { display: none; }

/* Class picker (js/classpick.js) */
.cpick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cpick-card { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--well); border: 3px solid #000; box-shadow: 0 0 0 2px var(--line2); min-width: 0; }
.cpick-card:hover { box-shadow: 0 0 0 2px var(--accent), 0 0 12px rgba(255, 211, 77, .4); }
.cpick-art { position: relative; aspect-ratio: 1; max-width: 100%; display: flex; align-items: flex-end; justify-content: center; background: radial-gradient(circle at 50% 70%, #2c2452, #120d24 70%); border: 2px solid #000; }
.cpick-art canvas { width: 80%; height: 80%; image-rendering: pixelated; animation: bob 1.2s steps(2) infinite; }
.cpick-icon { position: absolute; left: 4px; top: 4px; }
.cpick-body h3 { margin: 0; color: var(--accent); } .cpick-body p { margin: 4px 0 0; }
.cpick-card .btn { width: 100%; }
.cpick.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cpick.compact .cpick-body p { display: none; } .cpick.compact .cpick-body .dim { font-size: calc(15px * var(--ts, 1)); }
.cpick.compact .cpick-card { padding: 4px; gap: 4px; } .cpick.compact .btn { font-size: calc(8px * var(--ts, 1)); padding: 6px 2px; }
.tut-box.choose { max-width: none; }
.tut.portrait .tut-box.choose { top: 8px !important; bottom: auto !important; max-height: calc(100vh - 110px); overflow-y: auto; }
.tut.landscape .tut-box.choose { width: min(900px, 92vw) !important; left: 50% !important; right: auto !important; top: 50% !important; transform: translate(-50%, -50%) !important; max-height: 94vh; overflow-y: auto; flex-direction: row; }
@media (max-width: 480px) { .cpick { grid-template-columns: 1fr 1fr; } }

.tut.portrait .tut-box.choose { flex-direction: column; transform: none !important; }
.tut.portrait .tut-box.choose .tut-guide { display: none; }
.tut.portrait .tut-box.choose .cpick { grid-template-columns: 1fr 1fr; }
.tut-box.choose .cpick.compact .cpick-art canvas { width: 70%; height: 70%; }

/* Hero creator (js/creator.js) */
.cr-back { position: fixed; inset: 0; z-index: 880; display: flex; align-items: center; justify-content: center; padding: 10px; background: rgba(6, 4, 14, .82); }
.cr-panel { width: 100%; max-width: 860px; max-height: 96vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; background-color: rgba(23, 17, 44, .98); }
.cr-head h2 { margin: 0 0 2px; color: var(--accent); }
.cr-body { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 14px; align-items: start; }
.cr-stage { position: relative; aspect-ratio: 1; max-width: 100%; overflow: hidden; border: 6px solid transparent; border-image: var(--frm-gold) 8 / 6px stretch; background: var(--well); box-shadow: 4px 4px 0 #000; }
.cr-stage .scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.cr-stage canvas.creature { position: absolute; left: 10%; bottom: 6%; width: 80%; height: 80%; image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .5)); animation: bob 1.4s steps(2) infinite; }
.cr-name { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); padding: 0 8px; background: rgba(0, 0, 0, .7); font-family: var(--font-head); font-size: calc(9px * var(--ts, 1)); color: var(--accent); white-space: nowrap; }
.cr-controls { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cr-row { display: flex; flex-direction: column; gap: 4px; }
.cr-label { font-family: var(--font-head); font-size: calc(9px * var(--ts, 1)); color: var(--dim); }
.cr-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-chip { cursor: pointer; padding: 3px 8px; color: var(--text); font: inherit; font-size: calc(18px * var(--ts, 1)); }
.cr-chip.on { border-color: var(--accent); background: #ffd34d22; color: var(--accent); }
.cr-chip.locked { opacity: .55; }
.cr-sw { position: relative; width: 32px; height: 32px; padding: 0; cursor: pointer; border: 3px solid #000; box-shadow: 0 0 0 2px var(--line2); }
.cr-sw.on { box-shadow: 0 0 0 3px var(--accent), 0 0 10px var(--accent); }
.cr-sw.locked { opacity: .5; } .cr-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(13px * var(--ts, 1)); }
.cr-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.cr-done { animation: title-glow 1.6s steps(2) infinite; }
@media (max-width: 600px) { .cr-body { grid-template-columns: 1fr; } .cr-stage { max-width: 220px; margin: 0 auto; width: 100%; } .cr-foot .btn { flex: 1; } }
@media (orientation: landscape) and (max-height: 520px) { .cr-body { grid-template-columns: 200px 1fr; } .cr-panel { padding: 8px; } .cr-sw { width: 26px; height: 26px; } .cr-chip { font-size: calc(16px * var(--ts, 1)); padding: 2px 6px; } }
/* creator option groups fold open and shut (creator.js row) */
.cr-controls { max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.cr-row { border: 2px solid var(--line2); background: var(--bg2); }
.cr-fold { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; background: transparent; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.cr-fold:hover, .cr-fold:focus-visible { background: var(--panel2); }
.cr-fold.open { border-bottom: 2px solid var(--line2); }
.cr-fold .cr-label { color: var(--accent); }
.cr-caret { width: 1em; color: var(--accent); }
.cr-pick { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(18px * var(--ts, 1)); }
.cr-row > .cr-opts { padding: 8px 10px 10px; }
.cr-group { padding: 8px 10px 0; color: var(--accent2); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 600px) { .cr-controls { max-height: none; overflow: visible; } }
/* the hero preview stays in view while the options scroll (owner 2026-10-23); on phones the whole panel scrolls, so it sticks to its top */
.cr-stage { position: sticky; top: 0; z-index: 2; }
/* phones: a solid band the width of the panel behind the preview, so options scroll under it, not beside it */
@media (max-width: 600px) { .cr-stage { max-width: 170px; overflow: visible; box-shadow: 0 0 0 100vmax rgba(23, 17, 44, 1); clip-path: inset(-12px -100vmax -10px -100vmax); } .cr-body { gap: 14px; } }
