/* Mancala web: mismo estilo que la app Android (blanco y negro, esquinas rectas, semillas de colores). */
:root {
  --ink: #111111; --paper: #ffffff; --muted: #666666; --alert: #e53935; --line: #111111;
  --pit: clamp(40px, 12vw, 76px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #f2f2f2; --paper: #111111; --muted: #a0a0a0; --alert: #ff6b66; --line: #f2f2f2; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

.topbar { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  padding: 10px 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-end { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45vw; }
.content { max-width: 720px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.onboarding { min-height: 90vh; justify-content: center; }
.brand { font-size: 40px; margin: 0; }
h2 { font-size: 18px; margin: 18px 0 4px; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .strong { font-weight: 700; } .center { text-align: center; }
.mono { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.headline { font-size: 28px; margin: 24px 0 8px; }

.btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--ink); color: var(--paper); padding: 10px 14px;
  border-radius: 0; cursor: pointer; min-height: 44px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.btn.outline { background: var(--paper); color: var(--ink); }
.btn.link { background: none; color: var(--ink); border: none; text-decoration: underline; padding: 6px 8px; min-height: 36px; }
.btn.wide { width: 100%; }
.btn:focus-visible, .pit:focus-visible, .panel.clickable:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--alert); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; } .row > * { flex: 1 1 0; min-width: 0; }
.segmented { display: flex; gap: 6px; } .segmented > .btn { flex: 1; }
.line { display: flex; align-items: center; gap: 10px; } .grow { flex: 1; min-width: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }

input[type=text], input[type=search], input[type=email], input[type=password], select {
  font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 0; background: var(--paper); color: var(--ink); min-height: 44px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--ink); }

.panel { border: 1px solid var(--line); padding: 14px; background: var(--paper); display: flex; flex-direction: column; gap: 6px; }
.panel.match { flex-direction: row; align-items: center; }
.panel.clickable { cursor: pointer; } .panel.clickable:hover { background: color-mix(in srgb, var(--ink) 6%, var(--paper)); }
.end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.notice { border: 1px solid var(--line); padding: 10px; font-size: 14px; }
.offline-banner { background: var(--alert); color: #fff; padding: 8px 16px; font-size: 14px; margin: 0; }
.alert { color: var(--alert); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--alert); display: inline-block; }
.countdown.urgent, .turn-clock .urgent { color: var(--alert); }
.tiles { display: flex; gap: 10px; } .tiles > * { flex: 1; } .tile strong { font-size: 28px; }
.table { width: 100%; border-collapse: collapse; display: table; } .table th, .table td { padding: 6px 4px; text-align: end; border-bottom: 1px solid var(--line); }
.table th:first-child, .table td:first-child { text-align: start; }

/* ---------------------------------------------------------------- tablero */
.scores { display: flex; justify-content: space-around; text-align: center; }
.scores div { display: flex; flex-direction: column; } .scores strong { font-size: 30px; }
.board { display: grid; grid-template-columns: calc(var(--pit) * 1.1) 1fr calc(var(--pit) * 1.1); gap: 8px; align-items: stretch;
  border: 2px solid var(--line); border-radius: 18px; padding: 10px; margin: 8px 0; user-select: none; touch-action: manipulation; }
.lanes { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.lane { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pit, .store { position: relative; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit;
  display: flex; align-items: center; justify-content: center; padding: 4px; overflow: hidden; }
.pit { aspect-ratio: 1; border-radius: 50%; cursor: default; }
.pit.legal { cursor: pointer; border-width: 3px; }
.pit.legal:hover { background: color-mix(in srgb, var(--ink) 8%, var(--paper)); }
.pit:disabled { opacity: 1; }
.store { border-radius: 999px; min-height: calc(var(--pit) * 2.2); border-width: 2px; }
.seeds { position: absolute; inset: 14%; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 2px; }
.seed { width: clamp(5px, 1.6vw, 10px); aspect-ratio: 1; border-radius: 50%; background: var(--c); display: block; }
.count { position: relative; z-index: 1; font-size: clamp(14px, 3.5vw, 22px); background: color-mix(in srgb, var(--paper) 80%, transparent); padding: 0 4px; border-radius: 6px; }
.flash { animation: flash .35s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, #f6c945 55%, var(--paper)); } to { background: var(--paper); } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }

/* ---------------------------------------------------------------- diálogos y avisos */
.modal { position: fixed; inset: 0; background: rgb(0 0 0 / .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.dialog { max-width: 420px; width: 100%; }
.cookie-bar { position: fixed; inset: auto 0 0 0; z-index: 9; border-top: 1px solid var(--line); background: var(--paper); padding: 12px 16px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cookie-bar p { flex: 1 1 280px; font-size: 14px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--muted); }
#google-button { min-height: 44px; display: flex; justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
body:has(.cookie-bar) .content { padding-bottom: 160px; }
