/* Shared UI bits for mini-games */
.ui-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(232, 244, 255, 0.08);
  overflow: hidden;
  border: 1px solid var(--line);
}

.ui-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint-dim), var(--mint));
  transition: width 0.2s ease;
}

.ui-segment {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(7, 18, 31, 0.55);
}

.ui-segment button {
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  background: transparent;
  color: var(--mist);
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.ui-segment button.is-active {
  background: rgba(61, 255, 194, 0.16);
  color: var(--mint);
}

.ui-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.ui-choice {
  min-width: 4.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: rgba(17, 38, 61, 0.85);
  color: var(--foam);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ui-choice:hover {
  transform: translateY(-1px);
  border-color: rgba(61, 255, 194, 0.4);
}

.ui-choice.is-correct {
  border-color: rgba(61, 255, 194, 0.7);
  background: rgba(61, 255, 194, 0.16);
}

.ui-choice.is-wrong {
  border-color: rgba(255, 107, 74, 0.7);
  background: rgba(255, 107, 74, 0.14);
}

.ui-board {
  display: grid;
  gap: 0.55rem;
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 1rem;
}

.ui-card {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(17, 38, 61, 0.9);
  color: var(--foam);
  font: inherit;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ui-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(61, 255, 194, 0.4);
}

.ui-card.is-flipped,
.ui-card.is-matched {
  background: rgba(61, 255, 194, 0.14);
  border-color: rgba(61, 255, 194, 0.45);
  color: var(--mint);
}

.ui-card.is-matched {
  opacity: 0.55;
  cursor: default;
}

.ui-card:disabled {
  cursor: default;
}

.dom-stage {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    linear-gradient(rgba(232, 244, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 244, 255, 0.04) 1px, transparent 1px),
    #081628;
  background-size: 36px 36px, 36px 36px, auto;
}

.dom-stage .play-panel {
  width: min(100%, 480px);
  text-align: center;
}

.dom-stage .prompt {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: -0.03em;
}

.dom-stage .subprompt {
  margin: 0 0 1.1rem;
  color: var(--mist);
}

.letter-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.letter-slots button,
.letter-bank button {
  width: 2.4rem;
  height: 2.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(17, 38, 61, 0.95);
  color: var(--foam);
  font: inherit;
  font-family: var(--font-display);
  font-weight: 800;
  cursor: pointer;
}

.letter-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.letter-slots button.is-filled {
  border-color: rgba(61, 255, 194, 0.45);
  color: var(--mint);
}

.react-pad {
  width: min(100%, 360px);
  aspect-ratio: 1;
  border-radius: 24px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease, transform 0.12s ease;
}

.react-pad.is-wait {
  background: rgba(255, 200, 87, 0.16);
  color: var(--amber);
}

.react-pad.is-go {
  background: rgba(61, 255, 194, 0.22);
  color: var(--mint);
  transform: scale(1.02);
}

.react-pad.is-fail {
  background: rgba(255, 107, 74, 0.2);
  color: var(--coral);
}

.color-swatch {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.slide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  width: min(100%, 320px);
  margin: 0 auto;
}

.slide-grid button {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 38, 61, 0.95);
  color: var(--foam);
  font: inherit;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
}

.slide-grid button.is-blank {
  background: transparent;
  border-style: dashed;
  cursor: default;
  color: transparent;
}

.echo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: min(100%, 320px);
  margin: 0 auto;
}

.echo-pad {
  aspect-ratio: 1;
  border-radius: 22px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: color-mix(in srgb, var(--pad) 22%, #081628);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.echo-pad.is-lit {
  background: var(--pad);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pad) 35%, transparent);
  transform: scale(1.04);
}

.mole-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  width: min(100%, 360px);
  margin: 0 auto;
}

.mole-hole {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: rgba(7, 18, 31, 0.85);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.mole-hole.is-up.is-mint {
  background: radial-gradient(circle at 50% 40%, #3dffc2 0 38%, #1aa884 40% 70%, #081628 72%);
  border-color: rgba(61, 255, 194, 0.55);
  transform: translateY(-4px);
}

.mole-hole.is-up.is-coral {
  background: radial-gradient(circle at 50% 40%, #ff6b4a 0 38%, #b33a24 40% 70%, #081628 72%);
  border-color: rgba(255, 107, 74, 0.55);
  transform: translateY(-4px);
}

.num-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  width: min(100%, 360px);
  margin: 0 auto;
}

.num-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 38, 61, 0.95);
  color: var(--foam);
  font: inherit;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(0.95rem, 3.2vw, 1.2rem);
  cursor: pointer;
}

.num-cell.is-done {
  opacity: 0.35;
  border-style: dashed;
  cursor: default;
}
