/* Corner Pocket — flat candy-vector UI chrome over the rendered world.
   Mirrors boardwalk-putt's chip/cta/panel system almost verbatim, retheme
   only (green felt + pink rail palette already matches the pool table). */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #1b2a3a; font-family: 'Segoe UI', system-ui, sans-serif; overflow: hidden; }

#stage { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 8px 0; }
canvas { max-width: 100vw; max-height: calc(100vh - 16px); aspect-ratio: 520 / 900; touch-action: none; border-radius: 14px; min-height: 0; flex: 0 1 auto; }
#hud:not(.hide) ~ * canvas, #stage:has(#hud:not(.hide)) canvas { max-height: calc(100vh - 90px); }

.hide { display: none !important; }

/* HUD — in flow above the canvas so chips never cover the table */
#hud { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: min(96vw, 640px); }
.chip { background: #fff; border-radius: 999px; padding: 10px 14px; font-weight: 700; font-size: 15px; color: #23445c; box-shadow: 0 3px 0 rgba(0,0,0,.25); border: none; text-decoration: none; min-height: 48px; display: inline-flex; align-items: center; }
.chip.btn { cursor: pointer; }
.chip.home { background: #ffd166; }
.chip.hint { background: #ffe27a; }
.chip.wide { max-width: 40vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Menu */
#menu { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(180deg, #ff6fa5 0%, #ffd166 55%, #3fc463 130%); text-align: center; padding: 20px; }
#menu h1 { font-size: clamp(34px, 7vw, 56px); color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,.2); }
.tag { color: #3a2a1a; font-weight: 700; }
.banner { background: #fff; border-radius: 12px; padding: 10px 16px; font-weight: 800; color: #23445c; box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.modes { display: flex; flex-direction: column; gap: 12px; width: min(86vw, 340px); }
.cta { background: #3fc463; color: #fff; font-size: 20px; font-weight: 800; border: none; border-radius: 16px; padding: 16px; cursor: pointer;
  box-shadow: 0 5px 0 #1f8f43; min-height: 56px; }
.cta:active { transform: translateY(3px); box-shadow: 0 2px 0 #1f8f43; }
.cta.alt { background: #a077ff; box-shadow: 0 5px 0 #7a50d6; }
.cta small { display: block; font-size: 12px; font-weight: 600; opacity: .9; }
.ghost { background: transparent; border: 2px solid rgba(255,255,255,.8); color: #fff; border-radius: 12px; padding: 10px 18px; font-weight: 700; cursor: pointer; text-decoration: none; }
.hint { color: rgba(0,0,0,.55); font-size: 13px; line-height: 1.5; }

/* Overlays */
#overlay { position: absolute; inset: 0; background: rgba(20, 35, 50, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.panel { background: #fff; border-radius: 20px; padding: 24px; width: min(92vw, 420px); text-align: center; box-shadow: 0 8px 0 rgba(0,0,0,.25); max-height: 88vh; overflow-y: auto; }
.panel h2 { color: #23445c; margin-bottom: 6px; }
.panel p { color: #23445c; margin: 4px 0; }
.panel .big { font-size: 22px; font-weight: 800; color: #23445c; margin: 6px 0; }
.panel .stars { font-size: 34px; }
.panel .rec { color: #d94a80; font-weight: 800; }
.panel .cta { width: 100%; margin-top: 10px; font-size: 18px; }
.panel .ghost { display: inline-block; margin-top: 10px; border-color: #23445c; color: #23445c; }
table.card { margin: 10px auto; border-collapse: collapse; font-size: 12px; }
table.card td, table.card th { border: 1px solid #dde5ee; padding: 3px 6px; color: #23445c; }
table.card .dim { color: #8aa0b4; }
