:root {
  --purple: #5b2bd9;
  --purple-dark: #3d1a9e;
  --yellow: #ffd23f;
  --yellow-dark: #e0a800;
  --pink: #ff4f9a;
  --green: #22c55e;
  --green-dark: #15803d;
  --red: #ff4d4d;
  --red-dark: #c62828;
  --ink: #2a1650;
  --muted: #6b5c8f;
  --card: rgba(255, 255, 255, 0.94);
  --mark: #ffd8b0;
  --radius: 22px;
  --font: 'Baloo 2', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fd3ff; font-family: var(--font); color: var(--ink); }
body { -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.hidden { display: none !important; }

.loading { position: fixed; inset: 0; display: grid; place-items: center; font-size: 28px; font-weight: 800; color: #fff; background: linear-gradient(#6ec6ff, #fff1c1); z-index: 50; text-shadow: 0 3px 0 var(--purple); }

.screen { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.screen > * { pointer-events: auto; }

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit; font-weight: 800; font-size: 18px; color: var(--ink);
  background: #fff; border: 0; border-radius: 16px; padding: 10px 18px; cursor: pointer;
  box-shadow: 0 5px 0 #c9bfe6; transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #c9bfe6; }
.btn.primary { background: var(--yellow); box-shadow: 0 5px 0 var(--yellow-dark); }
.btn.primary:active { box-shadow: 0 1px 0 var(--yellow-dark); }
.btn.danger { background: var(--red); color: #fff; box-shadow: 0 5px 0 var(--red-dark); }
.btn.ghost { background: #efe9ff; box-shadow: 0 5px 0 #cfc3f5; }
.btn.big { font-size: 22px; padding: 12px 26px; }
.btn.small { font-size: 15px; padding: 6px 12px; border-radius: 12px; box-shadow: 0 3px 0 #c9bfe6; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { font-family: inherit; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; font-size: 20px; cursor: pointer; box-shadow: 0 4px 0 #c9bfe6; flex: none; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c9bfe6; }
.mute { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 40; }
.link-btn { background: none; border: 0; font-family: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; }

.panel, .card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: 0 10px 0 rgba(61, 26, 158, .18), 0 20px 40px rgba(42, 22, 80, .18);
  border: 3px solid #fff;
}

/* ---------- Title ---------- */
.title-wrap { position: absolute; top: calc(20px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; pointer-events: none; }
.logo { margin: 0; font-size: clamp(44px, 8vw, 92px); line-height: 1; color: #fff; letter-spacing: 1px;
  text-shadow: 0 4px 0 var(--purple), 0 8px 0 var(--purple-dark), 0 14px 24px rgba(0,0,0,.25); animation: float 3s ease-in-out infinite; }
.logo .logo-q { color: var(--yellow); margin-left: 10px; }
.logo .br { color: var(--pink); }
.tagline { margin: 10px 0 0; font-size: clamp(16px, 2.4vw, 24px); font-weight: 700; color: var(--ink); background: rgba(255,255,255,.75); display: inline-block; padding: 4px 16px; border-radius: 99px; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-1deg); } }

.title-bottom { position: absolute; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(680px, calc(100% - 32px)); padding: 14px 18px 18px; text-align: center; }
.panel-title { margin: 0 0 8px; font-weight: 800; font-size: 20px; }
.panel-title small { font-weight: 500; color: var(--muted); font-size: 14px; }
.hero-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hero-card { font-family: inherit; border: 3px solid transparent; border-radius: 16px; background: #f5f1ff; padding: 8px 6px; cursor: pointer; font-size: 15px; color: var(--ink); transition: transform .15s; }
.hero-card .em { font-size: 30px; display: block; line-height: 1.1; }
.hero-card b { display: block; font-size: 19px; }
.hero-card.sel { border-color: var(--purple); background: #fff7d6; transform: translateY(-4px); }
.name-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; justify-content: center; font-weight: 700; }
.name-row input { font-family: inherit; font-size: 18px; padding: 6px 12px; border-radius: 12px; border: 3px solid #e3dbff; outline: none; width: 200px; user-select: text; -webkit-user-select: text; }
.name-row input:focus { border-color: var(--purple); }

/* ---------- Map ---------- */
.map-panel { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); width: min(520px, 46vw); padding: 16px 18px; max-height: calc(100vh - 40px); overflow: auto; }
.panel-heading { margin: 6px 0 10px; font-size: 26px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row-between.foot { margin-top: 10px; }
.total-stars { font-weight: 800; font-size: 18px; }
.level-cards { display: grid; gap: 12px; }
.level-card { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; border: 0; background: #fff; cursor: pointer; text-align: left; font-family: inherit; color: var(--ink);
  box-shadow: 0 5px 0 var(--c, #ccc); border-left: 8px solid var(--c, #ccc); transition: transform .12s; }
.level-card:hover { transform: translateY(-2px) scale(1.01); }
.level-card .lv-num { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--c); color: #fff; font-size: 30px; font-weight: 800; box-shadow: inset 0 -5px 0 rgba(0,0,0,.18); }
.level-card h3 { margin: 0; font-size: 21px; line-height: 1.1; }
.level-card p { margin: 2px 0 0; color: var(--muted); font-size: 15px; line-height: 1.2; }
.level-card .lv-side { text-align: right; font-size: 14px; color: var(--muted); }
.level-card .lv-stars { font-size: 20px; letter-spacing: 1px; }
.level-card.locked { filter: grayscale(.9); opacity: .65; cursor: not-allowed; }

/* ---------- HUD ---------- */
.hud { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 68px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hud-chip { background: #fff; border-radius: 99px; padding: 4px 14px; font-weight: 800; font-size: 18px; box-shadow: 0 4px 0 #c9bfe6; white-space: nowrap; }
.level-chip { background: var(--purple); color: #fff; box-shadow: 0 4px 0 var(--purple-dark); }
.streak.hot { background: #ffedd5; animation: pulse .6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.hud-progress { display: flex; gap: 4px; flex: 1; min-width: 120px; max-width: 360px; }
.hud-progress i { flex: 1; height: 12px; border-radius: 99px; background: rgba(255,255,255,.7); border: 2px solid #fff; }
.hud-progress i.ok { background: var(--green); }
.hud-progress i.bad { background: var(--red); }
.hud-progress i.now { background: var(--yellow); animation: pulse 1s infinite; }
.timer { position: relative; width: 56px; height: 56px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); background: #fff; border-radius: 50%; box-shadow: 0 4px 0 #c9bfe6; }
.timer circle { fill: none; stroke-width: 5; }
.timer .track { stroke: #eee; }
.timer .bar { stroke: var(--green); stroke-linecap: round; stroke-dasharray: 119.4; transition: stroke-dashoffset .25s linear, stroke .3s; }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 19px; }
.timer.warn .bar { stroke: #ff9800; }
.timer.danger .bar { stroke: var(--red); }
.timer.danger { animation: shake .4s infinite; }
@keyframes shake { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

.monster-hp { position: absolute; top: calc(80px + env(safe-area-inset-top)); left: 12px; width: min(300px, 44vw); background: rgba(255,255,255,.85); border-radius: 14px; padding: 4px 10px 8px; font-weight: 800; font-size: 15px; }
.hp-track { height: 14px; border-radius: 99px; background: #d9d2e6; overflow: hidden; border: 2px solid #fff; }
.hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff4d4d, #ff9a3d); transition: width .5s cubic-bezier(.3,1.6,.6,1); }

/* ---------- Question card ---------- */
#qCard { position: absolute; right: 20px; top: 50%; transform: translateY(-46%); width: min(560px, 46vw); max-height: calc(100vh - 130px); overflow: auto; padding: 16px 20px 20px; }
#qCard.pop { animation: pop .35s ease-out; }
@keyframes pop { from { transform: translateY(-46%) scale(.85); opacity: 0; } }
#qCard.shake { animation: cardShake .4s; }
@keyframes cardShake { 20%, 60% { margin-right: 10px; } 40%, 80% { margin-right: -10px; } }
.q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.q-num { background: var(--pink); color: #fff; font-weight: 800; padding: 2px 12px; border-radius: 99px; }
.q-label { font-weight: 800; flex: 1; font-size: 18px; line-height: 1.15; }
.hint { background: #fff7d6; box-shadow: 0 3px 0 #f0d77a; }
.hint-box { background: #fff7d6; border: 2px dashed #f0c419; border-radius: 14px; padding: 8px 12px; margin: 6px 0; font-weight: 700; }
.q-body .expr { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; text-align: center; padding: 10px 0; letter-spacing: .5px; white-space: nowrap; overflow-x: auto; }
.q-body .expr.small { font-size: clamp(19px, 2.4vw, 28px); }
.box { display: inline-grid; place-items: center; min-width: 1.8em; height: 1.25em; border: 3px solid var(--purple); border-radius: 10px; color: var(--purple); background: #f5f1ff; padding: 0 .2em; }
.circle { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; border-radius: 50%; border: 3px solid var(--purple); color: var(--purple); background: #f5f1ff; }
.story { font-size: clamp(18px, 1.9vw, 22px); line-height: 1.4; margin: 4px 0 8px; font-weight: 600; }
.story-icon { font-size: 40px; float: left; margin: 0 10px 0 0; line-height: 1; }
.step-label { font-weight: 800; color: var(--purple); margin: 10px 0 6px; font-size: 17px; }
.step-label .done { color: var(--green-dark); }

.answer-row { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 30px; font-weight: 800; margin: 8px 0; }
.answer-display { min-width: 180px; height: 58px; border-radius: 16px; border: 4px solid var(--purple); background: #fff; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: var(--ink); padding: 0 12px; }
.answer-display.empty::after { content: '?'; color: #c9bfe6; }
.answer-display.blink { animation: blink 1s infinite; }
@keyframes blink { 50% { border-color: #b79bff; } }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 360px; margin: 6px auto 0; }
.keypad button { font-family: inherit; font-size: 24px; font-weight: 800; padding: 6px 0; border-radius: 14px; border: 0; background: #f2edff; color: var(--ink); box-shadow: 0 4px 0 #cfc3f5; cursor: pointer; }
.keypad button:active { transform: translateY(3px); box-shadow: 0 1px 0 #cfc3f5; }
.keypad .go { grid-row: span 2; background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-dark); font-size: 20px; }
.keypad .del { background: #ffe4e4; box-shadow: 0 4px 0 #f3b5b5; }
.keypad .zero { grid-column: span 2; }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.choices.wide { grid-template-columns: 1fr 1fr; }
.choice { font-family: inherit; font-size: 22px; font-weight: 800; padding: 12px 10px; border-radius: 16px; border: 3px solid #e3dbff; background: #fff; color: var(--ink); cursor: pointer; box-shadow: 0 5px 0 #e3dbff; transition: transform .1s; }
.choice:hover { transform: translateY(-2px); border-color: var(--purple); }
.choice.right { background: #dcfce7; border-color: var(--green); }
.choice.wrongpick { background: #ffe4e4; border-color: var(--red); }
.choice:disabled { cursor: default; transform: none; }

.built-expr { min-height: 58px; border-radius: 16px; border: 4px dashed #b79bff; background: #faf8ff; padding: 6px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 26px; font-weight: 800; }
.built-expr .ph { color: #b9add9; font-size: 17px; font-weight: 600; }
.tok { padding: 0 6px; border-radius: 8px; background: #efe9ff; animation: pop2 .2s; }
.tok.op { background: #ffe9d6; }
.tok.br { background: #ffd6ea; color: var(--pink); }
@keyframes pop2 { from { transform: scale(.4); } }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; }
.tile { font-family: inherit; font-size: 22px; font-weight: 800; min-width: 54px; padding: 6px 12px; border-radius: 14px; border: 0; cursor: pointer; background: #efe9ff; color: var(--ink); box-shadow: 0 4px 0 #cfc3f5; }
.tile.op { background: #ffe9d6; box-shadow: 0 4px 0 #f5c79f; }
.tile.br { background: #ffd6ea; box-shadow: 0 4px 0 #f5a8cb; color: var(--pink); }
.tile.ctl { background: #eee; box-shadow: 0 4px 0 #ccc; font-size: 17px; }
.tile:active { transform: translateY(3px); box-shadow: none; }
.expr-chosen { text-align: center; font-size: 26px; font-weight: 800; background: #f5f1ff; border-radius: 14px; padding: 6px; margin-bottom: 4px; }
.mini-msg { text-align: center; font-weight: 700; color: var(--red-dark); min-height: 1.3em; }

/* ---------- Feedback ---------- */
.feedback { margin-top: 12px; border-radius: 18px; padding: 12px 14px; background: #f0fdf4; border: 3px solid var(--green); animation: fbIn .35s ease-out; text-align: center; }
@keyframes fbIn { from { transform: translateY(16px) scale(.94); opacity: 0; } }
#qCard.answered .keypad, #qCard.answered .tiles, #qCard.answered #checkExpr { display: none; }
.feedback.bad { background: #fff1f1; border-color: var(--red); }
.fb-top { display: flex; align-items: center; gap: 12px; justify-content: center; text-align: left; }
.fb-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; color: #fff; background: var(--green); font-weight: 800; flex: none; }
.feedback.bad .fb-icon { background: var(--red); }
.fb-title { font-size: 26px; font-weight: 800; line-height: 1.1; }
.fb-points { font-weight: 700; color: var(--muted); }
.steps { text-align: left; background: #fff; border-radius: 14px; padding: 8px 14px; margin: 10px 0 12px; font-size: 21px; font-weight: 700; line-height: 1.55; }
.steps .lbl { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
mark { background: var(--mark); border-radius: 6px; padding: 0 3px; color: inherit; }

.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-size: 160px; font-weight: 800; color: #fff; text-shadow: 0 8px 0 var(--purple), 0 16px 30px rgba(0,0,0,.3); pointer-events: none; z-index: 30; }
.countdown.go { animation: zoom .7s ease-out; }
@keyframes zoom { from { transform: scale(2.2); opacity: 0; } }

/* ---------- Results ---------- */
.result-card { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); width: min(520px, 46vw); padding: 18px 22px; text-align: center; max-height: calc(100vh - 40px); overflow: auto; }
.result-card h2 { margin: 0; font-size: 34px; }
.res-stars { font-size: 60px; letter-spacing: 6px; margin: 4px 0; }
.res-stars span { display: inline-block; animation: starIn .5s both cubic-bezier(.3,1.8,.5,1); }
.res-stars span.off { filter: grayscale(1); opacity: .3; }
@keyframes starIn { from { transform: scale(0) rotate(-180deg); } }
.res-msg { margin: 0 0 10px; font-size: 18px; font-weight: 700; color: var(--muted); }
.res-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.res-stats div { background: #f5f1ff; border-radius: 14px; padding: 6px; }
.res-stats span { display: block; font-size: 14px; color: var(--muted); font-weight: 700; }
.res-stats b { font-size: 24px; }
.review { text-align: left; margin: 12px 0; background: #faf8ff; border-radius: 14px; padding: 8px 12px; }
.review summary { font-weight: 800; cursor: pointer; }
.review ol { padding-left: 22px; margin: 8px 0 0; }
.review li { margin: 6px 0; font-size: 16px; }
.review li .ok { color: var(--green-dark); font-weight: 800; }
.review li .no { color: var(--red-dark); font-weight: 800; }
.res-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(42, 22, 80, .45); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal-card { width: min(560px, 100%); padding: 18px 22px; max-height: calc(100vh - 32px); overflow: auto; }
.modal-card.small { width: min(400px, 100%); text-align: center; }
.modal-card h2 { margin: 0 0 6px; }
.how { padding-left: 4px; list-style: none; font-size: 17px; line-height: 1.45; }
ol.how { padding-left: 24px; list-style: decimal; }
.how li { margin: 6px 0; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: #fff; font-size: 22px; z-index: 99; }

/* ---------- Portrait / narrow screens: card at the bottom ---------- */
@media (max-width: 899px), (orientation: portrait) {
  #qCard { left: 50%; right: auto; top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: calc(100% - 20px); max-height: 60vh; padding: 12px 14px 14px; }
  @keyframes pop { from { transform: translateX(-50%) scale(.85); opacity: 0; } }
  .map-panel, .result-card { left: 50%; right: auto; top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: calc(100% - 20px); max-height: 62vh; }
  .monster-hp { top: calc(150px + env(safe-area-inset-top)); }
  .choices.wide .choice { font-size: 18px; padding: 10px 6px; }
  .hud { right: 64px; }
  .hud-progress { order: 10; flex-basis: 100%; max-width: none; }
  .res-stars { font-size: 44px; }
  .title-wrap { top: calc(62px + env(safe-area-inset-top)); }
  .hero-card { padding: 6px 4px; font-size: 13px; }
  .res-stats b { font-size: 20px; }
  .keypad button { padding: 4px 0; font-size: 22px; }
  .answer-display { height: 50px; font-size: 30px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .title-wrap { top: 6px; }
  .logo { font-size: 40px; }
  .title-bottom { padding: 8px 12px 10px; }
  .hero-card .em { font-size: 22px; }
}

.star { width: 1em; height: 1em; vertical-align: -0.12em; }
.lv-stars span.off, .res-stars span.off { filter: grayscale(1); opacity: .3; }

/* Retries and overtime */
.hud-progress i.ok2 { background: #a3e635; }
.try-msg { border-radius: 14px; padding: 8px 12px; margin: 6px 0; font-weight: 700; font-size: 17px; animation: fbIn .3s ease-out; }
.try-msg.bad { background: #fff1f1; border: 2px solid #ffb4b4; color: var(--red-dark); }
.try-msg.warn { background: #fff4e0; border: 2px solid #ffc46b; color: #9a4b00; }
.try-msg.good { background: #f0fdf4; border: 2px solid #86efac; color: var(--green-dark); }
.giveup-row { text-align: center; margin-top: 8px; }
.timer.over svg { background: #fff4e0; }
.timer.over .bar { stroke: #ff9800; }
.q-body .sub { text-align: center; margin: 0 0 4px; color: var(--muted); font-weight: 700; }
.choices.wide .choice { font-size: 19px; }

/* ---------- Loading ---------- */
.load-box { text-align: center; width: min(360px, 80vw); }
.load-title { font-size: 46px; color: #fff; text-shadow: 0 4px 0 var(--purple); margin-bottom: 10px; }
.load-bar { height: 18px; border-radius: 99px; background: rgba(255,255,255,.6); border: 3px solid #fff; overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--yellow), var(--pink)); transition: width .3s; }
#loadText { font-size: 18px; margin-top: 8px; color: var(--ink); text-shadow: none; }

/* ---------- Intro ---------- */
#screen-intro { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: calc(7vh + env(safe-area-inset-top)); cursor: pointer; pointer-events: auto; }
.intro-logo { font-size: clamp(54px, 11vw, 120px); font-weight: 800; line-height: 1; white-space: nowrap; }
.intro-logo span { display: inline-block; color: #fff; text-shadow: 0 5px 0 var(--purple), 0 10px 0 var(--purple-dark), 0 16px 30px rgba(0,0,0,.3);
  animation: letterIn .7s cubic-bezier(.3,1.7,.5,1) both, wobble 2.4s ease-in-out infinite; }
.intro-logo span.y { color: var(--yellow); }
.intro-logo span.p { color: var(--pink); }
@keyframes letterIn { from { transform: translateY(-120vh) rotate(-30deg); } }
@keyframes wobble { 50% { transform: translateY(-6px) rotate(3deg); } }
.intro-sub { font-size: clamp(18px, 2.6vw, 26px); font-weight: 700; background: rgba(255,255,255,.8); padding: 4px 18px; border-radius: 99px; animation: fadeUp .6s 2.6s both; }
.intro-go { margin-top: auto; margin-bottom: calc(12vh + env(safe-area-inset-bottom)); animation: fadeUp .6s 3.4s both, pulse 1.2s 4s ease-in-out infinite; font-size: 28px; padding: 14px 34px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } }

/* ---------- Level cinematic ---------- */
.cine { position: fixed; inset: 0; z-index: 45; pointer-events: auto; cursor: pointer; }
.cine .bar { position: absolute; left: 0; right: 0; height: 11vh; background: #120a26; transition: transform .5s ease; }
.cine .bar.top { top: 0; transform: translateY(-100%); }
.cine .bar.bottom { bottom: 0; transform: translateY(100%); }
.cine.on .bar { transform: none; }
.cine-card { position: absolute; left: 50%; top: 16vh; transform: translateX(-50%); text-align: center; color: #fff; opacity: 0; }
.cine-card small { display: block; font-size: 22px; letter-spacing: 6px; font-weight: 800; color: var(--yellow); }
.cine-card b { font-size: clamp(36px, 6vw, 64px); text-shadow: 0 4px 0 var(--purple), 0 10px 24px rgba(0,0,0,.4); white-space: nowrap; }
.cine.on .cine-card { animation: cardIn 2.2s .2s both; }
@keyframes cardIn { 0% { opacity: 0; transform: translateX(-50%) scale(.6); } 15% { opacity: 1; transform: translateX(-50%) scale(1.05); } 25% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-20px); } }
.cine-monster { position: absolute; left: 50%; bottom: 15vh; transform: translateX(-50%); background: #fff; color: var(--ink); font-size: clamp(20px, 3vw, 30px); font-weight: 800; padding: 8px 22px; border-radius: 99px; box-shadow: 0 6px 0 var(--pink); white-space: nowrap; opacity: 0; }
.cine-monster b { color: var(--pink); }
.cine.on .cine-monster { animation: monIn 1.6s 2.1s both; }
@keyframes monIn { 0% { opacity: 0; transform: translateX(-50%) scale(.3) rotate(-8deg); } 20% { opacity: 1; transform: translateX(-50%) scale(1.1) rotate(2deg); } 30% { transform: translateX(-50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
.cine-skip { position: absolute; right: 16px; bottom: calc(11vh + 12px); font-family: inherit; font-weight: 800; font-size: 16px; border: 0; border-radius: 99px; padding: 6px 14px; background: rgba(255,255,255,.85); cursor: pointer; }

/* ---------- In-game banners ---------- */
.banner { position: fixed; left: 50%; top: 22vh; z-index: 35; transform: translateX(-50%); pointer-events: none; font-size: clamp(26px, 4.5vw, 46px); font-weight: 800; color: #fff; white-space: nowrap;
  text-shadow: 0 4px 0 var(--purple), 0 8px 18px rgba(0,0,0,.35); animation: bannerIn 1.9s both; }
.banner.hot { color: var(--yellow); text-shadow: 0 4px 0 #d84315, 0 8px 18px rgba(0,0,0,.35); }
.banner.danger { color: #ffcdd2; text-shadow: 0 4px 0 #b71c1c, 0 8px 18px rgba(0,0,0,.35); }
@keyframes bannerIn { 0% { opacity: 0; transform: translateX(-50%) scale(.3) rotate(-6deg); } 15% { opacity: 1; transform: translateX(-50%) scale(1.15) rotate(2deg); } 25% { transform: translateX(-50%) scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-30px); } }
#screen-game.cine-mode .hud, #screen-game.cine-mode .monster-hp { opacity: 0; }
.hud, .monster-hp { transition: opacity .4s; }
@media (min-width: 900px) and (orientation: landscape) { .banner { left: 27%; } }
.pw-input { font-family: inherit; font-size: 20px; width: 100%; padding: 8px 12px; border-radius: 12px; border: 3px solid #e3dbff; outline: none; margin: 6px 0; user-select: text; -webkit-user-select: text; }
.pw-input:focus { border-color: var(--purple); }
