/* Number Knockout — page-specific styles */

/* The dice tray needs a perspective or the shared cube renders flat. */
.tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.75rem, 3.5vw, 1.4rem);
  min-height: 6rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: radial-gradient(ellipse at 50% 40%, #f7f1e4, #ece3d3 72%);
  box-shadow: inset 0 2px 10px rgba(120, 100, 70, 0.13);
  perspective: 900px;
  perspective-origin: 50% 42%;
}

.tray .die { --size: clamp(3rem, 13vw, 4.25rem); }

/* What is being typed */
.typed {
  margin-top: 0.9rem;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 8vw, 2.4rem);
  line-height: 1.2;
  color: #c4b8a2;
  min-height: 1.3em;
  overflow-wrap: anywhere;
  transition: color 0.15s, transform 0.12s;
}

.typed.has-sum { color: var(--color-text); }
.typed.is-wrong { color: var(--color-coral); transform: translateX(4px); }

.keys {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.7rem 0 0.2rem;
}

.key {
  min-width: 2.9rem;
  padding: 0.55rem 0.6rem;
  border: 2px solid #e8e2d8;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
}

.key:hover, .key:focus-visible { border-color: var(--color-green); outline: none; }
.key:active { transform: translateY(2px); }

/* Saying what you think it comes to is the point, so the sign is highlighted. */
.key--equals {
  background: #fff4c9;
  border-color: #f0d98a;
  color: #a37a00;
}

/* The numbers you actually rolled, so they stand out from the signs. */
.key--die {
  background: #eaf7ec;
  border-color: #b9e2c0;
  color: #1c6b3a;
}

/* The board */
.board {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 0.3rem;
  margin: 1rem auto 0;
  max-width: 26rem;
}

.square {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 2px solid #e0d6c2;
  background: #fffdf7;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.85rem, 3.6vw, 1.15rem);
  color: var(--color-text);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.square.is-out {
  background: #e7ded0;
  border-color: #d6cab5;
  color: #b1a288;
  text-decoration: line-through;
  text-decoration-thickness: 3px;
}

.square.just-out {
  background: var(--color-green);
  border-color: var(--color-green);
  color: #fff;
  transform: scale(1.14);
  text-decoration: none;
}

.stat-value.is-urgent { color: var(--color-coral); }

/* End of round */
.summary {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  background: #f2fbf7;
  border: 2px solid #bfe6d6;
}

.summary-score {
  font-family: var(--font-display);
  color: #2f9e78;
  margin-bottom: 0.4rem;
}

.missed { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.missed-note { width: 100%; color: var(--color-text-muted); font-size: 0.92rem; margin-bottom: 0.3rem; }

.missed-chip {
  min-width: 1.9rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #fff4c9;
  color: #a37a00;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.chip {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 2px solid #e8e2d8;
  background: var(--color-bg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.chip:hover, .chip:focus-visible { border-color: var(--color-green); outline: none; }
.chip.is-on { background: var(--color-green); border-color: var(--color-green); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .typed, .square, .key { transition: none; }
}
