:root {
  --ink: #eafcff;
  --accent: #78f5ff;
  --card: rgba(18, 12, 48, 0.94);
  font-family: "Comic Sans MS", "Chalkboard SE", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #05061a;
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
}

/* On-screen buttons: phones and tablets only. */
#controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(88px + env(safe-area-inset-bottom));
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: none;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  background: #231638;
  touch-action: none;
}

#controls button {
  flex: 1;
  height: 100%;
  border: 0;
  border-radius: 18px;
  font-size: 30px;
  color: #fff;
  background: rgba(120, 245, 255, 0.15);
  touch-action: none;
}

#controls #fire {
  flex: 1.4;
  font-size: 38px;
  background: #ff3df2;
  box-shadow: 0 4px 0 #a01c98;
}

#controls #submit {
  background: #2fbf71;
  box-shadow: 0 4px 0 #1b7a46;
}

#controls button:active {
  transform: translateY(2px);
}

@media (hover: none) and (pointer: coarse) {
  #controls {
    display: flex;
  }
  .only-keys {
    display: none;
  }
}

@media not ((hover: none) and (pointer: coarse)) {
  .only-touch {
    display: none;
  }
}

#overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 6, 26, 0.45);
}

#overlay[hidden] {
  display: none;
}

.card {
  max-width: 440px;
  width: 100%;
  padding: 24px 22px;
  border-radius: 24px;
  background: var(--card);
  border: 1.5px solid rgba(120, 245, 255, 0.4);
  box-shadow: 0 0 40px rgba(120, 245, 255, 0.25);
  text-align: center;
  font-size: 18px;
  line-height: 1.45;
}

.card h1 {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.15;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(120, 245, 255, 0.7);
}

.card h1 span {
  color: #ff6af5;
  text-shadow: 0 0 14px rgba(255, 61, 242, 0.7);
}

.card .keys {
  font-size: 15px;
  opacity: 0.8;
}

kbd {
  padding: 1px 6px;
  border: 1px solid #6b5fa8;
  border-bottom-width: 3px;
  border-radius: 6px;
  background: #2a1f5c;
  font-family: inherit;
}

.card button {
  margin-top: 10px;
  padding: 12px 40px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 24px;
  font-weight: bold;
  color: #120b2e;
  background: var(--accent);
  box-shadow: 0 5px 0 #2a9aa5;
  cursor: pointer;
}

.card button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #2a9aa5;
}

.answer {
  margin: 4px 0 8px;
  font-size: 36px;
  font-weight: bold;
  color: #ffd23f;
}

#sound {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  border: 1.5px solid rgba(120, 245, 255, 0.4);
  border-radius: 50%;
  background: rgba(20, 16, 50, 0.7);
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
}

/* Parent setup: the minimum time per word. */
.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 8px 0 4px;
}

.card .choice {
  margin: 0;
  padding: 12px 0;
  font-size: 22px;
  color: var(--ink);
  background: rgba(120, 245, 255, 0.12);
  box-shadow: 0 4px 0 rgba(120, 245, 255, 0.25);
}

.card .choice.chosen {
  color: #120b2e;
  background: var(--accent);
}

.card .link {
  margin: 6px 0 0;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: normal;
  color: var(--ink);
  opacity: 0.7;
  background: none;
  box-shadow: none;
  text-decoration: underline;
}
