body { background: #f0ede8; font-family: 'Inter', system-ui, sans-serif; color: #111; -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* Setup */
.back-link { display: inline-block; font-size: .75rem; font-weight: 700; color: #bbb; text-decoration: none; margin-bottom: 1rem; }
.back-link:hover { color: #111; }
.sbox { max-height: calc(100vh - 3rem); overflow-y: auto; }
.stepper { display: flex; align-items: center; gap: .75rem; }
.step-btn { width: 48px; height: 48px; border-radius: 9px; border: 1.5px solid #e8e5e0; font-size: 1.3rem; font-weight: 700; color: #111; background: #fff; }
.step-btn:disabled { color: #ddd; cursor: default; }
.step-val { min-width: 2ch; text-align: center; font-size: 1.4rem; font-weight: 800; }

/* App shell */
#app { background: #f0ede8; height: 100vh; height: 100dvh; } /* dvh keeps the round panel above Safari's toolbar */
.hdr-back { font-size: 1.4rem; color: #bbb; text-decoration: none; margin-right: .5rem; line-height: 1; }
.hdr-back:hover { color: #111; }
.hdr .hdr-logo { flex: 1; }
.hdr-new { font-size: .72rem; font-weight: 700; color: #999; background: #f0ede8; border-radius: 50px; padding: .35rem .75rem; }
.hdr-new:hover { color: #111; }

/* Board */
.board { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .55rem; }
.prow { background: #fff; border: 1.5px solid #e8e5e0; border-left: 4px solid var(--c); border-radius: 12px; padding: .7rem .7rem .7rem .85rem; display: flex; align-items: center; gap: .65rem; color: #111; transition: border-color .12s, background .12s; }
.prow.aan { background: #fef2f2; border-color: #fca5a5; border-left-color: #dc2626; }
.prow.out { opacity: .45; }
.p-main { flex: 1; min-width: 0; }
.p-name { font-size: .95rem; font-weight: 700; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.p-name span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.badge { font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: .15rem .45rem; border-radius: 50px; background: #dc2626; color: #fff; }
.badge.out { background: #111; }
.tally { display: block; margin-top: .35rem; stroke: var(--c); stroke-width: 2.2; stroke-linecap: round; }
.prow.aan .tally { stroke: #dc2626; }
.p-pts { font-size: 1.35rem; font-weight: 800; min-width: 2.2ch; text-align: right; font-variant-numeric: tabular-nums; }
.p-pts small { font-size: .65rem; color: #bbb; font-weight: 700; }
/* +1 / −1 buttons */
.minus-btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid #e8e5e0; background: #fff; font-size: .8rem; font-weight: 800; color: #999; flex-shrink: 0; }
.minus-btn:disabled { color: #e8e5e0; cursor: default; }
.plus-btn { width: 56px; height: 52px; border-radius: 12px; background: #111; color: #fff; font-size: 1.1rem; font-weight: 800; flex-shrink: 0; transition: transform .1s; }
.plus-btn:active { transform: scale(.93); }
.prow.aan .plus-btn { background: #dc2626; }
.plus-btn:disabled { background: #ddd; }

/* Aanpakken banner */
.aan-banner { flex-shrink: 0; margin: 1rem 1.25rem 0; background: #dc2626; color: #fff; font-size: .82rem; font-weight: 700; padding: .65rem .85rem; border-radius: 10px; line-height: 1.35; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(220,38,38,.2); } }

/* Toast */
.toast { position: absolute; left: 50%; top: 4rem; transform: translateX(-50%); background: #111; color: #fff; font-size: .82rem; font-weight: 700; padding: .55rem 1rem; border-radius: 50px; z-index: 50; pointer-events: none; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }

/* Game over (named end-* to avoid shared #over styles) */
.end { position: fixed; inset: 0; background: rgba(240,237,232,.92); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.end-box { background: #fff; border-radius: 20px; padding: 2rem; width: 100%; max-width: 360px; box-shadow: 0 4px 40px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: .6rem; }
.end-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .5rem; }
.end-list { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .75rem; }
.end-list div { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 600; }
.end-list div.win { font-weight: 800; }
.btn-ghost { width: 100%; padding: .7rem; font-size: .85rem; font-weight: 700; color: #777; background: transparent; border-radius: 50px; }
.btn-ghost:hover { color: #111; }

@media (prefers-reduced-motion: reduce) {
  .aan-banner { animation: none; }
  .prow, .plus-btn { transition: none; }
}
