/* Descent — the page around the game canvas. The look of menus is the site kit's (site/ui/balatro.css). */
/* a canvas redrawn every frame must not sit on the fixed felt (site/ui/README.md, last section) */
html body.bal-page.ds-page { background: #07090c; margin: 0; overflow: hidden; height: 100dvh; touch-action: none; -webkit-user-select: none; user-select: none; }

#ds-view { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#ds-canvas { image-rendering: pixelated; display: block; background: #07090c; }

.ds-overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(3, 4, 6, 0.6); padding: 12px; }
.ds-overlay[hidden] { display: none; }
.ds-panel { width: min(420px, 100%); max-height: 100%; overflow: auto; text-align: center; }
.ds-col { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin-top: 10px; }
.ds-note { color: var(--bal-text-muted, #b9c4c7); font-size: 16px; line-height: 1.25; margin: 8px 0; }
.ds-keys { width: 100%; border-collapse: collapse; font-size: 16px; text-align: left; }
.ds-keys th { font-weight: normal; color: var(--bal-text, #fff); padding: 3px 8px 3px 0; white-space: nowrap; }
.ds-keys td { color: var(--bal-text-muted, #b9c4c7); padding: 3px 0; }
.ds-recap { color: var(--bal-text, #fff); font-size: 20px; line-height: 1.25; margin: 10px 0 12px; }
.ds-summary { margin: 0 auto 4px; width: auto; }
.ds-summary th { color: var(--bal-text-muted, #b9c4c7); }
.ds-summary td { color: var(--bal-text, #fff); }
.ds-panel .bal-btn.ds-focus { outline: 3px solid var(--bal-attn, #ff9a00); outline-offset: 2px; }

/* ---- watching: a replay's bar, or the spectator's line, under the view */
body.ds-watching #ds-view { align-items: flex-start; }
#ds-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 8px max(10px, env(safe-area-inset-left)); background: #0b0e12; border-top: 2px solid #1f2a2c; min-height: 40px; }
#ds-bar[hidden] { display: none; }
.ds-bar-btn { padding: 6px 12px; font-size: 16px; text-decoration: none; }
.ds-bar-range { flex: 1 1 160px; min-width: 120px; accent-color: #fda200; }
.ds-bar-time, .ds-bar-note { color: var(--bal-text-muted, #b9c4c7); font-size: 16px; }
.ds-panel a.bal-btn { text-decoration: none; text-align: center; }
.ds-panel a.bal-btn[hidden] { display: none; }

/* ---- touch controls: only on a touch screen (main.js adds .ds-touch-on at the first touch, or for a coarse pointer) */
#ds-touch { display: none; }
body.ds-touch-on #ds-touch { display: block; position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#ds-touch > * { pointer-events: auto; }
#ds-stick { position: absolute; left: max(14px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom)); width: 132px; height: 132px; border-radius: 50%; background: rgba(255, 255, 255, 0.07); border: 2px solid rgba(255, 255, 255, 0.18); touch-action: none; }
#ds-nub { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); pointer-events: none; }
#ds-buttons { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); width: 190px; height: 150px; }
.ds-tb { position: absolute; font-family: var(--bal-font, monospace); font-size: 16px; color: #fff; background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.25); border-radius: 12px; touch-action: none; padding: 0; }
.ds-tb.ds-down { background: rgba(255, 255, 255, 0.34); }
.ds-tb[hidden] { display: none; }
.ds-tb-jump { right: 0; bottom: 0; width: 84px; height: 84px; border-radius: 50%; background: rgba(0, 157, 255, 0.28); }
.ds-tb-swing { right: 92px; bottom: 6px; width: 64px; height: 64px; border-radius: 50%; background: rgba(254, 95, 85, 0.24); }
.ds-tb-bomb { right: 110px; bottom: 80px; width: 48px; height: 48px; }
.ds-tb-rope { right: 56px; bottom: 96px; width: 48px; height: 48px; }
.ds-tb-run { right: 2px; bottom: 96px; width: 48px; height: 48px; }
.ds-tb-door { right: 150px; bottom: 30px; width: 44px; height: 44px; background: rgba(143, 214, 255, 0.35); }
/* (the site's own gear, the Games switcher, is in the corner: this sits beside it) */
#ds-menu-btn { right: calc(max(10px, env(safe-area-inset-right)) + 52px); top: max(8px, env(safe-area-inset-top)); width: 44px; height: 44px; font-size: 13px; letter-spacing: 1px; }

/* upright phone: the view on top, the controls under it */
@media (orientation: portrait) {
	body.ds-touch-on #ds-view { align-items: flex-start; padding-top: 44px; }
	#ds-stick { bottom: max(70px, env(safe-area-inset-bottom)); }
	#ds-buttons { bottom: max(64px, env(safe-area-inset-bottom)); }
}

/* ---- the Codex */
.ds-entry { text-align: left; padding: 6px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); }
.ds-entry-name { color: var(--bal-text, #fff); font-size: 18px; }
.ds-entry-text { color: var(--bal-text-muted, #b9c4c7); font-size: 15px; line-height: 1.2; }
.ds-unknown .ds-entry-name, .ds-unknown .ds-entry-text { opacity: 0.45; }
.ds-panel .bal-btn[hidden] { display: none; }
.ds-toast { position: fixed; left: 50%; top: max(52px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 22; padding: 6px 14px; border-radius: 8px; background: rgba(11, 14, 18, 0.88); border: 2px solid #5f3fa8; color: #fff; font-family: var(--bal-font, monospace); font-size: 16px; pointer-events: none; max-width: 90vw; text-align: center; }
.ds-toast[hidden] { display: none; }

/* ---- the boards */
.ds-board { display: flex; flex-direction: column; gap: 6px; }
.ds-board-me { outline: 2px solid var(--bal-attn, #ff9a00); }

/* ---- the training course's line */
.ds-toast.ds-hint { top: auto; bottom: max(64px, env(safe-area-inset-bottom)); border-color: #2c7f7a; font-size: 18px; }
