/* Dart – old English pub: dark wood panelling, brass, chalkboards, and the board's red and green. */
:root {
  --wood-0: #120a05;
  --wood-1: #1f130a;
  --wood-2: #2e1c0f;
  --wood-3: #4a2d17;
  --brass: #c9a14a;
  --brass-2: #e8c873;
  --brass-dark: #8a6a2a;
  --cream: #f4ead3;
  --cream-2: #d9ccae;
  --muted: #a99878;
  --chalk: #1c2620;
  --chalk-2: #24312a;
  --chalk-line: rgba(244, 234, 211, .14);
  --red: #c0302a;
  --red-2: #e0473f;
  --green: #1f7a44;
  --green-2: #2fa25e;
  --live: #ff5a4e;
  --radius: 10px;
  --shadow: 0 6px 22px rgba(0, 0, 0, .55);
  --font-sign: 'IM Fell English SC', Georgia, serif;
  --font: 'Barlow Condensed', 'Roboto Condensed', system-ui, sans-serif;
  --font-num: 'Barlow Condensed', 'Roboto Condensed', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font: 500 17px/1.4 var(--font);
  background-color: var(--wood-1);
  /* wood panelling: planks, grain and a warm lamp in the middle */
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(255, 190, 110, .16), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, .7), transparent 60%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .35) 0 2px, transparent 2px 140px),
    repeating-linear-gradient(90deg, rgba(255, 220, 170, .025) 0 1px, transparent 1px 7px, rgba(0, 0, 0, .05) 7px 9px, transparent 9px 23px),
    linear-gradient(180deg, var(--wood-2), var(--wood-1) 40%, var(--wood-0));
  background-attachment: fixed;
}
a { color: var(--brass-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-sign); font-weight: 400; letter-spacing: .02em; margin: 0 0 .5em; color: var(--brass-2); }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
small, .muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--chalk-line); margin: 1rem 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- top bar: a pub sign */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(180deg, #16301f, #0f2216);
  border-bottom: 3px double var(--brass);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .6);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar__inner { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none !important; }
.brand img { width: 44px; height: 44px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.brand span { font-family: var(--font-sign); font-size: 1.7rem; line-height: 1; color: var(--brass-2); text-shadow: 0 2px 0 #000; }
.brand small { display: block; font: 600 .7rem/1 var(--font); letter-spacing: .2em; color: var(--cream-2); text-transform: uppercase; margin-top: 2px; }
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav a { color: var(--cream-2); padding: 8px 12px; border-radius: 6px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; font-size: .95rem; }
.topnav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.topnav a.is-active { color: var(--wood-0); background: var(--brass); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.online-pill { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--cream-2); white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green-2); box-shadow: 0 0 6px var(--green-2); display: inline-block; }
.dot--live { background: var(--live); box-shadow: 0 0 8px var(--live); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.me { display: flex; align-items: center; gap: 8px; color: var(--cream); }
.me:hover { text-decoration: none; }

/* bottom tab bar on phones */
.tabbar { display: none; }
@media (max-width: 760px) {
  .topnav, .online-pill .label, .me .me__name { display: none; }
  .topbar__inner { height: 54px; }
  .brand img { width: 38px; height: 38px; }
  .brand span { font-size: 1.45rem; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: linear-gradient(180deg, #16301f, #0c1b11); border-top: 3px double var(--brass);
    padding-bottom: var(--safe-b);
  }
  .tabbar a { flex: 1; text-align: center; padding: 7px 0 6px; color: var(--cream-2); font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
  .tabbar a .ico { display: block; font-size: 1.35rem; line-height: 1.2; }
  .tabbar a.is-active { color: var(--brass-2); }
  .tabbar a:hover { text-decoration: none; }
  main { padding-bottom: calc(80px + var(--safe-b)); }
  body.is-scoring main { padding-bottom: 0; }
  body.is-scoring .tabbar { display: none; }
}

main { padding: 20px 0 40px; }

/* ---------- panels: chalkboards in a wooden frame */
.board {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .045), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(255, 255, 255, .03), transparent 50%),
    var(--chalk);
  border: 6px solid var(--wood-3);
  border-image: linear-gradient(135deg, #6b4425, #3a2210 40%, #5b391e 60%, #2b180b) 1;
  box-shadow: var(--shadow), inset 0 0 40px rgba(0, 0, 0, .55);
  padding: 16px 18px;
  margin-bottom: 18px;
  position: relative;
}
.board > h2:first-child, .board > h3:first-child, .board__head h2, .board__head h3 { margin-bottom: .4em; }
.board__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.board__head h2, .board__head h3 { margin: 0; }
.chalk { color: var(--cream); text-shadow: 0 0 1px rgba(244, 234, 211, .6), 0 0 6px rgba(244, 234, 211, .12); }

.grid { display: grid; gap: 18px; }
.grid--dash { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid--dash, .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1rem/1 var(--font); letter-spacing: .05em; text-transform: uppercase;
  color: var(--wood-0); background: linear-gradient(180deg, var(--brass-2), var(--brass) 55%, var(--brass-dark));
  border: 1px solid #5c4316; border-radius: 8px; padding: 12px 18px; cursor: pointer;
  box-shadow: 0 2px 0 #3a2a0c, 0 4px 10px rgba(0, 0, 0, .4); text-decoration: none !important;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #3a2a0c; }
.btn--big { font-size: 1.25rem; padding: 18px 26px; border-radius: 12px; }
.btn--red { color: #fff; background: linear-gradient(180deg, var(--red-2), var(--red) 60%, #821b16); border-color: #5a120f; box-shadow: 0 2px 0 #3d0c09, 0 4px 10px rgba(0, 0, 0, .4); }
.btn--green { color: #fff; background: linear-gradient(180deg, var(--green-2), var(--green) 60%, #11512b); border-color: #0b3a1d; box-shadow: 0 2px 0 #07290f, 0 4px 10px rgba(0, 0, 0, .4); }
.btn--ghost { color: var(--cream); background: rgba(255, 255, 255, .06); border: 1px solid var(--chalk-line); box-shadow: none; }
.btn--small { padding: 7px 11px; font-size: .85rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.linkbtn { background: none; border: 0; color: var(--brass-2); cursor: pointer; font: inherit; padding: 0; }

label { display: block; font-weight: 600; color: var(--cream-2); margin: 10px 0 4px; letter-spacing: .02em; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; font: 500 1.05rem var(--font); color: var(--cream); background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(244, 234, 211, .25); border-radius: 8px; padding: 11px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brass); outline-offset: 1px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brass); vertical-align: middle; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--cream); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 600; }
.alert--ok { background: rgba(47, 162, 94, .18); border: 1px solid var(--green-2); }
.alert--err { background: rgba(224, 71, 63, .18); border: 1px solid var(--red-2); }

/* ---------- avatars, people */
.av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--wood-3); border: 2px solid var(--brass-dark); flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--cream); font-size: .85rem; overflow: hidden; }
.av--lg { width: 96px; height: 96px; font-size: 2rem; border-width: 3px; }
.av--md { width: 52px; height: 52px; font-size: 1.2rem; }
.av--sm { width: 24px; height: 24px; font-size: .65rem; border-width: 1px; }
.person { display: inline-flex; align-items: center; gap: 8px; color: var(--cream); min-width: 0; }
.person span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.person:hover { text-decoration: none; color: var(--brass-2); }
.online-list { display: flex; flex-wrap: wrap; gap: 8px; }
.online-list .person { background: rgba(255, 255, 255, .05); padding: 4px 10px 4px 4px; border-radius: 999px; font-size: .95rem; }

/* ---------- tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--chalk-line); }
.table td { padding: 8px; border-bottom: 1px dashed var(--chalk-line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.is-me td { background: rgba(201, 161, 74, .12); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.pos { font-family: var(--font-num); font-weight: 800; font-size: 1.2rem; color: var(--brass-2); width: 2.2em; text-align: center; }
.up { color: var(--green-2); } .down { color: var(--red-2); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; background: rgba(255, 255, 255, .08); color: var(--cream-2); }
.tag--live { background: var(--live); color: #fff; }
.tag--open { background: var(--green); color: #fff; }
.tag--brass { background: var(--brass); color: var(--wood-0); }
.tag--red { background: var(--red); color: #fff; }

/* ---------- dashboard */
.hero { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.hero h1 { margin: 0; flex: 1 1 auto; }
.hero .btn--big { flex: 0 0 auto; }
@media (max-width: 760px) { .hero .btn--big { width: 100%; } .hero h1 { font-size: 1.6rem; } }

.nextmatch { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; background: rgba(201, 161, 74, .1); border: 1px solid rgba(201, 161, 74, .35); margin-bottom: 10px; flex-wrap: wrap; }
.nextmatch__who { flex: 1 1 200px; min-width: 0; }
.nextmatch__who b { font-size: 1.15rem; }

.livecard { display: block; padding: 10px 12px; border-radius: 8px; background: rgba(0, 0, 0, .25); border: 1px solid var(--chalk-line); margin-bottom: 10px; color: var(--cream); }
.livecard:hover { text-decoration: none; border-color: var(--brass); }
.livecard__row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 3px 0; }
.livecard__row.is-up .person span { color: var(--brass-2); font-weight: 700; }
.livecard__legs { color: var(--muted); font-size: .9rem; min-width: 2.2em; text-align: right; }
.livecard__total { font-family: var(--font-num); font-weight: 800; font-size: 1.5rem; min-width: 2.6em; text-align: right; }
.livecard__meta { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; color: var(--muted); margin-top: 4px; }
.flash { animation: flash 1.2s; }
@keyframes flash { 0% { background: rgba(232, 200, 115, .35); } 100% { background: transparent; } }

.tlist { list-style: none; margin: 0; padding: 0; }
.tlist li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--chalk-line); flex-wrap: wrap; }
.tlist li:last-child { border-bottom: 0; }
.tlist__main { flex: 1 1 200px; min-width: 0; }
.tlist__main b { font-size: 1.12rem; }

.mini-hs ol { margin: 0; padding: 0; list-style: none; }
.mini-hs li { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.mini-hs li .val { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--brass-2); font-weight: 700; }
.mini-hs .medal { width: 1.6em; text-align: center; }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fact { background: rgba(0, 0, 0, .25); border: 1px solid var(--chalk-line); border-radius: 8px; padding: 10px; }
.fact__val { font-family: var(--font-num); font-weight: 800; font-size: 1.8rem; color: var(--brass-2); line-height: 1.1; }
.fact__lbl { font-size: .85rem; color: var(--muted); }

/* ---------- bracket (like the big tournament wallcharts) */
.bracket { display: flex; gap: 0; overflow-x: auto; padding-bottom: 10px; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.bracket__round { flex: 0 0 230px; display: flex; flex-direction: column; scroll-snap-align: start; }
.bracket__title { text-align: center; font: 700 .8rem var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--wood-0); background: var(--brass); padding: 5px; margin: 0 14px 10px; border-radius: 3px; }
.bracket__deadline { text-align: center; font-size: .8rem; color: var(--muted); margin: -6px 0 8px; }
.bracket__games { flex: 1; display: flex; flex-direction: column; justify-content: space-around; }
.bmatch { position: relative; margin: 8px 14px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(201, 161, 74, .45); border-radius: 4px; color: var(--cream); display: block; }
.bmatch:hover { text-decoration: none; border-color: var(--brass-2); }
.bmatch::after { content: ''; position: absolute; right: -15px; top: 50%; width: 14px; border-top: 2px solid rgba(201, 161, 74, .5); }
.bracket__round:last-child .bmatch::after { display: none; }
.bmatch__p { display: flex; align-items: center; gap: 6px; padding: 5px 7px; font-size: .95rem; }
.bmatch__p + .bmatch__p { border-top: 1px solid var(--chalk-line); }
.bmatch__p .seed { font-size: .7rem; color: var(--muted); width: 1.4em; text-align: right; }
.bmatch__p .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bmatch__p .sc { font-weight: 700; min-width: 1.2em; text-align: right; }
.bmatch__p.is-win .nm { color: var(--brass-2); font-weight: 700; }
.bmatch__p.is-lose { opacity: .55; }
.bmatch__p.is-tbd .nm { color: var(--muted); font-style: italic; }
.bmatch__status { position: absolute; top: -9px; right: 6px; }
.bmatch.is-live { border-color: var(--live); box-shadow: 0 0 10px rgba(255, 90, 78, .35); }
.bmatch.is-overdue { border-color: var(--red-2); }

/* ---------- rules */
.rules h2 { margin-top: 1.2em; }
.rules ol, .rules ul { padding-left: 1.3em; }
.rules li { margin: .3em 0; }
.seqline { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.seqline span { font-family: var(--font-num); font-weight: 800; font-size: 1.3rem; background: rgba(0, 0, 0, .3); border: 1px solid var(--brass-dark); padding: 4px 12px; border-radius: 6px; color: var(--brass-2); }

/* ---------- profile */
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-head h1 { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--brass-dark); margin: 16px 0; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--cream-2); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .9rem; border-radius: 6px 6px 0 0; white-space: nowrap; }
.tabs a.is-active { background: var(--brass); color: var(--wood-0); }
.tabs a:hover { text-decoration: none; }
.avatar-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.avatar-pick button { background: rgba(0, 0, 0, .25); border: 2px solid transparent; border-radius: 10px; padding: 8px 4px; color: var(--cream-2); cursor: pointer; font: 600 .78rem var(--font); }
.avatar-pick button img { width: 56px; height: 56px; display: block; margin: 0 auto 4px; border-radius: 50%; }
.avatar-pick button.is-on { border-color: var(--brass-2); background: rgba(201, 161, 74, .15); }
.form-dots { display: flex; gap: 4px; }
.form-dots i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.form-dots i.w { background: var(--green-2); } .form-dots i.l { background: var(--red-2); }
.spark { width: 100%; height: 120px; }

/* ---------- login */
.login { max-width: 430px; margin: 4vh auto 0; }
.login__logo { display: block; width: 150px; margin: 0 auto 6px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .7)); }
.login h1 { text-align: center; font-size: 2.4rem; margin-bottom: .1em; }
.login .sub { text-align: center; color: var(--cream-2); margin-bottom: 18px; letter-spacing: .15em; text-transform: uppercase; font-size: .85rem; }
.code-input { font-size: 2rem !important; letter-spacing: .4em; text-align: center; }

/* ---------- match setup */
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 50vh; overflow-y: auto; padding: 2px; }
.pick-list label { margin: 0; display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 8px; background: rgba(0, 0, 0, .25); border: 2px solid transparent; cursor: pointer; color: var(--cream); font-weight: 500; }
.pick-list input { position: absolute; opacity: 0; pointer-events: none; }
.pick-list label:has(input:checked) { border-color: var(--brass-2); background: rgba(201, 161, 74, .15); }
.seg { display: inline-flex; border: 1px solid var(--brass-dark); border-radius: 8px; overflow: hidden; }
.seg label { margin: 0; padding: 10px 16px; cursor: pointer; color: var(--cream-2); }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--brass); color: var(--wood-0); }

/* ========== SCORER (phone first) ========== */
.scorer { max-width: 640px; margin: 0 auto; }
.sb { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.sb__p {
  position: relative; padding: 12px 10px 8px; border-radius: 10px; background: var(--chalk);
  border: 3px solid #3a2414; box-shadow: inset 0 0 26px rgba(0, 0, 0, .6); text-align: center; transition: border-color .2s, box-shadow .2s;
}
.sb__p.is-up { border-color: var(--brass-2); box-shadow: inset 0 0 26px rgba(0, 0, 0, .6), 0 0 16px rgba(232, 200, 115, .35); }
.sb__name { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; }
.sb__name span { overflow: hidden; text-overflow: ellipsis; }
.sb__total { font-family: var(--font-num); font-weight: 800; font-size: 3.4rem; line-height: 1; margin: 2px 0; color: var(--cream); text-shadow: 0 0 2px rgba(255, 255, 255, .5), 0 0 12px rgba(244, 234, 211, .15); font-variant-numeric: tabular-nums; }
.sb__legs { font-size: .85rem; color: var(--muted); letter-spacing: .06em; }
.sb__legs b { color: var(--brass-2); font-size: 1.05rem; }
.sb__throw { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: var(--brass-2); color: var(--wood-0) !important; padding: 1px 8px; border-radius: 4px; font-weight: 800; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brass-2); }
.sb__signed { position: absolute; top: 5px; right: 8px; color: var(--green-2); font-size: 1.05rem; }

.targets { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 10px; padding: 2px 0; scrollbar-width: none; }
.targets::-webkit-scrollbar { display: none; }
.targets span { flex: 1 0 auto; min-width: 40px; text-align: center; padding: 6px 4px; border-radius: 6px; background: rgba(0, 0, 0, .3); color: var(--muted); font-family: var(--font-num); font-weight: 800; font-size: 1.1rem; border: 1px solid transparent; }
.targets span.is-done { color: var(--cream-2); }
.targets span.is-now { background: var(--brass); color: var(--wood-0); border-color: var(--brass-2); transform: scale(1.06); }

.pad { background: var(--chalk); border: 3px solid #3a2414; border-radius: 12px; padding: 12px; box-shadow: var(--shadow), inset 0 0 30px rgba(0, 0, 0, .5); }
.pad__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pad__who { flex: 1; min-width: 0; }
.pad__who b { font-size: 1.2rem; color: var(--brass-2); }
.pad__who .tgt { display: block; font-size: .95rem; color: var(--cream-2); }
.pad__tgt { font-family: var(--font-num); font-weight: 800; font-size: 2.6rem; line-height: 1; color: var(--cream); min-width: 2.2em; text-align: center; background: rgba(0, 0, 0, .35); border-radius: 10px; padding: 6px 8px; border: 2px solid var(--brass-dark); }
.mode { display: inline-flex; border: 1px solid var(--brass-dark); border-radius: 8px; overflow: hidden; flex: none; }
.mode button { background: none; border: 0; color: var(--cream-2); font: 700 .8rem var(--font); letter-spacing: .06em; text-transform: uppercase; padding: 8px 10px; cursor: pointer; }
.mode button.is-on { background: var(--brass); color: var(--wood-0); }

.slots { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 6px; margin-bottom: 10px; }
.slot { height: 50px; border-radius: 8px; border: 2px dashed rgba(244, 234, 211, .25); display: flex; align-items: center; justify-content: center; font: 700 1.3rem var(--font); color: var(--muted); }
.slot.is-filled { border-style: solid; border-color: var(--brass-dark); color: var(--cream); background: rgba(0, 0, 0, .3); }
.slot.is-hit { border-color: var(--green-2); color: #bff0cf; }
.slot.is-off { border-color: var(--red-2); color: #ffc9c4; }
.slot.is-next { border-color: var(--brass-2); }
.slot--back { width: 54px; border: 0; background: rgba(255, 255, 255, .08); color: var(--cream); font-size: 1.4rem; cursor: pointer; border-radius: 8px; }

.preview { text-align: center; min-height: 2.2em; font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.preview .half { color: var(--red-2); }
.preview .plus { color: var(--green-2); }
.preview .left { color: var(--brass-2); }

.keys { display: grid; gap: 8px; }
.keys--4 { grid-template-columns: repeat(4, 1fr); }
.keys--3 { grid-template-columns: repeat(3, 1fr); }
.keys--2 { grid-template-columns: repeat(2, 1fr); }
.keys--7 { grid-template-columns: repeat(7, 1fr); gap: 5px; }
.key {
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none;
  min-height: 62px; border-radius: 10px; border: 1px solid rgba(0, 0, 0, .6); cursor: pointer;
  font: 800 1.15rem/1.05 var(--font); letter-spacing: .03em; text-transform: uppercase; color: var(--cream);
  background: linear-gradient(180deg, #3b2b1d, #24180e); box-shadow: 0 3px 0 #0b0603, inset 0 1px 0 rgba(255, 255, 255, .08);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px;
}
.key small { display: block; font-weight: 600; font-size: .78rem; color: var(--cream-2); letter-spacing: .02em; text-transform: none; }
.key:active { transform: translateY(2px); box-shadow: 0 1px 0 #0b0603; }
.key[disabled] { opacity: .35; pointer-events: none; }
.key--s { background: linear-gradient(180deg, #efe1bf, #cdb98e); color: #1b120a; }
.key--s small { color: #4a3a22; }
.key--d { background: linear-gradient(180deg, var(--green-2), var(--green)); }
.key--t { background: linear-gradient(180deg, var(--red-2), var(--red)); }
.key--miss { background: linear-gradient(180deg, #2a2a2a, #151515); }
.key--off { background: linear-gradient(180deg, #5a1612, #3a0c09); color: #ffb3ab; }
.key--ok { background: linear-gradient(180deg, var(--brass-2), var(--brass)); color: var(--wood-0); font-size: 1.3rem; }
.key--wide { grid-column: span 2; }
.key--full { grid-column: 1 / -1; }
.key--num { min-height: 46px; font-size: 1.1rem; }
.key.is-on { outline: 3px solid var(--brass-2); outline-offset: -3px; }
.key--bull { background: radial-gradient(circle, var(--red-2) 0 22%, var(--green) 23% 60%, #24180e 61%); }
.mult { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.sumbox { display: flex; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.sumbox output { flex: 1; font-family: var(--font-num); font-weight: 800; font-size: 2.4rem; text-align: center; background: rgba(0, 0, 0, .4); border-radius: 10px; border: 2px solid var(--brass-dark); padding: 4px; min-height: 60px; }
.quick { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; }
.quick button { flex: none; background: rgba(255, 255, 255, .08); color: var(--cream); border: 1px solid var(--chalk-line); border-radius: 8px; padding: 8px 12px; font: 700 1rem var(--font); cursor: pointer; }

.card-legs { display: flex; gap: 6px; margin: 14px 0 6px; flex-wrap: wrap; }
.scorecard { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.scorecard th, .scorecard td { padding: 6px 4px; text-align: center; border-bottom: 1px dashed var(--chalk-line); }
.scorecard th { font-size: .8rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.scorecard td.t { font-family: var(--font-num); font-weight: 800; color: var(--brass-2); font-size: 1.1rem; width: 3.2em; }
.scorecard td.c { cursor: default; }
.scorecard td.c.is-edit { cursor: pointer; }
.scorecard td.c.is-edit:hover { background: rgba(255, 255, 255, .05); }
.scorecard .pts { font-size: .85rem; color: var(--muted); display: block; }
.scorecard .tot { font-size: 1.15rem; font-weight: 700; }
.scorecard .half { color: var(--red-2); }
.scorecard tr.is-now td.t { background: var(--brass); color: var(--wood-0); border-radius: 4px; }
.scorecard .darts { display: block; font-size: .72rem; color: var(--muted); letter-spacing: .02em; }

.sign { text-align: center; }
.sign__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.sign__box { background: rgba(0, 0, 0, .3); border-radius: 10px; padding: 12px; border: 1px solid var(--chalk-line); }
.sign__box.is-done { border-color: var(--green-2); }
.winner-banner { font-family: var(--font-sign); font-size: 2rem; color: var(--brass-2); margin: 6px 0; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: #000; color: #fff; border: 1px solid var(--brass); border-radius: 10px; padding: 10px 16px; z-index: 100; font-weight: 600; box-shadow: var(--shadow); max-width: 92vw; }
.sync { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 8px; }

dialog { background: var(--chalk); color: var(--cream); border: 3px solid var(--brass-dark); border-radius: 12px; max-width: 420px; width: 92vw; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, .7); }

@media (max-width: 420px) {
  .sb__total { font-size: 2.9rem; }
  .key { min-height: 58px; font-size: 1.05rem; }
  .pad { padding: 10px; }
}

/* footer */
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 0 10px; }
.bronze .bmatch::after { display: none; }
