/* Flatlands — 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.fl-page { background: #16203a; margin: 0; overflow: hidden; height: 100dvh; touch-action: none; -webkit-user-select: none; user-select: none; }

#fl-view { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#fl-canvas { touch-action: none; display: block; background: #16203a; }

.fl-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; }
.fl-overlay[hidden] { display: none; }
.fl-panel { width: min(420px, 100%); max-height: 100%; overflow: auto; text-align: center; }
.fl-col { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin-top: 10px; }
.fl-note { color: var(--bal-text-muted, #b9c4c7); font-size: 16px; line-height: 1.25; margin: 8px 0; }
.fl-wallet { color: #ffd86b; }
.fl-map-panel { width: min(1300px, 100%); max-height: 100%; overflow: auto; text-align: center; }
#fl-map-canvas { width: 100%; height: auto; image-rendering: pixelated; border-radius: 8px; background: #0b0e12; }
.fl-panel a.bal-btn { text-decoration: none; text-align: center; }
.fl-panel .bal-btn[hidden] { display: none; }
/* ---- watched: a replay or a friend's world (watch.js) */
#fl-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; }
#fl-bar[hidden] { display: none; }
.fl-bar-btn { padding: 6px 12px; font-size: 16px; text-decoration: none; }
.fl-bar-range { flex: 1 1 160px; min-width: 120px; accent-color: #fda200; }
.fl-bar-time, .fl-bar-note { color: var(--bal-text-muted, #b9c4c7); font-size: 16px; }
body.fl-watching #fl-touch, body.fl-watching #fl-pack-btn { display: none !important; }
body.fl-watching #fl-view { align-items: flex-start; }
.fl-toast { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 40; max-width: min(92vw, 520px); padding: 8px 16px; border-radius: 10px; border: 2px solid #ffd86b; background: rgba(20, 28, 40, 0.94); color: #ffe9a0; font-size: 18px; text-align: center; pointer-events: none; }
.fl-toast[hidden] { display: none; }
.fl-toast-in { animation: fl-toast-in 0.35s ease-out; }
@keyframes fl-toast-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .fl-toast-in { animation: none; } }
.fl-keys { width: 100%; border-collapse: collapse; font-size: 16px; text-align: left; }
.fl-keys th { font-weight: normal; color: var(--bal-text, #fff); padding: 3px 8px 3px 0; white-space: nowrap; }
.fl-keys td { color: var(--bal-text-muted, #b9c4c7); padding: 3px 0; }
.fl-panel .bal-btn.fl-focus { outline: 3px solid var(--bal-attn, #ff9a00); outline-offset: 2px; }

/* ---- touch controls: only on a touch screen (main.js adds .fl-touch-on at the first touch, or for a coarse pointer) */
#fl-touch { display: none; }
body.fl-touch-on #fl-touch { display: block; position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#fl-touch > * { pointer-events: auto; }
#fl-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; }
#fl-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; }
#fl-buttons { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); width: 190px; height: 150px; }
.fl-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; }
.fl-tb.fl-down { background: rgba(255, 255, 255, 0.34); }
.fl-tb[hidden] { display: none; }
.fl-tb-jump { right: 0; bottom: 0; width: 84px; height: 84px; border-radius: 50%; background: rgba(0, 157, 255, 0.28); }
.fl-tb-use { right: 92px; bottom: 6px; width: 64px; height: 64px; border-radius: 50%; background: rgba(254, 95, 85, 0.24); }
.fl-tb-prev { right: 110px; bottom: 84px; width: 48px; height: 44px; }
.fl-tb-next { right: 54px; bottom: 96px; width: 48px; height: 44px; }
.fl-tb-heal { right: 0; bottom: 100px; width: 46px; height: 44px; color: #ff8a8a; }
.fl-tb-hook { right: 150px; bottom: 30px; width: 44px; height: 44px; }
/* (the site's own gear, the Games switcher, is in the corner: this sits beside it) */
#fl-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.fl-touch-on #fl-view { align-items: flex-start; padding-top: 44px; }
	#fl-stick { bottom: max(70px, env(safe-area-inset-bottom)); }
	#fl-buttons { bottom: max(64px, env(safe-area-inset-bottom)); }
}

/* ---- the pack's screen (js/packui.js) */
.fl-pack-panel { --slot: 38px; display: flex; gap: 14px; align-items: flex-start; width: auto; max-width: 100%; max-height: 100%; overflow: auto; padding: 12px 14px; text-align: left; }
.fl-pack-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fl-pack-side { width: calc(var(--slot) * 10 + 27px); }
.fl-pack-title { margin: 0; font-size: 22px; }
.fl-grid { display: grid; grid-template-columns: repeat(10, var(--slot)); gap: 3px; }
.fl-grid[hidden], .fl-recs[hidden] { display: none; }
.fl-slot { position: relative; width: var(--slot); height: var(--slot); padding: 0; border: 2px solid rgba(255, 255, 255, 0.14); border-radius: 7px; background: rgba(12, 20, 32, 0.55); cursor: pointer; }
.fl-slot canvas { width: 100%; height: 100%; display: block; pointer-events: none; }
.fl-slot.fl-hot { background: rgba(40, 60, 90, 0.7); }
.fl-slot.fl-held { border-color: rgba(255, 244, 200, 0.75); }
.fl-slot.fl-sel { border-color: var(--bal-attn, #ff9a00); background: rgba(255, 154, 0, 0.25); }
.fl-n { position: absolute; right: 2px; bottom: 0; font-family: var(--bal-font, monospace); font-size: 13px; color: #fff; text-shadow: 1px 1px 0 #000; pointer-events: none; }
.fl-worn { display: flex; gap: 8px; align-items: center; }
.fl-worn-acc { margin-right: -5px; }
.fl-worn-hook { margin-left: 12px; }
.fl-worn-slot { display: flex; align-items: center; gap: 4px; }
.fl-worn-name, .fl-def { font-size: 15px; color: var(--bal-text-muted, #b9c4c7); }
.fl-def { margin-left: auto; color: var(--bal-text, #fff); }
.fl-pack-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.fl-pack-bar .bal-btn { padding: 4px 10px; font-size: 17px; min-width: 0; }
.fl-pbtn.fl-on { outline: 3px solid #fff; outline-offset: 1px; }
.fl-info { min-height: 2.5em; margin: 0; font-size: 15px; line-height: 1.25; color: var(--bal-text-muted, #b9c4c7); max-width: calc(var(--slot) * 10 + 27px); }
.fl-recs { display: flex; flex-direction: column; gap: 3px; max-height: calc(var(--slot) * 7 + 60px); overflow-y: auto; padding: 3px; }
.fl-rec { display: flex; align-items: center; gap: 8px; padding: 2px 8px 2px 2px; border: 2px solid rgba(255, 255, 255, 0.14); border-radius: 7px; background: rgba(12, 20, 32, 0.55); color: #fff; font-family: var(--bal-font, monospace); text-align: left; cursor: pointer; }
.fl-rec canvas { width: 32px; height: 32px; flex: none; pointer-events: none; }
.fl-rec-text { display: flex; flex-direction: column; min-width: 0; flex: 1; pointer-events: none; }
.fl-rec-name { font-size: 16px; }
.fl-rec-need { font-size: 13px; color: var(--bal-text-muted, #b9c4c7); }
.fl-rec-n { font-size: 14px; color: #9be28f; pointer-events: none; }
.fl-rec.fl-dim { opacity: 0.5; }
.fl-talk .fl-note { margin: 2px 4px; }
.fl-say { font-size: 16px; color: #fff3c4; }
.fl-use { cursor: default; border-style: dashed; }
.fl-pack-panel .fl-focus { outline: 3px solid var(--bal-attn, #ff9a00); outline-offset: 1px; z-index: 1; }
#fl-pack-btn { position: fixed; z-index: 21; right: calc(max(10px, env(safe-area-inset-right)) + 104px); top: max(8px, env(safe-area-inset-top)); width: 44px; height: 44px; font-size: 18px; }
@media (max-width: 900px) { .fl-pack-panel { --slot: 30px; gap: 10px; padding: 6px 10px; } .fl-pack-col { gap: 5px; } .fl-info { min-height: 1.3em; } .fl-pack-title { font-size: 18px; } .fl-recs { max-height: calc(var(--slot) * 6 + 30px); } }
@media (max-width: 720px) { .fl-pack-panel { flex-direction: column; --slot: min(34px, calc((100vw - 70px) / 10)); } .fl-recs { max-height: 220px; } }

/* co-op (js/coopmode.js): what the wire is doing, above the view; the room's lines */
.fl-coop-status { position: fixed; left: 50%; top: 34px; transform: translateX(-50%); z-index: 25; max-width: min(92vw, 520px); padding: 5px 14px; border-radius: 10px; background: rgba(10, 14, 22, 0.82); border: 2px solid #4a9ae8; color: #ffffff; font-size: 16px; text-align: center; pointer-events: none; }
.fl-coop-status[hidden] { display: none; }
.fl-coop-who { color: #ffffff; margin: 4px 0; }
.fl-coop-note { color: #ffd86b; }
#fl-coop .fl-note { overflow-wrap: anywhere; }
