/* Fruit Storm. Logical properties only, so RTL and LTR share one file. */
:root {
    --bg: #0b1228; --surface: rgba(10, 16, 40, .72); --border: rgba(255, 255, 255, .14); --text: #f2f5ff; --muted: #b4bde0;
    --accent: #ffb020; --ink: #1a1300; --ok: #4ade80; --bad: #ff5d73; --storm: #b26bff; --card: rgba(16, 24, 58, .86);
    --font: system-ui, "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Sans", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.game { max-inline-size: 960px; margin-inline: auto; padding: 8px; }

.stage { touch-action: none;
    position: relative; overflow: hidden; border-radius: 16px; aspect-ratio: 16 / 10; max-block-size: 620px; inline-size: 100%;
    background: radial-gradient(120% 90% at 50% 115%, #17707a 0%, #13405f 38%, #0e1a3a 72%, #0b1228 100%);
    box-shadow: inset 0 0 0 1px var(--border);
}
@media (max-width: 559px) { .stage { aspect-ratio: 4 / 5; } }
/* The phone play screen and a window of its own: the play area takes all the room there is. */
.game.fill { max-inline-size: none; padding: 0; }
.game.fill .stage { aspect-ratio: auto; max-block-size: none; block-size: var(--ah, 100vh); border-radius: 0; box-shadow: none; }
.game.fill .mode { display: none; }
.stage::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s; z-index: 1;
    background: radial-gradient(90% 60% at 50% 0%, rgba(178, 107, 255, .42), transparent 70%),
                radial-gradient(70% 50% at 50% 100%, rgba(56, 189, 248, .22), transparent 70%);
}
.stage.storm::after { opacity: 1; animation: storm 1.1s ease-in-out infinite alternate; }
@keyframes storm { to { filter: brightness(1.35); } }

.stage > canvas { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; touch-action: none; cursor: crosshair; z-index: 1; }
#bg { z-index: 0; pointer-events: none; }
/* Edge glows: slow motion (blue) and a lost heart or the last seconds (red). */
.edge { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; will-change: opacity; }
.edge.frost { background: radial-gradient(circle farthest-corner, rgba(150, 210, 255, 0) 57%, rgba(150, 210, 255, .5) 128%); }
.edge.red { background: radial-gradient(circle farthest-corner, rgba(255, 40, 70, 0) 61%, rgba(255, 40, 70, .55) 124%); }

/* ---------- Top bar ---------- */
.hud {
    position: absolute; inset-block-start: max(8px, env(safe-area-inset-top)); inset-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
    z-index: 4; display: flex; align-items: center; gap: 6px; pointer-events: none;
}
.pill {
    display: flex; flex-direction: column; align-items: center; min-inline-size: 64px; padding: 3px 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; backdrop-filter: blur(4px);
    box-shadow: 0 3px 10px rgba(0, 0, 10, .28); transition: opacity .2s;
}
.pill .k { font-size: .66rem; color: var(--muted); line-height: 1.2; }
.pill b { font-size: 1.15rem; font-variant-numeric: tabular-nums; line-height: 1.25; }
.pill.mult { min-inline-size: 44px; gap: 4px; font-weight: 900; font-size: 1.05rem; color: var(--accent); padding-block: 6px 7px; }
.pill.mult > span { opacity: .4; transition: opacity .2s; line-height: 1; }
.pill.mult.on > span { opacity: 1; }
.pill.mult.bump { animation: bump .32s ease-out; }
.pill.mult.lost { animation: lost .4s ease-out; }
.meter { display: block; inline-size: 100%; block-size: 4px; border-radius: 4px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.meter > i { display: block; block-size: 100%; border-radius: 4px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .18s ease-out; }
.pill.time { margin-inline-start: auto; }
.pill.bump b, .pill.time.bump b { animation: bump .22s ease-out; }
.pill.time.low b { color: var(--bad); animation: bump .5s ease-out infinite; }
.hearts { display: flex; gap: 2px; padding-inline: 4px; transition: opacity .2s; }
.hearts svg { inline-size: 22px; block-size: 22px; transition: transform .25s, opacity .25s; filter: drop-shadow(0 2px 3px rgba(0, 0, 10, .4)); }
.hearts svg.gone { opacity: .28; transform: scale(.75); filter: grayscale(1); }
.hearts svg.hit { animation: hit .5s ease-out; }
.hearts svg.gain { animation: gain .6s cubic-bezier(.3, 1.7, .5, 1); }
.icon, .tool {
    pointer-events: auto; flex: none; inline-size: 40px; block-size: 40px; border-radius: 12px; cursor: pointer; padding: 0;
    background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; box-shadow: 0 3px 10px rgba(0, 0, 10, .28);
}
.icon svg, .tool svg { inline-size: 20px; block-size: 20px; }
.icon:active, .tool:active { transform: scale(.94); }
.icon:focus-visible, .tool:focus-visible, .btn:focus-visible, .mode-card:focus-visible, .item:focus-visible, .lvl:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* A menu or a card is open: the numbers step back, the sound buttons stay in reach. */
.stage.veil .pill, .stage.veil .hearts { opacity: 0; }
.stage.veil .hud .pill.time { margin-inline-start: auto; }
.stage.sheet-open .hud { visibility: hidden; }
.stage.lesson .pill, .stage.lesson .hearts, .stage.lesson #music { display: none; }
.stage.lesson .hud { justify-content: flex-end; }
.stage.narrow .pill { min-inline-size: 50px; padding-inline: 7px; }
.stage.narrow .pill.mult { min-inline-size: 38px; }
.stage.narrow .pill b { font-size: 1rem; }
.stage.narrow .icon { inline-size: 34px; block-size: 34px; border-radius: 10px; }
.stage.narrow .hearts svg { inline-size: 18px; block-size: 18px; }
.stage.narrow .hud { gap: 4px; }

/* Storm power in use, with the time it has left. */
.power {
    position: absolute; inset-block-start: 62px; inset-inline: 0; margin-inline: auto; inline-size: max-content; min-inline-size: 150px; z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 16px 8px; border-radius: 14px; pointer-events: none;
    background: var(--surface); border: 1px solid var(--border); font-weight: 800; font-size: .92rem; animation: rise .3s ease-out both;
}
.power.frost { color: #cfeaff; border-color: rgba(150, 210, 255, .55); }
.power.frost .meter > i { background: #8fd0ff; }
.power.whirl { color: #c9fff0; border-color: rgba(95, 240, 194, .55); }
.power.whirl .meter > i { background: #5ff0c2; }
[dir="rtl"] .power .meter > i, [dir="rtl"] .lv-bar > i, [dir="rtl"] .ms-bar > i { transform-origin: right; }

/* ---------- Words over the play area ---------- */
.banner, .praise {
    position: absolute; inset-inline: 0; text-align: center; pointer-events: none; font-weight: 900; letter-spacing: .02em; opacity: 0;
    paint-order: stroke fill; -webkit-text-stroke: 5px rgba(10, 12, 40, .85);
}
.banner { inset-block-start: 38%; z-index: 5; font-size: clamp(1.6rem, 6vw, 3rem); text-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 0 24px rgba(255, 176, 32, .55); }
.banner.show { animation: banner 1.3s ease-out forwards; }
.banner.storm { color: #e9d5ff; text-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 0 28px var(--storm); }
.praise { inset-block-start: 16%; line-height: 1.15; z-index: 2; font-size: clamp(1.3rem, 5vw, 2.3rem); color: #ffe07a; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.praise.show { animation: praise .95s ease-out forwards; }
.praise small { display: block; margin-block-start: -.1em; font-size: .62em; color: #fff; -webkit-text-stroke-width: 4px; }
.praise.p1 { color: #ffc24a; } .praise.p2 { color: #ff9f43; } .praise.p3 { color: #ff7a8a; } .praise.p4 { color: #f58bff; font-size: clamp(1.5rem, 6vw, 2.7rem); }
.praise.bolt { color: #9fe6ff; } .praise.whirl { color: #8dffd9; } .praise.frost { color: #d5ecff; } .praise.heart { color: #ff8fa8; }
.stage.short .praise { inset-block-start: 26%; }

/* ---------- First-play lesson ---------- */
.coach {
    position: absolute; inset-block-end: max(16px, 5%); inset-inline: 0; margin-inline: auto; inline-size: min(92%, 440px); z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 16px 12px; text-align: center; pointer-events: none;
    background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 10px 30px rgba(0, 0, 10, .4); animation: rise .35s ease-out both;
}
.coach b { font-size: clamp(1rem, 3.4vw, 1.2rem); line-height: 1.35; }
.co-step { font-size: .74rem; color: var(--accent); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.co-step:empty { display: none; }
.coach .btn { pointer-events: auto; }
.stage.short .coach { flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 4px 12px; padding-block: 8px; inset-block-end: 10px; inline-size: min(94%, 620px); }
.hand { position: absolute; inset-block-start: 43%; left: 30%; inline-size: clamp(34px, 7vw, 52px); z-index: 2; pointer-events: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 10, .45)); margin-inline-start: -14px; }
.hand svg { display: block; inline-size: 100%; }
.hand.s0 { animation: swipe0 1.7s ease-in-out infinite; }
.hand.s1 { animation: swipe1 1.9s ease-in-out infinite; }
@keyframes swipe0 { 0% { left: 30%; opacity: 0; transform: scale(1.15); } 14% { opacity: 1; transform: none; } 68% { left: 68%; opacity: 1; } 100% { left: 68%; opacity: 0; } }
@keyframes swipe1 { 0% { left: 14%; opacity: 0; transform: scale(1.15); } 14% { opacity: 1; transform: none; } 72% { left: 84%; opacity: 1; } 100% { left: 84%; opacity: 0; } }

/* ---------- Menus and cards ---------- */
.overlay {
    position: absolute; inset: 0; z-index: 3; display: none; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 20px; padding-block-start: max(20px, env(safe-area-inset-top)); text-align: center; background: rgba(8, 12, 30, .78); backdrop-filter: blur(3px);
}
.overlay.show { display: flex; animation: fade .25s ease-out; }
.overlay.start { background: radial-gradient(75% 75% at 50% 50%, rgba(8, 12, 30, .66), rgba(8, 12, 30, .3)); backdrop-filter: none; }
.overlay.end { background: rgba(8, 12, 30, .5); backdrop-filter: none; }
.overlay h2 { margin: 0; font-size: clamp(1.4rem, 5vw, 2rem); text-shadow: 0 3px 0 rgba(0, 0, 0, .3), 0 0 22px rgba(255, 176, 32, .35); }
.overlay p { margin: 0; max-inline-size: 46ch; color: var(--muted); line-height: 1.5; }
.menu > *, .r-main > *, .r-side > *, .overlay.show > h2, .overlay.show > .btns { animation: rise .45s cubic-bezier(.2, .9, .3, 1.25) both; }
.menu > :nth-child(2), .r-main > :nth-child(2) { animation-delay: .04s; } .menu > :nth-child(3), .r-main > :nth-child(3) { animation-delay: .08s; }
.menu > :nth-child(4), .r-main > :nth-child(4) { animation-delay: .12s; } .menu > :nth-child(5), .r-main > :nth-child(5) { animation-delay: .16s; }
.menu > :nth-child(n+6), .r-side > * { animation-delay: .2s; }

.btn {
    cursor: pointer; border: 0; border-radius: 999px; padding: 12px 30px; font-weight: 800; font-size: 1.05rem; min-block-size: 46px;
    background: linear-gradient(180deg, #ffd062, var(--accent)); color: var(--ink); box-shadow: 0 4px 0 #b86f00, 0 10px 20px rgba(0, 0, 10, .3);
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #b86f00; }
.btn.ghost { background: rgba(255, 255, 255, .06); color: var(--text); box-shadow: inset 0 0 0 2px var(--border); }
.btn.small { padding: 6px 16px; font-size: .88rem; min-block-size: 34px; box-shadow: 0 3px 0 #b86f00; }
.btn.ghost.small { box-shadow: inset 0 0 0 2px var(--border); }
.btn:disabled { opacity: .6; cursor: default; }
.btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btns.col { flex-direction: column; align-items: stretch; min-inline-size: 200px; }

/* Main menu */
.menu { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(6px, 2.4vh, 14px); inline-size: min(100%, 540px); block-size: 100%; }
.lvl {
    position: absolute; inset-block-start: max(8px, env(safe-area-inset-top)); inset-inline-start: max(8px, env(safe-area-inset-left)); z-index: 1;
    display: flex; align-items: center; gap: 8px; block-size: 40px; padding: 0 12px 0 5px; padding-inline: 5px 12px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 3px 10px rgba(0, 0, 10, .28);
}
.lv-badge {
    flex: none; display: grid; place-items: center; inline-size: 30px; block-size: 30px; border-radius: 50%; font-weight: 900; font-size: .95rem; color: var(--ink);
    background: radial-gradient(circle at 35% 30%, #fff1a8, #ffb020 70%); box-shadow: 0 0 0 2px rgba(255, 255, 255, .25), 0 2px 6px rgba(0, 0, 0, .35); font-variant-numeric: tabular-nums;
}
.lv-bar { display: block; inline-size: 74px; block-size: 9px; border-radius: 6px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.lv-bar > i { display: block; block-size: 100%; border-radius: 6px; background: linear-gradient(90deg, #4ade80, #b6f04a); transform-origin: left; }
.lv-txt { font-weight: 800; font-size: .86rem; }
.m-brand { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.logo { inline-size: clamp(110px, 24vh, 168px); block-size: auto; filter: drop-shadow(0 8px 14px rgba(0, 0, 10, .45)); animation: bob 2.8s ease-in-out .5s infinite; }
.wordmark {
    font-size: clamp(1.9rem, 8.5vw, 3.2rem) !important; font-weight: 900; line-height: 1.15; letter-spacing: .01em; padding-inline: .2em;
    background: linear-gradient(180deg, #fff6c2 15%, #ffc53d 52%, #ff7a1a 92%); -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: none !important; filter: drop-shadow(0 3px 0 #7a2c00) drop-shadow(0 8px 12px rgba(0, 0, 10, .5));
}
.m-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; inline-size: 100%; }
.mode-card {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px 9px; cursor: pointer; min-inline-size: 0;
    background: var(--card); border: 2px solid var(--border); border-radius: 16px; box-shadow: 0 6px 16px rgba(0, 0, 10, .3); transition: transform .15s, border-color .15s, background .15s;
}
.mode-card b { font-size: clamp(.8rem, 2.9vw, .98rem); line-height: 1.25; }
.mode-card em { font-style: normal; font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mc-ico { display: grid; place-items: center; inline-size: 38px; block-size: 38px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #9fd8ff; }
.mc-ico svg { inline-size: 22px; block-size: 22px; }
.mode-card[data-mode="survival"] .mc-ico { color: #ff7d95; }
.mode-card[data-mode="chill"] .mc-ico { color: #8be28f; }
.mode-card.on { border-color: var(--accent); background: linear-gradient(180deg, rgba(255, 176, 32, .26), rgba(16, 24, 58, .9)); transform: translateY(-3px); }
.mode-card.on .mc-ico { background: var(--accent); color: var(--ink); }
.m-desc { font-size: .92rem; min-block-size: 1.5em; color: #d5dcf5 !important; }
.btn.play { display: inline-flex; align-items: center; gap: 8px; padding: 13px 44px; font-size: 1.25rem; min-block-size: 54px; animation: rise .45s .15s both, glow 1.8s ease-in-out .6s infinite; }
.btn.play svg { inline-size: 22px; block-size: 22px; }
.m-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; min-block-size: 38px; cursor: pointer; font-weight: 700; font-size: .84rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 3px 10px rgba(0, 0, 10, .28);
}
.chip svg { inline-size: 17px; block-size: 17px; color: var(--accent); }
.chip:active { transform: scale(.96); }
.chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.stage.short .logo { inline-size: 76px; animation: none; }
.stage.short .m-brand { flex-direction: row; gap: 10px; }
.stage.short .wordmark { font-size: clamp(1.5rem, 5vw, 2.1rem) !important; }
.stage.short .mode-card { flex-direction: row; flex-wrap: wrap; justify-content: center; column-gap: 8px; padding-block: 7px; }
.stage.short .mode-card em { flex-basis: 100%; }
.stage.short .mc-ico { inline-size: 28px; block-size: 28px; }
.stage.short .mc-ico svg { inline-size: 17px; block-size: 17px; }
.stage.short .btn.play { min-block-size: 46px; padding-block: 9px; font-size: 1.1rem; }
.stage.short .overlay { padding-block: 10px; gap: 6px; }
.stage.short .menu { gap: 6px; }
.stage.tiny .logo, .stage.tiny .m-desc { display: none; }

/* Sheets: missions, blades and scenes */
.sheet {
    display: flex; flex-direction: column; inline-size: min(100%, 600px); max-block-size: 100%; overflow: hidden; text-align: start;
    background: rgba(14, 20, 50, .96); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 20px 50px rgba(0, 0, 10, .5); animation: rise .3s ease-out both;
}
.sh-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 10px 10px 16px; padding-inline: 16px 10px; border-block-end: 1px solid var(--border); }
.sh-head h3 { margin: 0; font-size: 1.1rem; }
.sh-body { overflow: hidden auto; touch-action: pan-y; padding: 12px 14px 16px; overscroll-behavior: contain; }
.sh-body h4 { margin: 4px 2px 8px; font-size: .86rem; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.sh-body h4 + .grid { margin-block-end: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.item {
    display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 8px; cursor: pointer; min-inline-size: 0;
    background: rgba(255, 255, 255, .05); border: 2px solid var(--border); border-radius: 14px;
}
.item b { font-size: .9rem; }
.item small { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; color: var(--muted); }
.item small svg { inline-size: 13px; block-size: 13px; }
.item.on { border-color: var(--accent); background: rgba(255, 176, 32, .14); }
.item.on small { color: var(--accent); font-weight: 800; }
.item.locked { cursor: default; }
.item.locked > :not(small) { opacity: .38; filter: grayscale(.7); }
.item.nope { animation: lost .4s ease-out; }
.swatch { display: block; inline-size: 84%; block-size: 14px; margin-block: 14px 10px; background: var(--g); clip-path: polygon(0 50%, 22% 30%, 82% 0, 100% 50%, 82% 100%, 22% 70%); filter: drop-shadow(0 0 6px rgba(255, 255, 255, .5)); }
[dir="rtl"] .swatch { transform: scaleX(-1); }
.thumb { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 16 / 10; border-radius: 9px; }
.lv-row { display: flex; align-items: center; gap: 10px; margin-block-end: 12px; font-size: .9rem; }
.lv-row .lv-bar { flex: 1; inline-size: auto; }
.lv-row span[dir] { color: var(--muted); font-variant-numeric: tabular-nums; }
.missions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.missions li { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 10px 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--border); border-radius: 14px; }
.ms-t { font-weight: 700; font-size: .93rem; line-height: 1.35; }
.ms-xp { font-weight: 900; color: var(--ok); font-size: .86rem; }
.ms-bar { display: block; block-size: 7px; border-radius: 5px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.ms-bar > i { display: block; block-size: 100%; border-radius: 5px; background: var(--accent); transform-origin: left; }
.ms-n { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hint { margin-block-start: 12px !important; font-size: .84rem; text-align: center; max-inline-size: none !important; }

/* End card */
.r-main, .r-side { display: flex; flex-direction: column; align-items: center; gap: clamp(5px, 1.6vh, 10px); inline-size: 100%; min-inline-size: 0; }
.result {
    display: flex; flex-direction: column; align-items: center; gap: clamp(5px, 1.6vh, 10px); inline-size: min(100%, 470px); max-block-size: 100%; overflow: hidden auto; touch-action: pan-y;
    padding: clamp(10px, 3vh, 20px) 18px; background: rgba(14, 20, 50, .9); border: 1px solid var(--border); border-radius: 24px; box-shadow: 0 20px 50px rgba(0, 0, 10, .5);
}
.stars { display: flex; gap: 6px; }
.stars svg { inline-size: 30px; block-size: 30px; fill: rgba(255, 255, 255, .14); transform: scale(0); animation: star .45s cubic-bezier(.3, 1.7, .5, 1) forwards; animation-delay: var(--d); }
.stars svg.on { fill: #ffc23d; filter: drop-shadow(0 0 6px rgba(255, 194, 61, .7)); }
.rank { color: var(--accent); font-weight: 800; letter-spacing: .03em; font-size: .95rem; }
.big { font-size: clamp(2.6rem, 11vw, 4rem); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.big.land { animation: land .4s ease-out; }
.scorebox { position: relative; display: inline-block; }
.stamp {
    position: absolute; inset-block-start: 2px; inset-inline-start: 100%; margin-inline-start: 6px; white-space: nowrap;
    padding: 3px 10px; border: 2px solid #ff5d73; border-radius: 8px; color: #ff8193; background: rgba(255, 93, 115, .12);
    font-weight: 900; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; transform: rotate(-12deg);
    box-shadow: 0 0 18px rgba(255, 93, 115, .35); animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) both;
}
[dir="rtl"] .stamp { transform: rotate(12deg); animation-name: stamp-rtl; }
.row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; color: var(--muted); font-size: .92rem; }
.row b { color: var(--text); }
.xp { display: flex; align-items: center; gap: 9px; inline-size: min(100%, 330px); padding: 6px 12px 6px 6px; padding-inline: 6px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; }
.xp .lv-bar { flex: 1; inline-size: auto; }
.xp-gain { color: var(--ok); font-size: .9rem; font-variant-numeric: tabular-nums; }
.xp.up .lv-badge { animation: levelup .7s cubic-bezier(.3, 1.7, .5, 1); }
.done { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; inline-size: min(100%, 400px); }
.done li { display: flex; align-items: center; gap: 8px; padding: 5px 10px; text-align: start; font-size: .84rem; background: rgba(74, 222, 128, .1); border: 1px solid rgba(74, 222, 128, .35); border-radius: 10px; }
.done li span { flex: 1; }
.done li b { color: var(--ok); }
.done svg { flex: none; inline-size: 16px; block-size: 16px; color: var(--ok); }
.unlock { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px; padding: 7px 12px; font-weight: 800; font-size: .92rem; color: #ffe07a; background: rgba(255, 176, 32, .12); border: 1px solid rgba(255, 176, 32, .45); border-radius: 12px; animation: rise .45s .3s both; }
.note { font-weight: 600; font-size: .9rem; }
.note:empty { display: none; }
.note.ok { color: var(--ok); }
.note.bad { color: var(--bad); }
/* A short, wide play area (a phone held sideways): the card splits in two columns. */
.stage.short .result { flex-direction: row; align-items: center; gap: 18px; inline-size: min(100%, 700px); padding-block: 10px; }
.stage.short .r-main { flex: 0 1 44%; gap: 4px; }
.stage.short .r-side { flex: 1; gap: 5px; }
.stage.short .stars svg { inline-size: 22px; block-size: 22px; }
.stage.short .big { font-size: 2.4rem; }
.stage.short .result .btn { min-block-size: 40px; padding-block: 8px; }
.stage.short .done li { padding-block: 3px; }
.stage.short.narrow .result { flex-direction: column; gap: 6px; }

.mode { margin: 8px 4px 0; min-block-size: 1.3em; text-align: center; color: var(--muted); font-size: .9rem; }

/* Full screen: the stage takes the whole screen. */
.fs .game { max-inline-size: none; padding: 0; }
.fs .stage { aspect-ratio: auto; max-block-size: none; block-size: 100vh; block-size: 100dvh; border-radius: 0; }
.fs .mode { display: none; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
@keyframes glow { 50% { box-shadow: 0 4px 0 #b86f00, 0 0 0 7px rgba(255, 176, 32, .18), 0 0 26px rgba(255, 176, 32, .45); } }
@keyframes star { to { transform: scale(1); } }
@keyframes land { 35% { transform: scale(1.18); color: #ffd36b; } }
@keyframes bump { 40% { transform: scale(1.25); } }
@keyframes lost { 30% { transform: translateX(-4px); color: var(--bad); } 60% { transform: translateX(4px); } }
@keyframes stamp { from { opacity: 0; transform: scale(2.4) rotate(-12deg); } }
@keyframes stamp-rtl { from { opacity: 0; transform: scale(2.4) rotate(12deg); } }
@keyframes hit { 30% { transform: scale(1.5) rotate(-12deg); } }
@keyframes gain { 0% { transform: scale(.4); } 50% { transform: scale(1.6); filter: drop-shadow(0 0 8px #ff8fa8); } }
@keyframes levelup { 40% { transform: scale(1.7) rotate(-8deg); box-shadow: 0 0 0 6px rgba(255, 224, 122, .5), 0 0 24px #ffd062; } }
@keyframes banner {
    0% { opacity: 0; transform: scale(.6); }
    18% { opacity: 1; transform: scale(1.08); }
    30% { transform: scale(1); }
    75% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-24px); }
}
@keyframes praise {
    0% { opacity: 0; transform: scale(.5) rotate(-4deg); }
    16% { opacity: 1; transform: scale(1.18) rotate(-2deg); }
    30% { transform: scale(1) rotate(-2deg); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-18px) rotate(-2deg); }
}
@media (prefers-reduced-motion: reduce) {
    .stage.storm::after, .pill.time.low b, .pill.bump b, .menu > *, .r-main > *, .r-side > *, .logo, .btn.play, .big.land, .stamp, .hand, .sheet, .coach, .power, .unlock { animation: none; }
    .stars svg { animation: none; transform: none; }
}
