:root {
  --bg: #0c0f18;
  --panel: rgba(13, 16, 27, 0.86);
  --panel-2: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f1f3f8;
  --muted: #9ba3b8;
  --accent: #f97316;
  --accent-2: #ffd166;
  --blue: #7cc8ff;
  --danger: #ef4444;
  --display: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  /* The dynamic viewport tracks mobile address bars as they show and hide. */
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

canvas#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  touch-action: none;
}

body.in-game canvas#game { cursor: none; }

.hidden { display: none !important; }

/* ---------------------------------------------------------------- screens */

.screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 40%, rgba(8, 10, 18, 0.2), rgba(8, 10, 18, 0.66));
}

#pause { background: rgba(6, 8, 14, 0.62); z-index: 5; }

.shell {
  width: min(940px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  animation: rise 0.28s ease-out;
}
.shell.narrow { width: min(720px, 100%); }
.shell.small { width: min(400px, 100%); }

@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
@media (prefers-reduced-motion: reduce) { .shell { animation: none; } }

.top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
}

.logo {
  margin: 0;
  font: italic 900 34px/1 var(--display);
  letter-spacing: 0.02em;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}
.logo span { color: var(--accent); }

.title { margin: 0; font: 800 20px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }

.tabs { display: flex; gap: 4px; margin-left: auto; }
.tab {
  font: 700 14px/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s, background 0.15s;
}
.tab:hover { color: var(--text); background: var(--panel-2); }
.tab.on { color: var(--text); }
.tab.on::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 3px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.body {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 0;
  flex: 1;
}
.body.single { display: block; padding: 18px 22px 20px; overflow-y: auto; }

.hero {
  position: relative;
  border-right: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 62%, rgba(249, 115, 22, 0.2), transparent 68%), rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 10px 16px;
  min-height: 0;
}
.hero canvas { width: 100%; max-width: 220px; height: auto; flex: 0 1 auto; min-height: 0; aspect-ratio: 440 / 520; }
.hero-name { font: 800 20px/1.1 var(--display); letter-spacing: 0.04em; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-sub { color: var(--muted); font-size: 12px; text-align: center; margin-top: 4px; }

.panes { min-width: 0; min-height: 0; overflow-y: auto; }
.pane { padding: 18px 22px 20px; display: grid; gap: 14px; align-content: start; }

h2 { margin: 0; font-size: 18px; }

/* ---------------------------------------------------------------- controls */

.field { display: grid; gap: 7px; min-width: 0; }
.field > span {
  font: 700 11px/1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.field output { color: var(--text); }

input, select {
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  user-select: text;
  min-width: 0;
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

input[type="range"] { padding: 0; height: 28px; accent-color: var(--accent); background: none; border: 0; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.35);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s;
}
.swatch:hover { transform: scale(1.1); }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 64px;
  padding: 6px 4px 7px;
  font: 700 10px/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.chip canvas { width: 44px; height: 44px; }
.chip.on { color: var(--text); border-color: var(--accent); background: rgba(249, 115, 22, 0.14); }

.guns { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gun {
  display: grid;
  gap: 6px;
  padding: 8px 10px 10px;
  text-align: left;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
}
.gun canvas { width: 100%; height: 44px; }
.gun b { font: 800 13px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.gun i { font-style: normal; font-size: 11px; color: var(--blue); min-height: 14px; }
.gun .stat { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 6px; font: 700 9px/1 var(--display); letter-spacing: 0.1em; color: var(--muted); }
.gun .stat em { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.gun .stat em::after { content: ""; display: block; height: 100%; width: var(--v); background: var(--accent-2); border-radius: 2px; }
.gun.on { border-color: var(--accent); background: rgba(249, 115, 22, 0.14); }
.gun.info { cursor: default; }

.seg { display: flex; gap: 4px; padding: 4px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 12px; }
.seg.wrap { flex-wrap: wrap; }
.seg button {
  flex: 1;
  font: 700 12px/1 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 9px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.seg button.on { color: #fff; background: var(--accent); }

.row { display: flex; gap: 10px; }
.row.col { flex-direction: column; }
.row > .btn { flex: 1; }

.btn {
  font: 800 14px/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  cursor: pointer;
  transition: background 0.15s, transform 0.06s, filter 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  box-shadow: 0 8px 22px rgba(234, 88, 12, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { display: grid; gap: 5px; padding: 18px 20px; text-align: left; border-radius: 16px; }
.btn.big strong { font: italic 900 26px/1 var(--display); letter-spacing: 0.04em; }
.btn.big small { font: 500 12px/1.2 system-ui, sans-serif; letter-spacing: 0; text-transform: none; opacity: 0.9; }
.btn.danger { color: #fecaca; border-color: rgba(239, 68, 68, 0.45); }
.btn.small { padding: 7px 12px; font-size: 12px; }

.join { display: flex; gap: 8px; flex: 1.3; }
.join input { flex: 1; text-transform: uppercase; letter-spacing: 0.24em; font-weight: 700; text-align: center; }

.rooms-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 4px; }
.rooms-head h2 { font: 700 11px/1 var(--display); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.link { background: none; border: 0; color: var(--accent-2); cursor: pointer; font: inherit; font-size: 13px; }

.rooms { list-style: none; margin: -6px 0 0; padding: 0; display: grid; gap: 6px; }
.rooms li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.rooms li > div:first-child { flex: 1; min-width: 0; }
.rooms li strong { font: 800 15px/1.2 var(--display); letter-spacing: 0.18em; }
.rooms li span { color: var(--muted); font-size: 12px; display: block; }
.rooms li .count { color: var(--text); font: 700 13px/1 var(--display); white-space: nowrap; }
.rooms li.empty { color: var(--muted); justify-content: center; font-size: 13px; padding: 16px; border-style: dashed; }

.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 7px 16px; font-size: 13px; color: var(--muted); }
.keys div { display: flex; align-items: center; gap: 4px; }
.keys span { margin-left: 6px; }
kbd {
  font: 700 11px/1 var(--display);
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  color: var(--text);
}
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.hint strong { color: var(--text); }
.hint.center { text-align: center; }

.status { min-height: 0; margin: 0; padding: 0 22px; text-align: center; color: var(--accent-2); font-size: 13px; }
.status:not(:empty) { padding: 10px 22px 12px; border-top: 1px solid var(--line); }
.status.error { color: #fca5a5; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 14px 0 10px; }
.check { display: flex; align-items: center; gap: 9px; margin: 6px 0; color: var(--muted); font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.body.single .row { margin-top: 14px; }

.map-cards { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.map-card {
  flex: 0 0 150px;
  display: grid;
  gap: 5px;
  padding: 6px 6px 8px;
  text-align: left;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
}
.map-card canvas, .map-card .dice {
  width: 100%;
  aspect-ratio: 2 / 1;
  border-radius: 8px;
  display: block;
  background: linear-gradient(135deg, #1f2937, #111827);
}
.map-card .dice { display: grid; place-items: center; font: 900 30px/1 var(--display); color: var(--accent-2); }
.map-card b { font: 800 12px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; padding: 0 2px; }
.map-card i { font-style: normal; font-size: 10.5px; line-height: 1.25; color: var(--muted); padding: 0 2px; min-height: 26px; }
.map-card.on { border-color: var(--accent); background: rgba(249, 115, 22, 0.14); }

.code-line { font-size: 14px; margin: 0 0 6px; text-align: center; color: var(--muted); }
.code-line strong { font: 900 34px/1.1 var(--display); letter-spacing: 0.25em; color: var(--accent-2); display: block; margin-top: 4px; }
.shell.small .field { margin-top: 12px; }

.chat {
  position: fixed;
  left: 16px;
  bottom: 160px;
  width: min(420px, calc(100vw - 32px));
  z-index: 4;
  background: rgba(10, 12, 20, 0.9);
}

.rotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  place-items: center;
  padding: 24px;
  text-align: center;
  font: 800 20px/1.3 var(--display);
  background: var(--bg);
}

@media (orientation: portrait) {
  body.touch.in-game .rotate, body.touch.in-editor .rotate { display: grid; }
}

/* ---------------------------------------------------------------- full screen */

.fs-btn {
  position: fixed;
  z-index: 3;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  background: rgba(12, 15, 24, 0.55);
  color: #fff;
  cursor: pointer;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  touch-action: manipulation;
}
.fs-btn svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fs-btn .fs-out { display: none; }
.fs-btn[aria-pressed="true"] .fs-in { display: none; }
.fs-btn[aria-pressed="true"] .fs-out { display: inline; }
.fs-btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.fs-tip { position: fixed; inset: 0; z-index: 12; display: grid; place-items: center; padding: 16px; background: rgba(6, 8, 14, 0.7); }
.fs-tip .steps { margin: 8px 0 14px; padding-left: 20px; line-height: 1.7; }

/* ---------------------------------------------------------------- layout editor */

.editor { position: fixed; inset: 0; z-index: 8; background: var(--bg); }
.editor canvas { position: absolute; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; cursor: grab; }
.editor canvas:active { cursor: grabbing; }
.ed-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 8px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 12, 20, 0.88);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}
.ed-head { display: flex; align-items: center; gap: 8px; font: 800 14px/1.2 var(--display); }
.ed-grip { width: 22px; height: 22px; flex: none; border-radius: 6px; cursor: move; touch-action: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,0.45) 0 2px, transparent 2px 5px); background-size: 12px 13px; background-position: center; background-repeat: no-repeat; }
.ed-base { color: var(--muted); font: 600 11.5px/1.2 system-ui, sans-serif; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-fold { flex: none; }
.ed-body { display: grid; gap: 8px; margin-top: 8px; }
.ed-presets { display: grid; grid-template-columns: repeat(4, 1fr); }
.ed-presets button { padding: 7px 4px; font-size: 12px; }
.ed-presets button:disabled { opacity: 0.4; cursor: not-allowed; }
.ed-sel { margin: 0; min-height: 1.3em; font: 700 12.5px/1.3 system-ui, sans-serif; color: var(--accent-2); }
.ed-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ed-sliders .field { margin: 0; }
.ed-sliders input:disabled { opacity: 0.35; }
.ed-actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.ed-actions .btn { padding: 8px 6px; }
.ed-panel { transition: opacity 0.15s; }
.editor.dragging .ed-panel { opacity: 0.12; pointer-events: none; }
.editor.folded .ed-body { display: none; }
.editor.folded .ed-panel { width: auto; }
.ed-presets button, .ed-actions .btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-presets button { letter-spacing: 0.02em; }
.ed-actions .btn { font-size: 13px; letter-spacing: 0.04em; }
/* Short phone screens in landscape: a slimmer panel, with size and opacity
   beside the actions instead of above them. */
@media (max-height: 430px) {
  .ed-panel { padding: 6px 10px 8px; width: min(520px, calc(100vw - 24px)); border-radius: 14px; }
  .ed-head { font-size: 12.5px; }
  .ed-body { gap: 5px; margin-top: 5px; grid-template-columns: 1fr 1fr; align-items: end; }
  .ed-presets, .ed-sel { grid-column: 1 / -1; }
  .ed-presets button { padding: 6px 2px; font-size: 10.5px; }
  .ed-sel { font-size: 11.5px; min-height: 0; }
  .ed-sliders { gap: 8px; }
  .ed-sliders .field > span { font-size: 10.5px; }
  .ed-actions { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .ed-actions .btn { padding: 8px 4px; font-size: 11px; white-space: normal; line-height: 1.1; }
}

/* Narrow screens: the character preview moves above the content. */
@media (max-width: 700px) {
  .top { flex-wrap: wrap; gap: 6px 12px; padding: 12px 14px 8px; }
  .logo { font-size: 28px; }
  .tabs { margin-left: 0; width: 100%; }
  .tab { flex: 1; padding: 10px 4px; font-size: 12px; }
  .body { grid-template-columns: 1fr; overflow-y: auto; }
  .panes { overflow: visible; }
  .hero { flex-direction: row; justify-content: center; gap: 12px; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px 14px; }
  .hero canvas { width: 84px; }
  .hero-sub { text-align: left; }
  .pane, .body.single { padding: 14px; }
  .row { flex-wrap: wrap; }
}

/* Short screens (phones in landscape): tighten everything up. */
@media (max-height: 480px) {
  .top { padding: 8px 16px; }
  .logo { font-size: 24px; }
  .tab { padding: 8px 10px; font-size: 12px; }
  .body { grid-template-columns: 150px minmax(0, 1fr); }
  .pane, .body.single { padding: 10px 16px 12px; gap: 9px; }
  .btn { padding: 10px 14px; }
  .btn.big { padding: 11px 16px; }
  .btn.big strong { font-size: 20px; }
  .hero { padding: 4px 6px 8px; }
  .hero-name { font-size: 15px; }
  .hero-sub { font-size: 10.5px; }
  .grid { gap: 8px; margin: 8px 0 6px; }
  .code-line strong { font-size: 26px; }
}

/* ---------------------------------------------------------------- key bindings */
.fold summary { cursor: pointer; font: 700 11px/1 var(--display); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); padding: 4px 0; }
.fold[open] summary { margin-bottom: 10px; }
.binds { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; margin-bottom: 8px; }
.bind { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px 7px 12px; font: inherit; font-size: 13px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.bind.on { border-color: var(--accent); background: rgba(249, 115, 22, 0.14); }

/* ---------------------------------------------------------------- accounts */
#auth { z-index: 6; background: rgba(6, 8, 14, 0.7); }
.shell.small .top { justify-content: space-between; }
.acct { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 8px; padding: 7px 12px 8px; font: 700 13px/1 var(--display); letter-spacing: 0.04em; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; white-space: nowrap; }
.acct:hover { background: rgba(255, 255, 255, 0.12); }
.acct b { color: var(--accent-2); }
.acct i { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.acct i::after { content: ""; display: block; height: 100%; width: var(--v); background: var(--accent-2); }
.rooms-head em { font-style: normal; color: var(--blue); margin-left: 8px; }
.profile-body { display: grid; gap: 14px; }
.pitch { display: grid; gap: 10px; }
.level { display: flex; align-items: center; gap: 14px; }
.lv { width: 58px; height: 58px; display: grid; place-items: center; font: 900 26px/1 var(--display); color: #1b1300; background: linear-gradient(135deg, #ffe08a, #f59e0b); border-radius: 16px; transform: rotate(-4deg); box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35); }
.lv-info { flex: 1; display: grid; gap: 6px; min-width: 0; }
.lv-info strong { font: 800 20px/1 var(--display); letter-spacing: 0.03em; }
.lv-info span { font-size: 12px; color: var(--muted); }
.bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #ffe08a); border-radius: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.tile { display: grid; gap: 3px; padding: 9px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.tile b { font: 800 18px/1 var(--display); }
.tile span { font: 700 9.5px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.badge { display: grid; gap: 2px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; opacity: 0.5; }
.badge.on { opacity: 1; border-style: solid; border-color: rgba(255, 209, 102, 0.6); background: rgba(255, 209, 102, 0.09); }
.badge b { font: 800 12px/1.1 var(--display); letter-spacing: 0.05em; text-transform: uppercase; }
.badge span { font-size: 11px; color: var(--muted); }
.history, .ranks { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.history li, .ranks li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; font-size: 13px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.history li b { width: 40px; font: 800 11px/1 var(--display); letter-spacing: 0.08em; }
.history li.win b { color: #4ade80; } .history li.loss b { color: #f87171; } .history li.draw b { color: var(--muted); }
.history li span { flex: 1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history li i { font-style: normal; color: var(--accent-2); font-weight: 700; }
.history .empty, .ranks .empty { justify-content: center; color: var(--muted); border-style: dashed; padding: 14px; }
.ranks li.me { border-color: var(--accent); background: rgba(249, 115, 22, 0.14); }
.ranks .rk { width: 22px; text-align: center; font: 800 14px/1 var(--display); color: var(--muted); }
.ranks li:nth-child(1) .rk { color: #ffd166; } .ranks li:nth-child(2) .rk { color: #cbd5e1; } .ranks li:nth-child(3) .rk { color: #d19a66; }
.ranks canvas { width: 30px; height: 30px; }
.ranks .nm { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranks .nm em { font-style: normal; font-size: 11px; color: var(--accent-2); margin-left: 6px; }
.ranks span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ranks strong { font: 800 14px/1 var(--display); min-width: 64px; text-align: right; }
.chip.locked, .swatch.locked { position: relative; filter: grayscale(0.8) brightness(0.6); }
.chip.locked::after, .swatch.locked::after { content: attr(data-lock); position: absolute; inset: auto 0 2px 0; text-align: center; font: 800 9px/1 var(--display); color: #ffd166; letter-spacing: 0.04em; filter: none; }
.swatch.locked::after { inset: 9px 0 auto 0; }
@media (max-width: 860px) { .tab { padding: 10px 9px; font-size: 12.5px; letter-spacing: 0.05em; } .top { gap: 10px; } }
@media (max-width: 700px) { .acct { position: absolute; right: 14px; top: 12px; } .shell { position: relative; } }
