/* ---------- なぞり書き画面(trace / puzzle 共通ヘッダ込み) ---------- */

.trace-screen,
.puzzle-screen {
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 207, 86, 0.34), transparent 18rem),
    radial-gradient(circle at 88% 18%, rgba(114, 201, 255, 0.3), transparent 19rem),
    linear-gradient(145deg, #fff8e7, #f6fcff);
}

.trace-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.trace-top .hold-button {
  justify-self: start;
}

.trace-status {
  display: grid;
  justify-items: center;
  min-width: 0;
}

.trace-status span {
  color: rgba(39, 50, 72, 0.62);
  font-size: 0.82rem;
  font-weight: 900;
}

.trace-status strong {
  color: var(--ink);
  font-size: clamp(2.2rem, 10vw, 4.5rem);
  line-height: 1;
}

.trace-sound-button {
  justify-self: end;
}

.trace-board {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border: 6px solid rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(39, 50, 72, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(39, 50, 72, 0.06) 1px, transparent 1px),
    #fffdf6;
  background-size: 42px 42px;
  box-shadow: var(--shadow);
  touch-action: none;
}

.trace-cross {
  position: absolute;
  z-index: 1;
  background: rgba(255, 122, 168, 0.18);
  pointer-events: none;
}

.trace-cross-vertical {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
}

.trace-cross-horizontal {
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
}

.trace-guide {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  color: rgba(39, 50, 72, 0.16);
  font-family: "Mojikiki Kyokasho", "UD Digi Kyokasho N-R", "UD Digi Kyokasho NK-R", "Yu Kyokasho", "Yu Gothic", "Meiryo", sans-serif;
  font-size: min(62vh, 76vw);
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}

.trace-guide.trace-alphabet {
  font-family: Arial, "Helvetica Neue", "Segoe UI", sans-serif;
  font-size: min(64vh, 78vw);
  font-weight: 700;
}

.trace-board canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.trace-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 12px;
  flex: 0 0 auto;
}

.trace-actions button {
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
  cursor: pointer;
}

.trace-actions button:nth-child(2) {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
