/* game-kit.css: the shared look of the 3D games (game screen, score bar, menus, banners).
   The game screen is dark in both themes, like a monitor. Each game sets its own colors on .gk-stage:
   --gk-a (you), --gk-b (the bot or the other side), --gk-bg (behind the 3D picture). */
.gk-main { display: flex; flex-direction: column; padding: 10px; }
.gk-stage {
  --gk-a: #47c6e8; --gk-b: #ff6f61; --gk-bg: #0c0b1c; --gk-ink: #f2f3ff; --gk-soft: #c3c6e4;
  position: relative; flex: 1; min-height: 230px; border-radius: 14px; overflow: hidden; isolation: isolate;
  background: var(--gk-bg); color: var(--gk-ink); user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.gk-stage:fullscreen { border-radius: 0; }
.gk-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.gk-stage.is-aiming canvas { cursor: none; }

/* Score bar at the top, and the pause button in its corner */
.gk-hud { position: absolute; inset: 10px 10px auto; z-index: 2; display: flex; justify-content: center; pointer-events: none; }
.gk-hud[hidden] { display: none; }
.gk-score { display: flex; align-items: stretch; border-radius: 12px; overflow: hidden; background: rgba(10, 10, 28, 0.72); border: 1px solid rgba(255, 255, 255, 0.14); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.gk-team { display: flex; align-items: center; gap: 10px; padding: 5px 14px; }
.gk-team span { font-size: 12.5px; font-weight: 700; color: var(--gk-soft); }
.gk-team b { min-width: 1.2ch; font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; text-align: center; }
.gk-team.is-a { box-shadow: inset 0 -3px 0 var(--gk-a); }
.gk-team.is-a b { color: var(--gk-a); }
.gk-team.is-b { box-shadow: inset 0 -3px 0 var(--gk-b); }
.gk-team.is-b b { color: var(--gk-b); }
.gk-to { display: grid; place-items: center; padding: 0 10px; font-size: 11.5px; font-weight: 650; color: var(--gk-soft); border-inline: 1px solid rgba(255, 255, 255, 0.1); white-space: nowrap; }
.gk-round { position: absolute; inset-inline-end: 0; top: 0; pointer-events: auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(10, 10, 28, 0.72); color: var(--gk-ink); cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.gk-round:hover { background: rgba(30, 30, 60, 0.85); }
.gk-round svg { width: 18px; height: 18px; }
.gk-round:focus-visible, .gk-card :focus-visible { outline: 3px solid var(--gk-a); outline-offset: 2px; }

/* Big words in the middle (3, 2, 1, Goal!) and a short note near the bottom */
.gk-banner { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none; padding: 0 12px; text-align: center; }
.gk-banner b { --c: #ffffff; font-size: clamp(38px, 9vmin, 84px); font-weight: 900; line-height: 1.05; color: #ffffff; text-shadow: 0 0 24px var(--c), 0 0 4px var(--c), 0 4px 18px rgba(0, 0, 0, 0.6); }
.gk-banner b.is-pop { animation: gk-pop 0.62s cubic-bezier(0.2, 0.9, 0.25, 1.2) both; }
.gk-banner b.is-small { font-size: clamp(24px, 5.5vmin, 46px); }
@keyframes gk-pop {
  0% { transform: scale(1.6); opacity: 0; }
  30% { transform: scale(0.94); opacity: 1; }
  60% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}
.gk-toast { position: absolute; inset-inline: 0; bottom: 16px; z-index: 3; display: flex; justify-content: center; pointer-events: none; }
.gk-toast span { padding: 5px 14px; border-radius: 99px; background: rgba(10, 10, 28, 0.78); border: 1px solid rgba(255, 255, 255, 0.18); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 0.2s, transform 0.2s; transform: translateY(6px); }
.gk-toast span.is-on { opacity: 1; transform: none; }

/* Menus: the start menu, Paused and the result */
.gk-ov { position: absolute; inset: 0; z-index: 4; display: flex; padding: 14px; overflow: auto; background: rgba(6, 6, 18, 0.42); }
.gk-ov[hidden] { display: none; }
.gk-card {
  position: relative; width: min(440px, 100%); margin: auto; padding: 24px 24px 20px; border-radius: 18px; text-align: center; overflow: hidden;
  background: rgba(13, 13, 32, 0.88); border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.gk-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--gk-a) 0 50%, var(--gk-b) 50% 100%); }
[dir="rtl"] .gk-card::before { background: linear-gradient(270deg, var(--gk-a) 0 50%, var(--gk-b) 50% 100%); }
.gk-card h2 { margin: 2px 0 6px; font-size: 30px; font-weight: 850; letter-spacing: -0.01em; color: #ffffff; }
.gk-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: var(--gk-soft); }
.gk-field { margin: 14px 0 0; }
.gk-label { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 700; color: var(--gk-soft); }
.gk-seg { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); }
.gk-seg button { min-width: 64px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: #dfe2fa; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.gk-seg button:hover { background: rgba(255, 255, 255, 0.08); }
.gk-seg button[aria-pressed="true"] { background: #ffffff; color: #12122a; }
.gk-desc { min-height: 1.5em; margin: 8px 0 0 !important; font-size: 13px !important; }
.gk-rec { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 14px 0 0; }
.gk-rec span { padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); font-size: 12.5px; font-weight: 650; color: #e4e6fb; }
.gk-rec b { font-variant-numeric: tabular-nums; }
.gk-go { min-width: 180px; height: 50px; margin-top: 18px; padding: 0 28px; border: 0; border-radius: 14px; background: var(--gk-a); color: #06121c; font: inherit; font-size: 17px; font-weight: 850; cursor: pointer; box-shadow: 0 0 26px color-mix(in srgb, var(--gk-a) 45%, transparent); }
.gk-go:hover { filter: brightness(1.08); }
.gk-alt { min-height: 40px; margin-top: 10px; padding: 0 18px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.28); background: transparent; color: var(--gk-ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.gk-alt:hover { background: rgba(255, 255, 255, 0.08); }
.gk-btns { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.gk-btns .gk-go, .gk-btns .gk-alt { margin-top: 16px; }
.gk-keys { margin: 14px 0 0 !important; font-size: 12.5px !important; line-height: 1.5 !important; }
.gk-big { margin: 2px 0 4px; font-size: 48px; font-weight: 900; font-variant-numeric: tabular-nums; color: #ffffff; }
.gk-big .is-a { color: var(--gk-a); }
.gk-big .is-b { color: var(--gk-b); }
.gk-new { display: inline-block; margin-bottom: 8px; padding: 3px 12px; border-radius: 99px; background: #ffd23f; color: #2a1d00; font-size: 13px; font-weight: 800; }
.gk-res { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.gk-res div { padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); text-align: start; }
.gk-res dt { font-size: 12px; color: var(--gk-soft); }
.gk-res dd { margin: 0; font-size: 17px; font-weight: 800; color: #ffffff; font-variant-numeric: tabular-nums; }

.gk-tip { font-size: 12.5px; color: var(--text-2); }
.gk-sound[aria-pressed="false"] .on, .gk-sound[aria-pressed="true"] .off { display: none; }

@media (max-width: 560px) {
  .gk-main { padding: 6px; }
  .gk-hud { inset: 8px 8px auto; }
  .gk-team { gap: 7px; padding: 4px 10px; }
  .gk-team b { font-size: 21px; }
  .gk-to { padding: 0 7px; font-size: 10.5px; }
  .gk-round { width: 36px; height: 36px; }
  .gk-card { padding: 20px 16px 16px; }
  .gk-card h2 { font-size: 25px; }
  .gk-seg button { min-width: 56px; padding: 0 10px; }
  .gk-tip { display: none; }
}
/* Short screens (a phone on its side): a smaller menu, with the choices side by side */
@media (max-height: 560px) {
  .gk-ov { padding: 8px; }
  .gk-card { width: min(720px, 100%); padding: 14px 16px 12px; }
  .gk-tagline, .gk-desc { display: none; }
  .gk-fields { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; }
  .gk-card h2 { margin-bottom: 2px; font-size: 22px; }
  .gk-card p { margin-bottom: 6px; font-size: 13px; }
  .gk-field { margin-top: 8px; }
  .gk-label { margin-bottom: 4px; }
  .gk-seg button { min-height: 32px; }
  .gk-desc { margin-top: 4px !important; }
  .gk-rec { margin-top: 8px; }
  .gk-go { height: 44px; margin-top: 10px; }
  .gk-keys { display: none; }
  .gk-big { font-size: 36px; }
}
/* No room for the pause button next to the score on narrow screens: the score moves to the start */
@media (max-width: 420px) {
  .gk-hud { justify-content: flex-start; }
}
/* The thumb stick (GK.stick) and a round action button for touch screens (also clickable with a mouse) */
.gk-stick { position: absolute; z-index: 3; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.35); pointer-events: none; }
.gk-stick[hidden] { display: none; }
.gk-stick span { position: absolute; inset: 31px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35); }
.gk-action {
  --cd: 1; --c: var(--gk-a);
  position: absolute; z-index: 3; inset-inline-end: 16px; bottom: 16px; display: grid; place-items: center; width: 78px; height: 78px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; touch-action: none;
  color: #12122a; background: radial-gradient(circle at 50% 50%, var(--c) 0 58%, transparent 59%), conic-gradient(rgba(255, 255, 255, 0.95) calc(var(--cd) * 360deg), rgba(255, 255, 255, 0.18) 0);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.gk-action:disabled { cursor: default; }
.gk-action svg { width: 30px; height: 30px; }
.gk-action[data-ready="false"] svg { opacity: 0.45; }
.gk-action:focus-visible { outline: 3px solid #ffffff; outline-offset: 3px; }
@media (max-width: 560px) { .gk-action { width: 70px; height: 70px; inset-inline-end: 12px; bottom: 12px; } }
html.a11y-still .gk-banner b.is-pop, html.a11y-still .gk-toast span { animation: none; transition: none; }
@media (prefers-reduced-motion: reduce) {
  .gk-banner b.is-pop { animation: none; }
  .gk-toast span { transition: none; }
}
