@font-face {
  font-family: 'Cinzel';
  font-weight: 800;
  font-display: swap;
  src: url(fonts/cinzel-latin-800-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Varela Round';
  font-weight: 400;
  font-display: swap;
  src: url(fonts/varela-round-latin-400-normal.woff2) format('woff2');
}

:root {
  --bg: #0a2826;
  --panel: #103634;
  --gold: #d8a77d;
  --gold-hi: #f6dcc2;
  --gold-lo: #a8744d;
  --ink: #0b2b29;
  --text: #f4e9dc;
  --muted: #a9bfb9;
  --rose: #e8727a;
  --mint: #7fd6c2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* the floor's darkest colour, at its bottom edge: an iPhone home-screen app leaves a strip under the game
     (iPhone shortens the window by the clock's height) and fills it with this, so the floor seems to run on */
  background: #071d1c;
  color: var(--text);
  font-family: 'Varela Round', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* iPhone: no press-and-hold pop-up or magnifier on the game's text */
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}

#game {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: calc(100vh * 0.62);
  overflow: hidden;
  background: #071d1c; /* (the floor's bottom colour: no lighter line where the picture ends a fraction of a pixel short) */
  box-shadow: 0 0 60px rgba(0, 0, 0, .6);
}

canvas { display: block; position: absolute; inset: 0; touch-action: none; }
/* wide screens: the hall carries on out to the window's edges, behind the game (decoration only) */
#scenery { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#game { z-index: 1; }
/* taps on buttons and links are only taps (never a double-tap zoom on iPhone) */
button, a, label, .skin, .player, .board-list li { touch-action: manipulation; }

.hidden { display: none !important; }

/* HUD */
#hud {
  position: absolute;
  top: calc(var(--top, var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) + 14px);
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
}
/* your speed, top left (the back arrow is hidden mid-run) */
#speedHud {
  position: absolute;
  top: 6px;
  left: 14px;
  padding: 4px 10px;
  border-radius: 14px;
  background: rgba(5, 23, 22, .55);
  border: 1px solid rgba(216, 167, 125, .3);
  font-size: 14px;
  color: var(--text);
}
#speedHud b { color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.ad-live-title { margin: 10px 0 4px; }
.ad-live { max-height: 150px; }
/* (the admin screen scrolls as a whole, so its lists keep their size instead of being squashed) */
#admin { overflow-y: auto; touch-action: pan-y; }
#admin > * { flex-shrink: 0; }
/* shown on your own run while someone from IT is watching it */
#watchedNote { display: inline-block; margin-top: 8px; background: rgba(232, 114, 122, .9); color: #fff; box-shadow: none; animation: none; font-size: 12px; padding: 3px 10px; }
#watchedNote.hidden { display: none; }
#watchBadge { display: inline-block; margin-top: 8px; background: var(--mint); color: var(--ink); box-shadow: none; animation: none; font-size: 12px; padding: 3px 10px; pointer-events: auto; cursor: pointer; }
#score {
  font: 800 44px/1.1 'Cinzel', serif;
  color: var(--gold-hi);
  text-shadow: 0 3px 0 var(--gold-lo), 0 0 22px rgba(216, 167, 125, .45);
  font-variant-numeric: tabular-nums;
}
#votesHud {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 3px 10px 3px 6px;
  border-radius: 20px;
  background: rgba(5, 23, 22, .55);
  border: 1px solid rgba(216, 167, 125, .3);
  font-size: 16px;
}
#votesHud b { color: var(--gold-hi); }
#votesHud .mult {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--mint);
  color: var(--ink);
  font: 800 14px/1.3 'Cinzel', serif;
  font-variant-numeric: tabular-nums;
}
#votesHud .mult.pop { animation: multPop .25s ease-out; }
@keyframes multPop { 40% { transform: scale(1.25); } }
.vote {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
}
#toast {
  margin-top: 18px;
  font: 800 22px/1.2 'Cinzel', serif;
  color: var(--gold-hi);
  text-shadow: 0 2px 0 var(--ink), 0 0 16px rgba(216, 167, 125, .6);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .25s, transform .25s;
}
#toast.show { opacity: 1; transform: scale(1); }

/* Corner buttons */
#buttons {
  position: absolute;
  top: calc(var(--top, var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) + 14px);
  right: 14px;
  display: flex;
  gap: 10px;
  z-index: 5;
}
#homeBtn {
  position: absolute;
  top: calc(var(--top, var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) + 14px);
  left: 14px;
  z-index: 5;
}
.icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(216, 167, 125, .35);
  border-radius: 14px;
  background: rgba(5, 23, 22, .55);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 24px; height: 24px; fill: var(--gold-hi); stroke: var(--gold-hi); }
.icon-btn svg path:not(.wave), .icon-btn svg rect { stroke: none; }
#muteBtn .off { display: none; }
#muteBtn.muted .on { display: none; }
#muteBtn.muted .off { display: block; }

/* Overlay screens */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
  z-index: 4;
}
.screen.show { opacity: 1; visibility: visible; }
#start {
  /* (clear at the bottom: the floor there runs on into the iPhone's strip under the game, see matchStrip) */
  background: linear-gradient(180deg, rgba(5, 23, 22, .7), rgba(5, 23, 22, .35) 55%, rgba(5, 23, 22, 0) 70%);
  justify-content: flex-start;
  padding-top: calc(var(--top, var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) + 9vh);
}
#over, #pause { background: rgba(5, 23, 22, .72); }

@media (max-height: 820px) {
  /* shorter screens (like the app's frame): keep the crest clear of the top buttons */
  #start { padding-top: calc(var(--top, var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) + 66px); gap: 12px; }
}
@media (max-height: 760px) {
  /* short phones: no room for the jump/slide hints under the buttons (the power-ups took it) */
  #start .hints { display: none; }
}
/* too tall for the screen (see fitHints): smaller crest, title and buttons, less space, and it scrolls if still too tall */
#start.tight { gap: 8px; overflow-y: auto; }
#start.tight .crest { width: min(22vw, 9vh, 90px); }
#start.tight .logo { font-size: min(11vw, 5.8vh, 50px); }
#start.tight .tag { font-size: 13px; }
#start.tight #playBtn { padding: 12px 28px; font-size: 21px; }
#start.tight .btn-row { gap: 8px; }
#start.tight .btn-row .btn { margin-top: 0; }
.crest { width: min(30vw, 13vh, 130px); filter: drop-shadow(0 0 18px rgba(216, 167, 125, .45)); }
.logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
  font: 800 min(13vw, 7.5vh, 62px)/1 'Cinzel', serif;
  letter-spacing: .04em;
  filter: drop-shadow(0 4px 0 var(--ink)) drop-shadow(0 0 20px rgba(216, 167, 125, .4));
}
.logo span {
  background: linear-gradient(180deg, var(--gold-hi) 15%, var(--gold) 55%, var(--gold-lo) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo span:last-child { font-size: .78em; letter-spacing: .1em; }
.tag { max-width: 290px; font-size: 15px; line-height: 1.4; color: var(--text); opacity: .9; text-shadow: 0 2px 6px rgba(0, 0, 0, .5); }

.btn {
  margin-top: 4px;
  min-width: 200px;
  padding: 16px 32px;
  border: 0;
  border-radius: 18px;
  font: 800 24px/1 'Cinzel', serif;
  letter-spacing: .12em;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, #c8956a);
  box-shadow: 0 6px 0 var(--gold-lo), 0 12px 24px rgba(0, 0, 0, .4), 0 0 24px rgba(216, 167, 125, .3);
  cursor: pointer;
  animation: pulse 1.6s ease-in-out infinite;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-lo), 0 6px 12px rgba(0, 0, 0, .35); }
@keyframes pulse { 50% { transform: scale(1.05); } }

/* (on a dark band, because the runners pass right behind it) */
.best { padding: 3px 14px; border-radius: 999px; background: rgba(5, 23, 22, .78); font-size: 14px; letter-spacing: .2em; color: var(--muted); }
.best b { font: 800 20px 'Cinzel', serif; color: var(--gold-hi); margin-left: 6px; }

.hints {
  margin-top: auto; /* (at the bottom, in line with the rest, so it can never land on the buttons) */
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
  opacity: .85;
}
.hints i { font-style: normal; display: inline-block; width: 1.4em; color: var(--gold); }

/* Big titles: rose-gold like the logo (no red outline) */
.title {
  font: 800 40px/1.1 'Cinzel', serif;
  letter-spacing: .03em;
  background: linear-gradient(180deg, var(--gold-hi) 15%, var(--gold) 60%, var(--gold-lo) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 var(--ink)) drop-shadow(0 0 18px rgba(216, 167, 125, .35));
}
.sub { max-width: 280px; font-size: 15px; line-height: 1.4; color: var(--muted); }
.badge {
  display: none;
  padding: 6px 16px;
  border-radius: 20px;
  font: 800 15px 'Cinzel', serif;
  letter-spacing: .12em;
  color: var(--ink);
  background: var(--mint);
  box-shadow: 0 0 20px rgba(127, 214, 194, .6);
  animation: pulse 1s ease-in-out infinite;
}
.badge.show { display: block; }
.card {
  width: min(280px, 100%);
  padding: 18px 22px;
  border-radius: 20px;
  background: rgba(16, 54, 52, .9);
  border: 1px solid rgba(216, 167, 125, .4);
}
.btn.ghost {
  min-width: 0;
  padding: 12px 22px;
  font-size: 15px;
  color: var(--gold-hi);
  background: rgba(5, 23, 22, .55);
  border: 1px solid rgba(216, 167, 125, .55);
  box-shadow: none;
  animation: none;
}
.btn.ghost:active { box-shadow: none; }
.link-btn { border: 0; background: none; color: var(--rose); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
#boardReset, #adReset { margin-top: 26px; font-size: 12px; opacity: .75; } /* kept well away from BACK */
.rank { font-size: 15px; color: var(--gold-hi); }
.rank a { color: var(--gold-hi); }
.title.small { font-size: 30px; }
#board { justify-content: flex-start; padding-top: calc(var(--top, var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) + 64px); background: rgba(5, 23, 22, .92); gap: 12px; }
.board-list {
  list-style: none;
  width: min(330px, 100%);
  max-height: 52vh;
  overflow-y: auto;
  touch-action: pan-y;
  border-radius: 16px;
  background: rgba(16, 54, 52, .9);
  border: 1px solid rgba(216, 167, 125, .35);
  text-align: left;
}
.board-list li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid rgba(36, 80, 75, .8); }
.board-list li:last-child { border-bottom: 0; }
.board-list li.mine { background: rgba(127, 214, 194, .14); }
.board-list .r { width: 28px; font: 800 15px 'Cinzel', serif; color: var(--muted); }
.board-list li:nth-child(-n+3) .r { color: var(--gold-hi); }
.board-list .who { flex: 1; min-width: 0; }
.board-list .pic { position: static; flex: none; width: 32px; height: 37px; margin: -4px 0; }
.board-list .who b { display: block; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .who small { color: var(--muted); font-size: 12px; }
.board-list .s { font: 800 17px 'Cinzel', serif; color: var(--gold-hi); }
.board-list .x { border: 0; background: none; color: var(--rose); font-size: 18px; padding: 0 2px; cursor: pointer; }
.board-list .empty { justify-content: center; color: var(--muted); padding: 18px; }

/* Coins, shop and admin */
.hud-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
#coinsHud {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 3px 10px 3px 6px;
  border-radius: 20px; background: rgba(5, 23, 22, .55); border: 1px solid rgba(127, 214, 194, .4); font-size: 16px;
}
#coinsHud b { color: var(--mint); }
.coin {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px;
  background: radial-gradient(circle at 35% 35%, #d9fff6, var(--mint) 55%, #3f9886);
}
.power-hud { margin-top: 6px; font: 800 14px 'Cinzel', serif; letter-spacing: .04em; text-shadow: 0 2px 4px rgba(0, 0, 0, .6); min-height: 18px; }
.badge.test { display: inline-block; margin-top: 8px; background: var(--rose); color: #fff; box-shadow: none; animation: none; font-size: 12px; padding: 3px 10px; }
.best .sep { display: inline-block; width: 18px; }
.best .coin + b { color: var(--mint); margin-left: 5px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
/* Power-ups to buy before a run */
.boost-label { margin: 2px 0 -4px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.boosts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.boost {
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 74px; padding: 6px 10px; cursor: pointer;
  border: 1px solid rgba(216, 167, 125, .5); border-radius: 12px; background: rgba(5, 23, 22, .55); color: var(--gold-hi);
}
.boost b { font: 800 12px 'Cinzel', serif; letter-spacing: .04em; }
.boost .price { display: flex; align-items: center; gap: 4px; font: 800 13px 'Cinzel', serif; color: var(--gold-hi); }
.boost .price .coin { width: 11px; height: 11px; vertical-align: 0; }
.boost.on { background: var(--mint); border-color: var(--mint); color: var(--ink); }
.boost.on .price { color: var(--ink); font-size: 11px; letter-spacing: .08em; }
.boost:disabled { opacity: .45; cursor: default; }
.boost.on:disabled { opacity: 1; }
.boost-msg { min-height: 0; margin: 0; color: var(--gold-hi); font-size: 13px; }
.boost-msg:empty { display: none; }
.sub.closed { color: var(--rose); font-weight: 700; }
.sub.event { color: var(--ink); background: var(--mint); font-weight: 800; padding: 5px 14px; border-radius: 999px; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); } /* a solid pill: readable over the hall */
.sub.tip { max-width: 300px; font-size: 13px; color: var(--gold-hi); }
.sub.guest { max-width: 300px; font-size: 13px; }
.sub.guest a { color: var(--gold-hi); font-weight: 700; }
.admin-link { color: var(--muted); }
.btn:disabled { opacity: .45; animation: none; }

#shop, #admin, #gift { justify-content: flex-start; padding-top: calc(var(--top, var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) + 64px); background: rgba(5, 23, 22, .94); gap: 10px; }
.shop-list, .admin-list {
  width: min(340px, 100%); max-height: 56vh; overflow-y: auto; touch-action: pan-y;
  display: flex; flex-direction: column; gap: 8px; text-align: left;
}
.skin {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px;
  background: rgba(16, 54, 52, .92); border: 1px solid rgba(216, 167, 125, .3);
}
.skin.on { border-color: var(--mint); box-shadow: 0 0 0 1px var(--mint) inset; }
.skin.tap { cursor: pointer; }
.skin.tap:active { transform: scale(.98); background: rgba(24, 80, 73, .95); }
.skin canvas { position: static; width: 56px; height: 64px; flex: none; border-radius: 10px; background: rgba(5, 23, 22, .6); }
.skin .info { flex: 1; min-width: 0; }
.skin .info b { display: block; font: 800 15px 'Cinzel', serif; color: var(--gold-hi); }
.skin .info small { color: var(--muted); font-size: 12px; line-height: 1.3; display: block; }
.skin .variants { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.skin .variant {
  border: 1px solid rgba(216, 167, 125, .45); border-radius: 999px; padding: 3px 8px; cursor: pointer;
  font: 700 11px system-ui, sans-serif; color: var(--gold-hi); background: transparent;
}
.skin .variant.on { background: var(--mint); border-color: var(--mint); color: var(--ink); }
/* skin upgrades: a panel across the bottom of an owned skin's card, one line each for Coins, Start and Shields:
   name, 5 pips, what it gives now, and the button for the next level */
.skin { flex-wrap: wrap; }
.skin .upgrades {
  flex: 1 0 100%; display: flex; flex-direction: column; gap: 5px; margin-top: 2px; padding: 7px 8px;
  border-radius: 10px; background: rgba(5, 23, 22, .55); cursor: default;
}
.skin .upgrade { display: grid; grid-template-columns: 58px auto 1fr auto; align-items: center; gap: 8px; min-height: 26px; }
.skin .upgrade b { font: 800 11px 'Cinzel', serif; letter-spacing: .04em; color: var(--gold-hi); }
.skin .upgrade .pips { display: inline-flex; gap: 3px; }
.skin .upgrade .pips i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--gold-lo); }
.skin .upgrade .pips i.on { background: var(--gold-hi); border-color: var(--gold-hi); box-shadow: 0 0 5px rgba(246, 220, 194, .7); }
.skin .upgrade .up-note { font: 700 11px system-ui, sans-serif; color: var(--mint); white-space: nowrap; }
.skin .upgrade .mini-btn.up {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 76px; padding: 4px 8px;
  font: 700 11px system-ui, sans-serif; letter-spacing: 0; white-space: nowrap;
  background: transparent; color: var(--gold-hi); border: 1px solid rgba(216, 167, 125, .55);
}
.skin .upgrade .mini-btn.up:not(:disabled):active { background: var(--gold); color: var(--ink); }
.skin .upgrade .mini-btn.up:disabled { opacity: .45; }
/* the Custom skin's picker: a line for each part, with a chip (or a colour dot) for each choice */
.skin .customize { gap: 8px; }
/* (a solid band across the top of the picker: the choices scroll under it, so it never hides one) */
.skin .customize .big-preview {
  position: sticky; top: -1px; z-index: 1; display: flex; justify-content: center; margin: -7px -8px 0; padding: 6px 0;
  border-radius: 10px 10px 0 0; border-bottom: 1px solid rgba(216, 167, 125, .35);
  background: radial-gradient(circle at 50% 55%, #17423e, #0a2826 70%);
}
.skin .customize .big-preview canvas { width: 130px; height: 134px; }
.skin .customize .try-note { color: var(--mint); font: 700 11px system-ui, sans-serif; text-align: center; }
.skin .cpart > b { font: 800 11px 'Cinzel', serif; letter-spacing: .04em; color: var(--gold-hi); }
.skin .cpart > span { font: 700 11px system-ui, sans-serif; color: var(--mint); }
.skin .cpart .variants { margin-top: 4px; }
.skin .variant.swatch { width: 22px; height: 22px; padding: 0; border: 2px solid rgba(255, 255, 255, .25); }
.skin .variant.swatch.on { border-color: var(--mint); box-shadow: 0 0 0 2px var(--mint); }
.skin .upgrade .mini-btn.up .coin { width: 10px; height: 10px; }
.mini-btn {
  flex: none; border: 0; border-radius: 10px; padding: 8px 10px; cursor: pointer;
  font: 800 12px 'Cinzel', serif; letter-spacing: .06em; color: var(--ink); background: var(--gold);
}
.mini-btn.alt { background: transparent; color: var(--gold-hi); border: 1px solid rgba(216, 167, 125, .5); }
.mini-btn.danger { background: transparent; color: var(--rose); border: 1px solid rgba(232, 114, 122, .6); }
.mini-btn:disabled { opacity: .5; cursor: default; }

.admin-box {
  width: min(340px, 100%); display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px;
  background: rgba(16, 54, 52, .92); border: 1px solid rgba(216, 167, 125, .3); text-align: left; font-size: 14px;
}
.sw { display: flex; align-items: center; gap: 8px; }
.sw input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--mint); }
.sw input[type=range] { flex: 1; accent-color: var(--gold); }
.ad-search, .admin-box input { user-select: text; -webkit-user-select: text; touch-action: auto; }
.ad-search {
  width: min(340px, 100%); padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(216, 167, 125, .4);
  background: rgba(5, 23, 22, .7); color: var(--text); font: inherit; font-size: 14px;
}
.player { padding: 9px 12px; border-radius: 12px; background: rgba(16, 54, 52, .92); border: 1px solid rgba(36, 80, 75, .9); }
.player.banned { border-color: rgba(232, 114, 122, .7); }
.player .top { display: flex; justify-content: space-between; gap: 8px; }
.player .top b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .top span { color: var(--gold-hi); font: 800 14px 'Cinzel', serif; flex: none; }
.player small { display: block; color: var(--muted); font-size: 12px; margin: 2px 0 6px; }
.player .acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* Thin gold scrollbars on every list in the game (instead of the browser's grey ones), like the WESMUN website */
* { scrollbar-width: thin; scrollbar-color: rgba(216, 167, 125, .55) transparent; }
.board-list, .shop-list, .admin-list, .skin-toggles { padding-right: 2px; }
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(216, 167, 125, .55); border-radius: 4px; }
*::-webkit-scrollbar-button { display: none; height: 0; }

/* The game's own question box (instead of the browser's pop-up) */
.dialog {
  position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px;
  background: rgba(5, 23, 22, .75);
}
.dialog.hidden { display: none; }
.dlg-box {
  width: min(320px, 100%); padding: 18px; border-radius: 18px; text-align: left;
  background: var(--panel); border: 1px solid rgba(216, 167, 125, .5); box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
  animation: dlgIn .18s ease-out;
}
@keyframes dlgIn { from { transform: scale(.94); opacity: 0; } }
.dlg-title { font: 800 18px/1.2 'Cinzel', serif; color: var(--gold-hi); }
.dlg-text { margin-top: 6px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.dlg-text:empty { display: none; }
.dlg-input {
  width: 100%; margin-top: 12px; padding: 11px 12px; border-radius: 12px; border: 1px solid rgba(216, 167, 125, .5);
  background: rgba(5, 23, 22, .7); color: var(--text); font: 800 20px 'Cinzel', serif; text-align: center;
  user-select: text; -webkit-user-select: text; touch-action: auto; -moz-appearance: textfield;
}
.dlg-input::-webkit-inner-spin-button, .dlg-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.dlg-input:focus { outline: none; border-color: var(--mint); }
.dlg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dlg-chips:empty { display: none; }
.dlg-chips button { flex: 1; padding: 7px 6px; }
.dlg-btns { display: flex; gap: 8px; margin-top: 14px; }
.dlg-btns .mini-btn { flex: 1; padding: 11px; font-size: 14px; }

/* Leaderboard tabs, missions, team rows, admin skin list */
.tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(5, 23, 22, .7); border: 1px solid rgba(216, 167, 125, .3); }
.tab { border: 0; border-radius: 9px; padding: 7px 16px; cursor: pointer; background: transparent; color: var(--muted); font: 800 13px 'Cinzel', serif; letter-spacing: .08em; }
.tab.on { background: var(--gold); color: var(--ink); }
.mission .done, .mission-done { color: var(--mint); }
.rank.mission { color: var(--mint); }
.mission-row .info b { font-family: inherit; font-weight: 400; font-size: 14px; color: var(--text); }
.mission-row .reward { flex: none; font: 800 14px 'Cinzel', serif; color: var(--mint); }
.mission-row.done { opacity: .75; border-color: var(--mint); }
.mission-row .tick { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(127, 214, 194, .5); color: var(--mint); font-weight: 800; }
.board-list .kind { color: var(--muted); font-size: 11px; }
.skin-toggles { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 46vh; overflow-y: auto; }
.skin-toggle { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; background: rgba(5, 23, 22, .6); }
.skin-toggle b { flex: 1; font: 800 13px 'Cinzel', serif; color: var(--gold-hi); }
.skin-toggle .info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.skin-toggle .pic { position: static; width: 40px; height: 46px; flex: none; }
.skin-toggle.locked .pic { opacity: .35; }
.skin-toggle small { color: var(--muted); font-size: 11px; }

.row { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; color: var(--muted); }
.row b { font: 800 22px 'Cinzel', serif; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.row.big b { font-size: 34px; color: var(--text); }
