/* Mausathlon – 1984-Olympia-Retro UI (DESIGN §14). No external fonts/CDNs. */

/* Optional display font assets/fonts/display.woff2 is loaded from JS when present (client/assets.js). */

:root {
  --night: #1b2340;
  --deep: #24408e;
  --teal: #1fa6a0;
  --magenta: #e4407b;
  --orange: #f28c28;
  --gold: #f2c14e;
  --cream: #fff4dc;
  --ink: #14161f;
  --panel: rgba(27, 35, 64, 0.82);
  --line: rgba(255, 244, 220, 0.2);
  --medal-gold: #e8b931;
  --medal-silver: #c9ced6;
  --medal-bronze: #c77b3a;
  --display: 'Mausathlon Display', 'Arial Black', 'Helvetica Neue', Impact, sans-serif;
  --ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Consolas, monospace;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--night);
  color: var(--cream);
  font-family: var(--ui);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#app {
  position: fixed;
  inset: 0;
}

.hidden {
  display: none !important;
}

/* ───────────────────────── screens ───────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow: auto;
  background:
    repeating-linear-gradient(115deg, transparent 0 46px, rgba(255, 244, 220, 0.025) 46px 48px),
    radial-gradient(ellipse at 70% 0%, rgba(31, 166, 160, 0.25), transparent 60%),
    linear-gradient(180deg, #1b2340 0%, #161c35 100%);
}
.screen.active {
  display: block;
  animation: wipe-in 0.45s ease-out;
}
@keyframes wipe-in {
  from {
    clip-path: polygon(0 0, 0 0, -20% 100%, -20% 100%);
  }
  to {
    clip-path: polygon(0 0, 140% 0, 120% 100%, -20% 100%);
  }
}

/* ───────────────────────── buttons ───────────────────────── */
.btn {
  font: italic 900 15px/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--deep);
  border: 0;
  border-radius: 8px;
  padding: 11px 18px;
  cursor: pointer;
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition:
    transform 0.08s,
    filter 0.15s,
    box-shadow 0.08s;
}
.btn:hover {
  filter: brightness(1.12);
}
.btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.btn-primary {
  background: linear-gradient(100deg, var(--magenta), var(--orange));
}
.btn-secondary {
  background: linear-gradient(100deg, var(--teal), #178a85);
}
.btn-ghost {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn-big {
  font-size: 20px;
  padding: 16px 22px;
  width: 100%;
}
.btn-small {
  font-size: 12px;
  padding: 8px 12px;
}
.btn-ready {
  width: 100%;
  font-size: 18px;
  padding: 14px;
  margin-top: 12px;
  background: #3a4570;
}
.btn-ready.on {
  background: linear-gradient(100deg, #5dbb4c, #2f8f5b);
}

/* ───────────────────────── cards ───────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
}
.section-title {
  font: italic 900 20px/1.1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 14px;
  position: relative;
  padding-left: 46px;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  width: 36px;
  height: 18px;
  background: linear-gradient(180deg, var(--magenta) 0 33%, var(--orange) 33% 66%, var(--gold) 66%);
  transform: skewX(-20deg);
}
h4 {
  margin: 14px 0 8px;
  font: 800 12px/1 var(--ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
}
.hint {
  font-size: 13px;
  opacity: 0.7;
  line-height: 1.45;
}
input {
  font: 700 18px var(--ui);
  color: var(--ink);
  background: var(--cream);
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  outline: none;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.12);
}
input:focus {
  box-shadow:
    0 0 0 3px var(--gold),
    inset 0 2px 0 rgba(0, 0, 0, 0.12);
}

/* ───────────────────────── start ───────────────────────── */
#scr-start .keyart {
  position: absolute;
  inset: 0;
  /* two layers: shade on top of the key art (one layer cannot hold a gradient AND an image) */
  background:
    linear-gradient(180deg, rgba(27, 35, 64, 0.15), rgba(27, 35, 64, 0.55) 45%, rgba(22, 28, 53, 0.92) 80%),
    var(--keyart, none) center top / cover no-repeat;
}
.start-wrap {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  gap: 28px;
}
.logo {
  text-align: center;
}
.logo h1 {
  position: relative;
  isolation: isolate;
  margin: 10px 0 6px;
  font: italic 900 clamp(48px, 9vw, 120px) / 1 var(--display);
  letter-spacing: 0.02em;
  color: var(--cream);
  text-shadow:
    4px 4px 0 var(--ink),
    0 10px 30px rgba(0, 0, 0, 0.4);
  -webkit-text-stroke: 2px var(--ink);
}
.logo h1 .stripes {
  position: absolute;
  left: -4%;
  right: -4%;
  top: 22%;
  height: 56%;
  z-index: -1;
  background: linear-gradient(180deg, var(--magenta) 0 33%, var(--orange) 33% 66%, var(--gold) 66%);
  transform: skewX(-22deg);
  animation: stripes-in 0.9s cubic-bezier(0.2, 0.9, 0.2, 1);
}
@keyframes stripes-in {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
.claim {
  margin: 0;
  font-size: 17px;
  opacity: 0.85;
}
.rings {
  display: inline-flex;
  gap: 4px;
}
.rings i {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 6px solid;
  position: relative;
}
.rings i::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  left: 3px;
  top: 3px;
  opacity: 0.6;
}
.rings i:nth-child(1) {
  color: var(--magenta);
}
.rings i:nth-child(2) {
  color: var(--orange);
  transform: translateY(10px);
}
.rings i:nth-child(3) {
  color: var(--gold);
}
.rings i:nth-child(4) {
  color: var(--teal);
  transform: translateY(10px);
}
.rings i:nth-child(5) {
  color: #3a7bd5;
}
.start-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 244, 220, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cream);
  cursor: pointer;
  font: 800 17px var(--ui);
}
.profile-chip img {
  width: 36px;
  height: 24px;
  border-radius: 3px;
}
.profile-chip .chip-edit {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.55;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.join-row {
  display: flex;
  gap: 10px;
}
.join-row input {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font: 900 24px var(--mono);
  text-align: center;
}
.start-foot {
  font-size: 13px;
  opacity: 0.6;
}

/* ───────────────────────── profile ───────────────────────── */
#scr-profile.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.profile-card {
  width: min(860px, 100%);
}
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.field > span {
  font: 800 12px var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.75;
}
.nation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.nation-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: rgba(255, 244, 220, 0.06);
  border: 2px solid transparent;
  border-radius: 8px;
  color: var(--cream);
  font: 700 11px var(--ui);
  cursor: pointer;
}
.nation-grid button img {
  width: 42px;
  height: 28px;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.nation-grid button.sel {
  border-color: var(--gold);
  background: rgba(242, 193, 78, 0.15);
}
.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.color-row button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.3);
  cursor: pointer;
  position: relative;
}
.color-row button.sel {
  border-color: var(--cream);
  box-shadow: 0 0 0 3px var(--gold);
}
.color-row button.taken {
  opacity: 0.25;
  cursor: not-allowed;
}
.profile-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(circle at 50% 70%, rgba(31, 166, 160, 0.35), transparent 70%);
  border-radius: var(--radius);
}
.preview-name {
  font: italic 900 22px var(--display);
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* ───────────────────────── lobby ───────────────────────── */
#scr-lobby {
  background:
    linear-gradient(180deg, rgba(27, 35, 64, 0.75), rgba(22, 28, 53, 0.95)),
    var(--lobby-bg, none) center / cover no-repeat,
    linear-gradient(180deg, #1b2340, #161c35);
}
.lobby-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 64px 16px 22px;
  gap: 16px;
}
.room-code {
  display: flex;
  align-items: center;
  gap: 14px;
}
.room-code .label {
  font: 800 12px var(--ui);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.7;
}
.room-code strong {
  font: 900 44px/1 var(--mono);
  letter-spacing: 0.25em;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(242, 193, 78, 0.6);
}
.lobby-head-right {
  display: flex;
  gap: 8px;
}
.lobby-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) minmax(300px, 1fr) minmax(280px, 1fr);
  gap: 16px;
  padding: 0 22px 96px;
  align-items: start;
}
@media (max-width: 1100px) {
  .lobby-grid {
    grid-template-columns: 1fr 1fr;
  }
  .col-host {
    grid-column: 1 / -1;
  }
}
@media (max-width: 720px) {
  .lobby-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }
}
.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.player-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 244, 220, 0.06);
  border-left: 5px solid var(--c, transparent);
}
.player-list li.me {
  background: rgba(255, 244, 220, 0.14);
}
.player-list li.empty {
  opacity: 0.35;
  font-style: italic;
  border-left-color: transparent;
}
.player-list li.off {
  opacity: 0.5;
}
.player-list .slot {
  font: 900 14px var(--mono);
  opacity: 0.5;
  width: 16px;
}
.player-list img {
  width: 30px;
  height: 20px;
  border-radius: 2px;
}
.player-list .name {
  font-weight: 800;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag {
  font: 800 10px var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 244, 220, 0.12);
  white-space: nowrap;
}
.tag.ok {
  background: rgba(93, 187, 76, 0.3);
}
.tag.host {
  background: var(--gold);
  color: var(--ink);
}
.tag.bot {
  background: var(--deep);
}
.ping {
  font: 700 11px var(--mono);
  opacity: 0.6;
  width: 46px;
  text-align: right;
}
.x-btn {
  background: none;
  border: 0;
  color: var(--cream);
  opacity: 0.5;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}
.x-btn:hover {
  opacity: 1;
  color: var(--magenta);
}
.spectators ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  opacity: 0.8;
}
.last-standings {
  margin-top: 14px;
  font-size: 13px;
  opacity: 0.85;
}
.calib-box canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 440 / 200;
  border-radius: 8px;
  background: #11162b;
  cursor: pointer;
  display: block;
}
.calib-text {
  min-height: 44px;
  font-size: 14px;
  line-height: 1.45;
}
.calib-actions {
  display: flex;
  gap: 8px;
}
.playlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.pl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 244, 220, 0.07);
  font-weight: 800;
}
.pl-item .num {
  font: 900 14px var(--mono);
  color: var(--gold);
  width: 18px;
}
.pl-item .name {
  flex: 1;
}
.pl-item button {
  background: rgba(255, 244, 220, 0.1);
  border: 0;
  color: var(--cream);
  border-radius: 5px;
  width: 26px;
  height: 26px;
  cursor: pointer;
}
.season {
  font: 800 10px var(--ui);
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.season.summer {
  background: var(--orange);
  color: var(--ink);
}
.season.winter {
  background: #bfe3f2;
  color: var(--ink);
}
.season.debug {
  background: #555c7a;
}
.presets,
.available,
.bot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
/* Bottom action bar of the lobby: emotes + (host) "Spiel starten". Fixed, never overlaps the
   content – the lobby grid reserves its height as bottom padding. */
.lobby-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 22px;
  background: linear-gradient(0deg, rgba(20, 22, 31, 0.96) 60%, rgba(20, 22, 31, 0.6));
  border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.emote-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}
#btn-start {
  width: auto;
  min-width: 240px;
  flex: none;
  padding: 14px 28px;
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.35),
    0 6px 24px rgba(228, 64, 123, 0.35);
}
.emote-bar button {
  font: 800 13px var(--ui);
  color: var(--cream);
  background: rgba(255, 244, 220, 0.1);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 12px;
  cursor: pointer;
}
.emote-bar button kbd {
  font: 700 10px var(--mono);
  opacity: 0.6;
  margin-right: 4px;
}

/* ───────────────────────── game ───────────────────────── */
#scr-game {
  background: #0b0e1a;
  overflow: hidden;
}
.game-wrap {
  position: absolute;
  inset: 0;
}
.game-wrap canvas {
  display: block;
}
.game-top {
  /* Host controls: small, translucent, in the bottom-right corner strip below the discipline HUDs
     (HUD panels end at y ≈ 700 of 720 logical px) */
  position: absolute;
  bottom: 2px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 20;
}
.game-top > * {
  pointer-events: auto;
}
.game-top .spacer {
  display: none;
}
.game-top .btn {
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(11, 14, 26, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  opacity: 0.5;
  transition: opacity 0.15s;
}
.game-top .btn:hover,
.game-top .btn:focus-visible {
  opacity: 1;
}
.game-top #btn-next {
  opacity: 0.95;
  background: linear-gradient(100deg, var(--magenta), var(--orange));
}
.game-title {
  display: none;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 14, 26, 0.55);
  animation: fade-in 0.35s ease-out;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
.intro-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.intro-art {
  min-height: 340px;
  background:
    repeating-linear-gradient(115deg, var(--magenta) 0 30px, var(--orange) 30px 60px, var(--gold) 60px 90px, transparent 90px 180px),
    linear-gradient(160deg, var(--deep), var(--night));
  background-size: cover;
  background-position: center;
}
.intro-body {
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.intro-body h2 {
  margin: 0;
  font: italic 900 44px/1 var(--display);
  text-transform: uppercase;
}
.intro-body p {
  margin: 0;
  line-height: 1.5;
  font-size: 17px;
}
.badge {
  align-self: flex-start;
  font: 900 12px var(--ui);
  letter-spacing: 0.15em;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--orange);
  color: var(--ink);
}
.badge.winter {
  background: #bfe3f2;
}
.badge.debug {
  background: #8a90aa;
}
.controls {
  margin: 4px 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.controls li {
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255, 244, 220, 0.08);
  font-weight: 700;
}
.controls li::before {
  content: '🖱 ';
}
.progress {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 244, 220, 0.15);
  overflow: hidden;
  margin-top: auto;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--magenta), var(--gold));
}
.lock-hint {
  font-weight: 900;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 14px !important;
}
.lock-hint.ok {
  color: #7fe07a;
}
.board {
  width: min(820px, 100%);
  background: #0a0b10;
  border: 6px solid #2a2f45;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    inset 0 0 40px rgba(0, 0, 0, 0.8);
}
.board.wide {
  width: min(1100px, 100%);
}
.board-title {
  margin: 0 0 14px;
  font: italic 900 30px var(--display);
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(242, 193, 78, 0.6);
  text-align: center;
}
.board-table {
  width: 100%;
  border-collapse: collapse;
  font: 700 18px var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(242, 193, 78, 0.55);
}
.board-table th {
  font: 800 11px var(--ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 244, 220, 0.55);
  text-shadow: none;
  padding: 4px 8px;
  text-align: left;
}
.board-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(242, 193, 78, 0.08);
  white-space: nowrap;
}
.board-table tr {
  animation: row-in 0.35s both;
}
@keyframes row-in {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
}
.board-table tr.me td {
  background: rgba(242, 193, 78, 0.12);
}
.board-table td.name {
  font-family: var(--ui);
  font-weight: 800;
  color: var(--cream);
  text-shadow: none;
}
.board-table td.num,
.board-table th.num {
  text-align: right;
}
.board-table img {
  width: 30px;
  height: 20px;
  vertical-align: middle;
  border-radius: 2px;
}
.medal {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  vertical-align: middle;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.25);
}
.medal.m1 {
  background: var(--medal-gold);
}
.medal.m2 {
  background: var(--medal-silver);
}
.medal.m3 {
  background: var(--medal-bronze);
}
.flag-warn {
  color: var(--magenta);
  cursor: help;
}
.extra {
  font: 700 11px var(--ui);
  color: var(--magenta);
  text-shadow: none;
  margin-left: 6px;
}

/* Records on the result board (DESIGN §4.5) */
.record-banner {
  margin: -4px auto 12px;
  width: fit-content;
  padding: 8px 22px;
  border-radius: 999px;
  font: italic 900 22px var(--display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(100deg, var(--gold), #ffe38a 45%, var(--gold));
  box-shadow: 0 0 24px rgba(242, 193, 78, 0.55);
  animation:
    record-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both,
    record-glow 1.2s ease-in-out 0.5s infinite alternate;
}
@keyframes record-pop {
  from {
    transform: scale(0.4) rotate(-4deg);
    opacity: 0;
  }
}
@keyframes record-glow {
  to {
    box-shadow: 0 0 40px rgba(242, 193, 78, 0.9);
  }
}
.rec-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  font: italic 900 11px var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--gold);
  text-shadow: none;
  vertical-align: middle;
}
.rec-tag.server {
  background: linear-gradient(100deg, var(--magenta), var(--orange));
  color: #fff;
}
.board-records {
  margin: 12px 0 0;
  font: 600 13px var(--ui);
  color: rgba(255, 244, 220, 0.7);
  text-align: center;
}
.board-records b {
  color: var(--gold);
  font-weight: 800;
}
.board-records:empty {
  display: none;
}

/* ───────────────────────── misc ───────────────────────── */
.toasts {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 50;
  pointer-events: none;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.25s ease-out;
}
.toast.err {
  border-left-color: var(--magenta);
}
.toast.emote {
  border-left-color: var(--gold);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}
.conn-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 14, 26, 0.7);
  font: italic 900 26px var(--display);
}
.btn-mute {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 55;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--cream);
  font-size: 18px;
  cursor: pointer;
}
body:has(#scr-game.active) .btn-mute {
  /* in-game: tuck the music toggle into the bottom-right corner next to the host controls */
  top: auto;
  bottom: 2px;
  right: 6px;
  width: 18px;
  height: 18px;
  font-size: 10px;
  line-height: 1;
  padding: 0;
  opacity: 0.5;
  background: rgba(11, 14, 26, 0.45);
}
body:has(#scr-game.active) .btn-mute:hover {
  opacity: 1;
}
.btn-mute.off {
  text-decoration: line-through;
  opacity: 0.6;
}

/* ───────────────────────── visual polish (result board, lobby) ───────────────────────── */
/* Result board: stadium scoreboard look – LED dot matrix, 80s stripe trim, glass sheen,
   rows flip in one after another, medal rows tinted. */
.board {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle, rgba(242, 193, 78, 0.07) 0.9px, transparent 1.3px) 0 0 / 5px 5px,
    radial-gradient(ellipse at 50% -10%, rgba(242, 193, 78, 0.12), transparent 55%),
    linear-gradient(180deg, #0d0f18, #07080d);
  border-color: #2e3450;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 0 2px rgba(0, 0, 0, 0.6),
    inset 0 0 40px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 244, 220, 0.12);
}
.board::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--magenta) 0 33%, var(--orange) 33% 66%, var(--gold) 66%);
  opacity: 0.9;
}
.board::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.045) 45%, transparent 60%);
  background-size: 300% 100%;
  animation: board-sheen 6s ease-in-out 0.6s infinite;
}
@keyframes board-sheen {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}
.board-title {
  letter-spacing: 0.02em;
  text-shadow:
    0 0 10px rgba(242, 193, 78, 0.6),
    3px 3px 0 rgba(228, 64, 123, 0.55);
}
.board-table tr {
  animation: row-in 0.4s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}
.board-table tr:nth-child(1) { animation-delay: 0.05s; }
.board-table tr:nth-child(2) { animation-delay: 0.12s; }
.board-table tr:nth-child(3) { animation-delay: 0.19s; }
.board-table tr:nth-child(4) { animation-delay: 0.26s; }
.board-table tr:nth-child(5) { animation-delay: 0.33s; }
.board-table tr:nth-child(6) { animation-delay: 0.4s; }
.board-table tr:nth-child(7) { animation-delay: 0.47s; }
.board-table tr:nth-child(8) { animation-delay: 0.54s; }
.board-table tr:nth-child(n + 9) { animation-delay: 0.6s; }
.board-table tbody tr:hover td {
  background: rgba(255, 244, 220, 0.04);
}
.board-table tr:has(.medal.m1) td:first-child {
  box-shadow: inset 4px 0 0 var(--medal-gold);
}
.board-table tr:has(.medal.m2) td:first-child {
  box-shadow: inset 4px 0 0 var(--medal-silver);
}
.board-table tr:has(.medal.m3) td:first-child {
  box-shadow: inset 4px 0 0 var(--medal-bronze);
}
.board-table tr.me td {
  background: linear-gradient(90deg, rgba(242, 193, 78, 0.2), rgba(242, 193, 78, 0.06));
}
.board-table img {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
}
/* metallic medals with a little ribbon notch and a glint */
.medal {
  position: relative;
  box-shadow:
    inset -2px -2px 0 rgba(0, 0, 0, 0.25),
    inset 2px 2px 0 rgba(255, 255, 255, 0.35),
    0 0 10px rgba(242, 193, 78, 0.25);
}
.medal.m1 {
  background: radial-gradient(circle at 35% 30%, #fff3b8, var(--medal-gold) 45%, #9a7414);
}
.medal.m2 {
  background: radial-gradient(circle at 35% 30%, #ffffff, var(--medal-silver) 45%, #7d8592);
}
.medal.m3 {
  background: radial-gradient(circle at 35% 30%, #f8d0a6, var(--medal-bronze) 45%, #7a4519);
}
.medal::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
}
.board-table tr:has(.medal) .medal {
  animation: medal-pop 0.5s cubic-bezier(0.2, 1.8, 0.4, 1) 0.3s both;
}
@keyframes medal-pop {
  from {
    transform: scale(0) rotate(-90deg);
  }
}

/* Lobby: livelier cards and player rows */
#scr-lobby .card {
  background:
    linear-gradient(180deg, rgba(255, 244, 220, 0.05), transparent 120px),
    var(--panel);
  border-top-color: rgba(255, 244, 220, 0.3);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 244, 220, 0.12);
}
.player-list li {
  position: relative;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}
.player-list li:not(.empty):hover {
  transform: translateX(3px);
  background: rgba(255, 244, 220, 0.1);
}
.player-list li:not(.empty) {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--c, transparent) 18%, transparent), transparent 55%),
    rgba(255, 244, 220, 0.06);
}
.player-list li.me {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--c, transparent) 30%, transparent), transparent 70%),
    rgba(255, 244, 220, 0.14);
  box-shadow: inset 0 0 0 1px rgba(242, 193, 78, 0.35);
}
.player-list img {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 5px rgba(0, 0, 0, 0.35);
}
.room-code strong {
  text-shadow:
    0 0 12px rgba(242, 193, 78, 0.6),
    3px 3px 0 rgba(228, 64, 123, 0.45);
}
.pl-item {
  transition: background 0.15s ease;
}
.pl-item:hover {
  background: rgba(255, 244, 220, 0.1);
}
.emote-bar button {
  transition:
    transform 0.12s ease,
    background 0.12s ease;
}
.emote-bar button:hover {
  transform: translateY(-2px);
  background: rgba(255, 244, 220, 0.18);
}
#btn-start:not(:disabled) {
  background-size: 200% 100%;
  animation: start-glow 2.4s ease-in-out infinite;
}
@keyframes start-glow {
  50% {
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.35),
      0 10px 30px rgba(0, 0, 0, 0.45),
      0 0 26px rgba(242, 140, 40, 0.55);
  }
}

/* ───────────────────────── start: layout, "So geht's", sound sliders ───────────────────────── */
.start-wrap {
  gap: 22px;
}
.start-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  width: min(900px, 100%);
}
.start-main .start-card {
  flex: 1 1 340px;
  max-width: 420px;
  background: rgba(27, 35, 64, 0.88);
}
.howto {
  flex: 1 1 360px;
  max-width: 460px;
  background: rgba(27, 35, 64, 0.82);
  backdrop-filter: blur(4px);
}
.howto .section-title {
  margin-bottom: 10px;
}
.howto-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.howto-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.howto-list .ico {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 900 18px/1 var(--ui);
  color: var(--ink);
  background: var(--gold);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}
.howto-list li:nth-child(2) .ico { background: var(--orange); }
.howto-list li:nth-child(3) .ico { background: var(--teal); color: var(--cream); }
.howto-list li:nth-child(4) .ico { background: #bfe3f2; }
.howto-list li:nth-child(5) .ico { background: var(--magenta); color: var(--cream); }
.howto-list strong {
  display: block;
  font: italic 900 15px/1.2 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.howto-list span {
  display: block;
  font-size: 13.5px;
  line-height: 1.4;
  opacity: 0.85;
}
.howto kbd {
  font: 800 11px var(--mono);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(255, 244, 220, 0.12);
}
.howto-note {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(31, 166, 160, 0.18);
  font-size: 13px;
  line-height: 1.4;
}
.sound-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.slider {
  display: grid;
  grid-template-columns: 58px 1fr 38px;
  align-items: center;
  gap: 10px;
  font: 800 12px var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.slider span {
  opacity: 0.75;
}
.slider output {
  font: 700 12px var(--mono);
  text-align: right;
  opacity: 0.75;
}
.slider input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--magenta), var(--gold)) 0 0 / var(--fill, 50%) 100% no-repeat, rgba(255, 244, 220, 0.15);
  cursor: pointer;
}
.slider input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--ink);
}
.slider input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--ink);
}
@media (max-height: 820px) {
  .logo h1 {
    font-size: clamp(44px, 7vw, 92px);
  }
  .start-wrap {
    gap: 14px;
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .howto-list {
    gap: 6px;
  }
}

/* ───────────────────────── discipline pictograms (white silhouettes → mask, any colour) ───────────────────────── */
.ev-icon {
  display: inline-block;
  flex: none;
  width: 26px;
  height: 26px;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.ev-icon:not([style]) {
  visibility: hidden;
}
.pl-item .ev-icon {
  width: 28px;
  height: 28px;
  color: var(--gold);
}
.pl-item .ev-icon.winter {
  color: #bfe3f2;
}
.available .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.available .ev-icon {
  width: 18px;
  height: 18px;
}
.intro-art {
  position: relative;
}
.intro-art .ev-icon {
  position: absolute;
  left: 18px;
  bottom: 16px;
  width: 92px;
  height: 92px;
  color: var(--cream);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}
.intro-art .ev-icon-disc {
  position: absolute;
  left: 8px;
  bottom: 6px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(228, 64, 123, 0.92), rgba(242, 140, 40, 0.85));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 4px rgba(255, 244, 220, 0.65);
}
.intro-art .ev-icon-disc.winter {
  background: radial-gradient(circle, rgba(36, 64, 142, 0.95), rgba(31, 166, 160, 0.9));
}
.intro-art .ev-icon-disc:has(.ev-icon:not([style])) {
  display: none;
}
.intro-art .ev-icon-disc .ev-icon {
  left: 12px;
  bottom: 12px;
  width: 88px;
  height: 88px;
}
.board-table th .th-disc {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.board-table th .ev-icon {
  width: 30px;
  height: 30px;
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(242, 193, 78, 0.5));
}

/* ───────────────────────── result/overall boards on the stadium scoreboard ───────────────────────── */
#ov-results,
#ov-overall {
  background:
    radial-gradient(ellipse at 50% 45%, rgba(11, 14, 26, 0.25), rgba(11, 14, 26, 0.7) 80%),
    var(--results-bg, linear-gradient(rgba(11, 14, 26, 0.55), rgba(11, 14, 26, 0.55))) center 30% / cover no-repeat;
}
#ov-results .board,
#ov-overall .board {
  background-color: rgba(7, 8, 13, 0.9);
}
.available .ev-icon:not([style]) {
  display: none;
}
