:root {
  --bg: #1b0f08;
  --bg2: #2a170b;
  --panel: #3a2312;
  --panel-edge: #8a6233;
  --text: #f6ecdc;
  --muted: #cdb491;
  --accent: #f4bb4a;
  --blue: #43a6ff;
  --red: #ff5d5d;
  --danger: #c0392b;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #140b08;
  min-height: 100vh;
}
.hidden { display: none !important; }
button {
  font: inherit; cursor: pointer; border: 0; border-radius: 8px;
  padding: 8px 14px; background: var(--accent); color: #1c1c1c; font-weight: 600;
}
button:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--text); padding: 4px 8px; font-size: 18px; }
button.danger { background: var(--danger); color: #fff; }
button.secondary { background: #6b4423; color: var(--text); }
input, select {
  font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--panel-edge);
  background: #24140a; color: var(--text);
}
select { padding: 4px 6px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: rgba(8, 4, 2, .55); border-bottom: 1px solid rgba(255,190,90,.25);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); position: relative; z-index: 2;
}
.logo {
  font-size: 26px; font-weight: 800; letter-spacing: .5px; font-style: italic; color: #eafff0;
  text-shadow: 0 0 4px #fff, 0 0 10px #3cff8a, 0 0 22px #1fd36a;
}
.logo span {
  color: #fff6d6; text-shadow: 0 0 4px #fff, 0 0 10px #ffd23f, 0 0 24px #ff9a1f, 0 0 40px #ff7a00;
  animation: neonflicker 7s infinite;
}
@keyframes neonflicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: .45; text-shadow: none; }
}
.topright { display: flex; align-items: center; gap: 12px; }
#meInfo { color: var(--muted); }
#meInfo b { color: var(--text); }

main { padding: 16px; max-width: 1280px; margin: 0 auto; }
.card, .panel {
  background: rgba(42, 23, 11, .58); border: 1px solid rgba(205, 155, 85, .42); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(5px) saturate(1.2); -webkit-backdrop-filter: blur(5px) saturate(1.2);
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.panel { padding: 14px; display: flex; flex-direction: column; min-width: 0; }
.panel h2 { margin: 0 0 10px; font-size: 18px; color: var(--accent); }

/* login */
#login { display: flex; justify-content: center; padding-top: 6vh; }
.login-card { padding: 28px; width: 100%; max-width: 380px; text-align: center; }
.login-board { font-size: 64px; }
.login-card h1 { margin: 4px 0; }
.sub { color: var(--muted); margin-top: 0; }
#loginForm { display: flex; flex-direction: column; gap: 12px; text-align: left; }
#loginForm label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.error { color: #ffb4b4; min-height: 1em; margin: 0; }

/* lobby */
#lobby { display: grid; grid-template-columns: 280px 1fr 300px; gap: 16px; height: calc(100vh - 100px); min-height: 480px; }
.list { list-style: none; padding: 0; margin: 0 0 12px; overflow-y: auto; flex: 1; }
.list li {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px;
}
.list li:nth-child(odd) { background: rgba(0,0,0,.22); }
.list .pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .rating { color: var(--accent); font-variant-numeric: tabular-nums; }
.list .status { font-size: 12px; color: var(--muted); }
.list button { padding: 3px 9px; font-size: 13px; }
.list li.me .pname { font-weight: 700; }
.ranking { counter-reset: r; }
.ranking li::before { counter-increment: r; content: counter(r) "."; width: 24px; color: var(--muted); }
.ranking .wl { font-size: 12px; color: var(--muted); }
.howto { font-size: 13px; color: var(--muted); border-top: 1px solid var(--panel-edge); padding-top: 8px; }
.howto h3 { margin: 0 0 4px; color: var(--text); font-size: 14px; }
.howto ol { padding-left: 18px; margin: 4px 0; }
.howto p { margin: 4px 0 0; }

.chatpanel { min-height: 0; }
.chatlog { flex: 1; overflow-y: auto; font-size: 14px; padding-right: 4px; min-height: 0; }
.chatlog .msg { padding: 2px 0; overflow-wrap: anywhere; }
.chatlog .time { color: var(--muted); font-size: 12px; margin-right: 4px; }
.chatlog .from { font-weight: 700; color: var(--accent); }
.chatlog .sys { color: var(--muted); font-style: italic; }
.chatform { display: flex; gap: 8px; margin-top: 8px; }
.chatform input { flex: 1; min-width: 0; }

/* spel */
#game { display: grid; grid-template-columns: minmax(0, 600px) minmax(300px, 1fr); gap: 16px; align-items: start; }
.board-wrap { position: relative; }
#board {
  width: 100%; aspect-ratio: 1; display: block; border-radius: 12px;
  background: radial-gradient(circle, #4a2c16 0%, #22120a 75%); border: 2px solid var(--panel-edge);
  touch-action: manipulation;
}
.aimhint {
  text-align: center; margin-top: 8px; color: var(--muted); min-height: 1.4em; font-size: 15px;
}
.aimhint b { color: var(--accent); }
.side { display: flex; flex-direction: column; gap: 12px; }
.matchinfo { color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; }
/* klein gooi-dartbord */
.throwrow { display: flex; justify-content: center; }
.throwbtn {
  position: relative; width: 132px; height: 132px; padding: 6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3fc35f, #0d6a2a 70%);
  border: 4px solid #d9e6dc; box-shadow: 0 6px 0 #063d17, 0 10px 22px rgba(0,0,0,.45);
  transition: transform .08s, box-shadow .08s, filter .2s;
}
.throwbtn canvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
.throwbtn span {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-weight: 900; font-size: 20px; letter-spacing: 1px; color: #fff;
  background: rgba(0,0,0,.55); padding: 2px 10px; border-radius: 8px; pointer-events: none;
}
.throwbtn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #063d17, 0 4px 10px rgba(0,0,0,.45); }
.throwbtn:disabled { filter: grayscale(.85) brightness(.6); cursor: default; box-shadow: 0 6px 0 #222, 0 8px 16px rgba(0,0,0,.4); }
.throwbtn.ready { animation: throwpulse 1.2s ease-in-out infinite; }
@keyframes throwpulse {
  0%, 100% { box-shadow: 0 6px 0 #063d17, 0 0 0 0 rgba(255,210,63,.6); }
  50% { box-shadow: 0 6px 0 #063d17, 0 0 0 10px rgba(255,210,63,0); }
}

/* scorebord zoals in de kroeg */
.scoreboard {
  background: linear-gradient(#fffefa, #f1eee4); color: #1b1b1b;
  border: 10px solid #e67e22; border-radius: 6px;
  box-shadow: inset 0 0 0 2px #b85f10, inset 0 6px 14px rgba(0,0,0,.12), 0 8px 20px rgba(0,0,0,.4);
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  display: flex; flex-direction: column;
}
.sb-grid { display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); }
.sb-head > div {
  text-align: center; font-weight: 700; font-size: 17px; padding: 6px 4px 4px;
  border-bottom: 3px solid #1b1b1b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-head > div.active { background: linear-gradient(transparent 15%, rgba(255,221,64,.75) 15%, rgba(255,221,64,.75) 85%, transparent 85%); }
.sb-head > div.active::before { content: "▶ "; font-size: 13px; }
.sb-grid > div + div { border-left: 3px solid #1b1b1b; }
.sb-head .offline { color: #c0392b; font-size: 12px; }
.sb-cols { height: 220px; }
.sb-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; overflow: hidden; padding: 4px 0 2px; }
.sb-row { font-size: 19px; line-height: 1.25; color: #6b6b6b; position: relative; font-variant-numeric: tabular-nums; }
.sb-row.old::after {
  content: ""; position: absolute; left: -6px; right: -6px; top: 55%; height: 2px;
  background: currentColor; transform: rotate(-6deg); opacity: .7;
}
.sb-row.now { font-size: 46px; font-weight: 700; color: #111; line-height: 1.1; }
.sb-row.scored { font-size: 13px; color: #2d7a3e; }
.sb-darts { display: flex; justify-content: center; gap: 4px; min-height: 26px; padding: 4px; border-top: 2px dashed #bbb; }
.sb-darts span { font-family: "Segoe UI", sans-serif; background: #1b1b1b; color: #fff; border-radius: 5px; padding: 1px 6px; font-size: 12px; font-weight: 700; }
.sb-foot > div {
  font-family: "Segoe UI", sans-serif; font-size: 12px; color: #444; text-align: center;
  padding: 5px 4px; border-top: 3px solid #1b1b1b; display: flex; flex-direction: column; gap: 3px; align-items: center;
}
.sb-legs { display: flex; gap: 4px; }
.sb-legs i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #1b1b1b; display: inline-block; }
.sb-legs i.won { background: #e67e22; border-color: #b85f10; }
.sb-timer { font-weight: 700; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.sb-timer.low { color: #c0392b; }

/* 180 springt uit het bord */
.pop180 {
  position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 1; pointer-events: none;
  display: flex; align-items: center; justify-content: center; overflow: visible; z-index: 5;
}
.pop180 .burst {
  position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,210,63,.55) 0 10deg, transparent 10deg 20deg);
  mask-image: radial-gradient(circle, #000 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%);
  animation: burst 2.6s ease-out forwards;
}
.pop180 .num {
  position: relative; font: 900 min(30vw, 180px)/1 Impact, "Arial Black", sans-serif; letter-spacing: 2px;
  background: linear-gradient(#fff6b0, #ffd23f 45%, #e67e22 80%); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-stroke: 5px #4a1f00;
  filter: drop-shadow(0 10px 0 rgba(0,0,0,.55)) drop-shadow(0 0 28px rgba(255,210,63,.9));
  animation: pop180 2.6s cubic-bezier(.2,1.5,.4,1) forwards;
}
.pop180 .spark {
  position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #ffd23f;
  box-shadow: 0 0 10px #ffd23f; animation: spark 1.4s ease-out forwards;
}
@keyframes pop180 {
  0% { transform: scale(.05) rotate(-30deg); opacity: 0; }
  16% { transform: scale(1.4) rotate(8deg); opacity: 1; }
  28% { transform: scale(.95) rotate(-4deg); }
  38% { transform: scale(1.12) rotate(0deg); }
  82% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(2.4) translateY(-30px); opacity: 0; }
}
@keyframes burst {
  0% { transform: scale(.2) rotate(0deg); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: scale(1.6) rotate(90deg); opacity: 0; }
}
@keyframes spark {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; }
}
.checkout {
  min-height: 1.6em; text-align: center; font-weight: 700; color: var(--accent); letter-spacing: .5px;
}
.chatpanel.small { height: 220px; }

/* modal & toast */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center;
  z-index: 20; padding: 16px;
}
.modal .card { padding: 24px; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; width: 100%; text-align: center; }
.modal h2 { margin: 0 0 8px; color: var(--accent); }
.modal table { margin: 10px auto; border-collapse: collapse; }
.modal td, .modal th { padding: 4px 10px; }
.buttons { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.up { color: #7dff9a; } .down { color: #ffb4b4; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: #1f1009; border: 1px solid var(--panel-edge); padding: 10px 18px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 30; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 980px) {
  #lobby { grid-template-columns: 1fr; height: auto; }
  #lobby .chatpanel { height: 360px; }
  #game { grid-template-columns: 1fr; }
  main { padding: 10px; }
  .sb-cols { height: 220px; }
}

/* instellingenvenster */
.cfgline { color: var(--accent); font-weight: 700; margin: 4px 0 10px; }
.setup { display: flex; flex-direction: column; gap: 12px; text-align: left; margin-top: 12px; }
.setup .field { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; }
.setup .field > span { color: var(--muted); }
.setup select { width: 100%; }
.seg { display: flex; border: 1px solid var(--panel-edge); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; border-radius: 0; background: #24140a; color: var(--text); font-weight: 600; padding: 7px 6px; }
.seg button + button { border-left: 1px solid var(--panel-edge); }
.seg button.on { background: var(--accent); color: #1c1c1c; }
.lvl { display: flex; align-items: center; gap: 10px; }
.lvl input { flex: 1; accent-color: var(--accent); padding: 0; }
.lvl b { min-width: 110px; white-space: pre; }

/* tactics-scorebord */
.sb-points > div { text-align: center; font-size: 34px; font-weight: 700; padding: 2px 0; border-bottom: 3px solid #1b1b1b; }
.tac-table { display: grid; }
.tac-table > div { text-align: center; font-size: 19px; line-height: 1.2; border-bottom: 1px solid #e2ded2; min-height: 23px; }
.tac-num { font-weight: 700; background: rgba(0,0,0,.05); border-left: 3px solid #1b1b1b; border-right: 3px solid #1b1b1b; }
.tac-table.solo .tac-num { border-left: 0; }
.tac-num.dead { color: #aaa; text-decoration: line-through; }
.tac-mark { font-weight: 700; color: #111; }
.tac-mark.closed { color: #2d7a3e; }
.sb-sets { font-family: "Segoe UI", sans-serif; font-size: 12px; margin-right: 4px; }

/* statistieken na afloop */
table.stats { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
table.stats th, table.stats td { padding: 5px 8px; text-align: center; }
table.stats td:first-child { text-align: left; color: var(--muted); }
table.stats tr:nth-child(even) td { background: rgba(0,0,0,.15); }
table.stats th { border-bottom: 2px solid var(--panel-edge); }
table.stats .win { color: var(--accent); font-weight: 700; }
.ranking li.empty::before { content: none; }
.sb-row.note { font-size: 13px; color: #c0392b; font-weight: 700; }

/* live rest en uitgooiroute op het scorebord */
.sb-row.live { font-size: 16px; color: #1f5fbf; font-weight: 700; }
.sb-row.finish {
  font-family: "Segoe UI", sans-serif; font-size: 13px; font-weight: 800; color: #fff;
  background: #2d7a3e; border-radius: 6px; padding: 1px 8px; margin-top: 3px; white-space: nowrap;
}
.sb-row.nofinish { font-family: "Segoe UI", sans-serif; font-size: 12px; color: #999; margin-top: 3px; }

/* snelle chatknoppen */
.emotes { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.emotes button { background: #2a170b; border: 1px solid var(--panel-edge); padding: 3px 8px; font-size: 17px; }
.emotes button:hover { background: #5a3a1e; }

/* lobby */
.pname.link { cursor: pointer; }
.pname.link:hover { color: var(--accent); text-decoration: underline; }

/* prestatie-banner */
.achbanner {
  position: fixed; top: 16px; left: 50%; transform: translate(-50%, -140%); z-index: 40;
  display: flex; gap: 14px; align-items: center; padding: 12px 22px 12px 16px; border-radius: 14px;
  background: linear-gradient(135deg, #3a2a00, #6b4a00); border: 2px solid var(--accent);
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 30px rgba(255,210,63,.35);
  transition: transform .5s cubic-bezier(.2,1.4,.4,1); pointer-events: none; max-width: calc(100% - 32px);
}
.achbanner { opacity: 0; visibility: hidden; }
.achbanner.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.achbanner .icon { font-size: 40px; }
.achbanner div { display: flex; flex-direction: column; }
.achbanner small { color: var(--accent); text-transform: uppercase; letter-spacing: 1px; font-size: 11px; font-weight: 700; }
.achbanner b { font-size: 19px; }
.achbanner span { color: #f3e3b5; font-size: 13px; }

/* profiel */
.modal .card.wide { max-width: 640px; text-align: left; }
.modal .card.wide h2, .modal .card.wide .cfgline { text-align: center; }
.modal h3 { margin: 16px 0 8px; font-size: 15px; color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: rgba(0,0,0,.22); border-radius: 10px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.tile b { font-size: 20px; }
.tile span { font-size: 12px; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.badge {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  padding: 8px 6px; border-radius: 10px; background: rgba(0,0,0,.2); opacity: .45; filter: grayscale(1);
}
.badge.got { opacity: 1; filter: none; background: linear-gradient(160deg, rgba(255,210,63,.22), rgba(0,0,0,.2)); border: 1px solid rgba(255,210,63,.5); }
.badge .bi { font-size: 26px; }
.badge b { font-size: 13px; }
.badge small { font-size: 11px; color: var(--muted); }
table.recent td { font-size: 13px; }
@media (max-width: 600px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.list li { flex-wrap: wrap; }
.list .status.sub { flex-basis: 100%; order: 5; margin-top: -2px; }
.rematch-note { margin: 12px 0 0; padding: 8px 10px; border-radius: 8px; background: rgba(255,210,63,.18); color: var(--accent); font-weight: 700; }

/* ================================================= oud houten café op de achtergrond */
#scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #1b0f08; pointer-events: none; }

#cafe { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .6s; }

/* koperen hanglampen met amberglas */
#scene .lamp {
  position: absolute; top: 0; width: 120px; margin-left: -60px; transform-origin: 50% 0;
  animation: lampswing 7s ease-in-out infinite alternate;
}
#scene .l1 { left: 22%; }
#scene .l2 { left: 78%; animation-duration: 8.5s; animation-delay: -3s; }
#scene .cord { position: absolute; left: 59px; top: 0; width: 2px; height: 66px; background: #0b0605; }
#scene .shade {
  position: absolute; left: 22px; top: 62px; width: 76px; height: 44px;
  border-radius: 76px 76px 10px 10px / 64px 64px 10px 10px;
  background: radial-gradient(ellipse at 50% 85%, #ffcf7a, #e0892d 40%, #9a4a14 75%, #5e2a0a);
  box-shadow: inset 0 -5px 0 #d6aa52, inset 0 3px 0 #c4973e, 0 0 26px rgba(255,150,60,.55);
}
#scene .bulb {
  position: absolute; left: 47px; top: 101px; width: 26px; height: 10px; border-radius: 0 0 13px 13px;
  background: #ffe2a8; box-shadow: 0 0 18px 8px rgba(255,190,100,.75), 0 0 70px 26px rgba(255,150,60,.35);
}
#scene .cone {
  position: absolute; left: -170px; top: 106px; width: 460px; height: 80vh;
  background: linear-gradient(rgba(255,180,95,.26), rgba(255,170,90,.06) 60%, transparent);
  clip-path: polygon(41% 0, 59% 0, 100% 100%, 0 100%);
  mix-blend-mode: screen; filter: blur(4px);
}
@keyframes lampswing { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }

/* stofjes in het lamplicht */
#dust span {
  position: absolute; bottom: -10px; border-radius: 50%; background: rgba(255,220,170,.7);
  animation: dustfloat linear infinite;
}
@keyframes dustfloat {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: .8; }
  50% { transform: translate(18px, -45vh); }
  90% { opacity: .6; }
  100% { transform: translate(-10px, -92vh); opacity: 0; }
}
#scene .vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 42%, transparent 40%, rgba(15,7,2,.82) 100%);
}

/* tijdens een potje: café op de achtergrond dimmen */
body[data-screen="game"] #cafe { opacity: .3; }
body[data-screen="game"] #scene .cone, body[data-screen="game"] #dust { opacity: .35; }
@media (prefers-reduced-motion: reduce) {
  #scene .lamp, #dust span, .logo span { animation: none; }
}

/* Vandaag-paneel */
.rightcol { gap: 0; }
.daily { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.drow { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; background: rgba(0,0,0,.22); }
.dicon { font-size: 20px; width: 26px; text-align: center; }
.dtext { font-size: 13px; line-height: 1.3; min-width: 0; }
.dtext small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.dtext b { color: var(--accent); font-size: 15px; }
.dtext .link { cursor: pointer; }
.dtext .link:hover { color: var(--accent); text-decoration: underline; }
.dnone { color: var(--muted); font-style: italic; }
.streak { font-size: 12px; font-weight: 700; color: #ffb347; }
.chatlog .sysline { color: #ffd38a; font-weight: 600; background: rgba(255,170,60,.12); border-radius: 6px; padding: 3px 6px; margin: 2px 0; }
.modal .howto { text-align: left; color: var(--text); font-size: 14px; border: 0; }
.modal .howto h3 { color: var(--accent); }

.onlinecount { font-size: 13px; color: var(--muted); background: rgba(0,0,0,.3); padding: 3px 10px; border-radius: 12px; }
h2 .count { font-size: 13px; color: var(--muted); font-weight: 600; }
.sb-head > div.clickable { cursor: pointer; }
.sb-head > div.clickable:hover { text-decoration: underline; }

/* open tafels */
.tables-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tables-head h2 { margin: 0; }
.tables-head button { padding: 5px 12px; font-size: 14px; }
.tables { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; max-height: 34vh; overflow-y: auto; }
.tables-empty { color: var(--muted); font-size: 13px; font-style: italic; padding: 6px 2px; }
.tablerow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.25); }
.tablerow.mine { background: rgba(244,187,74,.16); border: 1px solid rgba(244,187,74,.55); }
.tinfo { flex: 1; min-width: 0; font-size: 14px; }
.seats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.seat { font-size: 12px; padding: 1px 8px; border-radius: 10px; border: 1px dashed rgba(255,255,255,.3); color: var(--muted); }
.seat.taken { border-style: solid; border-color: rgba(244,187,74,.6); color: var(--text); background: rgba(0,0,0,.25); }
.tbtns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tbtns button { padding: 5px 10px; font-size: 13px; }
.twait { color: var(--muted); font-size: 11px; width: 100%; text-align: right; }
.seg { flex-wrap: wrap; }
.seg button { min-width: 56px; }
.setup .hint { margin: 0; font-size: 12px; }
.modal .hint { color: var(--muted); font-size: 13px; }

/* scorebord met 3-4 spelers en Shanghai */
.scoreboard.many .sb-head > div { font-size: 14px; }
.scoreboard.many .sb-row.now { font-size: 32px; }
.scoreboard.many .sb-row { font-size: 15px; }
.scoreboard.many .sb-row.finish { font-size: 11px; padding: 1px 4px; white-space: normal; text-align: center; }
.sb-head > div.out { text-decoration: line-through; opacity: .55; }
.sb-row.plain::after { display: none; }
.roundinfo { width: 100%; text-align: center; color: var(--accent); font-weight: 700; font-size: 15px; margin-top: 4px; }
.matchinfo { flex-wrap: wrap; }

/* knoppen onder het spel */
.sidebtns { display: flex; gap: 8px; }
.sidebtns button { flex: 1; }
.soundbtn.muted { opacity: .75; }
.seg[data-name="game"] button { flex: 1 1 30%; border-left: 0; border-bottom: 1px solid var(--panel-edge); }
.seg[data-name="game"] { border-bottom: 0; }
.modal .card { overflow-x: hidden; }
.roundinfo { margin-bottom: 10px; }

/* ================================================= telefoon */
.mtabs, .mobile-only { display: none; }
.tables-block, .chat-block { display: flex; flex-direction: column; min-height: 0; }
.chat-block { flex: 1; }
#game, #lobby, .throwbtn, #board { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#game input, #lobby input { -webkit-user-select: text; user-select: text; }
button { touch-action: manipulation; }

@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  main { padding: 8px 8px 0; }
  input, select, textarea { font-size: 16px; }            /* iPhone zoomt anders in bij typen */

  /* compacte bovenbalk */
  .topbar { padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); gap: 6px; }
  .logo { font-size: 19px; white-space: nowrap; }
  .topright { gap: 2px; }
  .topright .lbl, #meInfo .metext { display: none; }
  .onlinecount { font-size: 11px; padding: 2px 7px; white-space: nowrap; }
  button.ghost { padding: 4px 6px; font-size: 18px; }

  /* lobby: één paneel tegelijk, tabbladen onderin */
  #lobby { display: block; height: auto; min-height: 0; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  #lobby > .panel { display: none; height: calc(100vh - 140px); height: calc(100dvh - 140px); }
  #lobby[data-tab="players"] .p-players,
  #lobby[data-tab="top"] .p-top,
  #lobby[data-tab="tables"] .p-center,
  #lobby[data-tab="chat"] .p-center { display: flex; }
  #lobby[data-tab="tables"] .chat-block { display: none; }
  #lobby[data-tab="chat"] .tables-block { display: none; }
  #lobby[data-tab="tables"] .tables-block { flex: 1; }
  #lobby[data-tab="tables"] .tables { max-height: none; flex: 1; }
  #lobby .p-top { overflow-y: auto; }
  .mobile-only { display: block; margin-top: 10px; }
  .mtabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    background: rgba(18, 9, 4, .94); border-top: 1px solid rgba(205,155,85,.35);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mtabs button {
    flex: 1; background: transparent; color: var(--muted); border-radius: 0; padding: 8px 0 7px;
    display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 20px; position: relative;
  }
  .mtabs button span { font-size: 11px; font-weight: 600; }
  .mtabs button.on { color: var(--accent); background: rgba(244,187,74,.08); }
  .mtabs .badge { position: absolute; top: 6px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: #ff4d4d; }
  .tablerow { flex-wrap: wrap; }
  .tbtns { width: 100%; justify-content: flex-end; }
  .list li { padding: 9px 8px; }
  .list button { padding: 6px 12px; font-size: 14px; }

  /* spelen: bord bovenaan, GOOI zwevend onder je duim */
  #game { grid-template-columns: 1fr; gap: 8px; padding-bottom: 120px; }
  #board { border-radius: 10px; }
  .aimhint { font-size: 13px; margin-top: 4px; padding-right: 100px; text-align: left; }
  .throwrow { position: fixed; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 12; }
  .throwbtn { width: 92px; height: 92px; padding: 5px; }
  .throwbtn span { font-size: 16px; }
  .matchinfo { font-size: 12px; }
  .sb-cols { height: 150px; }
  .sb-row.now { font-size: 36px; }
  .scoreboard.many .sb-row.now { font-size: 26px; }
  .sb-head > div { font-size: 14px; }
  .chatpanel.small { height: 190px; }
  .emotes button { padding: 4px 9px; }

  /* vensters */
  .modal { padding: 10px; align-items: flex-end; }
  .modal .card { padding: 18px 14px; max-height: calc(100dvh - 20px); }
  .setup .field { grid-template-columns: 64px 1fr; gap: 8px; }
  .seg button { font-size: 13px; padding: 8px 4px; }
  .tiles { gap: 6px; }
  .tile b { font-size: 17px; }
  .achbanner { top: 10px; padding: 10px 14px; }
  .toast { bottom: calc(110px + env(safe-area-inset-bottom)); }
}

/* ================================================= inloggen / account maken */
.authtabs { margin: 6px 0 14px; }
.authform { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.authform label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 14px; }
.authform label small { font-size: 11px; color: var(--muted); }
.authform label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.35; }
.authform label.check input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--accent); }
.authform a, .loginlinks a, .modal a { color: var(--accent); }
.small-link { font-size: 13px; align-self: center; }
.okmsg { color: #9be7a8; min-height: 1em; margin: 6px 0 0; font-size: 14px; }
#loginError { margin-top: 10px; }
.loginlinks { margin-top: 14px; font-size: 12px; color: var(--muted); }
textarea { font: inherit; width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--panel-edge);
  background: #24140a; color: var(--text); resize: vertical; }

/* melding onder de balk */
.mailbanner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 14px; background: rgba(244,187,74,.16); border-bottom: 1px solid rgba(244,187,74,.4); font-size: 14px; }
.mailbanner button { padding: 4px 12px; font-size: 13px; }

/* accountinstellingen */
.setup.acct h3 { margin: 10px 0 0; }
.setup.acct input { width: 100%; }
.setup.acct .hint { margin: 0; }

/* ================================================= beheer */
#admin { display: flex; flex-direction: column; gap: 12px; }
#admin.hidden { display: none !important; }
.admin-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-head h2 { margin: 0; color: var(--accent); }
.admin-head .seg { flex: 1; max-width: 460px; }
.admin-body { background: rgba(42,23,11,.75); border: 1px solid rgba(205,155,85,.42); border-radius: 12px; padding: 14px;
  backdrop-filter: blur(6px); min-height: 60vh; }
.admin-tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); margin-bottom: 14px; }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admchat { height: 340px; background: rgba(0,0,0,.2); border-radius: 8px; padding: 8px; }
.auditrow { font-size: 13px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.06); color: var(--muted); }
.admlink { color: var(--accent); font-weight: 700; text-decoration: none; }
.admlink:hover { text-decoration: underline; }
.admin-split { display: grid; grid-template-columns: 320px 1fr; gap: 14px; }
.admin-search { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.admin-search input { flex: 1; }
.admin-search .check { display: flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; }
#admRows { max-height: 65vh; overflow-y: auto; }
.admrow { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.admrow:nth-child(odd) { background: rgba(0,0,0,.18); }
.admrow:hover, .admrow.on { background: rgba(244,187,74,.18); }
.admrow b { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.admrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #555; }
.admrow .dot.on { background: #4cd07d; }
.admrow .flags { font-size: 12px; }
.admin-detail h3 { margin-top: 0; }
.admin-detail table.stats td:first-child { width: 130px; }
.admbtns { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.admbtns button { padding: 6px 10px; font-size: 13px; }
.reportcard { background: rgba(0,0,0,.22); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.reportcard.done { opacity: .55; }
.reportcard p { margin: 6px 0; font-style: italic; }
.rctx { font-size: 12px; color: var(--muted); background: rgba(0,0,0,.2); border-radius: 6px; padding: 6px 8px; margin: 6px 0; }
.reportcard button { padding: 4px 10px; font-size: 13px; margin-top: 4px; }
@media (max-width: 760px) {
  .admin-cols, .admin-split { grid-template-columns: 1fr; }
  .admin-head .seg { max-width: none; width: 100%; }
}

/* ================================================= training */
.lobbybtns { display: flex; flex-direction: column; gap: 8px; }
.drill { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 14px 8px;
  min-height: 190px; font-family: "Segoe Print", "Comic Sans MS", cursive; }
.drill-label { font-size: 15px; color: #555; }
.drill-big { font-size: 64px; font-weight: 700; line-height: 1; color: #111; }
.drill-line { font-family: "Segoe UI", sans-serif; font-size: 14px; color: #444; }
.drill-best { font-family: "Segoe UI", sans-serif; font-size: 13px; color: #8a5a10; font-weight: 700; margin-top: 6px; }
.drills { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.drillcard { background: rgba(0,0,0,.25); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 6px; }
.drillcard .dhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drillcard .dhead small { color: var(--muted); width: 100%; }
.drillcard .dicon { font-size: 24px; }
.drillcard p { margin: 0; font-size: 13px; color: var(--muted); flex: 1; }
.drillcard button { align-self: flex-start; }
.drill-result { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 6px 0; }
.drill-result b { font-size: 56px; color: var(--accent); }
.drill-result span { color: var(--muted); }
.ideatext { white-space: pre-wrap; font-style: normal !important; }
@media (max-width: 760px) { .drills { grid-template-columns: 1fr; } .drill-big { font-size: 48px; } }

/* gasten */
.guestbox { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.guestbox .or { display: flex; align-items: center; gap: 10px; color: var(--muted, #b9a58a); font-size: 12px; }
.guestbox .or::before, .guestbox .or::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.15); }
.guestbox small { color: var(--muted, #b9a58a); font-size: 12px; text-align: center; }
.guesttag { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: rgba(255,255,255,.12); color: #d8c7a8;
  margin-left: 4px; text-transform: uppercase; letter-spacing: .5px; }
.guestnote { font-size: 13px; background: rgba(244,187,74,.12); border: 1px solid rgba(244,187,74,.35); padding: 8px 10px;
  border-radius: 8px; }
body.is-guest .emotes { display: none; }
#authBack { display: block; text-align: center; margin-top: 10px; color: #f4bb4a; }

/* ---- merk Dartje */
.logo { display: inline-flex; align-items: center; text-shadow: none; }
.logo img { height: 34px; width: auto; display: block; filter: drop-shadow(0 0 10px rgba(244,187,74,.18)); }
.login-logo { margin: 0 0 2px; line-height: 0; }
.login-logo img { width: 220px; max-width: 70vw; height: auto; }
.login-card .sub { font-family: "Baloo 2", "Segoe UI", sans-serif; font-size: 20px; font-weight: 700; color: var(--accent); }
h1, h2, .panel h2 { font-family: "Baloo 2", "Segoe UI", system-ui, sans-serif; }
@media (max-width: 760px) { .logo img { height: 28px; } }

button:disabled, button[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }

/* mededeling van de beheerder */
.notice-bar { padding: 10px 16px; text-align: center; font-weight: 600; font-size: 15px; line-height: 1.4;
  background: linear-gradient(90deg, rgba(244,187,74,.22), rgba(244,187,74,.12)); color: #fff1d6;
  border-bottom: 1px solid rgba(244,187,74,.5); white-space: pre-line; }
.notice-bar.notice-onderhoud { background: linear-gradient(90deg, rgba(217,65,47,.35), rgba(217,65,47,.18));
  border-bottom-color: rgba(255,120,100,.6); }
.notice-bar.notice-feest { background: linear-gradient(90deg, rgba(46,158,91,.32), rgba(46,158,91,.16));
  border-bottom-color: rgba(110,220,150,.55); }
.notice-pin { margin: 0 0 10px; border-radius: 10px; border: 1px solid rgba(244,187,74,.5); }
.notice-game { margin: 6px 0; border-radius: 8px; font-size: 13px; padding: 6px 10px; }
.login-card .notice-pin { margin: 10px 0 0; font-size: 14px; }
.admin-notice textarea { width: 100%; min-height: 90px; }
.admin-notice .checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 8px 0; }
.admin-notice .row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0; }
.admin-notice .preview { margin: 12px 0; }

/* snel spelen bovenaan de lobby */
.quickplay { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; margin: 0 0 12px;
  padding: 12px; border-radius: 12px; background: linear-gradient(135deg, rgba(244,187,74,.18), rgba(244,187,74,.06));
  border: 1px solid rgba(244,187,74,.45); }
.quickplay .qp-head { grid-column: 1 / -1; display: flex; flex-direction: column; }
.quickplay .qp-head b { font-family: "Baloo 2", "Segoe UI", sans-serif; font-size: 19px; color: #fff1d6; line-height: 1.1; }
.quickplay .qp-head small { color: var(--muted); font-size: 12px; }
.quickplay .qp-main { font-size: 17px; font-weight: 800; padding: 12px 14px; }
.quickplay .qp-pick { white-space: nowrap; }
.pl-hint { display: none; margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px;
  background: rgba(244,187,74,.12); border: 1px solid rgba(244,187,74,.35); }
@keyframes flashPanel { 0%, 100% { box-shadow: none; } 30%, 70% { box-shadow: 0 0 0 3px rgba(244,187,74,.8), 0 0 28px rgba(244,187,74,.5); } }
.p-players.flash { animation: flashPanel 1.4s ease 1; }
@media (max-width: 760px) {
  .quickplay { grid-template-columns: 1fr; }
  .quickplay .qp-main { font-size: 18px; padding: 14px; }
  .pl-hint { display: block; }
}

/* rondleiding */
.tour { position: fixed; inset: 0; z-index: 60; }
.tour::before { content: ""; position: absolute; inset: 0; background: rgba(8,4,2,.55); }
.tour:has(.tour-hole:not(.hidden))::before { background: transparent; }
.tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(8,4,2,.62), 0 0 0 3px #f4bb4a, 0 0 24px rgba(244,187,74,.6);
  transition: all .25s ease; pointer-events: none; }
.tour-card { position: fixed; width: min(340px, calc(100vw - 24px)); background: #2a170b; color: #f6ecdc;
  border: 1px solid rgba(244,187,74,.6); border-radius: 14px; padding: 14px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.6);
  transition: left .25s ease, top .25s ease; }
.tour-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tour-top b { font-family: "Baloo 2", "Segoe UI", sans-serif; font-size: 19px; color: #f4bb4a; }
.tour-top small { color: var(--muted); }
.tour-card p { margin: 8px 0 12px; font-size: 15px; line-height: 1.45; }
.tour-btns { display: flex; justify-content: space-between; gap: 10px; }
