/* ==========================================================
   MELDout — UI styles (Game by MELD)
   ========================================================== */
:root {
  --cyan: #19f0ff; --magenta: #ff2fb9; --violet: #7a5cff; --lime: #3bff8a; --gold: #ffd23b; --red: #ff3b5c;
  --bg: #08051a; --ink: #eef3ff; --muted: #9aa6d4;
  --glass: rgba(18, 12, 48, 0.62); --glass-2: rgba(30, 20, 70, 0.55); --line: rgba(120, 140, 255, 0.22);
  --font-d: 'Orbitron', 'Segoe UI', Arial, sans-serif; --font-b: 'Rajdhani', 'Segoe UI', Arial, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; }
body { font-family: var(--font-b); font-size: 18px; line-height: 1.35; position: fixed; inset: 0; width: 100%; height: 100dvh; touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; touch-action: none; }
#ui { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
button { font-family: inherit; color: inherit; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; pointer-events: auto; }
.screen.active { display: flex; animation: screenIn .45s cubic-bezier(.2,.9,.3,1.2) both; }
.screen.leaving { animation: screenOut .25s ease-in both; }
@keyframes screenIn { from { opacity: 0; transform: scale(.96) translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes screenOut { to { opacity: 0; transform: scale(1.03); filter: blur(4px); } }
#s-game { pointer-events: none; }

.anim-in { opacity: 0; animation: riseIn .7s cubic-bezier(.2,.9,.3,1.15) forwards; animation-delay: calc(var(--d, 0) * 90ms + 120ms); }
@keyframes riseIn { from { opacity: 0; transform: translateY(26px) scale(.96); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.anim-in[data-delay="0"] { --d: 0 } .anim-in[data-delay="1"] { --d: 1 } .anim-in[data-delay="2"] { --d: 2 } .anim-in[data-delay="3"] { --d: 3 }
.anim-in[data-delay="4"] { --d: 4 } .anim-in[data-delay="5"] { --d: 5 } .anim-in[data-delay="6"] { --d: 6 } .anim-in[data-delay="7"] { --d: 7 } .anim-in[data-delay="8"] { --d: 8 }

/* ---------- boot ---------- */
.boot { margin: auto; text-align: center; width: min(80vw, 480px); }
.boot-logo img, .boot-logo svg { width: 100%; height: auto; filter: drop-shadow(0 0 30px rgba(25,240,255,.35)); }
.boot-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; margin: 22px auto 14px; width: 70%; }
.boot-bar i { display: block; height: 100%; width: 40%; border-radius: 3px; background: linear-gradient(90deg, var(--cyan), var(--magenta)); animation: bootBar 1.1s ease-in-out infinite; box-shadow: 0 0 14px var(--cyan); }
@keyframes bootBar { 0% { transform: translateX(-120%); } 100% { transform: translateX(300%); } }
.boot-txt { font-family: var(--font-d); letter-spacing: .3em; font-size: 12px; color: var(--muted); }

/* ---------- title ---------- */
#s-title { justify-content: center; align-items: center; padding: calc(var(--sat) + 16px) 20px calc(var(--sab) + 16px); }
.title-wrap { width: min(92vw, 560px); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.logo-hero { width: 100%; animation: riseIn .9s cubic-bezier(.2,.9,.3,1.15) forwards, logoFloat 6s ease-in-out 1s infinite; }
.logo-hero svg { width: 100%; height: auto; filter: drop-shadow(0 0 28px rgba(25,240,255,.45)) drop-shadow(0 0 60px rgba(255,47,185,.25)); animation: logoGlow 3.2s ease-in-out infinite alternate; }
@keyframes logoFloat { 0%,100% { transform: translateY(0) rotate(-.4deg); } 50% { transform: translateY(-10px) rotate(.4deg); } }
@keyframes logoGlow { from { filter: drop-shadow(0 0 22px rgba(25,240,255,.35)) drop-shadow(0 0 50px rgba(255,47,185,.18)); } to { filter: drop-shadow(0 0 40px rgba(25,240,255,.7)) drop-shadow(0 0 90px rgba(255,47,185,.45)); } }
.logo-hero .logo-ball { animation: ballBob 2.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes ballBob { 0%,100% { transform: translate(0,0); } 50% { transform: translate(6px,-8px); } }
.tagline { font-family: var(--font-d); font-weight: 700; letter-spacing: .42em; font-size: clamp(10px, 2.6vw, 14px); color: var(--cyan); text-shadow: 0 0 14px rgba(25,240,255,.8); margin: -6px 0 18px; padding-left: .42em; text-align: center; }

.menu { display: flex; flex-direction: column; gap: 12px; width: min(100%, 380px); }
.btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 22px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(40,30,90,.7), rgba(18,12,48,.7)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-family: var(--font-d); font-weight: 700; font-size: 15px; letter-spacing: .16em; cursor: pointer; overflow: hidden; isolation: isolate;
  transition: transform .15s ease, box-shadow .25s ease, border-color .25s ease; box-shadow: 0 8px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08); text-transform: uppercase; }
.btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.14) 50%, transparent 70%); transform: translateX(-120%); transition: transform .6s ease; z-index: -1; }
.btn:hover::before, .btn:focus-visible::before { transform: translateX(120%); }
.btn:hover, .btn:focus-visible { transform: translateY(-2px); border-color: rgba(25,240,255,.7); box-shadow: 0 0 24px rgba(25,240,255,.35), 0 10px 36px rgba(0,0,0,.4); outline: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, rgba(25,240,255,.28), rgba(255,47,185,.28)); border-color: rgba(25,240,255,.6); box-shadow: 0 0 30px rgba(25,240,255,.3), 0 10px 30px rgba(0,0,0,.4); animation: primaryPulse 2.4s ease-in-out infinite; }
.btn-primary.anim-in { animation: riseIn .7s cubic-bezier(.2,.9,.3,1.15) forwards, primaryPulse 2.4s ease-in-out .9s infinite; }
@keyframes primaryPulse { 0%,100% { box-shadow: 0 0 22px rgba(25,240,255,.25), 0 10px 30px rgba(0,0,0,.4); } 50% { box-shadow: 0 0 44px rgba(25,240,255,.55), 0 0 80px rgba(255,47,185,.25), 0 10px 30px rgba(0,0,0,.4); } }
.btn-danger { border-color: rgba(255,59,92,.6); background: linear-gradient(135deg, rgba(255,59,92,.3), rgba(120,10,40,.5)); }
.btn-danger:hover { border-color: var(--red); box-shadow: 0 0 24px rgba(255,59,92,.45); }
.btn-small { padding: 9px 14px; font-size: 12px; border-radius: 10px; }
.btn-icon { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(255,255,255,.08); font-size: 14px; color: var(--cyan); }
.btn small { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-family: var(--font-b); letter-spacing: .05em; font-size: 12px; color: rgba(255,255,255,.7); text-transform: none; font-weight: 600; }
.title-stats { margin-top: 16px; display: flex; gap: 14px; align-items: center; font-family: var(--font-d); font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.title-stats b { color: var(--gold); text-shadow: 0 0 10px rgba(255,210,59,.6); }
.title-stats .sep { width: 1px; height: 14px; background: var(--line); }
.credit { position: absolute; bottom: calc(var(--sab) + 14px); left: 0; right: 0; text-align: center; font-family: var(--font-d); font-size: 11px; letter-spacing: .3em; color: var(--muted); }
.credit b, .credit-inline b { color: #fff; text-shadow: 0 0 12px var(--cyan); }
.credit-inline { text-align: center; font-family: var(--font-d); font-size: 11px; letter-spacing: .3em; color: var(--muted); margin: 24px 0 8px; }

/* ---------- sub-screens ---------- */
.sc-head { display: grid; grid-template-columns: 52px 1fr 60px; align-items: center; gap: 10px; padding: calc(var(--sat) + 12px) calc(var(--sar) + 14px) 12px calc(var(--sal) + 14px);
  background: linear-gradient(180deg, rgba(8,5,26,.95), rgba(8,5,26,.6) 80%, transparent); position: relative; z-index: 2; }
.sc-head h1 { margin: 0; text-align: center; font-family: var(--font-d); font-weight: 900; font-size: clamp(16px, 4vw, 22px); letter-spacing: .28em; padding-left: .28em; background: linear-gradient(90deg, #fff, var(--cyan), var(--magenta)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 14px rgba(25,240,255,.35)); }
.head-stat { text-align: right; font-family: var(--font-d); font-size: 13px; color: var(--gold); text-shadow: 0 0 10px rgba(255,210,59,.6); }
.btn-back { width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); font-size: 30px; line-height: 1; padding: 0 0 4px; cursor: pointer; color: var(--cyan); transition: all .2s; }
.btn-back:hover { border-color: var(--cyan); box-shadow: 0 0 18px rgba(25,240,255,.4); }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 4px calc(var(--sar) + 16px) calc(var(--sab) + 30px) calc(var(--sal) + 16px); }
.scroll::-webkit-scrollbar { width: 6px; } .scroll::-webkit-scrollbar-thumb { background: rgba(25,240,255,.3); border-radius: 3px; }
.card { background: var(--glass); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; margin: 0 auto 14px; max-width: 720px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 10px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06); animation: riseIn .6s cubic-bezier(.2,.9,.3,1.15) both; }
.card:nth-child(2) { animation-delay: .06s } .card:nth-child(3) { animation-delay: .12s } .card:nth-child(4) { animation-delay: .18s } .card:nth-child(5) { animation-delay: .24s }
.card h2 { margin: 0 0 10px; font-family: var(--font-d); font-size: 13px; letter-spacing: .3em; color: var(--cyan); text-shadow: 0 0 12px rgba(25,240,255,.6); }
.card h2.danger { color: var(--red); text-shadow: 0 0 12px rgba(255,59,92,.6); margin-top: 18px; }
.card p { margin: 0 0 8px; color: #dbe3ff; }
.card p.muted, .hint { color: var(--muted); font-size: 15px; }
.hero-card { background: linear-gradient(135deg, rgba(25,240,255,.14), rgba(255,47,185,.12)), var(--glass); }
.hero-card p { font-size: 19px; }
kbd { display: inline-block; padding: 1px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); font-family: var(--font-d); font-size: 11px; letter-spacing: .05em; box-shadow: 0 2px 0 rgba(0,0,0,.4); vertical-align: middle; margin-right: 2px; color: #fff; }
.ctl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ctl { background: rgba(255,255,255,.04); border-radius: 14px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.06); }
.ctl-ico { font-size: 28px; }
.ctl h3 { margin: 4px 0 6px; font-family: var(--font-d); font-size: 13px; letter-spacing: .18em; color: #fff; }
.ctl ul, ul.plain { margin: 0; padding-left: 18px; color: #dbe3ff; }
.ctl li, ul.plain li { margin: 5px 0; }
.brick-list, .pw-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 18px; }
.brick-row, .pw-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.brick-row small, .pw-row small { display: block; color: var(--muted); font-size: 14px; line-height: 1.25; }
.bk { flex: 0 0 auto; width: 54px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-d); font-weight: 900; font-size: 14px; color: #111; border: 1px solid rgba(255,255,255,.7); background: linear-gradient(180deg, #fff 0%, var(--c) 45%, color-mix(in srgb, var(--c) 60%, #000) 100%); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent); }
.bk-1 { --c: #19f0ff; } .bk-2 { --c: #7a5cff; background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(0,0,0,.25) 8px 12px), linear-gradient(180deg, #fff 0%, var(--c) 45%, #3a2a80 100%); }
.bk-3 { --c: #ff2fb9; background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(0,0,0,.35) 8px 12px), linear-gradient(180deg, #fff 0%, var(--c) 45%, #801660 100%); }
.bk-s { --c: #aab4c3; background: linear-gradient(135deg, #7d8794, #c9d2dc 35%, #8a94a1 50%, #b4bcc7 80%, #5f6874); }
.bk-x { --c: #ff7a1a; color: #fff; } .bk-q { --c: #ffffff; animation: hueSpin 3s linear infinite; } .bk-g { --c: #ffc93b; }
@keyframes hueSpin { to { filter: hue-rotate(360deg); } }
.pw-cap { flex: 0 0 auto; width: 58px; height: 28px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-d); font-weight: 900; font-size: 12px; color: #0b0b1a; background: linear-gradient(180deg, #fff, var(--c) 50%, color-mix(in srgb, var(--c) 55%, #000)); border: 2px solid #fff; box-shadow: 0 0 16px color-mix(in srgb, var(--c) 70%, transparent); }

/* ---------- levels ---------- */
.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-width: 900px; margin: 0 auto; }
.lvl { position: relative; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(12px); padding: 12px 12px 10px; text-align: left; cursor: pointer; min-height: 108px; display: flex; flex-direction: column; justify-content: space-between; transition: transform .15s, box-shadow .25s, border-color .25s; animation: riseIn .5s cubic-bezier(.2,.9,.3,1.15) both; animation-delay: calc(var(--i) * 25ms); overflow: hidden; }
.lvl::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120px 60px at 100% 0%, var(--c, var(--cyan)) 0%, transparent 70%); opacity: .18; pointer-events: none; }
.lvl:hover, .lvl:focus-visible { transform: translateY(-3px); border-color: var(--c, var(--cyan)); box-shadow: 0 0 22px color-mix(in srgb, var(--c, var(--cyan)) 45%, transparent); outline: none; }
.lvl .num { font-family: var(--font-d); font-size: 26px; font-weight: 900; color: var(--c, var(--cyan)); text-shadow: 0 0 12px color-mix(in srgb, var(--c, var(--cyan)) 70%, transparent); line-height: 1; }
.lvl .name { font-family: var(--font-d); font-size: 11px; letter-spacing: .08em; font-weight: 700; margin-top: 8px; color: #fff; }
.lvl .sub { font-size: 13px; color: var(--muted); line-height: 1.2; }
.lvl .st { font-size: 14px; letter-spacing: 2px; color: var(--gold); margin-top: 6px; text-shadow: 0 0 8px rgba(255,210,59,.6); }
.lvl .st.none { color: rgba(255,255,255,.18); text-shadow: none; }
.lvl .best { font-size: 12px; color: var(--muted); }
.lvl.locked { opacity: .45; filter: grayscale(.6); cursor: not-allowed; }
.lvl.locked .name::after { content: ' 🔒'; }
.lvl.current { border-color: var(--c, var(--cyan)); animation: riseIn .5s both, lvlPulse 2s ease-in-out infinite; }
@keyframes lvlPulse { 0%,100% { box-shadow: 0 0 12px color-mix(in srgb, var(--c, var(--cyan)) 30%, transparent); } 50% { box-shadow: 0 0 30px color-mix(in srgb, var(--c, var(--cyan)) 70%, transparent); } }

/* ---------- settings ---------- */
.settings .row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.06); flex-wrap: wrap; }
.settings .row:first-of-type { border-top: 0; }
.settings .row > span { font-weight: 600; font-size: 17px; }
.settings .val { font-family: var(--font-d); font-size: 12px; min-width: 44px; text-align: right; color: var(--cyan); }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; min-width: 120px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--cyan) var(--p, 50%), rgba(255,255,255,.12) var(--p, 50%)); outline: none; pointer-events: auto; touch-action: pan-x; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 0 14px var(--cyan); border: 2px solid var(--cyan); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 0 14px var(--cyan); border: 2px solid var(--cyan); cursor: pointer; }
.seg { display: inline-flex; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: rgba(0,0,0,.3); }
.seg button { border: 0; background: transparent; padding: 9px 12px; font-family: var(--font-d); font-size: 11px; letter-spacing: .1em; cursor: pointer; color: var(--muted); transition: all .2s; }
.seg button.on { background: linear-gradient(135deg, rgba(25,240,255,.4), rgba(122,92,255,.4)); color: #fff; text-shadow: 0 0 8px var(--cyan); }
.toggle { width: 58px; height: 32px; border-radius: 16px; border: 1px solid var(--line); background: rgba(0,0,0,.35); position: relative; cursor: pointer; transition: all .25s; padding: 0; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #666; transition: all .25s; }
.toggle.on { background: rgba(25,240,255,.3); border-color: var(--cyan); box-shadow: 0 0 14px rgba(25,240,255,.4); }
.toggle.on::after { left: 29px; background: #fff; box-shadow: 0 0 10px var(--cyan); }

/* ---------- scores ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; max-width: 720px; margin: 0 auto 14px; }
.tile { background: linear-gradient(135deg, rgba(25,240,255,.14), rgba(122,92,255,.14)), var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 14px; text-align: center; animation: riseIn .5s both; }
.tile small { display: block; font-family: var(--font-d); font-size: 10px; letter-spacing: .2em; color: var(--muted); }
.tile b { display: block; font-family: var(--font-d); font-size: 26px; margin-top: 4px; color: #fff; text-shadow: 0 0 14px var(--cyan); }
.runs { margin: 0; padding-left: 26px; }
.runs li { padding: 6px 0; border-top: 1px solid rgba(255,255,255,.06); display: flex; justify-content: space-between; }
.runs li:first-child { border-top: 0; } .runs b { font-family: var(--font-d); color: var(--gold); }
.runs li:first-child b { text-shadow: 0 0 10px rgba(255,210,59,.7); }
.lvl-scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 18px; }
.lvl-scores div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 15px; }
.lvl-scores div b { font-family: var(--font-d); font-size: 12px; color: var(--cyan); }
.lvl-scores div i { color: var(--gold); font-style: normal; margin-left: 8px; font-size: 12px; }
.empty { color: var(--muted); font-style: italic; }

/* ---------- in-game overlay ---------- */
.pause-btn { position: absolute; top: calc(var(--sat) + 10px); right: calc(var(--sar) + 10px); width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); color: #fff; font-size: 14px; cursor: pointer; pointer-events: auto; transition: all .2s; z-index: 5; }
.pause-btn:hover { border-color: var(--cyan); box-shadow: 0 0 16px rgba(25,240,255,.4); }
.tap-hint { position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 16%); text-align: center; pointer-events: none; opacity: 0; transition: opacity .3s; }
.tap-hint.show { opacity: 1; }
.tap-hint span { display: inline-block; font-family: var(--font-d); font-size: clamp(11px, 2.6vw, 14px); letter-spacing: .3em; padding: 10px 18px; border-radius: 12px; background: rgba(8,5,26,.6); border: 1px solid var(--line); color: var(--cyan); animation: blink 1.4s ease-in-out infinite; backdrop-filter: blur(8px); }
@keyframes blink { 0%,100% { opacity: .55; } 50% { opacity: 1; text-shadow: 0 0 14px var(--cyan); } }

/* ---------- modals ---------- */
.modal { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at 50% 40%, rgba(25,240,255,.10), rgba(4,2,14,.78) 70%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: auto; z-index: 20; }
.modal.show { display: flex; animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box { width: min(92vw, 420px); background: linear-gradient(160deg, rgba(40,28,96,.92), rgba(12,8,36,.94)); border: 1px solid rgba(25,240,255,.35); border-radius: 24px; padding: 26px 24px calc(22px + var(--sab) * 0); text-align: center; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 0 60px rgba(25,240,255,.18), 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.1); animation: popIn .45s cubic-bezier(.2,.9,.3,1.3) both; max-height: calc(100dvh - 40px); overflow-y: auto; }
@keyframes popIn { from { opacity: 0; transform: scale(.8) translateY(30px); } to { opacity: 1; transform: none; } }
.modal-box h2 { margin: 0; font-family: var(--font-d); font-size: clamp(20px, 5.5vw, 28px); font-weight: 900; letter-spacing: .12em; background: linear-gradient(90deg, #fff, var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(25,240,255,.5)); }
.modal-kicker { margin: 0; font-family: var(--font-d); font-size: 11px; letter-spacing: .35em; color: var(--lime); text-shadow: 0 0 12px rgba(59,255,138,.7); }
.modal-kicker.danger { color: var(--red); text-shadow: 0 0 12px rgba(255,59,92,.8); }
.modal-sub { margin: 0 0 4px; color: var(--muted); font-size: 15px; }
.modal-sub code { color: var(--red); font-family: monospace; }
.stars { display: flex; justify-content: center; gap: 10px; font-size: 40px; margin: 4px 0; }
.stars i { font-style: normal; color: rgba(255,255,255,.15); transform: scale(.6); transition: none; }
.stars i::before { content: '★'; }
.stars i.on { color: var(--gold); text-shadow: 0 0 22px rgba(255,210,59,.9), 0 0 40px rgba(255,150,0,.5); animation: starPop .5s cubic-bezier(.2,.9,.3,1.6) both; }
.stars i.on:nth-child(2) { animation-delay: .25s } .stars i.on:nth-child(3) { animation-delay: .5s }
@keyframes starPop { 0% { transform: scale(0) rotate(-90deg); opacity: 0; } 60% { transform: scale(1.35) rotate(8deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.breakdown { display: flex; flex-direction: column; gap: 4px; background: rgba(0,0,0,.28); border-radius: 14px; padding: 10px 14px; margin: 4px 0; }
.breakdown div { display: flex; justify-content: space-between; font-size: 15px; color: var(--muted); }
.breakdown div b { font-family: var(--font-d); color: #fff; font-size: 14px; }
.breakdown .total { border-top: 1px solid rgba(255,255,255,.12); margin-top: 4px; padding-top: 6px; color: #fff; font-family: var(--font-d); font-size: 12px; letter-spacing: .2em; }
.breakdown .total b { color: var(--gold); font-size: 20px; text-shadow: 0 0 14px rgba(255,210,59,.7); }

.toast { position: absolute; left: 50%; bottom: calc(var(--sab) + 30px); transform: translateX(-50%) translateY(20px); background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 10px 18px; font-size: 15px; opacity: 0; transition: all .3s; pointer-events: none; backdrop-filter: blur(10px); max-width: 90vw; text-align: center; z-index: 30; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.rotate-hint { display: none; position: absolute; inset: 0; z-index: 40; background: rgba(8,5,26,.94); align-items: center; justify-content: center; text-align: center; font-size: 20px; line-height: 1.5; pointer-events: auto; }
.rotate-hint > div { font-size: 22px; }
@media (orientation: landscape) and (pointer: coarse) and (max-height: 520px) { .rotate-hint { display: flex; } }

/* ---------- responsive / motion ---------- */
@media (max-width: 420px) { body { font-size: 16px; } .btn { padding: 12px 18px; font-size: 13px; } .card { padding: 14px 16px; border-radius: 16px; } .level-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
@media (min-width: 1100px) { .title-wrap { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } .anim-in { opacity: 1; } }
