/* Video Poker — No. 095
 * A green-felt cabinet with a brass rail. Cards + paytable live on the canvas;
 * the machine buttons are real DOM so they focus and read correctly. */

:root {
  --bg: #08130f;
  --ink: #f2f6f1;
  --gold: #e8c06a;
  --felt: #0f3b2c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ------------------------------------------------------------------ frame */

.frame { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
.frame__corner {
  position: absolute;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: rgba(242, 246, 241, 0.3);
}
.frame__corner--tl { top: max(14px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); }
.frame__corner--tr { top: max(14px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); }
.frame__corner--bl { bottom: max(14px, env(safe-area-inset-bottom)); left: max(16px, env(safe-area-inset-left)); pointer-events: auto; }
.frame__corner--bl a { color: inherit; text-decoration: none; transition: color 0.18s ease; }
.frame__corner--bl a:hover { color: var(--gold); }
.frame__corner--bl a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
body.is-playing .frame__corner--tl,
body.is-playing .frame__corner--tr { opacity: 0; transition: opacity 0.3s ease; }

/* --------------------------------------------------------------- controls */

.controls {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 26px);
  z-index: 8;
  display: flex;
  align-items: stretch;
  gap: 9px;
  width: min(560px, calc(100% - 24px));
  justify-content: center;
}
.controls[hidden] { display: none; }

.btn {
  flex: 1 1 0;
  min-height: 46px;
  padding: 10px 8px;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #f0e5cd;
  background: linear-gradient(180deg, rgba(44, 62, 52, 0.95) 0%, rgba(20, 34, 28, 0.96) 100%);
  border: 1px solid rgba(232, 192, 106, 0.4);
  border-radius: 11px;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 240, 200, 0.16);
  transition: transform 0.1s ease, filter 0.16s ease, box-shadow 0.1s ease;
}
.btn:hover { filter: brightness(1.14); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 240, 200, 0.16); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn[disabled] { opacity: 0.42; cursor: default; filter: none; }
.btn[disabled]:active { transform: none; }

.btn--primary {
  flex: 1.35 1 0;
  color: #2a1c05;
  background: linear-gradient(180deg, #ffe6a8 0%, #e8c06a 54%, #c2913a 100%);
  border-color: rgba(255, 236, 190, 0.8);
  box-shadow: 0 5px 0 rgba(86, 60, 12, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn--primary:active { box-shadow: 0 2px 0 rgba(86, 60, 12, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.55); }

/* ------------------------------------------------------------ sound button */

.sound-btn {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 9;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(14, 32, 24, 0.78);
  border: 1px solid rgba(232, 192, 106, 0.32);
  border-radius: 50%;
  color: rgba(242, 246, 241, 0.82);
  font-size: 14px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: color 0.18s ease, border-color 0.18s ease;
}
.sound-btn:hover { color: var(--gold); border-color: var(--gold); }
.sound-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sound-btn[aria-pressed="false"] { color: rgba(242, 246, 241, 0.3); }

/* ---------------------------------------------------------------- overlay */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(120% 100% at 50% 34%, rgba(20, 66, 48, 0.76) 0%, rgba(4, 10, 8, 0.96) 74%);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: ovIn 0.35s ease both;
}
.overlay[hidden] { display: none; }
@keyframes ovIn { from { opacity: 0; } to { opacity: 1; } }

.panel {
  width: min(460px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 26px 26px 24px;
  text-align: center;
  background: linear-gradient(170deg, rgba(20, 56, 42, 0.95) 0%, rgba(7, 16, 12, 0.97) 100%);
  border: 1px solid rgba(232, 192, 106, 0.3);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.66), inset 0 1px 0 rgba(255, 235, 190, 0.14);
  color: var(--ink);
}
.panel__eyebrow {
  margin: 0 0 8px;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}
.panel__title {
  margin: 0 0 12px;
  font-size: clamp(32px, 7.4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  text-shadow: 0 0 40px rgba(232, 192, 106, 0.34);
}
.panel__text { margin: 0 0 20px; font-size: 14.5px; line-height: 1.6; color: rgba(242, 246, 241, 0.78); }
.panel__text b { color: var(--ink); font-weight: 700; }
.panel__keys {
  margin: 14px 0 0;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(242, 246, 241, 0.38);
  line-height: 1.9;
}

.play-btn {
  display: inline-block;
  padding: 13px 34px;
  font-size: 14.5px;
  font-weight: 800;
  font-family: inherit;
  color: #2a1c05;
  background: linear-gradient(180deg, #ffe6a8 0%, #e8c06a 56%, #c2913a 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(194, 145, 58, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.14s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.play-btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 14px 34px rgba(194, 145, 58, 0.54); }
.play-btn:active { transform: translateY(1px); }
.play-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* -------------------------------------------------- shared-badge docking
 * The button rail owns the bottom and the cards own the middle, so the badges
 * stack down the top-right under the sound button. The paytable width in
 * script.js (W - 116) is what keeps clear of them — change both together. */
.opt-tipjar.opt-tipjar { top: calc(max(56px, env(safe-area-inset-top) + 56px)); bottom: auto; transform: none; }
.opt-fs.opt-fs { top: calc(max(110px, env(safe-area-inset-top) + 110px)); bottom: auto; transform: none; }
.opt-tipjar.opt-tipjar.tj-nudge { animation: none; }
@media (max-width: 560px) {
  .opt-tipjar.opt-tipjar { top: calc(max(52px, env(safe-area-inset-top) + 52px)); }
  .opt-fs.opt-fs { top: calc(max(100px, env(safe-area-inset-top) + 100px)); }
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 560px) {
  .panel { padding: 22px 18px 20px; border-radius: 15px; }
  .btn { font-size: 9.5px; letter-spacing: 0.09em; min-height: 44px; }
}
@media (max-height: 520px) {
  .panel { padding: 16px 18px 16px; }
  .panel__title { font-size: clamp(22px, 5vh, 30px); margin-bottom: 6px; }
  .panel__text { font-size: 12.5px; margin-bottom: 12px; }
  .panel__keys { display: none; }
  .controls { bottom: max(8px, env(safe-area-inset-bottom)); }
  .btn { min-height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .overlay { animation: none; }
  .play-btn, .sound-btn, .btn { transition: none; }
}
