/* Shared by every game on Score Chalk: the palette, the reset, and the two
   base rules each page needs. Anything specific to one game belongs in that
   game's own stylesheet, not here. */

:root{
  --bg:#12161c;
  --bg2:#182029;
  --card:#1e2732;
  --line:#2b3743;
  --txt:#e8eef5;
  --dim:#8ea0b3;
  --green:#2e9e63;
  --green-d:#247a4d;
  --red:#c0392b;
  --gold:#e0b341;
  --pad: env(safe-area-inset-bottom, 0px);
}

*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}

html,body{height:100%}

body{
  background:var(--bg);
  color:var(--txt);
  font:16px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,system-ui,sans-serif;
  overscroll-behavior:none;
  -webkit-user-select:none;
  user-select:none;
}

button{font:inherit;color:inherit;background:none;border:none;cursor:pointer;touch-action:manipulation}

.hidden{display:none !important}

/* ---------- Account bubble (every page) ---------- */
/* z-index stays below the game overlays (10 and 20 in darts) so a win or
   confirm dialog is never floated over by the avatar. */
.acct{position:fixed;top:8px;right:10px;z-index:5}
.acct[hidden]{display:none}

.acct-bubble{
  display:block;padding:0;border-radius:50%;
  border:1px solid var(--line);background:var(--bg2);
  width:34px;height:34px;overflow:hidden;
}
.acct.is-open .acct-bubble,
.acct-bubble:active{border-color:var(--green)}

.acct-img{width:100%;height:100%;display:block;object-fit:cover}
.acct-img-lg{width:38px;height:38px;border-radius:50%;display:block;object-fit:cover;flex:none}
.acct-initials{
  display:flex;align-items:center;justify-content:center;
  background:var(--green-d);color:#fff;font-weight:700;font-size:13px;letter-spacing:.3px;
}
.acct-img-lg.acct-initials{font-size:15px}

/* signed out: a pill rather than a bubble, since there is no face to show */
.acct-pill{
  display:inline-flex;align-items:center;gap:7px;
  background:var(--bg2);border:1px solid var(--line);border-radius:999px;
  padding:7px 13px;color:var(--txt);text-decoration:none;
  font-size:13px;font-weight:600;
}
.acct-pill:active{border-color:var(--green)}
.acct-g{font-weight:800;font-size:14px;line-height:1}

/* ---------- menu ---------- */
.acct-menu{
  position:absolute;top:calc(100% + 8px);right:0;min-width:210px;
  background:var(--card);border:1px solid var(--line);border-radius:12px;
  padding:6px;display:flex;flex-direction:column;
  box-shadow:0 12px 28px #0008;
}
.acct-menu[hidden]{display:none}

.acct-head{display:flex;align-items:center;gap:10px;padding:8px 8px 10px}
.acct-names{display:flex;flex-direction:column;gap:1px;min-width:0}
.acct-names b{font-size:14px;font-weight:700}
.acct-names small{
  font-size:11.5px;color:var(--dim);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:150px;
}

.acct-sep{height:1px;background:var(--line);margin:0 2px 6px}

.acct-item{
  display:block;width:100%;text-align:left;
  padding:9px 10px;border-radius:8px;
  font-size:13.5px;color:var(--txt);text-decoration:none;background:none;
}
.acct-item:active{background:var(--bg2)}
.acct-danger{color:#e2857a}
.acct-danger:disabled{opacity:.5}

/* ---------- Shared controls ----------
   Buttons and segmented rows used by more than one page. They live here
   rather than in a game's stylesheet because the account pages need them
   too — and a second game will. A game may still override below. */

.preset-row{display:flex;gap:8px}
.preset,.seg{
  flex:1;padding:12px 0;border-radius:10px;
  background:var(--bg2);border:1px solid var(--line);
  font-weight:600;font-size:17px;
}
.seg{font-size:15px}
.preset.is-on,.seg.is-on{background:var(--green-d);border-color:var(--green);color:#fff}

.primary{
  background:var(--green);color:#fff;border-radius:14px;
  font-weight:700;letter-spacing:.2px;
}
.primary:active{background:var(--green-d)}
.big{padding:13px;font-size:17px;width:100%}

.danger{
  background:var(--red);color:#fff;border-radius:14px;
  font-weight:700;letter-spacing:.2px;
}
.danger:active{background:#962d21}

.ghost{
  color:var(--dim);border:1px solid var(--line);
  border-radius:11px;padding:9px;width:100%;font-size:14px;
}
.ghost:active{background:var(--card)}

/* ---------- players: a numbered list ----------
   A box for a name at the top, the list building under it: Enter adds
   the name. The tournament's setup and the Builder's both list their
   players this way. */
.roster{list-style:none;display:flex;flex-direction:column}
.roster:empty{display:none}
.roster li{
  display:flex;align-items:center;gap:10px;padding:6px 0 6px 2px;
  border-bottom:1px solid var(--line);font-size:17px;
}
.roster li span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.roster i{
  font-style:normal;width:1.6em;flex:none;text-align:right;
  color:var(--dim);font-variant-numeric:tabular-nums;font-size:15px;
}
.roster li button{width:34px;height:34px;border-radius:50%;color:var(--dim);font-size:20px;line-height:1;flex:none}
.roster li button:active{background:var(--bg2)}
.roster-add{display:flex}
.roster-add input{flex:1;min-width:0}
/* a name that can be changed where it is listed (the Builder) */
.roster .roster-name{
  flex:1;min-width:0;padding:4px 0;font-size:17px;
  background:none;border:none;border-bottom:1px dashed transparent;border-radius:0;
}
.roster .roster-name:focus{border-bottom-color:var(--green)}
.roster li button:disabled{opacity:.3}
/* the grip a row is dragged by (/roster.js): two short upright bars */
.roster li .roster-grip{width:30px;touch-action:none;cursor:grab;position:relative;border-radius:8px}
.roster-grip::before{
  content:'';position:absolute;left:50%;top:50%;width:7px;height:16px;transform:translate(-50%,-50%);
  border-left:2px solid var(--dim);border-right:2px solid var(--dim);
}
.roster li.dragging{
  position:relative;z-index:2;background:var(--card);cursor:grabbing;
  box-shadow:0 6px 18px rgba(0,0,0,.28);border-radius:8px;
}
.roster.sorting li:not(.dragging){transition:transform .15s}
