/* MaliGames casual kit (2026-11-14, phase 32): the play area guard and the
   result card for ตุ๊กตุ๊กซิ่ง and ฟินจัง. Colours come from the site's theme
   tokens (minimal.css / space.css), so Day and Night both work. Text on the
   orange is ink, never white (DESIGN.md "Contrast"). */

.gk-play {
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
html.gk-on, html.gk-on body { overscroll-behavior: none; }

/* ---------- result card ---------- */
.gk-res {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(17, 17, 17, .42);
  animation: gkFade .18s ease-out both;
  -webkit-user-select: none; user-select: none;
}
.gk-res-card {
  width: min(100%, 380px);
  background: var(--surface, #faf8f3); color: var(--text, #111111);
  border: 1px solid var(--edge, rgba(17, 17, 17, .08));
  border-radius: 22px; padding: 18px 18px 16px;
  box-shadow: 0 10px 30px rgba(17, 17, 17, .18);
  display: grid; gap: 12px; text-align: center;
  animation: gkPop .26s cubic-bezier(.2, .9, .3, 1.2) both;
}
.gk-res-t { margin: 0; font: 700 1.35rem/1.3 "Chakra Petch", Inter, "SukhumvitSet", system-ui, sans-serif; }
.gk-badge {
  justify-self: center; padding: 4px 12px; border-radius: 999px;
  background: #ffd23f; color: #111111; font-weight: 800; font-size: .85rem; line-height: 1.5;
}
.gk-stats { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.gk-stat {
  flex: 1 1 0; min-width: 88px; padding: 8px 6px; border-radius: 14px;
  background: var(--fill, rgba(17, 17, 17, .045));
  display: grid; gap: 2px;
}
.gk-stat span { font-size: .78rem; color: var(--muted, #6b655c); line-height: 1.5; }
.gk-stat b { font: 700 1.3rem/1.2 "Chakra Petch", Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.gk-say { display: flex; align-items: center; gap: 10px; text-align: left; }
.gk-say img { width: 48px; height: 48px; flex: none; }
.gk-say p { margin: 0; font-size: .95rem; line-height: 1.6; }
.gk-res-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.gk-btn {
  min-height: 44px; padding: 8px 14px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong, rgba(17, 17, 17, .16));
  background: transparent; color: var(--text, #111111);
  font-family: inherit; font-size: .9rem; font-weight: 600; line-height: 1.4; text-decoration: none; cursor: pointer;
}
.gk-btn.gk-line { background: #06c755; border-color: #06c755; color: #fff; }
.gk-go {
  width: min(100%, 380px); min-height: 64px; border: 0; border-radius: 22px; cursor: pointer;
  background: #ff4b2b; color: #111111;
  font: 700 1.4rem/1.3 "Chakra Petch", Inter, "SukhumvitSet", system-ui, sans-serif;
  box-shadow: 0 4px 0 var(--ink-sh, #111111);
  touch-action: manipulation;
}
.gk-go:active { transform: translateY(3px); box-shadow: none; }
.gk-go:focus-visible, .gk-btn:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }

/* big: the restart button takes what the card leaves, at least ~40% of the
   screen, down to the bottom edge (one tap from anywhere low on the screen) */
.gk-res-big { justify-content: flex-end; padding-bottom: 0; gap: 10px; }
.gk-res-big .gk-go {
  width: calc(100% + 32px); max-width: none; margin: 0 -16px;
  flex: 1 1 0; min-height: 38vh; min-height: 38dvh;
  border-radius: 28px 28px 0 0; box-shadow: none;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-height: 700px) {
  .gk-res-big .gk-res-card { gap: 8px; padding: 14px 14px 12px; }
  .gk-res-big .gk-res-t { font-size: 1.15rem; }
  .gk-res-big .gk-stat { padding: 6px; }
  .gk-res-big .gk-stat b { font-size: 1.1rem; }
}

/* in card (ตุ๊กตุ๊กซิ่ง, 2026-11-16): one compact card in the middle of the
   screen, the restart button inside it above three even small buttons */
.gk-res-in { background: rgba(17, 17, 17, .5); }
.gk-res-in .gk-res-card { width: min(100%, 340px); gap: 12px; padding: 18px 16px 14px; border-radius: 24px; }
.gk-res-in .gk-res-t { font-size: 1.25rem; }
.gk-res-in .gk-badge { margin-bottom: -4px; }
.gk-res-in .gk-stats { flex-wrap: nowrap; gap: 6px; }
.gk-res-in .gk-stat { min-width: 0; padding: 7px 4px; border-radius: 12px; }
.gk-res-in .gk-stat span { font-size: .74rem; }
.gk-res-in .gk-stat b { font-size: 1.12rem; white-space: nowrap; }
.gk-res-in .gk-say { gap: 8px; padding: 0 2px; }
.gk-res-in .gk-say img { width: 36px; height: 36px; }
.gk-res-in .gk-say p { font-size: .9rem; line-height: 1.5; }
.gk-res-in .gk-go {
  width: 100%; min-height: 52px; margin-top: 2px; border-radius: 999px;
  font-size: 1.15rem; box-shadow: 0 3px 0 var(--ink-sh, #111111);
}
.gk-res-in .gk-res-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gk-res-in .gk-btn { min-width: 0; padding: 6px 8px; font-size: .82rem; line-height: 1.3; text-align: center; }
@media (max-height: 640px) {
  .gk-res-in .gk-res-card { gap: 9px; padding: 14px 14px 12px; }
  .gk-res-in .gk-say img { width: 30px; height: 30px; }
}

@keyframes gkFade { from { opacity: 0; } }
@keyframes gkPop { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@media (prefers-reduced-motion: reduce) {
  .gk-res, .gk-res-card { animation: none; }
}

/* ---------- placeholder pages (until each game is built) ---------- */
.gk-soon .cc-body { justify-items: center; text-align: center; }
.gk-soon img { width: 96px; height: 96px; }
.gk-soon p { margin: 0; line-height: 1.6; }
.gk-kit { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
