/* Noos Cube 2.0 - assets/css/cube.css
   The stage size comes from JS (--cb-sz, set by fit()), so the cube is the same size on every phone and never overflows.
   The arcade modal (.nx-*) and the hint-ad modal bring their own styles. */
[hidden] { display: none !important; }
:root { --cb-sz: 340px; }   /* fit() in cube.js overwrites this on <html>; must NOT be redeclared on .cb-body */

.cb-body {
    --cb-bg: #0b0618; --cb-panel: rgba(255,255,255,.07); --cb-line: rgba(255,255,255,.14);
    --cb-text: #f1f5f9; --cb-mute: rgba(241,245,249,.62); --cb-acc: #3b82f6; --cb-acc2: #60a5fa; --cb-warn: #fbbf24;
    font-family: 'Quicksand', sans-serif;
    background: radial-gradient(120% 70% at 50% 0%, #1d1244 0%, #0e0828 48%, #070312 100%) fixed, #0b0618;
    color: var(--cb-text);
    -webkit-tap-highlight-color: transparent;
    margin: 0;
}
#beta-report-trigger { display: none !important; }   /* arcade games report bugs from Options / Pause, never a floating pill */

.cb-wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 8px max(12px, env(safe-area-inset-left)) calc(18px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right)); box-sizing: border-box; }
.cb-card { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cb-card > * { width: var(--cb-sz); max-width: 100%; box-sizing: border-box; }
.cb-card > .cb-hintcard { width: max(var(--cb-sz), min(100%, 560px)); }   /* wider than a small cube so the tip stays 2-3 lines and the whole game fits one screen */

/* HUD */
.cb-hud { display: grid; grid-template-columns: 1.25fr 1fr 1.1fr 40px; align-items: end; gap: 6px; padding: 2px 4px 0; }
.cb-stat { display: flex; flex-direction: column; min-width: 0; }
.cb-lab { font-size: 10px; font-weight: 800; letter-spacing: .14em; color: var(--cb-mute); }
.cb-val { font-size: clamp(1.15rem, 5.4vw, 1.7rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.05; white-space: nowrap; }
.cb-stat-time .cb-val { color: #fff; text-shadow: 0 0 18px rgba(96,165,250,.55); }
.cb-iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--cb-line); background: var(--cb-panel); color: var(--cb-text); font-family: inherit; font-weight: 800; font-size: 13px; cursor: pointer; display: grid; place-items: center; touch-action: manipulation; }
.cb-iconbtn.sm { width: 34px; height: 34px; font-size: 17px; border-radius: 11px; background: rgba(8,5,22,.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.cb-iconbtn:active { transform: scale(.94); }

/* board pills */
.cb-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cb-pill { font-family: inherit; font-weight: 800; font-size: 12px; letter-spacing: .08em; padding: 9px 4px; border-radius: 999px; border: 1px solid var(--cb-line); background: transparent; color: var(--cb-mute); cursor: pointer; touch-action: manipulation; white-space: nowrap; }
.cb-pill.on { background: var(--cb-acc); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -6px var(--cb-acc); }
.cb-tick { color: #34d399; margin-left: 2px; }
.cb-pill.on .cb-tick { color: #fff; }

/* stage */
.cb-stage { position: relative; width: var(--cb-sz); height: var(--cb-sz); border-radius: 24px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
    background: radial-gradient(70% 60% at 50% 42%, rgba(96,165,250,.16), transparent 70%), radial-gradient(120% 90% at 50% 0%, #24165a, #0d0827 70%);
    border: 1px solid var(--cb-line); box-shadow: 0 18px 50px -18px rgba(0,0,0,.7), inset 0 0 60px rgba(0,0,0,.35); }
#cubeCanvas, #fxCanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; display: block; }
#cubeCanvas:active { cursor: grabbing; }
#fxCanvas { pointer-events: none; z-index: 3; }
.cb-stage.cb-covered #cubeCanvas { visibility: hidden; }
.cb-viewbtns { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.cb-tag { position: absolute; top: 10px; left: 10px; z-index: 5; font-size: 10px; font-weight: 800; letter-spacing: .14em; padding: 5px 9px; border-radius: 999px; background: rgba(8,5,22,.7); border: 1px solid var(--cb-line); color: #c7d2fe; }
.cb-tag.warn { color: #fde68a; border-color: rgba(251,191,36,.5); }

.cb-banner { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 6; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 18px; background: rgba(8,5,22,.82); border: 1px solid var(--cb-line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: cbIn .25s ease-out; }
.cb-banner-big { font-size: 22px; font-weight: 800; letter-spacing: .06em; color: #fff; min-width: 1ch; white-space: nowrap; }
.cb-banner-num .cb-banner-big { font-size: 34px; font-variant-numeric: tabular-nums; min-width: 1.6ch; text-align: center; color: var(--cb-acc2); }
.cb-banner-small { flex: 1; font-size: 12px; font-weight: 600; line-height: 1.35; color: var(--cb-mute); }
.cb-banner-btn { flex: none; padding: 9px 14px; }
@keyframes cbIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.cb-pausecard { position: absolute; inset: 0; z-index: 8; background: #0d0820; display: grid; place-items: center; }
.cb-pausecard-in { display: flex; flex-direction: column; gap: 9px; width: min(70%, 240px); }
.cb-pausecard-h { text-align: center; font-weight: 800; letter-spacing: .3em; font-size: 15px; color: var(--cb-acc2); margin-bottom: 4px; }
.cb-count { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; font-size: 84px; font-weight: 800; background: #0d0820; color: #fff; text-shadow: 0 0 30px var(--cb-acc); }

/* buttons */
.cb-btn { font-family: inherit; font-weight: 800; font-size: 13px; letter-spacing: .08em; padding: 12px 8px; border-radius: 14px; border: 1px solid var(--cb-line); background: var(--cb-panel); color: var(--cb-text); cursor: pointer; touch-action: manipulation; white-space: nowrap; transition: transform .1s, background .2s; }
.cb-btn:hover { background: rgba(255,255,255,.12); }
.cb-btn:active { transform: scale(.97); }
.cb-btn:disabled { opacity: .45; cursor: default; }
.cb-btn.cb-primary { background: var(--cb-acc); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -8px var(--cb-acc); }
.cb-btn.cb-primary:hover { filter: brightness(1.08); background: var(--cb-acc); }
.cb-btn.ghost { background: transparent; }
.cb-btn small { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; opacity: .75; }
.cb-btn.dim { opacity: .5; }
.cb-btn.busy { opacity: .6; pointer-events: none; }
.cb-btn.busy::after { content: " ..."; }
.cb-actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.1fr; gap: 6px; margin-top: 2px; }
.cb-actions .cb-btn { min-width: 0; padding: 12px 4px; font-size: 12px; letter-spacing: .05em; overflow: hidden; text-overflow: clip; }
.cb-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 3px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: 11px; }

/* hint card */
.cb-hintcard { padding: 10px 12px 12px; border-radius: 18px; background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.35); }
.cb-hint-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cb-hint-stage { font-weight: 800; font-size: 13px; color: #fde68a; }
.cb-linkbtn { background: none; border: 0; color: var(--cb-mute); font: inherit; font-weight: 800; font-size: 11px; letter-spacing: .1em; cursor: pointer; padding: 4px 2px; }
.cb-pips { display: flex; gap: 4px; margin: 7px 0 6px; }
.cb-pips i { flex: 1; height: 5px; border-radius: 4px; background: rgba(255,255,255,.14); }
.cb-pips i.d { background: #34d399; } .cb-pips i.c { background: #fbbf24; }
.cb-hint-tip { font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--cb-mute); margin-bottom: 8px; }
.cb-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cb-chip { min-width: 30px; padding: 5px 8px; border-radius: 9px; text-align: center; font-weight: 800; font-size: 13px; background: rgba(255,255,255,.1); border: 1px solid transparent; }
.cb-chip.done { opacity: .35; text-decoration: line-through; }
.cb-chip.cur { background: #fbbf24; color: #1c1300; box-shadow: 0 0 14px -2px #fbbf24; }
.cb-more { align-self: center; color: var(--cb-mute); font-weight: 800; }

/* move pad */
.cb-pad { display: flex; flex-direction: column; gap: 6px; }
.cb-padrow { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cb-padbtn { font-family: inherit; font-weight: 800; font-size: 15px; padding: 11px 0; border-radius: 12px; border: 1px solid var(--cb-line); background: var(--cb-panel); color: var(--cb-text); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.cb-padbtn:active { background: var(--cb-acc); }

/* overlays: sheets + options. Never centre a scrolling overlay with justify-content:center (it clips the top). */
.cb-ov { position: fixed; inset: 0; z-index: 15000; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 12px; box-sizing: border-box; overflow-y: auto; -webkit-overflow-scrolling: touch; background: rgba(6,3,16,.9); }
.cb-ov > :first-child { margin-top: auto; }
.cb-ov > :last-child { margin-bottom: auto; }
.cb-sheet, .cb-optscard { width: 100%; max-width: 380px; box-sizing: border-box; border-radius: 24px; border: 1px solid var(--cb-line); background: linear-gradient(180deg, #1b0d33, #0b0618); box-shadow: 0 24px 60px rgba(0,0,0,.55); color: var(--cb-text); }
.cb-sheet { padding: 20px 18px 18px; text-align: center; }
.cb-sheet-h { font-weight: 800; font-size: 18px; letter-spacing: .04em; margin-bottom: 8px; }
.cb-sheet-p { margin: 0 0 16px; font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--cb-mute); }
.cb-sheet-actions { display: flex; gap: 10px; }
.cb-sheet-actions .cb-btn { flex: 1; }
.cb-sheet-actions.col { flex-direction: column; }

.cb-optscard { padding: 16px 14px 16px; opacity: 1; background: #120a28; }
.cb-opts-h { display: flex; justify-content: space-between; align-items: center; font-weight: 800; letter-spacing: .24em; font-size: 14px; color: var(--cb-acc2); padding: 0 4px 10px; }
.cb-x { background: none; border: 0; color: var(--cb-mute); font-size: 30px; line-height: 1; cursor: pointer; padding: 0 6px; font-family: inherit; }
.cb-opts-body { display: flex; flex-direction: column; gap: 7px; }
.cb-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--cb-line); background: var(--cb-panel); color: var(--cb-text); font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-align: left; touch-action: manipulation; }
.cb-row b { color: var(--cb-acc2); font-size: 12px; letter-spacing: .1em; white-space: nowrap; }
.cb-row:active { background: rgba(255,255,255,.14); }
.cb-back { margin-top: 6px; }
.cb-note { margin: 0 2px 4px; font-size: 12px; font-weight: 600; line-height: 1.45; color: var(--cb-mute); }
.cb-trophies, .cb-statsbox { max-height: 46vh; overflow-y: auto; padding: 6px; border-radius: 14px; background: rgba(0,0,0,.22); -webkit-overflow-scrolling: touch; }
.cb-statsbox { font-size: 13px; padding: 10px 12px; }
.cb-statsbox table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cb-statsbox th, .cb-statsbox td { padding: 5px 4px; text-align: right; font-weight: 700; }
.cb-statsbox th:first-child, .cb-statsbox td:first-child { text-align: left; }
.cb-statsbox thead th { font-size: 10px; letter-spacing: .12em; color: var(--cb-mute); }
.cb-statsbox p { margin: 8px 0 0; color: var(--cb-mute); font-weight: 600; }

.cb-skinrow { padding: 8px 4px 2px; }
.cb-skinlab { display: block; font-weight: 700; font-size: 14px; margin: 0 0 8px 10px; }
.cb-skins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.cb-skin { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; border-radius: 14px; border: 2px solid var(--cb-line); background: var(--cb-panel); color: var(--cb-text); font-family: inherit; cursor: pointer; }
.cb-skin.on { border-color: var(--cb-acc2); box-shadow: 0 0 14px -4px var(--cb-acc); }
.cb-skin.lock { opacity: .55; }
.cb-skin .sw { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 34px; height: 34px; }
.cb-skin .sw i { border-radius: 4px; }
.cb-skin em { font-style: normal; font-weight: 800; font-size: 11px; }
.cb-skin small { font-size: 9px; font-weight: 700; color: var(--cb-mute); }

.cb-prow { display: flex; gap: 8px; align-items: stretch; }
.cb-prow .cb-btn { flex: 1; }
.cb-len { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--cb-mute); }
.cb-len input { width: 56px; }
.cb-optscard input[type=text], .cb-optscard input[type=number] { font-family: inherit; font-size: 16px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--cb-line); background: rgba(0,0,0,.35); color: #fff; min-width: 0; box-sizing: border-box; }
.cb-optscard input[type=text] { flex: 1; }
.cb-codebox { padding: 6px 2px 0; }
.cb-codebox label { display: block; font-size: 12px; font-weight: 700; color: var(--cb-mute); margin: 0 4px 6px; }
.cb-codebox .cb-btn { flex: none; padding: 10px 16px; }
.cb-err { min-height: 18px; margin: 6px 4px 0; font-size: 12px; font-weight: 700; color: #fca5a5; }

.cb-toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 21500; max-width: 90%; text-align: center; background: #10b981; color: #fff; padding: 11px 20px; border-radius: 30px; font-weight: 800; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.cb-fatal { position: absolute; inset: 0; display: grid; place-content: center; padding: 20px; text-align: center; color: #fecaca; font-weight: 600; }
.cb-fatal b { color: #fff; font-size: 16px; }

/* short, wide screens: stage left, controls right */
@media (orientation: landscape) and (max-height: 600px) {
    .cb-wrap.cb-land { max-width: none; }
    .cb-wrap.cb-land .cb-card { display: grid; grid-template-columns: var(--cb-sz) minmax(210px, 1fr); grid-template-areas: "stage hud" "stage modes" "stage hint" "stage pad" "stage actions"; align-content: center; justify-content: center; gap: 8px 14px; }
    .cb-wrap.cb-land .cb-card > * { width: auto; }
    .cb-wrap.cb-land .cb-stage { grid-area: stage; width: var(--cb-sz); }
    .cb-wrap.cb-land .cb-hud { grid-area: hud; align-self: end; }
    .cb-wrap.cb-land .cb-modes { grid-area: modes; }
    .cb-wrap.cb-land .cb-hintcard { grid-area: hint; }
    .cb-wrap.cb-land .cb-pad { grid-area: pad; }
    .cb-wrap.cb-land .cb-actions { grid-area: actions; grid-template-columns: 1fr 1fr; }
}
.cb-tight .cb-banner-small { font-size: 11px; }
.cb-tight .cb-banner-big { font-size: 18px; }
@media (max-width: 360px) { .cb-actions .cb-btn { font-size: 11px; letter-spacing: .03em; } .cb-pill { font-size: 11px; } }
@media (max-width: 360px) { .cb-badge { min-width: 15px; height: 15px; padding: 0 3px; margin-left: 2px; font-size: 10px; } .cb-actions { grid-template-columns: 1.2fr 1.1fr 1fr 1.1fr; } }
@media (prefers-reduced-motion: reduce) { .cb-banner { animation: none; } .cb-btn, .cb-iconbtn { transition: none; } }