* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

@font-face {
  font-family: "Peli Emoji";
  src: url("/fonts/NotoColorEmoji.woff2") format("woff2");
  font-display: swap;
}

/* The page itself never scrolls: on a touch screen that only lets a child
   drag the game out of view or rubber-band the whole layout. Anything that
   does not fit is scrolled inside <main> instead. */
html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: "Comic Sans MS", "Trebuchet MS", Verdana, sans-serif;
  background: linear-gradient(180deg, #bde0fe 0%, #a2d2ff 100%);
  color: #2b2d42;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

:root.no-emoji-font body {
  font-family: "Comic Sans MS", "Trebuchet MS", Verdana, "Peli Emoji", sans-serif;
}

header {
  width: 100%;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

#hub-link {
  flex-shrink: 0;
  color: #2b2d42;
  font-weight: bold;
  text-decoration: none;
  background: #ffffff;
  border-radius: 14px;
  padding: 0.5rem 0.9rem;
  box-shadow: 0 4px 0 #6c8ebf;
}

#active-player {
  flex-shrink: 0;
  font-weight: bold;
  background: #ffffff;
  border-radius: 14px;
  padding: 0.5rem 0.9rem;
  box-shadow: 0 4px 0 #6c8ebf;
}

header h1 {
  margin: 0;
  font-size: 2.2rem;
  flex: 1;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 700px;
  padding: 0 1rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

#round-progress {
  font-size: 1.2rem;
  font-weight: bold;
  background: #ffffff;
  border-radius: 14px;
  padding: 0.5rem 1.1rem;
  box-shadow: 0 4px 0 #6c8ebf;
}

#instruction {
  font-size: 1.8rem;
  font-weight: bold;
  background: #fff9c4;
  border: 3px solid #f6c343;
  border-radius: 20px;
  padding: 0.8rem 1.6rem;
  text-align: center;
}

#choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  width: 100%;
}

.choice-card {
  background: #eef4ff;
  border: none;
  border-radius: 20px;
  padding: 1.5rem;
  cursor: pointer;
  box-shadow: 0 6px 0 #6c8ebf;
  transition: transform 0.1s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-family: inherit;
}

.choice-card:hover {
  transform: translateY(-4px);
}

.choice-card:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #6c8ebf;
}

.choice-card .shape-icon {
  font-size: 5rem;
  line-height: 1;
  text-shadow:
    -1.5px -1.5px 0 #6c6c6c,
    1.5px -1.5px 0 #6c6c6c,
    -1.5px 1.5px 0 #6c6c6c,
    1.5px 1.5px 0 #6c6c6c;
}

.choice-card .choice-number {
  font-size: 2rem;
  font-weight: bold;
  color: #6c8ebf;
  background: #ffffff;
  border-radius: 50%;
  width: 2.8rem;
  height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.choice-card.correct {
  background: #d7f7dc;
  box-shadow: 0 6px 0 #4caf50;
  animation: pop-in 0.2s ease;
}

.choice-card.correct .choice-number {
  background: #d7f7dc;
  color: #2e7d32;
}

.game-button {
  background: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 0.6rem 1.1rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 0 #6c8ebf;
}

@keyframes pop-in {
  0% {
    transform: scale(0.85);
  }
  100% {
    transform: scale(1);
  }
}

/* Touch devices: no lingering hover state after a tap, and no double-tap zoom
   when a child taps quickly. */
button,
a {
  touch-action: manipulation;
}

@media (hover: none) {
  button:hover,
  a:hover,
  .game-card:hover,
  .category-button:hover,
  .choice-card:hover,
  .option-button:hover,
  .difficulty-button:hover,
  .food-button:hover,
  .gender-button:hover,
  .device-button:hover,
  .book-button:hover,
  .memory-card:hover {
    transform: none;
  }
}

/* Keyboard-only hints make no sense on a touch screen. */
@media (hover: none) and (pointer: coarse) {
  .kbd-hint {
    display: none;
  }
}
