/* Anotalo: scoreboard dark for viewing, big touch targets for scoring in sun. */
:root {
  --bg: #0d1512;
  --panel: #16211c;
  --panel2: #1d2b24;
  --line: #2b3d33;
  --text: #f2f7f4;
  --muted: #9db3a8;
  --green: #35c66b;
  --amber: #ffc53d;
  --red: #ff5d5d;
  --dirt: #c98a4b;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.45;
}
a { color: var(--green); text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; border-radius: var(--radius); }
input, select { font: inherit; }

.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: .5px; color: var(--text); }
.brand span { color: var(--green); }
.lang-toggle {
  background: var(--panel); color: var(--muted); padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 999px; font-weight: 700; font-size: .85rem;
}
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.muted { color: var(--muted); font-size: .9rem; }
.btn { background: var(--green); color: #06210f; font-weight: 800; padding: 14px 20px; font-size: 1rem; }
.btn:disabled { opacity: .5; }
.btn.secondary { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--red); color: #2b0505; }
.btn.small { padding: 8px 14px; font-size: .85rem; border-radius: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
input[type=text], input[type=datetime-local], input[type=url] {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 13px 14px; font-size: 1rem;
}
input::placeholder { color: #5f7a6d; }
h1 { font-size: 1.7rem; line-height: 1.2; }
h2 { font-size: 1.1rem; margin-bottom: 10px; }
.hero { text-align: center; padding: 36px 16px 20px; }
.hero h1 { font-size: 2rem; margin-bottom: 10px; }
.hero p { color: var(--muted); max-width: 520px; margin: 0 auto 22px; }
.values { list-style: none; text-align: left; max-width: 460px; margin: 24px auto; display: grid; gap: 10px; }
.values li { padding-left: 28px; position: relative; color: var(--text); }
.values li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 26px 16px; }

/* Scoreboard */
.scoreboard { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sb-team { flex: 1; text-align: center; }
.sb-team .name { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-team .runs { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sb-mid { text-align: center; min-width: 110px; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.badge.live { background: var(--red); color: #fff; animation: pulse 1.6s infinite; }
.badge.final { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.badge.upcoming { background: var(--panel2); color: var(--amber); border: 1px solid var(--line); }
@keyframes pulse { 50% { opacity: .55; } }
.inning-ind { font-weight: 800; font-size: 1.05rem; margin-top: 6px; }
.count-ind { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }

.outs-dots { display: inline-flex; gap: 5px; margin-left: 6px; vertical-align: middle; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line); }
.dot.on { background: var(--amber); border-color: var(--amber); }

/* Diamond */
.diamond { width: 92px; height: 92px; position: relative; margin: 0 auto; }
.base { position: absolute; width: 26px; height: 26px; background: var(--panel2); border: 2px solid var(--line); transform: rotate(45deg); border-radius: 4px; }
.base.on { background: var(--amber); border-color: var(--amber); }
.base.b1 { right: 2px; top: 33px; }
.base.b2 { left: 33px; top: 2px; }
.base.b3 { left: 2px; top: 33px; }
.base.home { left: 33px; bottom: 2px; background: var(--bg); }

/* Line score */
.linescore { overflow-x: auto; }
.linescore table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.linescore th, .linescore td { padding: 6px 9px; text-align: center; border-bottom: 1px solid var(--line); font-size: .9rem; }
.linescore th { color: var(--muted); font-weight: 600; }
.linescore td.teamname { text-align: left; font-weight: 700; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linescore .tot { font-weight: 800; color: var(--green); }

/* Tabs */
.tabs { display: flex; gap: 8px; margin: 14px 0; }
.tab { flex: 1; background: var(--panel); border: 1px solid var(--line); color: var(--muted); padding: 11px; border-radius: 10px; font-weight: 700; }
.tab.active { background: var(--panel2); color: var(--text); border-color: var(--green); }

/* Play feed */
.play { display: flex; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--line); align-items: baseline; }
.play .inn { color: var(--muted); font-size: .78rem; min-width: 52px; font-variant-numeric: tabular-nums; }
.play .desc { flex: 1; }
.play .runs-chip { color: var(--green); font-weight: 800; font-size: .85rem; }
.play.undone .desc { text-decoration: line-through; color: var(--muted); }

/* Stats tables */
.stat-table { overflow-x: auto; }
.stat-table table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.stat-table th, .stat-table td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--line); font-size: .85rem; white-space: nowrap; }
.stat-table th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--panel); }
.stat-table th:first-child, .stat-table td:first-child { text-align: left; }

/* Scorekeeper */
.pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 12px; }
.pad button { padding: 15px 4px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); font-weight: 800; font-size: .95rem; border-radius: 12px; min-height: 56px; }
.pad button.hit { border-color: var(--green); color: var(--green); }
.pad button.walk { border-color: var(--amber); color: var(--amber); }
.pad button.outr { border-color: var(--line); }
.pad button.other { border-color: var(--dirt); color: var(--dirt); }
.countpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 12px; }
.countpad button { padding: 16px; font-size: 1.05rem; font-weight: 800; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); min-height: 60px; }
.batter-bar { display: flex; justify-content: space-between; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.batter-bar .who { font-weight: 800; font-size: 1.05rem; }
.toolbar { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.toolbar .btn { flex: 1; min-width: 100px; }

/* Confirm sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: none; align-items: flex-end; z-index: 40; }
.sheet-backdrop.open { display: flex; }
.sheet { background: var(--panel); border-radius: 18px 18px 0 0; width: 100%; max-width: 760px; margin: 0 auto; padding: 18px 16px 26px; max-height: 82vh; overflow-y: auto; }
.sheet h3 { margin-bottom: 12px; }
.runner-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: flex; gap: 5px; flex-wrap: wrap; }
.seg button { padding: 8px 11px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); font-size: .8rem; font-weight: 700; }
.seg button.sel { background: var(--green); color: #06210f; border-color: var(--green); }
.seg button.sel-out { background: var(--red); color: #fff; border-color: var(--red); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line); color: var(--text); font-size: 1.3rem; font-weight: 800; }
.stepper .val { font-size: 1.4rem; font-weight: 800; min-width: 26px; text-align: center; }

.banner { position: fixed; left: 0; right: 0; bottom: 0; padding: 11px 16px; text-align: center; font-weight: 700; font-size: .9rem; z-index: 50; display: none; }
.banner.warn { display: block; background: var(--amber); color: #201600; }
.banner.ok { display: block; background: var(--green); color: #06210f; }

.list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); gap: 10px; }
.pick { background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 12px; font-weight: 700; text-align: left; }
.pick.sel { border-color: var(--green); }
.pick .ord { display: inline-block; min-width: 24px; color: var(--green); font-weight: 800; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
@media (max-width: 420px) { .pad { grid-template-columns: repeat(3, 1fr); } }
