@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../assets/fonts/baloo2-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../assets/fonts/baloo2-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Sizes mirror tools/check/standard.json (hit.*MinCssPx). */
  --gk-answer-min: 60px;
  --gk-chrome-min: 48px;
  --ink: #3d3a5c;
  --ink-soft: #6b6890;
  --mint: #bdeedc;
  --mint-deep: #5cc98f;
  --peach: #ffd6c2;
  --peach-deep: #ff9f7a;
  --sky: #cfe9ff;
  --sky-deep: #6fb6f2;
  --butter: #fff1b8;
  --butter-deep: #f7c948;
  --lav: #e3d9ff;
  --lav-deep: #a58cf0;
  --pink: #ffc9de;
  --pink-deep: #f48fb1;
  --card: #ffffff;
  --radius: 28px;
  --shadow: 0 8px 0 rgba(61, 58, 92, 0.1), 0 18px 40px rgba(61, 58, 92, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: "Baloo 2", "Nunito", "Comic Sans MS", system-ui, sans-serif;
  color: var(--ink);
  background: #eaf6ff center / cover no-repeat fixed;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body.bg-meadow {
  background-image: url("../assets/img/bg-meadow.jpg");
}

body.bg-sky {
  background-image: url("../assets/img/bg-sky.jpg");
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  z-index: 120;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.topbar .title {
  flex: 1;
  font-size: clamp(22px, 3.4vw, 34px);
  font-weight: 800;
  text-shadow: 0 2px 0 #fff;
  pointer-events: none;
}

.icon-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
  font-weight: 800;
  font-size: 18px;
}

.icon-btn:hover {
  transform: translateY(-2px) scale(1.04);
}

.icon-btn:active {
  transform: translateY(3px) scale(0.96);
}

.icon-btn svg {
  width: 32px;
  height: 32px;
  stroke: var(--ink);
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn.voice-btn {
  width: auto;
  padding: 0 18px;
  border-radius: 32px;
  gap: 6px;
  display: flex;
  align-items: center;
}

.big-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 220px;
  padding: 16px 34px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  border-radius: 999px;
  background: var(--mint-deep);
  color: #fff;
  box-shadow: 0 8px 0 #3fa572, 0 16px 30px rgba(63, 165, 114, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  text-decoration: none;
}

.big-btn:hover {
  transform: translateY(-2px);
}

.big-btn:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #3fa572, 0 6px 16px rgba(63, 165, 114, 0.3);
}

.big-btn.alt {
  background: var(--sky-deep);
  box-shadow: 0 8px 0 #4a8fcc, 0 16px 30px rgba(74, 143, 204, 0.35);
}

.big-btn.alt:active {
  box-shadow: 0 2px 0 #4a8fcc, 0 6px 16px rgba(74, 143, 204, 0.3);
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(234, 246, 255, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 40;
  padding: 20px;
}

.overlay[hidden] {
  display: none;
}

.panel {
  background: var(--card);
  border-radius: 40px;
  box-shadow: var(--shadow);
  padding: 30px 40px 40px;
  text-align: center;
  max-width: 640px;
  width: 100%;
  animation: pop-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.panel h1,
.panel h2 {
  margin: 4px 0 10px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.1;
}

.panel p {
  margin: 0 0 22px;
  font-size: clamp(18px, 2.4vw, 24px);
  color: var(--ink-soft);
}

.panel .mascot {
  width: clamp(120px, 22vw, 190px);
  animation: bob 2.6s ease-in-out infinite;
}

.panel .btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
}

.mascot-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.mascot-box img {
  width: clamp(90px, 14vw, 150px);
  animation: bob 2.6s ease-in-out infinite;
  filter: drop-shadow(0 8px 10px rgba(61, 58, 92, 0.18));
}

.bubble {
  position: relative;
  background: var(--card);
  border-radius: 26px;
  padding: 12px 20px;
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 700;
  box-shadow: var(--shadow);
  margin-bottom: 60px;
  max-width: 280px;
}

.bubble::after {
  content: "";
  position: absolute;
  left: -12px;
  bottom: 18px;
  border: 12px solid transparent;
  border-right-color: var(--card);
  border-left: 0;
}

.bubble.say {
  animation: wiggle 0.5s ease;
}

.stars-count {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border-radius: 999px;
  padding: 6px 18px 6px 8px;
  box-shadow: var(--shadow);
  font-size: 26px;
  font-weight: 800;
}

.stars-count img {
  width: 46px;
  height: 46px;
}

.stars-count.bump {
  animation: bump 0.5s ease;
}

#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

.fly-star {
  position: fixed;
  width: 90px;
  height: 90px;
  z-index: 45;
  pointer-events: none;
  transition: transform 0.9s cubic-bezier(0.5, -0.3, 0.3, 1), opacity 0.9s ease;
}

.rotate-hint {
  display: none;
}

@keyframes pop-in {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-3deg);
  }
  75% {
    transform: rotate(3deg);
  }
}

@keyframes bump {
  0%,
  100% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.25);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-12px);
  }
  40% {
    transform: translateX(10px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(4px);
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 5px 0 #e0a92a, 0 0 0 0 rgba(247, 201, 72, 0.7);
  }
  50% {
    box-shadow: 0 5px 0 #e0a92a, 0 0 0 14px rgba(247, 201, 72, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.tint-balloon {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--c, #f48fb1);
  -webkit-mask: url("../assets/img/balloon.png") center / contain no-repeat;
  mask: url("../assets/img/balloon.png") center / contain no-repeat;
}

.tint-balloon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/img/balloon.png") center / contain no-repeat;
  mix-blend-mode: multiply;
}

.icon-btn .ui-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
}

.icon-btn.voice-btn .ui-icon {
  width: 36px;
  height: 36px;
}

.ui-icon.off {
  filter: grayscale(1);
  opacity: 0.45;
}

.panel .mascot.sticker {
  animation: none;
}

.panel .mascot.sticker-in {
  animation: sticker-pop 0.7s cubic-bezier(0.2, 1.6, 0.4, 1), bob 2.6s ease-in-out 0.7s infinite;
}

@keyframes sticker-pop {
  0% {
    transform: scale(0.2) rotate(-30deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  height: 100dvh;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

body.hub-page {
  height: auto;
  min-height: 100dvh;
}

button,
a,
img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.topbar {
  padding-top: max(14px, env(safe-area-inset-top));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

@media (max-width: 900px) {
  .topbar {
    gap: 10px;
  }
  .icon-btn {
    width: 56px;
    height: 56px;
  }
  .icon-btn.voice-btn {
    padding: 0 14px;
    font-size: 16px;
  }
  .stars-count {
    font-size: 22px;
    padding: 4px 14px 4px 6px;
  }
  .stars-count img {
    width: 38px;
    height: 38px;
  }
}

@media (hover: none) {
  .card:hover,
  .group:hover,
  .icon-btn:hover,
  .big-btn:hover {
    transform: none;
  }
}

.overlay {
  display: flex;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.overlay > .panel {
  margin: auto;
}

.icon-btn.voice-btn::after {
  content: attr(data-short);
  display: none;
  font-weight: 800;
}

@media (max-width: 600px) {
  .topbar {
    gap: 6px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-top: max(10px, env(safe-area-inset-top));
  }
  .topbar .title {
    min-width: 0;
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .icon-btn {
    flex: none;
    width: var(--gk-chrome-min);
    height: var(--gk-chrome-min);
  }
  .icon-btn .ui-icon {
    width: 32px;
    height: 32px;
  }
  .icon-btn.voice-btn {
    padding: 0 8px;
    gap: 2px;
    font-size: 14px;
  }
  .icon-btn.voice-btn .ui-icon {
    width: 26px;
    height: 26px;
  }
  .icon-btn.voice-btn span {
    display: none;
  }
  .icon-btn.voice-btn::after {
    display: inline;
  }
  .stars-count {
    flex: none;
    font-size: 18px;
    gap: 2px;
    padding: 2px 10px 2px 4px;
  }
  .stars-count img {
    width: 30px;
    height: 30px;
  }
  .brand img {
    width: 40px;
    height: 40px;
  }
}

@media (max-height: 560px), (max-width: 420px) {
  .panel {
    padding: 14px 20px 18px;
    border-radius: 30px;
  }
  .panel .mascot {
    width: clamp(70px, 18vh, 110px);
  }
  .panel h1,
  .panel h2 {
    font-size: clamp(24px, 6vw, 32px);
    margin: 2px 0 6px;
  }
  .panel p {
    font-size: 16px;
    margin-bottom: 12px;
  }
  .panel .btn-row {
    gap: 10px;
  }
  .big-btn {
    min-width: 150px;
    padding: 10px 22px;
    font-size: 20px;
  }
}

.rotate-hint {
  position: fixed;
  inset: 0;
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  background: rgba(234, 246, 255, 0.97);
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

.rotate-hint img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  animation: rotate-nudge 2.2s ease-in-out infinite;
}

@keyframes rotate-nudge {
  0%,
  60%,
  100% {
    transform: rotate(0);
  }
  30% {
    transform: rotate(-90deg);
  }
}

@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  body:not(.hub-page) .rotate-hint {
    display: flex;
  }
}

/* .gk-target utilities: see docs/game-standard.md, section 1. */
.gk-target {
  min-width: var(--gk-answer-min);
  min-height: var(--gk-answer-min);
  touch-action: manipulation;
}

.gk-target--chrome {
  min-width: var(--gk-chrome-min);
  min-height: var(--gk-chrome-min);
}

/* Hit slop: grows the tappable area without changing the visible box. */
.gk-target--slop {
  position: relative;
}

.gk-target--slop::before {
  content: "";
  position: absolute;
  inset: calc(var(--gk-slop, 8px) * -1);
}

/* Decoration never receives touches. */
.gk-decor,
.gk-decor * {
  pointer-events: none;
}

.gk-exit {
  z-index: 110;
  background: rgba(234, 246, 255, 0.94);
}

.overlay {
  padding-top: max(100px, calc(env(safe-area-inset-top) + 90px));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.gk-action-row,
.gk-levels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}

.gk-action,
.gk-level {
  border: 3px solid #526575;
  border-radius: 18px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  min-width: max(140px, var(--gk-answer-min));
  min-height: var(--gk-answer-min);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1 1 150px;
}

.gk-action {
  background: #f4f7fa;
  color: #243746;
}

.gk-action--primary {
  border-width: 5px;
  font-weight: 900;
  background: #dce5ec;
  flex-basis: 100%;
}

.gk-action svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gk-level {
  flex-direction: column;
  background: var(--gk-level-color);
  color: #192d27;
  border-color: currentColor;
}

.gk-level--hard {
  color: #fff;
}

.gk-level[aria-pressed="true"] {
  outline: 4px solid #243746;
  outline-offset: 4px;
}

.gk-level-badge {
  display: flex;
  gap: 3px;
  padding: 5px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
}

.gk-level-badge svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.gk-action:focus-visible,
.gk-level:focus-visible {
  outline: 4px solid #1574c4;
  outline-offset: 5px;
}

:where(button, a[href], [role="button"], [data-answer], [data-chrome], .gk-target) {
  transition: scale 80ms ease-out, box-shadow 80ms ease-out;
}

.is-pressed,
:where(button, a[href], [role="button"], [data-answer], [data-chrome], .gk-target):active {
  scale: 0.93;
  box-shadow: 0 0 0 4px #ffffff, 0 0 0 9px #ffb703;
}

:where(button, a[href], [role="button"], [data-answer], [data-chrome], .gk-target):focus-visible {
  outline: 5px solid #ffb703;
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .is-pressed,
  :where(button, a[href], [role="button"], [data-answer], [data-chrome], .gk-target):active {
    scale: none;
  }
}


.gk-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.gk-action-row .gk-action,
.gk-action-row .gk-action--primary {
  flex: 0 0 auto;
  min-width: 96px;
  min-height: 96px;
  padding: 14px;
  border-radius: 28px;
}

.gk-action-row .gk-action--primary {
  min-width: 120px;
  min-height: 120px;
  background: #ffd166;
  border-color: #c98a00;
  color: #5a3b00;
}

.gk-action-row .gk-action svg {
  width: 56px;
  height: 56px;
  stroke-width: 2.6;
}

.gk-action-row .gk-action--primary svg {
  width: 72px;
  height: 72px;
  stroke-width: 2.8;
}

.gk-action[data-icon="play"] svg path {
  fill: currentColor;
}

.gk-locked {
  animation: wiggle 0.4s ease;
}
