/* Neuriosity — Double Task playfield.
   Shared chrome lives in ../_shared/game-kit.css */

.dt-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--gu) * 1.2);
  flex: 0 0 auto;
  width: min(100%, calc(var(--gu) * 78));
}

/* ---------- the gauge ---------- */

.dt-gauge {
  display: flex;
  align-items: center;
  gap: calc(var(--gu) * 1.6);
  width: 100%;
  transition: opacity 260ms ease;
}

/* Present but dead during the warm-up, so the player can see what is coming
   without it demanding anything yet. */
.dt-gauge.is-idle { opacity: 0.32; }
.dt-gauge.is-idle .dt-reset { visibility: hidden; }

.dt-gauge__track {
  position: relative;
  flex: 1 1 auto;
  height: calc(var(--gu) * 5);
  background: #fff;
  border: calc(var(--gu) * 0.3) solid rgba(95, 45, 140, 0.22);
  border-radius: 999px;
  overflow: hidden;
}

.dt-gauge__zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 17%;
  background: rgba(241, 95, 109, 0.22);
}

.dt-gauge__zone--l { left: 0; }
.dt-gauge__zone--r { right: 0; }

.dt-gauge__needle {
  position: absolute;
  top: 8%;
  bottom: 8%;
  left: 50%;
  width: calc(var(--gu) * 2);
  margin-left: calc(var(--gu) * -1);
  background: #5f2d8c;
  border-radius: 999px;
}

/* The red state is carried by the needle turning AND the track glowing, so it
   still reads for anyone who cannot pick the red band out by colour. */
.dt-gauge.is-red .dt-gauge__track {
  border-color: var(--coral, #f15f6d);
  box-shadow: inset 0 0 0 calc(var(--gu) * 0.6) rgba(241, 95, 109, 0.28);
}

.dt-gauge.is-red .dt-gauge__needle {
  background: var(--coral, #f15f6d);
  width: calc(var(--gu) * 2.8);
  margin-left: calc(var(--gu) * -1.4);
}

.dt-reset {
  flex: 0 0 auto;
  min-width: max(56px, calc(var(--gu) * 16));
  min-height: max(40px, calc(var(--gu) * 8));
  padding: 0 calc(var(--gu) * 1.6);
  color: #fff;
  font: inherit;
  font-size: calc(var(--gu) * 2.6);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #5f2d8c;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

.dt-reset:disabled { background: #a898b8; cursor: default; }
.dt-gauge.is-red .dt-reset { background: var(--coral, #f15f6d); }

.dt-phase {
  margin: 0;
  color: var(--ink-soft, #526b8e);
  font-size: calc(var(--gu) * 2.5);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dt-phase.is-live { color: #5f2d8c; }

/* ---------- the number ---------- */

.dt-card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-height: 0;
  width: min(100%, calc(var(--gu) * 78));
  padding: calc(var(--gu) * 1.5);
  background: #fff;
  border: calc(var(--gu) * 0.3) solid rgba(95, 45, 140, 0.2);
  border-radius: calc(var(--gu) * 3);
  transition: border-color 120ms ease, background 120ms ease;
}

.dt-card span {
  font-size: calc(var(--gu) * 13);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.dt-card.is-word span {
  font-size: calc(var(--gu) * 8);
  letter-spacing: -0.01em;
  text-transform: lowercase;
}

.dt-card.is-right { border-color: var(--green, #0ea85a); background: rgba(14, 168, 90, 0.08); }
.dt-card.is-wrong { border-color: var(--coral, #f15f6d); background: rgba(241, 95, 109, 0.08); }

.dt-card.is-frozen {
  border-style: dashed;
  border-color: rgba(241, 95, 109, 0.55);
  background: rgba(241, 95, 109, 0.05);
}

/* ---------- answers ---------- */

.dt-keys {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--gu) * 2);
  flex: 0 0 auto;
  width: min(100%, calc(var(--gu) * 78));
}

.dt-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--gu) * 0.3);
  min-height: max(48px, calc(var(--gu) * 11));
  color: var(--navy, #062b63);
  font: inherit;
  font-size: calc(var(--gu) * 3.6);
  font-weight: 800;
  background: #fff;
  border: calc(var(--gu) * 0.34) solid rgba(6, 43, 99, 0.16);
  border-radius: calc(var(--gu) * 2.4);
  cursor: pointer;
  transition: transform 110ms ease, border-color 110ms ease;
}

.dt-key small {
  color: var(--ink-soft, #526b8e);
  font-size: calc(var(--gu) * 2.2);
  font-weight: 700;
}

.dt-key:hover { border-color: rgba(95, 45, 140, 0.6); }
.dt-key:active { transform: scale(0.97); }

.dt-key:focus-visible,
.dt-reset:focus-visible {
  outline: calc(var(--gu) * 0.5) solid #5f2d8c;
  outline-offset: calc(var(--gu) * 0.3);
}

@media (prefers-reduced-motion: reduce) {
  .dt-key, .dt-card, .dt-gauge { transition: none; }
}
