/* Blind Timer styles. The theme and the shared controls are in ../shared/base.css. */

.names { display: flex; flex-direction: column; gap: 8px; }

.check { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 15px; }
.check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }

/* ---------- Play ---------- */
.play {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: calc(6px + env(safe-area-inset-top)) calc(6px + env(safe-area-inset-right))
    calc(6px + env(safe-area-inset-bottom)) calc(6px + env(safe-area-inset-left));
  background: var(--bg);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Stop or leave at any time during a round. Small and in a corner, so a tap on a zone does not hit it. */
.menu-btn {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}
.stop-sheet .btn { width: 100%; }
.stop-sheet .stack { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.arena { flex: 1; min-height: 0; display: grid; gap: 6px; }
.arena.n1 { grid-template: 1fr / 1fr; }
.arena.n2 { grid-template: 1fr 1fr / 1fr; }
.arena.n3 { grid-template: repeat(3, 1fr) / 1fr; }
.arena.n4 { grid-template: 1fr 1fr / 1fr 1fr; }

/* Sideways phone: put the zones side by side. */
@media (orientation: landscape) {
  .arena.n2:not(.face) { grid-template: 1fr / 1fr 1fr; }
  .arena.n3:not(.face) { grid-template: 1fr / repeat(3, 1fr); }
}

/* Face to face: two rows; the zones in the top row are turned for the players on the far side. */
.arena.face.n3 { grid-template: 1fr 1fr / 1fr 1fr; }
.arena.face.n3 .zone:first-child { grid-column: 1 / -1; }
.arena.face.n2 .zone:nth-child(1),
.arena.face.n3 .zone:nth-child(1),
.arena.face.n4 .zone:nth-child(-n + 2) { transform: rotate(180deg); }

.zone {
  --c: var(--accent);
  position: relative;
  min-height: 0;
  border-radius: 20px;
  background: var(--panel);
  border: 3px solid color-mix(in srgb, var(--c) 45%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}
.zone[data-i="0"] { --c: var(--accent); }
.zone[data-i="1"] { --c: var(--blue); }
.zone[data-i="2"] { --c: var(--green); }
.zone[data-i="3"] { --c: var(--purple); }

.zone.running { background: color-mix(in srgb, var(--c) 16%, var(--panel)); border-color: var(--c); }
.zone.stopped { background: var(--bg); }

.zname { color: var(--c); font-weight: 800; font-size: clamp(16px, 4.5vmin, 26px); }
.zmain { font-weight: 800; font-size: clamp(26px, 10vmin, 72px); line-height: 1.05; font-variant-numeric: tabular-nums; }
.zsub { color: var(--muted); font-size: clamp(14px, 3.8vmin, 20px); font-variant-numeric: tabular-nums; }
.zsub.good { color: var(--green); font-weight: 700; }
.zsub.ok { color: var(--accent); font-weight: 700; }
.zsub.bad { color: var(--red); font-weight: 700; }
.zrank { position: absolute; top: 10px; right: 12px; font-weight: 800; color: var(--c); font-size: clamp(13px, 3.5vmin, 18px); }
.zone .btn { margin-top: 10px; }

.controls {
  background: var(--panel);
  border-radius: 20px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.round-title { margin: 0; text-align: center; font-weight: 800; font-size: 18px; }

/* ---------- Summary ---------- */
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; padding: 6px 4px; }
.table td { padding: 8px 4px; border-top: 1px solid var(--line); }
.table td:not(:first-child), .table th:not(:first-child) { text-align: right; }
.table .win { color: var(--green); font-weight: 700; }

/* ---------- Timer bomb ---------- */
.zone.boom {
  --c: var(--red);
  background: color-mix(in srgb, var(--red) 22%, var(--panel));
  border-color: var(--red);
  animation: boom 0.5s ease-out;
}
@keyframes boom {
  0% { transform: scale(1.06); background: var(--red); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
  100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .zone.boom { animation: none; } }
