/* Noos Descent */
.ds-body { margin: 0; background: #070a18; color: #e2e8f0; font-family: 'Quicksand', system-ui, sans-serif; min-height: 100vh; overflow-x: hidden; }
.ds-page { --sz: 400px; --ac: #38bdf8; display: flex; flex-direction: column; align-items: center; padding: 6px 8px 10px; box-sizing: border-box; }
.ds-page [hidden], .ds-body [hidden] { display: none !important; }

/* HUD */
.ds-hud { width: var(--sz); max-width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; padding: 2px 4px 6px; box-sizing: border-box; }
.ds-hud-l { text-align: left; } .ds-hud-m { text-align: center; } .ds-hud-r { text-align: right; }
.ds-score { font-weight: 800; font-size: clamp(24px, calc(var(--sz) * 0.085), 38px); line-height: 1; color: #fff; text-shadow: 0 0 14px rgba(56,189,248,.55); font-variant-numeric: tabular-nums; }
.ds-best { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #94a3b8; margin-top: 3px; }
.ds-wave { font-weight: 800; font-size: clamp(14px, calc(var(--sz) * 0.04), 18px); letter-spacing: .1em; color: #bae6fd; }
.ds-mode { font-size: 10px; font-weight: 800; letter-spacing: .16em; color: #64748b; margin-top: 3px; }
.ds-lives { font-weight: 800; font-size: clamp(17px, calc(var(--sz) * 0.05), 22px); color: #fb7185; letter-spacing: .06em; line-height: 1; min-height: 20px; white-space: nowrap; }
.ds-lives.low { animation: dsPulse .7s infinite alternate; }
.ds-combo { font-size: 12px; font-weight: 800; color: #7dd3fc; margin-top: 4px; min-height: 14px; letter-spacing: .06em; }
@keyframes dsPulse { from { opacity: 1; } to { opacity: .45; } }

.ds-pwrow { width: var(--sz); max-width: 100%; display: flex; gap: 6px; min-height: 22px; padding: 0 4px 4px; box-sizing: border-box; }
.ds-pw { position: relative; flex: 0 0 auto; width: 54px; height: 20px; border-radius: 10px; background: rgba(255,255,255,.08); overflow: hidden; border: 1px solid var(--c); }
.ds-pw i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); opacity: .35; transition: width .15s linear; }
.ds-pw b { position: relative; z-index: 1; display: block; text-align: center; font-size: 12px; line-height: 18px; color: #fff; }

/* Stage */
.ds-stage-wrap { display: flex; justify-content: center; }
.ds-stage { position: relative; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px rgba(148,163,184,.18), 0 12px 40px rgba(0,0,0,.55); background: #0b1026; touch-action: none; user-select: none; -webkit-user-select: none; }
#ds-cv { display: block; touch-action: none; cursor: ew-resize; }
.ds-count { position: absolute; left: 0; right: 0; top: 34%; text-align: center; font-size: 84px; font-weight: 800; color: #fff; text-shadow: 0 0 24px var(--ac); pointer-events: none; }

/* Overlays */
.ds-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; background: rgba(5,8,22,.78); backdrop-filter: blur(3px); overflow-y: auto; padding: 14px; box-sizing: border-box; }
.ds-overlay > :first-child { margin-top: auto; } .ds-overlay > :last-child { margin-bottom: auto; }
.ds-opts { background: #0a0f24; backdrop-filter: none; }   /* opaque so nothing ghosts through the text */
.ds-card, .ds-optcard { width: min(92%, 340px); display: flex; flex-direction: column; gap: 10px; align-items: stretch; text-align: center; }
.ds-optcard { width: min(96%, 380px); }
.ds-logo { font-size: 44px; font-weight: 800; letter-spacing: .14em; color: #fff; text-shadow: 0 0 22px #38bdf8, 0 0 4px #38bdf8; line-height: 1; }
.ds-logo.small { font-size: 26px; margin-bottom: 4px; }
.ds-tag { font-size: 13px; font-weight: 700; letter-spacing: .08em; color: #93c5fd; margin-bottom: 4px; }
.ds-start-title { font-size: 18px; font-weight: 800; color: #fde68a; }
.ds-start-best { font-size: 13px; font-weight: 700; color: #94a3b8; margin-bottom: 6px; }

.ds-btn { font-family: inherit; font-weight: 800; letter-spacing: .1em; font-size: 14px; color: #e2e8f0; background: #17203f; border: 1px solid rgba(148,163,184,.3); border-radius: 12px; padding: 12px 14px; cursor: pointer; white-space: nowrap; transition: transform .1s, background .15s; }
.ds-btn:hover { background: #1e2a52; } .ds-btn:active { transform: scale(.97); }
.ds-btn-big { font-size: 18px; padding: 15px 16px; color: #04121f; background: linear-gradient(180deg, #7dd3fc, #38bdf8); border: 0; box-shadow: 0 6px 18px rgba(56,189,248,.35); }
.ds-btn-big:hover { background: linear-gradient(180deg, #a5e3ff, #4cc3fa); }
.ds-btn-ghost { background: transparent; }

.ds-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; border-top: 1px solid rgba(148,163,184,.14); padding-top: 9px; }
.ds-row > span { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: #94a3b8; flex: 0 0 auto; }
.ds-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ds-chip { font-family: inherit; font-weight: 800; font-size: 11px; letter-spacing: .08em; white-space: nowrap; color: #cbd5e1; background: #131b38; border: 1px solid rgba(148,163,184,.28); border-radius: 999px; padding: 7px 11px; cursor: pointer; }
.ds-chip.on { color: #04121f; background: #7dd3fc; border-color: #7dd3fc; }
.ds-chip.lock { opacity: .4; cursor: not-allowed; }
#trophy-list { text-align: left; max-height: 240px; overflow-y: auto; border: 1px solid rgba(148,163,184,.2); border-radius: 10px; padding: 8px; font-size: 13px; }

/* Bottom bar */
.ds-bar { display: flex; gap: 8px; margin-top: 8px; width: var(--sz); max-width: 100%; }
.ds-btn-bar { flex: 1 1 0; padding: 10px 6px; font-size: 12px; }
.ds-toast { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(15,23,42,.95); border: 1px solid rgba(148,163,184,.3); padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; z-index: 5; }

/* Short / narrow stages */
.ds-page.compact .ds-logo { font-size: 34px; } .ds-page.compact .ds-card { gap: 7px; } .ds-page.compact .ds-btn-big { padding: 11px 14px; font-size: 16px; }
.ds-page.compact .ds-tag { display: none; }
.ds-page.tight .ds-chip { padding: 6px 8px; font-size: 10px; } .ds-page.tight .ds-hud { gap: 4px; }

/* Phone landscape: board left, controls in a right column */
.ds-page.land { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 12px; padding-top: 4px; }
.ds-page.land .ds-hud { order: 3; width: 190px; grid-template-columns: 1fr 1fr; text-align: left; align-self: flex-start; padding-top: 0; }
.ds-page.land .ds-hud-l { grid-column: 1 / 3; }
.ds-page.land .ds-hud > div { text-align: left; }
.ds-page.land .ds-hud-r { text-align: right; }
.ds-page.land .ds-pwrow { order: 4; width: 190px; }
.ds-page.land .ds-stage-wrap { order: 1; }
.ds-page.land .ds-bar { order: 5; width: 190px; flex-direction: row; gap: 4px; margin-top: 0; }
.ds-page.land .ds-btn-bar { font-size: 10px; padding: 8px 2px; letter-spacing: .05em; }
.ds-page.land .ds-logo { font-size: 28px; } .ds-page.land .ds-logo.small { font-size: 20px; }
.ds-page.land .ds-card, .ds-page.land .ds-optcard { gap: 6px; }
.ds-page.land .ds-btn-big { padding: 9px 12px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .ds-lives.low { animation: none; } .ds-btn { transition: none; } }