* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #070b1f; --panel: #111a3d; --panel2: #18234f; --text: #e7ecff; --muted: #93a0d0;
  --accent: #6fd3ff; --yellow: #ffd34d; --green: #4dff9a; --red: #ff6b7a;
}
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
.stars { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1px 1px at 10% 20%, #fff8, transparent),
    radial-gradient(1px 1px at 30% 70%, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 70% 30%, #fff9, transparent),
    radial-gradient(1px 1px at 85% 80%, #fff7, transparent),
    radial-gradient(1px 1px at 50% 50%, #fff5, transparent),
    radial-gradient(1.5px 1.5px at 20% 90%, #fff6, transparent),
    radial-gradient(1px 1px at 92% 10%, #fff8, transparent),
    radial-gradient(ellipse at 50% 0%, #1b2a6b55, transparent 60%);
}
header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; gap: 8px; }
h1 { margin: 0; font-size: 1.3rem; cursor: pointer; letter-spacing: .5px; }
#info { font-size: .85rem; color: var(--muted); text-align: right; }
main { max-width: 560px; margin: 0 auto; padding: 0 10px 30px; }
h2 { font-size: 1.15rem; margin: 10px 0; }
.card { background: var(--panel); border: 1px solid #ffffff14; border-radius: 14px; padding: 14px; margin: 10px 0; }
.muted { color: var(--muted); font-size: .9rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1; }
input { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid #ffffff22; background: #0b1230; color: var(--text); font-size: 1rem; }
button { padding: 12px 14px; border-radius: 10px; border: none; background: var(--panel2); color: var(--text); font-size: 1rem; cursor: pointer; font-weight: 600; }
button.primary { background: linear-gradient(135deg, #2f7bff, #6fd3ff); color: #041030; }
button.warn { background: #3a1830; color: #ffb3c0; }
button:disabled { opacity: .45; cursor: default; }
button.small { padding: 7px 10px; font-size: .85rem; }
.big { width: 100%; margin-top: 8px; }
.code { font-family: ui-monospace, monospace; font-size: 2rem; letter-spacing: 6px; color: var(--yellow); }
ul.players { list-style: none; padding: 0; margin: 6px 0; }
ul.players li { display: flex; justify-content: space-between; align-items: center; padding: 7px 4px; border-bottom: 1px solid #ffffff0f; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #555; margin-right: 6px; }
.dot.on { background: var(--green); }
.tag { font-size: .78rem; padding: 2px 8px; border-radius: 99px; background: #ffffff14; white-space: nowrap; }
.tag.ok { background: #1f5c3a; color: #b6ffd4; }
.tag.wait { background: #4a3a10; color: #ffe28a; }

/* Spielbrett */
.board { display: grid; grid-template-columns: 22px repeat(9, 1fr); gap: 3px; user-select: none; margin: 6px 0; }
.board .lab { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .78rem; font-weight: 700; }
.cell { aspect-ratio: 1; border-radius: 50%; position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: radial-gradient(circle at 50% 50%, #3d4f8f 0 18%, #5a6fb8 19% 24%, #8496d6 25% 100%); border: 1px solid #ffffff30; padding: 0; font-weight: 800; }
.cell .peg { width: 72%; height: 72%; border-radius: 50%; }
.cell .peg.b { background: radial-gradient(circle at 35% 30%, #6a6a6a 0, #1a1a1a 35%, #000 70%); border: 2px solid #e7ecff; box-shadow: 0 2px 4px #000c; }
.cell .num { width: 80%; height: 80%; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: clamp(.95rem, 4.8vw, 1.4rem);
  background: radial-gradient(circle at 38% 32%, #fff6c4, var(--yellow) 45%, #c99400); color: #2a1d00; box-shadow: 0 0 10px #ffd34daa; }
.cell .num.zero { box-shadow: none; filter: saturate(.55); }
.cell .hit { font-size: clamp(1rem, 5.5vw, 1.6rem); filter: drop-shadow(0 0 6px var(--green)); }
.cell .ghost { font-size: clamp(1rem, 5.5vw, 1.6rem); opacity: .55; filter: grayscale(.3) drop-shadow(0 0 4px var(--red)); }
.cell .probe { font-size: clamp(1rem, 5.5vw, 1.6rem); filter: drop-shadow(0 0 6px var(--accent)); }
.cell.sel { outline: 3px solid #fff; outline-offset: 1px; }
.cell.pend { outline: 3px solid var(--yellow); outline-offset: 1px; animation: pulse 1.2s infinite; }
.cell.last { box-shadow: 0 0 0 2px #fff inset; }
@keyframes pulse { 50% { outline-color: #ffd34d33; } }
.cell.hl { background: radial-gradient(circle at 50% 50%, #3d4f8f 0 18%, #6fa9e6 19% 24%, #a9d8ff 25% 100%); }

.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.tools button { padding: 9px 4px; font-size: .85rem; border: 2px solid transparent; }
.tools button.on { border-color: var(--accent); background: #1e3270; }
.status { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.found { font-size: 1.2rem; letter-spacing: 2px; }
.hist { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.hist span { font-size: .8rem; background: #ffffff10; border-radius: 6px; padding: 3px 7px; }
.hist span.h { background: #1f5c3a; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1e3270; color: #fff; padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 6px 24px #000a; z-index: 10; font-weight: 600; max-width: 90vw; text-align: center; }
#toast.hit { background: #1f5c3a; }
#toast.err { background: #5c1f2a; }
.hidden { display: none !important; }
details summary { cursor: pointer; font-weight: 600; }
details p, details li { color: var(--muted); font-size: .92rem; line-height: 1.45; }
.rank { counter-reset: r; list-style: none; padding: 0; }
.rank li { display: flex; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid #ffffff10; }
.mini { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; max-width: 260px; }
.mini div { aspect-ratio: 1; border-radius: 50%; background: #1b2759; font-size: .65rem; display: flex; align-items: center; justify-content: center; }
.mini div.p { background: var(--green); }
.mini div.q { background: #2b8fd6; }

