/* Senku: mesa de madera, bolas de cristal. Claro y oscuro. */
:root {
  --bg: #f3e6cf;
  --ink: #2b1d12;
  --muted: #7a6450;
  --card: #fff8ec;
  --line: #e0cdb0;
  --wood-1: #c98f55;
  --wood-2: #a86b36;
  --hole: #6f431c;
  --accent: #b5452f;
  --accent-ink: #fff;
  --glass-1: #ffffff;
  --glass-2: #7fb7e8;
  --glass-3: #2b5f9e;
  --ok: #3f8f5a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c140d;
    --ink: #f4e8d6;
    --muted: #b49c82;
    --card: #2a1f15;
    --line: #3d2e20;
    --wood-1: #7a4f2a;
    --wood-2: #5a3518;
    --hole: #2c1909;
    --accent: #e0714f;
    --glass-2: #8cc3f0;
    --glass-3: #2f6bb0;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, sans-serif; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
main { max-width: 560px; margin: 0 auto; padding: 0 16px 24px; }
.top { max-width: 560px; margin: 0 auto; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: linear-gradient(135deg, var(--wood-1), var(--wood-2)); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
h1 { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 1.6rem; line-height: 1; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.snd { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: 6px; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.tab { appearance: none; font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; text-align: center; }
.tab strong { font-size: .95rem; }
.tab small { color: var(--muted); font-size: .7rem; line-height: 1.25; }
.tab.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; text-align: center; }
.stats span { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stats strong { font-family: Fraunces, Georgia, serif; font-size: 1.4rem; }

.table { padding: clamp(10px, 4vw, 22px); border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--wood-1), var(--wood-2)); box-shadow: inset 0 0 0 6px rgba(0,0,0,.08), 0 18px 40px rgba(60,30,10,.35); aspect-ratio: 1; display: grid; place-items: center; }
.board { position: relative; width: 84%; --n: 7; }
.board.is-tri { width: 80%; }
.hole { position: absolute; left: calc(var(--x) * (100% - 100% / var(--n))); top: calc(var(--y) * (100% - 100% / var(--n))); width: calc(100% / var(--n)); aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.board.is-tri .hole { top: calc(var(--y) * (100% - 100% / var(--n) * 1.14)); }
.hole::before { content: ''; position: absolute; width: 46%; aspect-ratio: 1; border-radius: 50%; background: var(--hole); box-shadow: inset 0 3px 5px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.18); }
.peg { position: relative; width: 78%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 32% 28%, var(--glass-1) 0 12%, var(--glass-2) 32%, var(--glass-3) 100%); box-shadow: 0 4px 6px rgba(0,0,0,.35), inset 0 -3px 6px rgba(0,0,0,.25); transform: scale(0); transition: transform .18s ease, box-shadow .18s ease; }
.hole.has-peg .peg { transform: scale(1); }
.hole.can-move .peg { box-shadow: 0 4px 6px rgba(0,0,0,.35), inset 0 -3px 6px rgba(0,0,0,.25), 0 0 0 2px rgba(255,255,255,.35); }
.hole.is-sel .peg { transform: scale(1.12) translateY(-3px); box-shadow: 0 10px 14px rgba(0,0,0,.4), 0 0 0 3px var(--accent); }
.hole.is-target::after { content: ''; position: absolute; width: 56%; aspect-ratio: 1; border-radius: 50%; border: 3px dashed #fff3; border-color: #fffd; animation: pulse 1s ease-in-out infinite; }
.hole.is-hint .peg, .hole.is-hint::after { box-shadow: 0 0 0 3px #f6c445, 0 0 16px #f6c445; }
.hole.is-hint:not(.has-peg)::after { content: ''; position: absolute; width: 56%; aspect-ratio: 1; border-radius: 50%; }
.hole.just-landed .peg { animation: land .3s ease; }
.hole.just-gone::before { animation: gone .4s ease; }
@keyframes pulse { 50% { transform: scale(.85); opacity: .6; } }
@keyframes land { 0% { transform: scale(1.3) translateY(-8px); } 100% { transform: scale(1); } }
@keyframes gone { 0% { box-shadow: 0 0 0 8px rgba(255,255,255,.4); } }

.msg { min-height: 1.5em; text-align: center; color: var(--muted); margin: 12px 0 4px; font-size: .92rem; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.btn { appearance: none; font: inherit; font-weight: 600; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 8px; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-main { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); padding: 12px 28px; }

.end { position: fixed; inset: 0; background: rgba(20,10,4,.55); display: grid; place-items: center; padding: 16px; z-index: 20; animation: fade .25s ease; }
.end-card { background: var(--card); border-radius: 22px; padding: 26px 22px; text-align: center; max-width: 360px; width: 100%; box-shadow: 0 30px 60px rgba(0,0,0,.4); }
.end-emoji { font-size: 3.2rem; }
.end-card h2 { font-family: Fraunces, Georgia, serif; margin: 6px 0; font-size: 1.8rem; }
.end-card p { color: var(--muted); margin: 0 0 18px; }
@keyframes fade { from { opacity: 0; } }

.info { margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 6px 18px 12px; }
.info h2 { font-family: Fraunces, Georgia, serif; font-size: 1.15rem; margin: 14px 0 6px; }
.info li { margin: 4px 0; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 0 16px 28px; }
.foot a { color: var(--accent); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.confetti i { position: absolute; top: -12px; left: var(--l); width: 9px; height: 14px; background: hsl(var(--h) 80% 60%); animation: drop var(--d) linear forwards; }
@keyframes drop { to { transform: translateY(105vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
