/* Bedlam Darts phone page.
   Palette and layout carried over from the parked remote-door-wip page:
   deep purple ground, amber accents, a red MISS. Phone first, 320 to
   430 px wide, one handed, safe area aware, no zoom on a double tap. */

:root {
  --bg: #141019; --bg2: #1c1526; --panel: #201a2b; --line: #3a2f4e;
  --ink: #efeaf6; --dim: #9a8fae; --amber: #ffb02e; --amber2: #ffd84a;
  --go: #35e07b; --danger: #ff4d5e; --miss: #4a1720; --miss-line: #ff6b7a;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

main {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: calc(14px + env(safe-area-inset-top, 0px))
           calc(16px + env(safe-area-inset-right, 0px))
           calc(16px + env(safe-area-inset-bottom, 0px))
           calc(16px + env(safe-area-inset-left, 0px));
  max-width: 560px;
  margin: 0 auto;
}

header { display: flex; justify-content: space-between; align-items: baseline; }

.brand { font-weight: 800; letter-spacing: .22em; color: var(--amber); font-size: 15px; }

.game { color: var(--dim); letter-spacing: .12em; font-size: 14px; text-transform: uppercase; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  transition: opacity .2s ease;
}

.card.dimmed { opacity: .45; }

.label { color: var(--dim); font-size: 12px; letter-spacing: .18em; }

.thrower {
  font-size: clamp(28px, 9vw, 48px);
  font-weight: 800;
  line-height: 1.05;
  margin-top: 4px;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.team { color: var(--dim); font-size: 14px; letter-spacing: .1em; margin-top: 4px; min-height: 18px; }

.turn { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

.dart { color: var(--amber2); font-weight: 700; letter-spacing: .12em; font-size: 16px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  min-width: 40px;
  padding: 6px 8px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--dim);
  font-weight: 700;
  font-size: 14px;
}

.chip.thrown { color: var(--ink); border-color: var(--amber); }

.chip.missed { color: var(--miss-line); border-color: var(--miss-line); }

button.miss {
  flex: 1 1 auto;
  min-height: 40vh;
  width: 100%;
  font: inherit;
  font-size: clamp(48px, 18vw, 100px);
  font-weight: 800;
  letter-spacing: .08em;
  color: #ffe9ec;
  background: var(--miss);
  border: 3px solid var(--miss-line);
  border-radius: 22px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .06s ease, background-color .12s ease, opacity .12s ease;
  -webkit-tap-highlight-color: transparent;
}

button.miss:active:not(:disabled) { transform: scale(.985); background: #6a1f2c; }

button.miss:disabled { opacity: .35; cursor: default; transform: none; }

button.miss.called { background: #7a2433; }

.status {
  min-height: 24px;
  text-align: center;
  font-size: 15px;
  letter-spacing: .12em;
  color: var(--dim);
  margin: 0;
}

.status.good { color: var(--go); }

.status.warn { color: var(--amber); }

.status.bad { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  button.miss, .card { transition: none; }
}
