/* naxo7 Games — shared game UI */
:root {
  --bg: #d3e9e3;
  --ink: #2e3b47;
  --title: #a8577f;
  --pill: #9aa0a6;
  --pill-ink: #fff;
  --accent: #d47fa6;
  --btn: #fff;
  --gold: #ffc531;
  --gold-ink: #fff;
  --danger: #c62828;
  font-family: 'Baloo Bhaijaan 2', 'Baloo 2', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  flex-direction: column;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
svg { display: block; }

/* header */
.k-top {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 14px 6px;
  flex-shrink: 0;
}
.k-round {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--btn);
  color: var(--accent);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08);
  transition: transform 0.15s;
}
.k-round:active { transform: scale(0.92); }
.k-round svg { width: 28px; height: 28px; }
.k-title { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.k-pill {
  background: var(--pill);
  color: var(--pill-ink);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 1px 16px 0;
  border-radius: 999px;
  text-transform: uppercase;
  line-height: 1.6;
}
.k-title h1 { margin: 0; font-size: clamp(26px, 7vw, 34px); font-weight: 800; color: var(--title); line-height: 1.1; white-space: nowrap; }

/* bottom action buttons */
.k-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 8px 18px max(16px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}
.k-action { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 800; color: var(--gold); position: relative; }
.k-action .k-disc {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--gold-ink);
  display: grid;
  place-items: center;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.15s, opacity 0.2s;
}
.k-action:active .k-disc { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); }
.k-action[disabled] { opacity: 0.4; pointer-events: none; }
.k-action .k-disc svg { width: 32px; height: 32px; }
.k-badge {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: #333;
  border: 2px solid #9aa0a6;
  font-size: 15px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.k-stage { flex: 1; position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; }

/* hearts */
.k-hearts { display: flex; justify-content: center; gap: 14px; padding: 6px 0 2px; }
.k-hearts svg { width: 40px; height: 40px; transition: transform 0.3s, opacity 0.3s; }
.k-hearts .lost { opacity: 0.2; transform: scale(0.8); }

/* modal */
.k-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(20, 20, 30, 0.55);
  backdrop-filter: blur(4px);
  animation: k-fade 0.25s both;
  padding: 20px;
}
.k-card {
  background: #fff;
  color: #2b2b35;
  border-radius: 28px;
  padding: 26px 22px 20px;
  width: min(340px, 100%);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: k-pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.k-card .k-emoji { font-size: 56px; line-height: 1; }
.k-card h2 { margin: 8px 0 4px; font-size: 30px; font-weight: 800; color: var(--title); }
.k-card p { margin: 0 0 16px; font-size: 17px; color: #666; }
.k-card .k-btns { display: flex; flex-direction: column; gap: 10px; }
.k-btn {
  height: 54px;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 800;
  background: var(--gold);
  color: #fff;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.15);
}
.k-btn.ghost { background: #eee; color: #555; box-shadow: none; }
.k-btn:active { transform: translateY(2px); }
@keyframes k-fade { from { opacity: 0; } }
@keyframes k-pop { from { opacity: 0; transform: scale(0.8); } }

/* toast */
.k-toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  background: rgba(30, 30, 40, 0.9);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 60;
  white-space: nowrap;
  animation: k-fade 0.2s both;
}

/* loading */
.k-loading { font-weight: 800; font-size: 20px; opacity: 0.6; animation: k-pulse 1s ease-in-out infinite; }
@keyframes k-pulse { 50% { opacity: 0.25; } }

/* confetti */
.k-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
