/* Drop Deck. Logical properties, so RTL and LTR share one file; the stage, pads order and grid stay LTR
   where timing reads left to right. Keyframes are prefixed dd- so they never clash with shared styles. */
:root {
    --bg: #07061a; --surface: #14112f; --surface2: #1f1a47; --border: #362f72; --text: #f7f5ff; --muted: #b8b2e8;
    --accent: #ff3df2; --accent2: #ffd23f; --cyan: #30e6ff; --mint: #4ade80; --rec: #ff3b5c;
    --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; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }
#game:focus { outline: none; }
[hidden] { display: none !important; }
.game { position: relative; max-inline-size: 820px; margin-inline: auto; padding: 8px; }
svg { display: block; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-block-size: 44px; padding: 10px 20px;
    border-radius: 999px; border: 2px solid var(--border); background: var(--surface2); cursor: pointer; font-weight: 800;
    transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
}
.btn svg { inline-size: 18px; block-size: 18px; }
.btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.97); }
.btn.primary { background: linear-gradient(180deg, #ff6af5, #c11bd0); border-color: #ffb0fa; box-shadow: 0 6px 18px rgba(255, 61, 242, .4); }
.btn.small { min-block-size: 38px; padding: 6px 14px; font-size: .9rem; }
.btn.ghost { background: transparent; }
.btn.wa { background: #1fa855; border-color: #45d483; }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.icon { inline-size: 42px; block-size: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: grid; place-items: center; flex: none; }
.icon svg { inline-size: 22px; block-size: 22px; }
input:not([type=range]) { min-block-size: 38px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface); padding: 4px 10px; color: var(--text); user-select: text; -webkit-user-select: text; }

/* ---------- menus ---------- */
.screen {
    position: relative; overflow: hidden; border-radius: 18px; border: 1px solid var(--border); padding: 18px 14px 22px;
    background:
        radial-gradient(60% 45% at 50% 0%, rgba(255, 61, 242, .3), transparent 70%),
        radial-gradient(45% 40% at 95% 85%, rgba(48, 230, 255, .2), transparent 70%),
        radial-gradient(40% 35% at 5% 75%, rgba(255, 210, 63, .12), transparent 70%),
        linear-gradient(180deg, #1a1045, #07061a 85%);
    text-align: center; min-block-size: 480px;
}
.screen > * { position: relative; }
.screen h1 { margin: 2px 0 6px; font-size: clamp(2rem, 7vw, 3rem); letter-spacing: .02em; text-shadow: 0 3px 0 #000, 0 0 26px rgba(255, 61, 242, .6); }
.screen h2 { margin: 4px 0 10px; font-size: clamp(1.5rem, 4.6vw, 2.2rem); text-shadow: 0 3px 0 #000; }
.screen h2.win, .card h2.win { color: var(--accent2); text-shadow: 0 3px 0 #000, 0 0 28px rgba(255, 210, 63, .55); }
.screen h2.lose, .card h2.lose { color: #ffb3c4; }
.screen .sub, .screen p { margin: 6px auto; max-inline-size: 600px; color: var(--muted); line-height: 1.5; }
.center { text-align: center; }

.eq { position: absolute !important; inset-inline: 0; inset-block-end: 0; block-size: 120px; display: flex; gap: 6px; align-items: flex-end; justify-content: center; opacity: .22; pointer-events: none; }
.eq i { inline-size: 5%; max-inline-size: 30px; block-size: 30%; border-radius: 6px 6px 0 0; background: linear-gradient(0deg, hsl(calc(300 - var(--i) * 12) 95% 60%), hsl(calc(200 - var(--i) * 8) 95% 65%)); transform-origin: bottom; animation: dd-eq 1.1s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.17s); }
@keyframes dd-eq { 0% { transform: scaleY(.3); } 50% { transform: scaleY(1.9); } 100% { transform: scaleY(.6); } }

.logo { display: grid; place-items: center; margin-block: 4px 0; }
.vinyl { inline-size: 84px; block-size: 84px; color: var(--accent); filter: drop-shadow(0 0 18px rgba(255, 61, 242, .6)); animation: dd-spin 3.2s linear infinite; }
.vinyl svg { inline-size: 100%; block-size: 100%; }
@keyframes dd-spin { to { transform: rotate(360deg); } }
.how { list-style: none; margin: 14px auto; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.how li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--border); font-weight: 700; font-size: .9rem; }
.how svg { inline-size: 18px; block-size: 18px; color: var(--accent2); }
.modes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-block-start: 16px; }
.mode {
    position: relative; text-align: start; padding: 16px; border-radius: 18px; border: 2px solid var(--border); cursor: pointer; display: grid; gap: 6px;
    background: linear-gradient(160deg, var(--c1), var(--c2)); box-shadow: 0 10px 26px rgba(0, 0, 0, .35); transition: transform .15s, box-shadow .15s;
    animation: dd-up .45s cubic-bezier(.2, .9, .3, 1.3) both;
}
.mode:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }
.mode b { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; }
.mode b svg { inline-size: 24px; block-size: 24px; }
.mode small { color: rgba(255, 255, 255, .85); line-height: 1.4; }
.mode em { position: absolute; inset-block-start: 12px; inset-inline-end: 12px; font-style: normal; font-weight: 800; background: rgba(0, 0, 0, .35); padding: 2px 10px; border-radius: 999px; }
.m1 { --c1: #a3109c; --c2: #3b0d6e; animation-delay: .05s; }
.m2 { --c1: #0b7e9c; --c2: #1d1a6e; animation-delay: .12s; }
.m3 { --c1: #b5651d; --c2: #4a1a4f; animation-delay: .19s; }
@keyframes dd-up { from { opacity: 0; transform: translateY(18px) scale(.96); } }

.top { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-block-end: 10px; }
.top h2 { margin: 0; font-size: 1.5rem; }
.tot { font-weight: 800; color: var(--accent2); min-inline-size: 60px; text-align: end; }
.lvls { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.lvl {
    position: relative; display: grid; gap: 4px; justify-items: start; text-align: start; padding: 12px 12px 10px; border-radius: 16px; cursor: pointer;
    border: 2px solid hsl(var(--h) 70% 45% / .7); background: linear-gradient(160deg, hsl(var(--h) 70% 28%), #120f30);
    animation: dd-up .4s cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: calc(var(--i) * .05s); transition: transform .15s;
}
.lvl:hover { transform: translateY(-3px); }
.lvl .num { position: absolute; inset-block-start: 8px; inset-inline-end: 10px; font-weight: 900; font-size: 1.6rem; opacity: .35; }
.lvl b { font-size: 1.05rem; }
.lvl small { color: var(--muted); font-size: .8rem; }
.lvl .st { display: flex; gap: 2px; }
.lvl .st i { inline-size: 18px; block-size: 18px; color: rgba(255, 255, 255, .18); }
.lvl .st i.got { color: var(--accent2); filter: drop-shadow(0 0 4px rgba(255, 210, 63, .6)); }
.lvl .bst { color: var(--accent2); }
.lvl.locked { filter: grayscale(.7); opacity: .65; cursor: not-allowed; }
.lvl .lk { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 700; }
.lvl .lk svg { inline-size: 16px; block-size: 16px; }
.lvl.shake { animation: dd-shake .4s; }
@keyframes dd-shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

.recs { display: grid; gap: 8px; text-align: start; }
.recrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid hsl(var(--h) 60% 45% / .6); animation: dd-up .35s both; animation-delay: calc(var(--i) * .05s); }
.recrow .dot { inline-size: 38px; block-size: 38px; color: hsl(var(--h) 90% 65%); flex: none; animation: dd-spin 4s linear infinite; }
.recrow .meta { flex: 1 1 140px; display: grid; }
.recrow small { color: var(--muted); }
.rbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.rbtns .btn.small { padding: 6px 10px; }
.rbtns .btn span { display: none; }
@media (min-width: 620px) { .rbtns .btn span { display: inline; } }
.btn.sure { background: var(--rec); border-color: #ff8fa2; }
.empty { padding: 30px 0; }
.result { padding-block: 20px; }
.result .place { font-weight: 800; color: var(--accent2); text-transform: uppercase; letter-spacing: .08em; }
.roll { display: block; margin: 10px auto; border-radius: 10px; background: rgba(0, 0, 0, .3); }
.goals { font-weight: 700; }
.btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-block-start: 14px; }
.btns.col { flex-direction: column; align-items: stretch; }
.flash { color: #ffb3c4 !important; font-weight: 700; flex-basis: 100%; margin: 6px 0 0; animation: dd-up .3s both; }

/* ---------- the deck ---------- */
.deck { position: relative; display: flex; flex-direction: column; gap: 8px; border-radius: 18px; padding: 8px; border: 1px solid var(--border); background: linear-gradient(180deg, #120d33, #07061a); }
.deck.dropped { animation: dd-drop .5s; }
@keyframes dd-drop { 0% { transform: scale(1.025); filter: brightness(1.6); } 100% { transform: none; filter: none; } }
.dtop { display: flex; align-items: center; gap: 8px; min-block-size: 42px; }
.packs { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.packs::-webkit-scrollbar { display: none; }
.chip { flex: none; min-block-size: 38px; padding: 6px 12px; border-radius: 999px; border: 2px solid hsl(var(--h) 70% 50% / .5); background: hsl(var(--h) 60% 18%); font-weight: 800; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.chip.on { background: linear-gradient(180deg, hsl(var(--h) 90% 55%), hsl(var(--h) 80% 35%)); border-color: hsl(var(--h) 100% 75%); box-shadow: 0 0 14px hsl(var(--h) 90% 55% / .55); }
.chip:disabled { opacity: .5; cursor: default; }
.lvtop { flex: 1; display: flex; align-items: center; gap: 10px; min-inline-size: 0; }
.lvtop b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hype, .prog { flex: 1; block-size: 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; min-inline-size: 60px; }
.hype i, .prog i { display: block; block-size: 100%; inline-size: 0; border-radius: inherit; background: linear-gradient(90deg, #ff5fa2, #ffd23f); transition: inline-size .4s cubic-bezier(.2, .9, .3, 1.2); }
.prog i { background: linear-gradient(90deg, var(--cyan), var(--accent)); transition: inline-size .15s linear; }
.hype.low i { background: linear-gradient(90deg, #ff3b5c, #ff8f3a); animation: dd-blink .6s infinite; }
.hype.hot i { background: linear-gradient(90deg, #ffd23f, #fff, #30e6ff); box-shadow: 0 0 12px #ffd23f; }
@keyframes dd-blink { 50% { opacity: .45; } }
.sc { font-weight: 900; font-size: 1.15rem; min-inline-size: 52px; text-align: end; color: var(--accent2); }
.sc.bump { animation: dd-bump .35s; }
@keyframes dd-bump { 40% { transform: scale(1.3); } }

.stage { position: relative; border-radius: 14px; overflow: hidden; block-size: 220px; background: #08061a; }
.stage canvas { display: block; inline-size: 100%; block-size: 100%; }
.cue {
    position: absolute; inset-block-start: 10px; inset-inline: 10px; margin-inline: auto; max-inline-size: 420px; padding: 8px 14px 10px; border-radius: 14px; text-align: center;
    background: rgba(8, 6, 26, .78); border: 2px solid rgba(255, 210, 63, .7); backdrop-filter: blur(4px); display: grid; gap: 2px; box-shadow: 0 8px 22px rgba(0, 0, 0, .4);
}
.cue b { font-size: 1.05rem; }
.cue small { color: var(--muted); }
.cue .n { position: absolute; inset-block-start: 6px; inset-inline-end: 10px; font-weight: 800; color: var(--accent2); }
.cue.in { animation: dd-cue .45s cubic-bezier(.2, .9, .3, 1.4) both; }
.cue.out { animation: dd-cueout .4s both; }
.cue.drop { border-color: var(--accent); box-shadow: 0 0 24px rgba(255, 61, 242, .55); }
.cue.rep { border-color: var(--rec); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; padding: 6px 12px; inset-inline: auto; inset-inline-end: 10px; }
.recdot { inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--rec); animation: dd-blink .8s infinite; }
@keyframes dd-cue { from { opacity: 0; transform: translateY(-16px) scale(.9); } }
@keyframes dd-cueout { to { opacity: 0; transform: translateY(-10px) scale(.95); } }
.win2 { display: block; block-size: 4px; border-radius: 9px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-block-start: 4px; }
.win2 i { display: block; block-size: 100%; inline-size: 0; background: linear-gradient(90deg, #4ade80 0 50%, #ffd23f 50%); background-size: 200% 100%; }
.cd { display: flex; gap: 8px; justify-content: center; margin-block-start: 4px; }
.cd i { inline-size: 16px; block-size: 16px; border-radius: 50%; border: 2px solid var(--accent); transition: background .1s, transform .1s; }
.cd i.on { background: var(--accent); transform: scale(1.2); box-shadow: 0 0 12px var(--accent); }
.cd i:last-child.on { background: var(--accent2); border-color: var(--accent2); box-shadow: 0 0 16px var(--accent2); }

.banner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-weight: 900; font-size: clamp(1.6rem, 7vw, 3rem); opacity: 0; text-shadow: 0 4px 0 #000, 0 0 30px rgba(255, 61, 242, .8); }
.banner.show { animation: dd-banner 1.2s both; }
.banner.count { font-size: clamp(3rem, 14vw, 5.5rem); color: var(--accent2); }
.banner.count.show { animation-duration: .42s; }
.banner.drop { font-size: clamp(3rem, 15vw, 6rem); color: #fff; letter-spacing: .06em; }
.banner.warn { color: #ffb3c4; font-size: clamp(1.1rem, 4.5vw, 1.8rem); }
.banner.streak { color: var(--accent2); font-size: clamp(1.2rem, 5vw, 2rem); align-items: end; padding-block-end: 18%; }
@keyframes dd-banner { 0% { opacity: 0; transform: scale(.4); } 18% { opacity: 1; transform: scale(1.12); } 30% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.05); } }
.spop { position: absolute; inset-inline: 0; inset-block-start: 52%; text-align: center; font-weight: 900; font-size: clamp(1.2rem, 5vw, 1.9rem); pointer-events: none; text-shadow: 0 3px 0 #000; animation: dd-pop 1.25s both; }
.spop.perfect { color: var(--accent2); text-shadow: 0 3px 0 #000, 0 0 20px rgba(255, 210, 63, .8); }
.spop.good { color: var(--mint); }
.spop.great { color: var(--cyan); }
.spop.miss { color: #ff8fa2; }
@keyframes dd-pop { 0% { opacity: 0; transform: translateY(14px) scale(.6); } 18% { opacity: 1; transform: translateY(0) scale(1.15); } 30% { transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }

.beat { display: flex; align-items: center; gap: 10px; min-block-size: 22px; padding-inline: 4px; font-size: .85rem; color: var(--muted); }
.dots { display: flex; gap: 6px; }
.dots i { inline-size: 12px; block-size: 12px; border-radius: 50%; background: rgba(255, 255, 255, .14); transition: background .08s; }
.dots i.past { background: rgba(255, 255, 255, .3); }
.dots i.hit { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.dots i.one { background: var(--accent2); box-shadow: 0 0 12px var(--accent2); transform: scale(1.2); }
.bl { font-weight: 800; min-inline-size: 64px; }
.kh { flex: 1; text-align: end; font-size: .75rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; direction: ltr; }
.col { display: flex; flex-direction: column; gap: 6px; min-inline-size: 0; }
.ch { position: relative; display: flex; align-items: center; justify-content: center; gap: 4px; font-weight: 800; font-size: .8rem; color: hsl(var(--h) 90% 75%); padding-block: 2px 4px; overflow: hidden; white-space: nowrap; }
.meter { position: absolute; inset-inline: 10%; inset-block-end: 0; block-size: 3px; border-radius: 3px; background: hsl(var(--h) 95% 60%); transform: scaleX(0); box-shadow: 0 0 8px hsl(var(--h) 95% 60%); }
.pad {
    --pulse: 0; position: relative; block-size: clamp(46px, 7.4vh, 66px); border-radius: 12px; cursor: pointer; padding: 4px; overflow: visible;
    border: 2px solid hsl(var(--h) 70% 50% / .45); background: linear-gradient(180deg, hsl(var(--h) 50% 20%), hsl(var(--h) 55% 12%));
    display: grid; place-items: center; font-weight: 800; font-size: clamp(.68rem, 2.6vw, .88rem); line-height: 1.15; text-align: center;
    transition: background .12s, border-color .12s, box-shadow .12s, transform .08s; touch-action: manipulation;
}
.pad .nm { position: relative; z-index: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pad .kb { position: absolute; inset-block-start: 3px; inset-inline-start: 5px; font-size: .6rem; opacity: .4; }
@media (pointer: coarse) { .pad .kb { display: none; } }
.pad:active { transform: scale(.95); }
.pad.on {
    background: linear-gradient(180deg, hsl(var(--h) 95% 62%), hsl(var(--h) 85% 40%)); border-color: hsl(var(--h) 100% 82%); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
    box-shadow: 0 0 calc(8px + var(--pulse) * 22px) hsl(var(--h) 95% 60% / calc(.45 + var(--pulse) * .5)); transform: scale(calc(1 + var(--pulse) * .045));
}
.pad .ring { position: absolute; inset: -2px; border-radius: 12px; pointer-events: none; opacity: 0; }
.pad.queued .ring, .pad.stopping .ring { opacity: 1; background: conic-gradient(hsl(var(--h) 100% 75%) calc(var(--p, 0) * 360deg), transparent 0); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 3px; }
.pad.queued { animation: dd-q .5s ease-in-out infinite alternate; }
.pad.stopping { animation: dd-q .3s ease-in-out infinite alternate; }
.pad.stopping .ring { background: conic-gradient(#ff3b5c calc(var(--p, 0) * 360deg), transparent 0); }
@keyframes dd-q { to { background: hsl(var(--h) 60% 32%); } }
.pad.hint { border-color: var(--accent2); box-shadow: 0 0 0 2px var(--accent2), 0 0 18px rgba(255, 210, 63, .7); animation: dd-hint .7s ease-in-out infinite alternate; }
.pad.cutme { box-shadow: 0 0 0 2px #ff3b5c, 0 0 16px rgba(255, 59, 92, .7); }
.pad.cutme::after { content: "×"; position: absolute; inset-block-start: -8px; inset-inline-end: -6px; inline-size: 20px; block-size: 20px; border-radius: 50%; background: #ff3b5c; color: #fff; font-size: 15px; line-height: 19px; z-index: 2; }
@keyframes dd-hint { to { box-shadow: 0 0 0 3px var(--accent2), 0 0 28px rgba(255, 210, 63, .95); } }
.pad.mine { border-style: dashed; }
.pad.tap::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle, rgba(255, 255, 255, .7), transparent 70%); animation: dd-tap .4s ease-out both; pointer-events: none; }
@keyframes dd-tap { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.pad.land { animation: dd-land .35s cubic-bezier(.2, .9, .3, 1.5); }
@keyframes dd-land { 0% { transform: scale(.88); } 60% { transform: scale(1.08); } }
.spark { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; inline-size: 6px; block-size: 6px; border-radius: 50%; background: hsl(var(--h) 100% 75%); pointer-events: none; z-index: 3; animation: dd-spark .6s ease-out both; }
@keyframes dd-spark { to { transform: translate(var(--x), var(--y)) scale(.2); opacity: 0; } }
.ppop { position: absolute; inset-block-end: 100%; inset-inline: -20px; text-align: center; font-size: .75rem; font-weight: 900; color: var(--accent2); pointer-events: none; z-index: 4; text-shadow: 0 2px 0 #000; animation: dd-ppop .9s both; white-space: nowrap; }
@keyframes dd-ppop { from { opacity: 0; transform: translateY(8px); } 25% { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-18px); } }
.pads.ro .pad { cursor: default; }

.fx { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.flt { flex: 1 1 150px; display: grid; gap: 2px; padding: 4px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: .75rem; font-weight: 800; color: var(--muted); }
.flt input { inline-size: 100%; accent-color: var(--accent); margin: 0; block-size: 26px; background: linear-gradient(90deg, #30e6ff, transparent 45% 55%, #ff3df2) center / 100% 4px no-repeat; }
.fxb { flex: 0 0 auto; min-inline-size: 56px; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 4px 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .7rem; font-weight: 800; }
.fxb svg { inline-size: 20px; block-size: 20px; }
.fxb[aria-pressed="true"] { background: linear-gradient(180deg, #2fd0ff, #1565c0); border-color: #9ff0ff; box-shadow: 0 0 12px rgba(48, 230, 255, .5); }
.fxb:disabled { opacity: .5; }
.fxb.rec svg { color: var(--rec); }
.fxb.rec.armed { animation: dd-blink .5s infinite; border-color: var(--rec); }
.fxb.rec.on { background: var(--rec); border-color: #ffb3c4; box-shadow: 0 0 16px rgba(255, 59, 92, .6); }
.fxb.rec.on svg { color: #fff; animation: dd-blink .9s infinite; }
.buildb {
    --b: 0; position: relative; overflow: hidden; flex: 1 1 130px; min-block-size: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; cursor: pointer;
    border: 2px solid #ffb0fa; background: linear-gradient(180deg, #ff4ff3, #9b12a8); font-weight: 900; font-size: 1rem; letter-spacing: .06em; touch-action: none;
    box-shadow: 0 6px 18px rgba(255, 61, 242, .35);
}
.buildb .bi svg { inline-size: 22px; block-size: 22px; }
.buildb b, .buildb .bi { position: relative; z-index: 1; }
.buildb .bfill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--b)); background: linear-gradient(90deg, #ffd23f, #fff); opacity: .55; }
.buildb.hold { animation: dd-buzz .09s infinite; border-color: #fff; box-shadow: 0 0 calc(10px + var(--b) * 30px) rgba(255, 255, 255, .8); }
.buildb:disabled { opacity: .45; }
@keyframes dd-buzz { 50% { transform: translateX(1px) scale(1.01); } }

.tray { border-radius: 14px; padding: 10px 12px; background: linear-gradient(160deg, #3a0f45, #14112f); border: 2px solid var(--rec); display: grid; gap: 8px; }
.tray.rise { animation: dd-up .4s cubic-bezier(.2, .9, .3, 1.3) both; }
.trow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trow .disc { inline-size: 38px; block-size: 38px; color: var(--accent); animation: dd-spin 3s linear infinite; }
.tmeta { display: grid; flex: 1 1 100px; }
.tmeta small { color: var(--muted); }
.tname { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.tname input { inline-size: 150px; }
.x { inline-size: 36px; block-size: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 1.3rem; line-height: 1; }
.tbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.tray .roll { margin: 0; }

.sheet { position: absolute; inset-inline: 8px; inset-block-end: 8px; z-index: 5; border-radius: 16px; padding: 10px; background: rgba(14, 10, 40, .97); border: 2px solid var(--accent); box-shadow: 0 -10px 30px rgba(0, 0, 0, .5); animation: dd-up .3s both; }
.shead { display: flex; align-items: center; gap: 8px; margin-block-end: 8px; }
.shead > div { flex: 1; display: grid; }
.shead small { color: var(--muted); font-size: .8rem; }
.grid { display: grid; gap: 5px; }
.grow { display: grid; grid-template-columns: 54px repeat(16, 1fr); gap: 3px; align-items: center; }
.gl { font-size: .7rem; font-weight: 800; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell { block-size: clamp(26px, 5vh, 38px); min-inline-size: 0; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06); cursor: pointer; padding: 0; }
.cell.b { background: rgba(255, 255, 255, .13); }
.cell.on { background: linear-gradient(180deg, #ff6af5, #c11bd0); border-color: #ffb0fa; box-shadow: 0 0 8px rgba(255, 61, 242, .6); }
.cell.ph { outline: 2px solid rgba(255, 210, 63, .8); outline-offset: -1px; }
.cell.on.ph { background: #ffd23f; }

.overlay { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 12px; background: rgba(5, 4, 18, .72); backdrop-filter: blur(3px); border-radius: 18px; overflow: hidden; }
.card { position: relative; inline-size: min(100%, 440px); border-radius: 20px; padding: 20px 18px; text-align: center; background: linear-gradient(180deg, #221a55, #110d2e); border: 2px solid var(--border); box-shadow: 0 20px 50px rgba(0, 0, 0, .55); animation: dd-up .35s cubic-bezier(.2, .9, .3, 1.3) both; }
.card h2 { margin: 0 0 8px; font-size: 1.7rem; }
.card.won { border-color: var(--accent2); }
.stars { display: flex; justify-content: center; gap: 8px; margin: 6px 0; }
.stars span { inline-size: 46px; block-size: 46px; color: rgba(255, 255, 255, .15); }
.stars span.pop { color: var(--accent2); filter: drop-shadow(0 0 10px rgba(255, 210, 63, .8)); animation: dd-star .5s cubic-bezier(.2, .9, .3, 1.6) both; }
@keyframes dd-star { from { transform: scale(0) rotate(-90deg); } }
.big { font-size: 2.6rem; font-weight: 900; margin: 0; color: #fff; text-shadow: 0 0 20px rgba(255, 61, 242, .6); }
.lbl { margin: 0; color: var(--muted); }
.lbl b { color: var(--accent2); }
.ribbon { display: inline-block; margin: 8px 0 0; padding: 4px 14px; border-radius: 999px; background: linear-gradient(90deg, #ffd23f, #ff8f3a); color: #2b1600; font-weight: 900; animation: dd-ribbon 1s .9s both; }
@keyframes dd-ribbon { 0% { transform: scale(0); } 60% { transform: scale(1.15) rotate(-3deg); } 100% { transform: none; } }
.stat { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0; margin: 12px 0 0; }
.stat li { display: grid; min-inline-size: 64px; padding: 6px 8px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.stat b { font-size: 1.2rem; }
.stat span { font-size: .72rem; color: var(--muted); }
.unl { color: var(--mint); font-weight: 800; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; inset-block-start: -12px; inset-inline-start: var(--x); inline-size: 8px; block-size: 13px; background: hsl(var(--h) 95% 60%); animation: dd-conf 2.6s var(--d) ease-in both; }
@keyframes dd-conf { to { transform: translateY(560px) rotate(var(--r)); opacity: .2; } }

.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 14px; background: rgba(5, 4, 18, .75); }
.card.share input { inline-size: 100%; margin-block-start: 6px; font-size: .85rem; }
.card.share h2 { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 1.3rem; }
.card.share h2 svg { inline-size: 22px; block-size: 22px; }
.card .x { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; }
.card p { color: var(--muted); }

@media (max-width: 420px) {
    .game { padding: 4px; }
    .deck { padding: 6px; gap: 6px; }
    .ch span { display: none; }
    .fxb { min-inline-size: 50px; padding: 4px 6px; }
    .packs { gap: 4px; }
    .chip { padding: 5px 8px; font-size: .74rem; min-block-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* Easy-to-learn layer: stronger hints, key badges, the practice set coach. */
.cue kbd { display: inline-grid; place-items: center; min-inline-size: 1.6em; padding: 0 .35em; margin-inline-start: 4px; border-radius: 6px; background: var(--accent2); color: #1a1033; font: 900 .9rem/1.5 inherit; box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.cue .coach { color: #fff; font-weight: 700; font-size: .82rem; opacity: .92; }
.pad.hint { z-index: 2; animation: dd-hint .7s ease-in-out infinite alternate, dd-hintgrow .7s ease-in-out infinite alternate; }
.pad.hint .kb { opacity: 1; font-size: .8rem; font-weight: 900; inset-block-start: -9px; inset-inline-start: -7px; min-inline-size: 22px; block-size: 22px; line-height: 22px; border-radius: 7px; background: var(--accent2); color: #1a1033; z-index: 3; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
@keyframes dd-hintgrow { to { transform: scale(1.06); } }
.pads.coach .pad:not(.hint):not(.on):not(.cutme) { opacity: .55; }
.pads.coach .pad.hint::after { content: "▼"; position: absolute; inset-block-start: 1px; inset-inline-start: 50%; translate: -50% 0; color: var(--accent2); font-size: 12px; line-height: 1; text-shadow: 0 0 10px rgba(255, 210, 63, .9); animation: dd-arrow .6s ease-in-out infinite alternate; pointer-events: none; z-index: 3; }
@keyframes dd-arrow { to { transform: translateY(3px); } }
.buildb.hint { box-shadow: 0 0 0 3px var(--accent2), 0 0 26px rgba(255, 210, 63, .85); animation: dd-hintgrow .7s ease-in-out infinite alternate; }
.buildb.hint.hold { animation: dd-buzz .09s infinite; }
@media (prefers-reduced-motion: reduce) { .pad.hint, .buildb.hint, .pads.coach .pad.hint::after { animation: none; } }
