:root {
  --green: #0b5d3b;
  --bg: #f3f6f4;
  --card: #fff;
  --accent: #e4572e;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 12px) 12px 12px;
  max-width: 520px;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: #1b1b1b;
}

h1 { color: var(--green); }

section, form { display: flex; flex-direction: column; gap: 12px; }

label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
label.check { flex-direction: row; align-items: center; font-weight: normal; }

input, select, button {
  font: inherit;
  padding: 10px;
  border: 1px solid #bbb;
  border-radius: 10px;
}

button { background: #fff; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--green); color: #fff; border-color: var(--green); }

.hint { color: #777; font-size: .9rem; margin: 0; }

#game header { display: flex; justify-content: space-between; align-items: center; }

#players { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.player {
  background: var(--card);
  border: 3px solid transparent;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}
.player.active { border-color: var(--green); }
.player .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .score { font-size: 3.5rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.player .last { color: #666; font-size: .9rem; }

#winner {
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
}

#turn {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#darts { min-height: 1.5em; text-align: center; font-weight: 600; }

.mult { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mult button.active { background: var(--green); color: #fff; }

#pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
#pad button { padding: 12px 0; }
#pad .miss { grid-column: span 2; background: #eee; }
#pad .bull { background: #c0392b; color: #fff; }

.actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }

#videos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
#videos figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
#videos video { width: 100%; aspect-ratio: 3 / 4; background: #000; border-radius: 12px; object-fit: cover; }
#videos figcaption { font-size: .85rem; color: #555; text-align: center; }
#videos #camera { grid-column: span 2; }

#status { min-height: 1.2em; color: #555; font-size: .9rem; }
