/* Penalty Shot: full-bleed canvas rink. Self-contained. */
@import url("https://fonts.googleapis.com/css2?family=Graduate&family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap");

:root{
  --ink: #f4efe4;
  --dim: rgba(244, 239, 228, 0.66);
  --faint: rgba(244, 239, 228, 0.4);
  --bg: #070c16;
  --red: #e0483f;
  --line: rgba(190, 215, 245, 0.18);
  --font-display: "Graduate", "Rockwell", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --tc-accent: #e0483f;
  --tc-on: #fff4e2;
  --tc-display: var(--font-display);
  --tc-ground: #0a1020;
}
*, *::before, *::after{ box-sizing: border-box; }
html, body{
  height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; touch-action: none;
}
canvas{ display: block; width: 100%; height: 100%; touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }

/* shootout tally */
.tally{
  position: fixed; z-index: 5; pointer-events: none; left: 50%; transform: translateX(-50%);
  top: max(12px, env(safe-area-inset-top));
  padding: 7px 14px 7px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(8, 14, 26, 0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono); display: grid; gap: 4px;
}
.tally[hidden]{ display: none; }
.tally__row{ display: flex; align-items: center; gap: 9px; }
.tally__who{ width: 34px; font-size: 10px; letter-spacing: 0.14em; color: var(--dim); }
.tally__pips{ display: flex; gap: 5px; min-width: 62px; }
.pip{ width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(190,215,245,0.4); position: relative; }
.pip.g{ background: #f4efe4; border-color: #f4efe4; box-shadow: 0 0 8px rgba(255,236,190,0.6); }
.pip.x{ border-color: rgba(224,72,63,0.8); }
.pip.x::before, .pip.x::after{ content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 1.5px; background: #e0483f; transform: translate(-50%,-50%) rotate(45deg); }
.pip.x::after{ transform: translate(-50%,-50%) rotate(-45deg); }
.pip.now{ border-color: #ffd98a; box-shadow: 0 0 8px rgba(255,217,138,0.7); }
.tally b{ font-size: 16px; font-weight: 600; min-width: 14px; text-align: right; font-variant-numeric: tabular-nums; }

.round{
  position: fixed; z-index: 5; pointer-events: none; left: 50%; transform: translateX(-50%);
  top: calc(max(12px, env(safe-area-inset-top)) + 76px);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim);
  text-shadow: 0 1px 6px rgba(0,0,0,0.8); white-space: nowrap; text-align: center;
}
.round[hidden]{ display: none; }
.call{
  position: fixed; z-index: 6; pointer-events: none; left: 0; right: 0; top: 30%; text-align: center;
  font-family: var(--font-display); font-size: clamp(38px, 12vw, 74px); line-height: 1; color: #fff7e6; letter-spacing: 0.02em;
  text-shadow: 0 0 22px rgba(255,170,90,0.55), 0 3px 0 rgba(120,20,24,0.9), 0 6px 18px rgba(0,0,0,0.7);
  opacity: 0; transform: scale(0.7);
}
.call.on{ animation: callpop 1.25s cubic-bezier(.2,.9,.25,1) forwards; }
.call small{ display: block; margin-top: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); text-shadow: 0 1px 6px #000; }
@keyframes callpop{ 0%{ opacity: 0; transform: scale(0.6); } 14%{ opacity: 1; transform: scale(1.08); } 24%{ transform: scale(1); } 78%{ opacity: 1; } 100%{ opacity: 0; transform: scale(1.04); } }
.hint{
  position: fixed; z-index: 9; pointer-events: none; left: 50%; transform: translateX(-50%);
  top: calc(max(12px, env(safe-area-inset-top)) + 112px); width: max-content; max-width: min(90vw, 440px); text-align: center;
  font-family: "Geist", system-ui, sans-serif; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: 0; color: #fff7e6;
  padding: 10px 18px; border-radius: 16px; background: rgba(8, 14, 26, 0.78); border: 1px solid rgba(255, 217, 138, 0.35);
  box-shadow: 0 6px 22px rgba(0,0,0,0.5); text-wrap: balance;
  opacity: 0; transition: opacity 300ms ease;
}
.hint.on{ opacity: 1; }
.ghost{
  position: fixed; left: 0; top: 0; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; pointer-events: none; z-index: 8; opacity: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.62) 0%, rgba(255,255,255,0.32) 58%, rgba(255,255,255,0.08) 100%);
  border: 2px solid rgba(255,255,255,0.85); box-shadow: 0 6px 22px rgba(0,0,0,0.5), 0 0 0 6px rgba(255,217,138,0.14); will-change: transform, opacity;
}
.ghost-rip{ position: fixed; left: 0; top: 0; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; pointer-events: none; z-index: 8; opacity: 0; border: 3px solid #ffd98a; }
.ghost-rip.go{ animation: grip 0.7s ease-out forwards; }
@keyframes grip{ 0%{ opacity: 0.95; transform: scale(0.5); } 100%{ opacity: 0; transform: scale(3.6); } }
.fade{ position: fixed; inset: 0; z-index: 7; background: #04070d; opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
.fade.on{ opacity: 1; }

.sound-btn{
  position: fixed; z-index: 6; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(8, 14, 26, 0.7); color: var(--ink);
  font-size: 15px; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform 140ms ease, border-color 140ms ease, opacity 140ms ease;
}
.sound-btn:hover{ transform: translateY(-1px); border-color: var(--red); }
.sound-btn[aria-pressed="false"]{ opacity: 0.45; }
.sound-btn:focus-visible{ outline: none; box-shadow: 0 0 0 3px rgba(224, 72, 63, 0.5); }

/* card */
.overlay{
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 22px; overflow-y: auto;
  background: radial-gradient(90% 70% at 50% 42%, rgba(4, 8, 16, 0.42), rgba(2, 4, 9, 0.84)); transition: opacity 240ms ease;
}
.overlay[hidden]{ display: none; }
.overlay.is-out{ opacity: 0; pointer-events: none; }
.panel{ max-width: 480px; text-align: center; margin: auto; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: rgba(10, 16, 30, 0.88); }
.panel__keys{ margin: 14px 0 0; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.04em; color: var(--faint); }
@media (hover: none), (pointer: coarse){ .panel__keys{ display: none; } }
html.tc .panel__title{ font-weight: 400; letter-spacing: 0; }
html.tc .panel__text{ font-size: 14px; line-height: 1.45; }
.panel__stat{ display: flex; justify-content: center; gap: 18px; margin: 0 0 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.panel__stat b{ display: block; font-size: 20px; color: var(--ink); letter-spacing: 0; font-weight: 600; }

/* frame corners */
.frame{ position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.frame__corner{ position: fixed; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); }
.frame__corner--tl{ top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); }
.frame__corner--tr{ top: max(14px, env(safe-area-inset-top)); right: max(58px, calc(env(safe-area-inset-right) + 58px)); }
.frame__corner--bl{ bottom: max(14px, env(safe-area-inset-bottom)); left: max(14px, env(safe-area-inset-left)); pointer-events: auto; }
.frame__corner--bl a{ color: var(--faint); text-decoration: none; }
.frame__corner--bl a:hover{ color: var(--red); }
@media (max-width: 620px){ .frame__corner--tr{ display: none; } .tally{ padding: 6px 11px 6px 10px; } }
@media (max-height: 500px){
  .tally{ top: max(6px, env(safe-area-inset-top)); padding: 4px 10px; gap: 2px; left: max(70px, calc(env(safe-area-inset-left) + 8px)); transform: none; }
  .round{ top: max(8px, env(safe-area-inset-top)); left: 50%; }
  .call{ top: 26%; font-size: clamp(34px, 9vw, 56px); }
  .hint{ top: auto; bottom: max(14px, calc(env(safe-area-inset-bottom) + 10px)); font-size: 15px; padding: 7px 14px; max-width: min(60vw, 440px); }
}
@media (prefers-reduced-motion: reduce){
  .call.on{ animation: none; opacity: 1; transform: none; }
  .fade{ transition: none; } .overlay, .hint, .sound-btn{ transition: none; } .ghost-rip.go{ animation: none; opacity: 0; }
}
.opt-tipjar.opt-tipjar{ top: calc(max(12px, env(safe-area-inset-top)) + 48px); bottom: auto; transform: none; }
.opt-fs.opt-fs{ top: calc(max(12px, env(safe-area-inset-top)) + 100px); bottom: auto; transform: none; }
.opt-tipjar.opt-tipjar.tj-nudge{ animation: none; }
