/* Simple Score 2.0 — paper, green, gold */
:root {
  --green: #006747;
  --green-deep: #004d36;
  --green-ink: #013322;
  --gold: #C9A227;
  --gold-soft: #E8D48A;
  --paper: #F7F4EC;
  --white: #FFFFFF;
  --ink: #12211A;
  --muted: #5C6B63;
  --line: #D7D5C8;
  --surface: #FFFFFF;
  --surface-2: #EFECE1;
  --plus: #C9A227;
  --minus: #8B2E2E;
  --warn: #8A6A12;
  --shadow: 0 10px 28px rgba(1, 51, 34, 0.10);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  --ease: 220ms ease;
  --radius: 16px;
  --tap: 48px;
  font-family: var(--sans);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  min-height: 100%;
}
body {
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button {
  cursor: pointer;
  border: 0;
  background: none;
  appearance: none;
}
input, textarea, select {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px;
  font-size: 17px;
  color: var(--ink);
  min-height: var(--tap);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
  border-color: var(--green);
}
label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 6px;
  font-weight: 650;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(10px + env(safe-area-inset-bottom));
}

.shell { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.screen {
  flex: 1;
  min-height: 0;
  animation: fadeSlide var(--ease);
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 4px 10px;
  cursor: pointer;
  user-select: none;
  background: none;
  width: 100%;
}
.wordmark .mark { width: 36px; height: 36px; flex: none; }
.wordmark .mark svg, .wordmark img { width: 36px; height: 36px; display: block; }
.wordmark h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: 0.01em;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}
.wordmark.hero { flex-direction: column; padding: 18px 8px 8px; gap: 12px; }
.wordmark.hero .mark { width: 64px; height: 64px; }
.wordmark.hero .mark svg, .wordmark.hero img { width: 64px; height: 64px; }
.wordmark.hero h1 { font-size: 36px; }

.tag {
  margin: 6px 0 0;
  text-align: center;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  font-weight: 550;
}
.sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn.primary:active { background: var(--green-deep); }
.btn.secondary {
  background: var(--white);
  border-color: var(--green);
  color: var(--green);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-weight: 650;
}
.btn.danger {
  background: var(--white);
  border-color: #E0C4C0;
  color: var(--minus);
}
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.4; }

.giant {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 22px 16px;
  min-height: 64px;
  border-radius: 16px;
  background: var(--green);
  color: #fff;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, background 160ms ease;
}
.giant:active { transform: scale(0.98); background: var(--green-deep); }
.giant.alt {
  margin-top: 12px;
  background: var(--white);
  color: var(--green);
  border: 2px solid var(--green);
  box-shadow: none;
}

.stack { display: grid; gap: 10px; }
.mt { margin-top: 16px; }
.center { text-align: center; }
.muted { color: var(--muted); }

.player-box {
  text-transform: uppercase;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  min-height: 52px;
  border-radius: 14px;
}
.player-box::placeholder { color: #B7B4A8; font-weight: 600; letter-spacing: 0.08em; }

.course-box {
  text-transform: uppercase;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.confirm-row { margin-top: 18px; display: grid; gap: 6px; }
.skip {
  display: block;
  width: 100%;
  min-height: 48px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.skip:active { transform: scale(0.98); color: var(--ink); }

.admin-entry {
  display: block;
  width: 100%;
  margin-top: 28px;
  min-height: 48px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.admin-entry:active { color: var(--green); }

.admin-list { display: grid; gap: 10px; margin-top: 8px; }
.admin-item {
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px;
  min-height: var(--tap);
  font-size: 16px;
  font-weight: 650;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.admin-item small { color: var(--muted); font-size: 12px; font-weight: 500; }
.admin-item:active { transform: scale(0.99); }

.hole-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
}
.hole-head .side {
  display: flex;
  gap: 6px;
  align-items: center;
}
.hole-head .side.right { justify-content: flex-end; }
.linkish {
  min-height: 44px;
  padding: 8px 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 12px;
}
.linkish:active { background: var(--surface-2); }

.hole-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.chev {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--green);
  font-size: 22px;
  font-weight: 700;
}
.chev:active { transform: scale(0.94); }
.chev:disabled { opacity: 0.3; }
.hole-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  line-height: 1;
}
.course-line {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin: -4px 0 10px;
}

.swipe-wrap {
  overflow: hidden;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.swipe-wrap input {
  -webkit-user-select: text;
  user-select: text;
  touch-action: pan-y;
}
.swipe-pane {
  will-change: transform;
}
.swipe-pane.anim { transition: transform var(--ease); }

.board {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.board th, .board td {
  padding: 0;
  text-align: center;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.board tr:last-child td { border-bottom: 0; }
.board th {
  background: var(--green);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 650;
  padding: 10px 8px;
}
.board th.name, .board td.name { text-align: left; padding-left: 14px; }
.board td.name {
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.board .cell-in {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  padding: 8px 4px;
}
.board .cell-in:focus { outline: none; background: #F3F8F5; }
.board td.flash { animation: cellFlash 240ms ease; }
@keyframes cellFlash {
  0% { background: var(--gold-soft); }
  100% { background: transparent; }
}
.plus { color: var(--plus); }
.minus { color: var(--minus); }
.dash { color: #B7B4A8; }

.warn {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #F4E8C2;
  color: var(--warn);
  font-size: 13px;
  border: 1px solid #E4D08A;
}
.err {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #F6E4E2;
  color: var(--minus);
  font-size: 15px;
}

.talk-dock {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin-top: 12px;
  padding: 8px 0 4px;
  background: linear-gradient(180deg, transparent, var(--paper) 32%);
}
.talk-pill {
  width: 100%;
  min-height: 56px;
  border-radius: 999px;
  background: var(--white);
  border: 2px solid var(--green);
  color: var(--green);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.talk-pill .mic {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}
.talk-pill.listening {
  background: var(--green);
  border-color: var(--gold);
  color: #fff;
  animation: talkpulse 1.8s ease-out infinite;
}
.talk-pill.speaking {
  background: var(--green-deep);
  border-color: var(--gold-soft);
  color: var(--gold-soft);
}
.talk-pill.error {
  border-color: var(--minus);
  color: var(--minus);
}
@keyframes talkpulse {
  0% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.42); }
  70% { box-shadow: 0 0 0 14px rgba(201, 162, 39, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0); }
}
.caption {
  min-height: 20px;
  margin-top: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.prompt-card {
  margin-top: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.prompt-card p { margin: 0 0 12px; font-size: 16px; line-height: 1.4; }
.prompt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 96px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  min-height: 56px;
}
.row.head {
  border-top: 0;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-height: 0;
  padding: 10px 14px;
}
.row .who { font-size: 16px; font-weight: 700; text-transform: uppercase; }
.pos { color: var(--gold); font-weight: 800; margin-right: 6px; font-family: var(--serif); }
.row .sc, .row .mo {
  text-align: right;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--serif);
}
.row.head .sc, .row.head .mo {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 650;
}

.history-item, .list-item {
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 8px;
  min-height: var(--tap);
}
.history-item .t, .list-item .t { font-size: 16px; font-weight: 700; }
.history-item .s, .list-item .s { color: var(--muted); font-size: 13px; margin-top: 4px; }

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.actions .wide { grid-column: 1 / -1; }

.sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(430px, 100%);
  background: var(--white);
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
  z-index: 20;
  animation: fadeSlide 180ms ease;
}
.sheet h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 22px; color: var(--green); }
.backdrop {
  position: fixed; inset: 0; background: rgba(1, 51, 34, 0.35); z-index: 15;
}

.ambig { display: grid; gap: 8px; margin-top: 8px; }
.ambig button {
  width: 100%;
  min-height: var(--tap);
  padding: 14px;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-size: 18px;
  font-weight: 750;
}

.auth-switch { text-align: center; margin-top: 18px; }
.dev-code {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--gold-soft);
  color: var(--green-ink);
  border-radius: 14px;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-align: center;
}
.auth-switch button { background: none; color: var(--green); text-decoration: underline; font-size: 15px; min-height: 44px; }

.log-row { border-bottom: 1px solid var(--line); padding: 12px 0; font-size: 14px; line-height: 1.35; }
.log-row .when { color: var(--muted); font-size: 11px; letter-spacing: 0.04em; }
.log-row .t { font-weight: 700; margin: 4px 0; }

footer.ver {
  display: block;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  margin: 10px 0 4px;
  opacity: 0.7;
}
footer.ver a { color: inherit; text-decoration: none; }

.screen-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 26px;
  color: var(--green);
  text-align: center;
}

.tiny {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

.hscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mini-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mini-table th, .mini-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
}
.mini-table th {
  background: var(--green);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mini-table td.name, .mini-table th.name { text-align: left; }
.mini-table td.num { font-family: var(--serif); font-size: 16px; font-weight: 700; }

.edit-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--green);
  font-weight: 700;
}
.icon-btn.danger { color: var(--minus); }

.ops-screen { padding-bottom: 24px; }
.ops-table { min-width: 640px; font-size: 13px; }
.ops-table td, .ops-table th { padding: 8px 10px; vertical-align: top; }
.ops-table .muted { font-size: 11px; font-weight: 400; }

.ops-h { font-family: var(--serif); color: var(--green); font-size: 22px; margin: 28px 0 10px; }
.ops-user-row { cursor: pointer; }
.ops-user-row:hover td { background: var(--surface-2); }
input[type="search"] { margin-top: 12px; }
