:root {
  --face: #d4d0c8;
  --face-light: #ffffff;
  --face-dark: #808080;
  --face-darker: #404040;
  --title-from: #0a246a;
  --title-to: #a6caf0;
  --title-text: #ffffff;
  --text: #000000;
  --muted: #444444;
  --sunken-bg: #ffffff;
  --chat-gutter: 34px;

  --taskbar-gap: 10px;
  --taskbar-h: 44px;

  --chat-box-h: 320px;
  --mention: #0a3fa8;
  --mention-bg: #cfe0ff;
  --accent: #0a246a;
  --link: #0a246a;
  --ok: #008000;
  --err: #b30000;
  --vote-up: #11651f;
  --vote-down: #ab1f1f;
  --desktop: #3a6ea5;
  --desktop-line: rgba(255, 255, 255, .05);
  --scroll-track: #e8e6e2;
  --when: #9a9a9a;
  --viz-bg: #101010;

  --desktop-image: url("../images/backgrounds/default.webp");

  --gold: #a07400;
  --graph-line: #000080;
  --graph-grid: #c8c8c8;
  --graph-frame: #808080;
}

:root[data-theme="dark"] {
  --face: #3c3c3c;
  --face-light: #5c5c5c;
  --face-dark: #1f1f1f;
  --face-darker: #0a0a0a;
  --title-from: #05132e;
  --title-to: #2f5493;
  --title-text: #f0f0f0;
  --text: #e8e8e8;
  --muted: #a6a6a6;
  --sunken-bg: #1b1b1b;
  --mention: #7db4f0;
  --mention-bg: #1f3557;
  --accent: #6aa5e6;
  --link: #7db4f0;
  --ok: #3fbf52;
  --err: #ff6b6b;
  --vote-up: #4fd06a;
  --vote-down: #ff7676;
  --desktop: #12283d;
  --desktop-line: rgba(255, 255, 255, .035);
  --scroll-track: #2a2a2a;
  --when: #8a8a8a;
  --viz-bg: #0a0a0a;
  --gold: #ffcf4a;
  --graph-line: #7db4f0;
  --graph-grid: #444444;
  --graph-frame: #6a6a6a;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

html { background-color: var(--desktop); }

body {
  min-height: 100vh;
  color: var(--text);
  font: 12px/1.5 Tahoma, "MS Sans Serif", Verdana, sans-serif;
  display: flex;
  justify-content: center;
  padding: 20px 12px;

  padding-bottom: calc(var(--taskbar-h) + var(--taskbar-gap) + 20px + env(safe-area-inset-bottom, 0px));
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  background:
    var(--desktop-image) center center / cover no-repeat,
    repeating-linear-gradient(45deg, var(--desktop-line) 0 1px, transparent 1px 5px),
    var(--desktop);
}

.page {
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

a { color: var(--link); }

.window {
  background: var(--face);
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face);
  padding: 3px;
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(90deg, var(--title-from), var(--title-to));
  color: var(--title-text);
  padding: 3px 6px;
  user-select: none;
}

.titlebar-text {
  font-weight: bold;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.titlebar-note {
  display: none;
  flex: 0 1 auto;
  min-width: 0;
  margin-left: -4px;
  margin-right: auto;
  font-weight: bold;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.titlebar-note::before { content: "- "; }

.window.collapsed .titlebar-text { flex: none; }

.window.collapsed .titlebar-note:not(:empty) { display: block; }

.titlebar-buttons { display: flex; gap: 2px; flex: none; }

.tb-btn {
  width: 16px;
  height: 14px;
  background: var(--face);
  color: var(--text);
  font-size: 9px;
  line-height: 12px;
  text-align: center;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light);
}

.tb-min {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 1px;
}

.tb-min::before {
  content: "";
  width: 8px;
  height: 2px;
  background: currentColor;
}

.window.collapsed .tb-min { align-items: center; padding: 0; }

.window.collapsed .tb-min::before {
  height: 7px;
  background: none;
  box-shadow:
    inset 0 0 0 1px currentColor,
    inset 0 2px currentColor;
}

.window-body { padding: 12px; }

.chat-messages,
.chat-picker,
.admin-list,
.hist,
.tracks-box {
  scrollbar-width: auto;
  scrollbar-color: var(--face) var(--face-dark);
}

.chat-messages::-webkit-scrollbar,
.chat-picker::-webkit-scrollbar,
.admin-list::-webkit-scrollbar,
.hist::-webkit-scrollbar,
.tracks-box::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

.chat-messages::-webkit-scrollbar-track,
.chat-picker::-webkit-scrollbar-track,
.admin-list::-webkit-scrollbar-track,
.hist::-webkit-scrollbar-track,
.tracks-box::-webkit-scrollbar-track {
  background-color: var(--scroll-track);
  background-image:
    linear-gradient(45deg, var(--face) 25%, transparent 25%, transparent 75%, var(--face) 75%),
    linear-gradient(45deg, var(--face) 25%, transparent 25%, transparent 75%, var(--face) 75%);
  background-size: 4px 4px;
  background-position: 0 0, 2px 2px;
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-picker::-webkit-scrollbar-thumb,
.admin-list::-webkit-scrollbar-thumb,
.hist::-webkit-scrollbar-thumb,
.tracks-box::-webkit-scrollbar-thumb {
  background: var(--face);
  border: none;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face);
}

.chat-messages::-webkit-scrollbar-button:vertical:start:decrement,
.chat-messages::-webkit-scrollbar-button:vertical:end:increment,
.chat-picker::-webkit-scrollbar-button:vertical:start:decrement,
.chat-picker::-webkit-scrollbar-button:vertical:end:increment,
.admin-list::-webkit-scrollbar-button:vertical:start:decrement,
.admin-list::-webkit-scrollbar-button:vertical:end:increment,
.hist::-webkit-scrollbar-button:vertical:start:decrement,
.hist::-webkit-scrollbar-button:vertical:end:increment,
.tracks-box::-webkit-scrollbar-button:vertical:start:decrement,
.tracks-box::-webkit-scrollbar-button:vertical:end:increment {
  display: block;
  height: 16px;
  background: var(--face);
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face);
}

.chat-messages::-webkit-scrollbar-corner,
.chat-picker::-webkit-scrollbar-corner {
  background: var(--face);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sunken {
  background: var(--sunken-bg);
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-darker);
}

.btn {
  font: inherit;
  color: var(--text);
  background: var(--face);
  border: none;
  padding: 4px 14px;
  cursor: pointer;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face);
}

.btn:active {
  box-shadow:
    inset 1px 1px var(--face-darker),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-dark);
  padding: 5px 13px 3px 15px;
}

.btn-icon { padding: 3px 6px; }

.btn[hidden] { display: none; }

.btn-square {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:active { padding: 4px 5px 2px 7px; }

.btn:disabled {
  color: var(--face-dark);
  text-shadow: 1px 1px var(--face-light);
  cursor: default;
}

.btn:disabled:active {
  padding: 4px 14px;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face);
}

input[type="text"],
textarea,
select {
  font: inherit;
  padding: 3px 5px;
  border: none;
  background: var(--sunken-bg);
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-darker);
  outline: none;
  min-width: 0;
}

fieldset.panel {
  border: 1px solid;
  border-color: var(--face-dark) var(--face-light) var(--face-light) var(--face-dark);
  padding: 8px 10px 10px;

  min-width: 0;
}

fieldset.panel legend {
  padding: 0 4px;
  font-weight: bold;
  font-size: 11px;
}

.header-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

:root { --tile: 118px; }

.header-brand {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: var(--tile);
  height: var(--tile);
  flex: none;
  object-fit: contain;
  cursor: pointer;
}

.logo-swap {
  position: relative;
  display: block;
  width: var(--tile);
  height: var(--tile);
  flex: none;
}

.logo-swap .logo { width: 100%; height: 100%; }

.logo-hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;

  pointer-events: none;
  transition: opacity .18s ease;
}

@media (hover: hover) {
  .logo-swap:hover .logo-hover { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-hover { transition: none; }
}

.header-title { flex: 1; min-width: 0; }

h1 { font-size: 20px; letter-spacing: .02em; }

.header-title h1 { font-size: 28px; line-height: 1.15; }

.sub { color: var(--muted); }

.header-title .sub { font-size: 15px; margin-top: 2px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.dot {
  width: 11px;
  height: 11px;
  background: var(--ok);
  flex: none;
  animation: dot-pulse 2.4s ease-in-out infinite;
}

.dot.live {
  background: var(--gold);
  animation: dot-beat 1.1s ease-in-out infinite;
}

.dot.off {
  background: var(--err);
  animation: dot-blink 1.6s steps(2, jump-none) infinite;
}

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.78); opacity: .7; }
}

@keyframes dot-beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

@keyframes dot-blink {
  0% { opacity: 1; }
  100% { opacity: .25; }
}

@media (prefers-reduced-motion: reduce) {
  .dot, .dot.live, .dot.off { animation: none; }
}

.widgets {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: none;
}

.header-body { align-items: stretch; flex-wrap: wrap; }

.nav-bar {
  flex: 1 0 100%;
  order: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  padding-top: 14px;
  font-size: 12px;
  box-shadow:
    inset 0 1px var(--face-dark),
    inset 0 2px var(--face-light);
}

.nav-item {
  flex: 1 1 auto;
  padding: 2px 4px;
  text-align: center;
  white-space: nowrap;
  color: var(--link);
  text-decoration: underline;
}

.nav-item + .nav-item {
  box-shadow:
    inset 1px 0 var(--face-dark),
    inset 2px 0 var(--face-light);
}

.nav-item.is-current {
  color: var(--text);
  font-weight: bold;
  text-decoration: none;
  cursor: default;
}

.calendar {
  width: var(--tile);
  min-height: var(--tile);
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--sunken-bg);
  padding: 4px 6px 5px;
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-darker);
}

.cal-title {
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 3px;

  line-height: 1.15;
  overflow-wrap: anywhere;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.cal-wd {
  font-size: 8px;
  color: var(--muted);
  text-align: center;
  padding-bottom: 1px;
}

.cal-day {
  font-size: 9px;
  text-align: center;
  line-height: 12px;
  min-width: 13px;
  font-variant-numeric: tabular-nums;
}

.cal-day.weekend { color: var(--err); }
.cal-day.empty { visibility: hidden; }

.cal-day.today {
  background: var(--title-from);
  color: #fff;
  font-weight: bold;
}

.weather {
  width: var(--tile);
  min-height: var(--tile);
  flex: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 9px;
  background: var(--sunken-bg);
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-darker);
  cursor: help;
}

.weather-title {
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.weather-icon { font-size: 28px; line-height: 1; }
.weather-meta { min-width: 0; text-align: center; }
.weather-temp { font-size: 20px; font-weight: bold; font-variant-numeric: tabular-nums; }
.weather-text {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.15;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.clock-wrap {
  width: var(--tile);
  min-height: var(--tile);
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--sunken-bg);
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-darker);
}

.clock-digital {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--face);
  padding: 1px 6px;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light);
  min-width: 62px;
  text-align: center;
}

.clock {
  width: 76px;
  height: 76px;
  flex: none;
  display: block;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 6px;
}

.stat-wide { grid-column: span 2; }

.stat {
  border: 1px solid;
  border-color: var(--face-dark) var(--face-light) var(--face-light) var(--face-dark);
  padding: 4px 7px;
  min-width: 0;
}

.stat-label {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 1px;
  line-height: 1.2;
}

.stat-value {
  font-size: 16px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.stat-graph {
  position: relative;
  margin-top: 2px;
  background: var(--sunken-bg);
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-darker);
  min-height: 18px;
  overflow: hidden;
}

.stat-graph > .none { display: inline-block; padding: 2px 4px; font-size: 11px; }

.stat-graph svg { display: block; }

.chart-plot { fill: var(--sunken-bg); stroke: var(--graph-frame); stroke-width: 1; }

.chart-grid,
.chart-tick { stroke: var(--graph-grid); stroke-width: 1; }

.chart-line {
  fill: none;
  stroke: var(--graph-line);
  stroke-width: 1;
  stroke-linejoin: round;
}

.chart-dot,
.chart-peak { fill: var(--graph-line); }

.chart-axis,
.chart-empty { font-size: 9px; fill: var(--muted); }

.chart-empty { font-size: 11px; }

.chart-peak-label {
  font-size: 10px;
  font-weight: bold;
  fill: var(--text);
}

.chart-hair {
  position: absolute;
  width: 1px;
  background: var(--graph-frame);
  pointer-events: none;
}

.chart-mark {
  position: absolute;
  width: 5px;
  height: 5px;
  margin: -3px 0 0 -2px;
  background: var(--graph-line);
  pointer-events: none;
}

.chart-tip {
  position: absolute;
  z-index: 2;
  padding: 1px 4px;
  font-size: 10px;
  line-height: 14px;
  color: #000;
  background: #ffffe1;
  white-space: nowrap;
  pointer-events: none;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    1px 1px 3px rgba(0, 0, 0, .35);
}

.flags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 9px;
  align-items: center;
  min-height: 18px;
}

.flag { display: inline-flex; align-items: center; gap: 4px; }

.flag img {
  width: 20px;
  height: auto;
  display: block;
}

.flag-unknown {
  display: inline-block;
  width: 20px;
  text-align: center;
  color: var(--muted);
  font-weight: bold;
}

.flag .cnt { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.none { color: var(--muted); }

.loading {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  vertical-align: middle;
  background: var(--sunken-bg);
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light);
}

.loading i {
  width: 6px;
  height: 9px;
  background: var(--accent);
  opacity: .25;
  animation: loading-blocks 1.2s linear infinite;
}

.loading i:nth-child(2) { animation-delay: .2s; }
.loading i:nth-child(3) { animation-delay: .4s; }

@keyframes loading-blocks {
  0%, 60%, 100% { opacity: .25; }
  20%, 40% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .loading i { animation: none; opacity: .55; }
}

.player-grid {
  display: grid;

  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.player-grid > * { min-width: 0; }

.player-body {
  display: flex;
  flex-direction: column;
}

.now {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  margin-bottom: 10px;
  min-height: 104px;
}

.art-box {
  position: relative;
  width: 120px;
  height: 120px;
  flex: none;
  padding: 0;
  border: 1px solid var(--face-dark);
  background: var(--face);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.art-box:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.art-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .55);
}

.art-modal[hidden] { display: none; }

.art-modal-window {
  max-width: min(92vw, 640px);

  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.art-modal-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 8px;
}

.art-modal-album {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.art-modal-body img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 90px);
  object-fit: contain;

  image-rendering: pixelated;
}

.art-box .ph { font-size: 30px; color: var(--face-dark); }

.art-box .ph-dj {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--face-dark);
}

.art-box .ph-dj svg { width: 100%; height: 100%; }

.art-box .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
}

.art {
  width: 84px;
  height: 84px;
  flex: none;
  object-fit: cover;
  border: 1px solid var(--face-dark);
  background: var(--face);
}

.now-meta { min-width: 0; flex: 1; overflow: hidden; }

.label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.label .req-nick { text-transform: none; color: var(--text); }

.track {
  font-weight: bold;
  font-size: 14px;
  margin-top: 2px;
}

.artist { color: var(--muted); }

.album { color: var(--muted); font-size: 11px; }

.album .marquee-inner { margin-top: 0; min-height: 15px; }

.album.is-empty { visibility: hidden; }

.marquee {
  overflow: hidden;
  white-space: nowrap;
}

.marquee .marquee-inner {
  display: inline-block;
  vertical-align: bottom;
}

.marquee.is-marquee .marquee-inner {
  animation: marquee var(--marquee-time, 8s) ease-in-out infinite alternate;
}

.marquee.is-clipped .marquee-inner {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes marquee {
  0%, 12%   { transform: translateX(0); }
  88%, 100% { transform: translateX(var(--shift, 0)); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee.is-marquee .marquee-inner { animation: none; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn:focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: -4px;
}

.chat-messages:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.now-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
  min-height: 18px;
}

.vote {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.vote[hidden] { display: none; }

.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 2px 8px;
  line-height: 1;
  color: var(--muted);
}

.btn-copy:active { padding: 3px 7px 1px 9px; }

.btn-copy .icon-copy { width: 14px; height: 14px; display: block; }

.btn-vote {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.btn-vote .arrow { font-size: 12px; line-height: 1; }

.vote-up .arrow { color: var(--vote-up); }
.vote-down .arrow { color: var(--vote-down); }

.btn-vote:active { padding: 3px 7px 1px 9px; }

.btn-vote.chosen {
  box-shadow:
    inset 1px 1px var(--face-darker),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-dark);
  font-weight: bold;
}

.vote-note { font-size: 10px; color: var(--err); }

.vote-off { font-size: 11px; color: var(--muted); }

.vote.is-busy { cursor: progress; }

.vote.is-busy .btn-vote {
  pointer-events: none;
  color: var(--muted);
}

.btn-vote > .counter { padding: 0 2px; }

.counter {
  position: relative;
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  min-width: 1ch;
  height: 1.25em;
  line-height: 1.25em;
  font-variant-numeric: tabular-nums;
}

.counter-now { display: block; }

.counter-now.is-leaving {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  animation: counter-out .28s ease-in forwards;
}

.counter-now.is-entering { animation: counter-in .28s ease-out; }

@keyframes counter-in  { from { transform: translateY(100%); }  to { transform: none; } }
@keyframes counter-out { from { transform: none; } to { transform: translateY(-100%); } }

.counter.is-down .counter-now.is-entering { animation-name: counter-in-down; }
.counter.is-down .counter-now.is-leaving { animation-name: counter-out-down; }

@keyframes counter-in-down  { from { transform: translateY(-100%); } to { transform: none; } }
@keyframes counter-out-down { from { transform: none; } to { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  .counter-now.is-entering,
  .counter-now.is-leaving { animation: none; }
  .counter-now.is-leaving { display: none; }
}

.viz {
  --viz-inset: 3px;
  position: relative;
  flex: 1 1 auto;
  min-height: 72px;
  margin-top: 12px;
  background: var(--viz-bg);
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-darker);
}

.viz canvas {
  position: absolute;
  top: var(--viz-inset);
  left: var(--viz-inset);
  width: calc(100% - var(--viz-inset) * 2);
  height: calc(100% - var(--viz-inset) * 2);
  display: block;

  cursor: pointer;
}

.is-reading .vote,
.is-reading .times { visibility: hidden; }

.is-reading .track { color: var(--muted); }

.progress { margin-bottom: 12px; }

.bar { height: 14px; padding: 2px; }

.bar .fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0 6px,
    transparent 6px 8px
  );
}

.is-live .progress { display: none; }
.is-live .vol { flex: 0 1 220px; margin-left: auto; }

.is-live .player-grid { grid-template-columns: 1fr; }
.is-live .side,
.is-live .skip { display: none; }

.is-live .ph { display: none; }
.is-live .ph-dj { display: flex; }

.times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.play,
.skip,
.vol > .btn-icon {
  width: 44px;
  height: 34px;
  flex: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.play:active,
.skip:active,
.vol > .btn-icon:active {
  padding: 2px 0 0 2px;
}

.play .icon-pause,
.play.playing .icon-play { display: none; }
.play.playing .icon-pause { display: inline; }
.play.loading { opacity: .6; pointer-events: none; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: .1em;
  color: var(--err);
  font-variant-numeric: tabular-nums;
}

.live-badge .rdot {
  width: 8px;
  height: 8px;
  background: var(--err);
  animation: blink 1.2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

@media (prefers-reduced-motion: reduce) {
  .live-badge .rdot { animation: none; }
}

.vol {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 140px;
}

#muteBtn svg {
  width: 20px;
  height: 20px;
  fill: var(--text);
  stroke: var(--text);
  stroke-linecap: round;
}

#muteBtn .icon-muted { display: none; }
#muteBtn.muted .icon-sound { display: none; }
#muteBtn.muted .icon-muted { display: block; }
#muteBtn.muted svg { fill: var(--err); stroke: var(--err); }

.vol input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  background: var(--face-dark);
  box-shadow: inset 1px 1px var(--face-darker);
  outline: none;
  cursor: pointer;
}

.vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 20px;
  background: var(--face);
  border: none;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark);
}

.vol input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 20px;
  border-radius: 0;
  background: var(--face);
  border: 1px solid var(--face-darker);
}

.offline { display: none; text-align: center; padding: 24px 12px; color: var(--muted); }
.is-offline .player-grid { display: none; }
.is-offline .offline { display: block; }

.side { display: flex; flex-direction: column; gap: 12px; }

.side .panel:last-child {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.next-track { display: flex; gap: 10px; align-items: center; }

.next-track .art { width: 44px; height: 44px; display: block; }

.next-art {
  flex: none;
  padding: 0;
  line-height: 0;
  background: var(--face);
  border: 1px solid var(--face-dark);
  cursor: pointer;
}

.next-art:empty { display: none; }

.next-track .t {
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-track .a {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-track .meta { min-width: 0; }

.hist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.hist li { min-width: 0; max-width: 100%; }

.hist-row,
.chart-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.hist-row:hover .t,
.hist-row:focus-visible .t,
.chart-row:hover .t,
.chart-row:focus-visible .t { color: var(--link); }

.hist li.none { display: flex; gap: 8px; }

.hist li .n { color: var(--muted); width: 14px; flex: none; text-align: right; font-size: 10px; }

.hist li .t {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
}

.hist li .when {
  color: var(--muted);
  font-size: 10px;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.hist li .delta {
  flex: none;
  font-size: 10px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

.hist li .delta.up { color: var(--vote-up); }
.hist li .delta.down { color: var(--vote-down); }
.hist li .delta.even { color: var(--muted); }

.chart-group { margin-bottom: 12px; }
.chart-group:last-child { margin-bottom: 0; }

.charts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.chart-box { min-width: 0; }

.chart-box h3 {
  font-size: 11px;
  font-weight: bold;
  color: var(--muted);
  margin-bottom: 6px;
}

.chart {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
}

.chart li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.chart .n {
  width: 12px;
  flex: none;
  text-align: right;
  font-size: 10px;
  color: var(--muted);
}

.chart .t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart .score {
  flex: none;
  display: inline-flex;
  gap: 5px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.chart .score .up { color: var(--vote-up); }
.chart .score .down { color: var(--vote-down); }

.chat-wrap { position: relative; }

.chat-messages {
  height: var(--chat-box-h);
  overflow-y: auto;
  overflow-wrap: anywhere;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 12px;
}

.chat-new {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  font: inherit;
  font-size: 11px;
  padding: 3px 12px;
  cursor: pointer;
  border: none;
  background: var(--title-from);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

.chat-msg {
  margin-bottom: 6px;
  word-wrap: break-word;
  position: relative;
  padding-right: 4px;

  content-visibility: auto;
  contain-intrinsic-size: auto 20px;
}

.chat-msg .who {
  font-weight: bold;
  color: var(--link);
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}

.chat-msg .who:hover { text-decoration: underline; }

.crown {
  color: #d4a017;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
  margin-right: 3px;
}

.chat-msg .txt { overflow-wrap: anywhere; }

.via-discord {
  color: #5865f2;
  font-weight: bold;
}

.mention {
  color: var(--mention);
  font-weight: bold;
}

.mention.is-me {
  background: var(--mention-bg);
  padding: 0 2px;
}

.chat-msg .when {
  color: var(--when);
  font-size: 9px;
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
}

.chat-msg.chat-system {
  color: var(--err);
  font-style: italic;
  font-size: 10px;
  opacity: 0.75;
}

.deleted-note {
  color: var(--muted);
  font-style: italic;
}

.chat-msg.chat-system.is-ban {
  font-weight: bold;
  font-style: normal;
}

.chat-msg.chat-system.is-radio { color: var(--muted); }

.chat-msg.chat-system .who-name,
.chat-msg.chat-system .chat-track { font-weight: bold; }

.chat-msg.chat-system .chat-track { color: var(--text); }

.kolobok {
  vertical-align: text-bottom;
  image-rendering: pixelated;
}

.msg-tools {
  display: none;
  gap: 4px;
  margin-left: 6px;
}

body.is-admin .chat-msg .msg-tools {
  display: inline-flex;
  opacity: 0;
  pointer-events: none;
}

body.is-admin .chat-msg:hover .msg-tools,
body.is-admin .chat-msg:focus-within .msg-tools {
  opacity: 1;
  pointer-events: auto;
}

.link-btn {
  border: none;
  background: none;
  font: inherit;
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
  padding: 0 2px;
  text-decoration: underline;
}

.link-btn:hover { color: var(--err); }

.admin-only { display: none; }

.chat-picker-frame {
  display: block;
  padding: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.chat-picker {
  max-height: 294px;
  overflow-y: auto;
  padding: 3px;
}

.kolobok-group {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.kolobok-group + .kolobok-group {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--face-dark);
}

.chat-picker-frame[hidden] { display: none; }

#chatPickerToggle.open {
  box-shadow:
    inset 1px 1px var(--face-darker),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-dark);
}

.kolobok-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 2px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1;
  min-width: 26px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kolobok-btn:hover { background: var(--title-to); }

.kolobok-btn img {
  display: block;
  image-rendering: pixelated;
}

#chatPickerToggle img {
  display: block;
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
}

.chat-form { display: flex; flex-direction: column; gap: 6px; }

.chat-row { display: flex; align-items: center; gap: 6px; }

.chat-row label { width: var(--chat-gutter); flex: none; text-align: right; }

.chat-row-send::before {
  content: "";
  width: var(--chat-gutter);
  flex: none;
}

.chat-row input { flex: 1; min-width: 0; }

#chatName { max-width: 17ch; flex: none; }
#chatSend { flex: none; min-width: 104px; }

#chatMessage.is-status::placeholder { color: var(--muted); }
#chatMessage.is-status-err::placeholder { color: var(--err); }

.nick-view {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  font: inherit;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
}

.nick-text {
  font-weight: bold;
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nick-pencil {
  width: 13px;
  height: 13px;
  flex: none;
  color: var(--accent);
}

.nick-view:hover .nick-pencil,
.nick-view:focus-visible .nick-pencil { color: var(--link); }

.nick-view[hidden],
.color-btn[hidden] { display: none; }

.chat-counter {
  flex: none;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 58px;
  text-align: right;
}

.chat-counter.low { color: var(--err); font-weight: bold; }

.admin-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.admin-note { font-size: 11px; color: var(--muted); }
.admin-note.err { color: var(--err); }

.admin-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-cols .panel-wide { grid-column: 1 / -1; }

.admin-requests .t { min-width: 0; }

.admin-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 150px;
  overflow-y: auto;
  font-size: 11px;
}

.admin-list li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.admin-list .t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.admin-list .when { color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }

.admin-list .act {
  flex: none;
  font-weight: bold;
  min-width: 88px;
}

.admin-list .ip {
  flex: none;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  background: var(--face);
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light);
}

.banners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 6px;
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light);
}

.banner {
  width: 88px;
  height: 31px;
  flex: none;
  display: block;
  padding: 0;
  border: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: 88px 62px;
  background-position: 0 0;
  image-rendering: pixelated;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .35);
}

a.banner,
button.banner { cursor: pointer; }

.banner:hover,
.banner:focus-visible { background-position: 0 -31px; }

a.banner:active,
button.banner:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

:root[data-theme="dark"] .banner {
  box-shadow:
    0 0 0 1px var(--face-light),
    1px 1px 0 rgba(0, 0, 0, .5);
}

:root[data-theme="dark"] a.banner:active,
:root[data-theme="dark"] button.banner:active {
  box-shadow: 0 0 0 1px var(--face-light);
}

.banner-share { background-image: url("../images/banners/share.svg"); }
.banner-lab { background-image: url("../images/banners/brom-lab.svg"); }
.banner-tg { background-image: url("../images/banners/tg.svg"); }
.banner-build-1 { background-image: url("../images/banners/build-1.svg"); }
.banner-build-2 { background-image: url("../images/banners/build-2.svg"); }
.banner-build-3 { background-image: url("../images/banners/build-3.svg"); }

.statusbar {
  display: flex;
  gap: 3px;
  font-size: 11px;
  flex-wrap: wrap;
}

.statusbar-cell {
  padding: 3px 8px;
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light);
  color: var(--muted);
  white-space: nowrap;
}

.statusbar-links { display: flex; gap: 10px; }

.feedback-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 14px;
  align-items: start;
}

.feedback-form { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feedback-form input[type="text"],
.feedback-form textarea,
.feedback-form select { width: 100%; box-sizing: border-box; }
.feedback-form textarea { resize: vertical; }
.feedback-field { display: flex; flex-direction: column; gap: 6px; }
.feedback-field[hidden] { display: none; }
.feedback-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.feedback-count { font-size: 11px; color: var(--muted); }
.feedback-count.is-full { color: var(--err); }
.feedback-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.feedback-actions .btn { min-width: 104px; }
.feedback-note { font-size: 11px; color: var(--muted); }

.feedback-aside { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; font-size: 12px; }
.feedback-aside h2 { margin-top: 0; }
.feedback-aside ul { padding-left: 18px; }

@media (max-width: 700px) {
  .feedback-layout { grid-template-columns: 1fr; }
}

.statusbar-grow {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.statusbar-right {
  position: relative;
  margin-left: auto;
  padding-right: 20px;
}

.statusbar-right::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0 2px,
    var(--face-dark) 2px 3px,
    var(--face-light) 3px 4px
  );
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

@media (min-width: 761px) and (max-width: 900px) {
  :root { --tile: 112px; }
  .header-body { gap: 10px; }
  .header-brand { gap: 12px; }
  .header-title h1 { font-size: 24px; }
  .header-title .sub { font-size: 14px; }
}

@media (max-width: 760px) {
  .header-body { flex-wrap: wrap; }
  .header-brand { flex: 1 1 100%; order: 1; }

  .widgets { display: contents; }

  .calendar { order: 2; }
  .weather { order: 3; }
  .clock-wrap { order: 4; }

  .calendar,
  .weather,
  .clock-wrap {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 760px) {
  body {
    padding: 12px 8px;
    padding-bottom: calc(var(--taskbar-h) + var(--taskbar-gap) + 12px + env(safe-area-inset-bottom, 0px));
  }

  :root { --tile: 104px; }

  :root { --chat-box-h: 240px; }

  .stats { grid-template-columns: 1fr 1fr; }

  .admin-cols { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }

  body.is-admin .msg-tools { display: inline-flex; }

  .player-grid { grid-template-columns: 1fr; }

  .hist {
    flex: 0 0 auto;
    max-height: 200px;
    padding-right: 8px;
  }

  .chat-row { flex-wrap: wrap; gap: 6px; }
  .chat-row label { width: auto; text-align: left; }
  .chat-row-send::before { display: none; }

  #chatName { flex: 0 1 12ch; max-width: 12ch; }

  #chatSend { min-width: 0; flex: none; margin-left: auto; }

  #chatMessage { flex: 1 0 100%; }

  .chat-counter { min-width: 0; }

  .statusbar-cell { white-space: normal; }
  .statusbar-grow { overflow: visible; }
}

@media (max-width: 560px) {
  :root {
    --tile: auto;
    --taskbar-gap: 6px;
  }

  .taskbar { width: calc(100% - 12px); }

  .widgets { display: contents; }

  .header-brand { order: 1; }
  .calendar { order: 2; }
  .weather { order: 3; }
  .clock-wrap { order: 4; }

  .header-body { gap: 8px; }

  .calendar,
  .weather,
  .clock-wrap {
    width: auto;
    min-height: 96px;
    flex: 1 1 28%;
    min-width: 0;
  }

  .header-brand { gap: 10px; }

  .logo,
  .logo-swap {
    width: 84px;
    height: 84px;
  }
  .clock { width: 58px; height: 58px; }
  .clock-digital { font-size: 10px; min-width: 0; }
  .weather { padding: 4px; gap: 2px; }
  .weather-title { font-size: 9px; }
  .weather-icon { font-size: 22px; }
  .weather-temp { font-size: 17px; }
  .weather-text { font-size: 9px; }
  .cal-day { font-size: 8px; line-height: 11px; min-width: 11px; }
  .cal-wd { font-size: 7px; }
  .nav-bar { font-size: 11px; }
}

@media (max-width: 380px) {
  .art { width: 64px; height: 64px; }
  h1 { font-size: 17px; }
  .header-title h1 { font-size: 22px; }
  .header-title .sub { font-size: 13px; }
  .controls { gap: 8px; }
}

.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--taskbar-gap) + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  width: min(920px, 100% - 24px);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--face);
  padding: 4px 6px;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face),
    0 3px 10px rgba(0, 0, 0, .4);
}

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-weight: bold;
  color: var(--text);
  background: var(--face);
  border: none;
  padding: 4px 14px 4px 9px;
  cursor: pointer;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face);
}

.start-btn:active,
.start-btn.is-open {
  box-shadow:
    inset 1px 1px var(--face-darker),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-dark);
}

.start-btn:active > *,
.start-btn.is-open > * { transform: translate(1px, 1px); }

.start-btn .start-logo {
  width: 18px;
  height: 18px;
  flex: none;
  object-fit: contain;
  display: block;
}

.tray {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tray-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 3px;
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light);
}

.tray-btn {
  font: inherit;
  color: var(--text);
  background: var(--face);
  border: none;
  padding: 2px 8px;
  min-width: 30px;
  text-align: center;
  cursor: pointer;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face);
}

.tray-btn:active {
  box-shadow:
    inset 1px 1px var(--face-darker),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-dark);
  font-weight: bold;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  line-height: 0;
}

.theme-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.theme-btn .icon-sun { display: none; }

:root[data-theme="dark"] .theme-btn .icon-moon { display: none; }
:root[data-theme="dark"] .theme-btn .icon-sun { display: block; }

.theme-btn:active > * { transform: translate(1px, 1px); }

.tb-btn {
  border: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tb-btn:hover { box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark); }

.tb-btn:active {
  box-shadow:
    inset 1px 1px var(--face-darker),
    inset -1px -1px var(--face-light);
}

.window.collapsed > .window-body { display: none; }

.start-wrap { position: relative; }

.start-btn .start-label {
  font-family: "Terminal", "Fixedsys", "Courier New", monospace;
  text-transform: lowercase;
}

.start-menu {
  position: absolute;
  bottom: calc(100% + 3px);
  left: 0;
  z-index: 51;
  min-width: 190px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px;
  background: var(--face);
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face),
    2px 2px 6px rgba(0, 0, 0, .4);
}

.start-menu[hidden] { display: none; }

.start-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  text-align: left;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.start-item:disabled,
.start-item.is-current {
  cursor: default;
}

.start-item.is-current {
  font-weight: bold;
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light);
}

.start-item:disabled:not(.is-current) { color: var(--muted); }

.start-item:not(:disabled):not(.is-current):hover,
.start-item:not(:disabled):not(.is-current):focus-visible {
  background: var(--title-from);
  color: var(--title-text);
  outline: none;
}

.start-sep {
  display: block;
  height: 2px;
  margin: 2px 4px;
  box-shadow:
    inset 0 1px var(--face-dark),
    inset 0 -1px var(--face-light);
}

.start-icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--accent);
}

.start-icon .cut { fill: var(--face); }

.start-item:not(:disabled):not(.is-current):hover .start-icon,
.start-item:not(:disabled):not(.is-current):focus-visible .start-icon {
  color: var(--title-text);
}

.start-item:not(:disabled):not(.is-current):hover .start-icon .cut,
.start-item:not(:disabled):not(.is-current):focus-visible .start-icon .cut {
  fill: var(--title-from);
}

.ticker {
  flex: 1 1 120px;
  min-width: 0;
  overflow: hidden;
  padding: 2px 4px;
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light);
}

.ticker-track {
  display: flex;
  width: max-content;
  gap: var(--ticker-gap, 200px);
  will-change: transform;
}

.ticker-text {
  white-space: nowrap;
  color: var(--muted);
}

.ticker.ticker-title {
  flex: 1 1 auto;
  padding: 0;
  box-shadow: none;
}

.ticker-title .ticker-text {
  color: var(--title-text);
  font-weight: bold;
  font-size: 12px;
}

.ticker.is-running .ticker-track {
  animation: ticker var(--ticker-time, 30s) linear infinite;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-50% - var(--ticker-gap, 200px) / 2)); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker.is-running .ticker-track { animation: none; }
}

.doc-overlay {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(0, 0, 0, .5);
}

.doc-overlay[hidden] { display: none; }

.doc-window {
  --doc-area: calc(100vh - var(--taskbar-h) - var(--taskbar-gap) - env(safe-area-inset-bottom, 0px));
  --doc-area: calc(100dvh - var(--taskbar-h) - var(--taskbar-gap) - env(safe-area-inset-bottom, 0px));
  position: fixed;
  top: calc(var(--doc-area) / 2);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0 auto;
  transform: translateY(-50%);
  width: min(920px, 100% - 24px);
  max-height: calc(var(--doc-area) - 32px);
  display: flex;
  flex-direction: column;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face),
    0 6px 18px rgba(0, 0, 0, .45);
}

.doc-window[hidden] { display: none; }

.doc-window > .titlebar { flex: none; }

.doc-window.is-dragging { user-select: none; }

@media (min-width: 760px) and (pointer: fine) {
  .doc-window > .titlebar { cursor: move; }
}

.doc-window-body {
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
}

.doc-note { color: var(--muted); }

.doc-note .btn { margin-right: 8px; }

@media (max-width: 560px) {
  .doc-window {
    width: calc(100% - 12px);
    max-height: calc(var(--doc-area) - 16px);
  }
}

.page-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-body h2 {
  font-size: 14px;
  margin-top: 6px;
}

.page-more { color: var(--muted); }

.page-body ol,
.page-body ul { padding-left: 22px; }

.page-body li { margin-bottom: 4px; }

kbd {
  font: inherit;
  padding: 0 4px;
  background: var(--face);
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face);
}

.stream-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.stream-url {
  font-family: "Courier New", monospace;
  word-break: break-all;
}

.copy-toast {
  position: fixed;
  z-index: 80;
  padding: 3px 8px;
  color: var(--text);
  background: var(--face);
  pointer-events: none;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face),
    2px 2px 6px rgba(0, 0, 0, .4);
}

.copy-toast.is-flying { animation: copy-fly 1s ease-out forwards; }

@keyframes copy-fly {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(-18px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .copy-toast.is-flying { animation: none; }
}

.news-body { gap: 14px; }

.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--face-dark);
  box-shadow: 0 1px var(--face-light);
}

.news-item[hidden] { display: none; }

.news-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
  box-shadow: none;
}

.news-title {
  font-size: 14px;
  margin-top: 0;
}

.news-date { color: var(--when); }

.news-item ul {
  margin: 0;
  padding-left: 20px;
  list-style: square;
}

.news-item li + li { margin-top: 4px; }

.news-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.news-pager[hidden] { display: none; }

.news-pages { color: var(--muted); }

.tracks-summary {
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
}


#reqStatus.is-ok { color: var(--vote-up); }

#reqStatus.is-off { color: var(--err); }

@media (max-width: 760px) {
  .tracks-summary { grid-template-columns: 1fr 1fr; }
  .tracks-summary .stat-value { font-size: 14px; }
  .tracks-box { max-height: 56vh; }
}

.tracks-note {
  margin: 6px 0 0;
  color: var(--muted);
}

.tracks-note:empty { display: none; }

.tracks .t-req {
  width: 100px;
  text-align: center;
  white-space: nowrap;
}

.req-btn {
  min-width: 88px;
  padding: 1px 6px;
}

.req-btn:active { padding: 2px 5px 0 7px; }

.req-btn:disabled:active { padding: 1px 6px; }

.req-btn.is-soon,
.req-btn.is-playing { font-weight: bold; }

.req-btn.is-playing { color: var(--vote-up); }

.req-btn.is-busy { cursor: progress; }

.req-off {
  color: var(--muted);
  font-style: italic;
}

.req-modal-window { max-width: min(92vw, 400px); }

.req-modal-body { padding: 10px 12px 12px; }

.req-ask { margin: 0 0 6px; }

.req-track {
  margin: 0 0 8px;
  font-weight: bold;
}

.req-warn { margin: 0 0 12px; }

.req-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.req-actions .btn { min-width: 76px; }

.req-work { display: none; }

.req-modal.is-working .req-ask,
.req-modal.is-working .req-warn,
.req-modal.is-working .req-choice { display: none; }

.req-modal.is-working .req-work { display: block; }

.req-step { margin: 8px 0 12px; min-height: 2.8em; }

.req-modal.is-done .bar,
.req-modal.is-failed .bar,
.req-modal.is-done .req-track { display: none; }

.req-modal.is-done .req-step,
.req-modal.is-failed .req-step { min-height: 0; margin: 0 0 10px; }

.req-modal.is-failed .req-step { color: var(--err); }

.tracks-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tracks-tools input {
  flex: 1 1 200px;
  min-width: 0;
}

.tracks-found { color: var(--muted); }

.tracks-box {
  overflow: auto;
  max-height: min(60vh, 620px);
}

.tracks {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.tracks th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-size: 10px;
  color: var(--muted);

  background: var(--face);
  padding: 4px 8px;
  box-shadow:
    inset -1px -1px var(--face-dark),
    inset 1px 1px var(--face-light);
  white-space: nowrap;
}

.tracks td {
  padding: 3px 8px;
  border-bottom: 1px solid var(--face);
}

.tracks tr:last-child td { border-bottom: none; }

.tracks .t-num {
  width: 1%;
  color: var(--when);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.tracks .t-name { min-width: 220px; }

.tracks .t-main,
.tracks .t-sub { display: block; }

.tracks .t-sub {
  color: var(--muted);
  font-size: 10px;
}

.rating-summary {
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
}

.rating-tabs {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}

.rating-tabs .btn[aria-pressed="true"] {
  font-weight: bold;
  box-shadow:
    inset 1px 1px var(--face-darker),
    inset -1px -1px var(--face-light);
}

.tracks .t-move {
  width: 1%;
  text-align: center;
  white-space: nowrap;
  font-size: 10px;
  color: var(--muted);
}

.tracks .t-move.is-up { color: var(--vote-up); }
.tracks .t-move.is-down { color: var(--vote-down); }
.tracks .t-move.is-new { color: var(--when); font-weight: bold; }

.tracks .t-art {
  width: 1%;
  padding: 2px 0 2px 4px;
}

.tracks .t-art img,
.tracks .t-art-none {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: cover;
}

.tracks .t-art-none {
  line-height: 32px;
  text-align: center;
  color: var(--muted);
  background: var(--face);
}

.tracks .t-score {
  width: 1%;
  white-space: nowrap;
  font-size: 10px;
}

.tracks .t-score .up { color: var(--vote-up); }
.tracks .t-score .down { color: var(--vote-down); }

.tracks .t-len {
  width: 1%;
  text-align: right;
  white-space: nowrap;
  color: var(--muted);
}

.tracks .none {
  color: var(--muted);
  padding: 10px 8px;
  text-align: center;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  margin-top: 8px;
}

.pager-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.pager-go input {
  width: 6ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pager-page { color: var(--muted); font-variant-numeric: tabular-nums; }

.bg-modal-window {
  width: min(92vw, 460px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.bg-modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
}

.bg-hint { color: var(--muted); }

.bg-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.bg-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  font: inherit;
  color: var(--text);
  background: var(--face);
  border: none;
  cursor: pointer;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face);
}

.bg-item img {
  display: block;
  width: 100%;
  height: 62px;
  object-fit: cover;
  background: var(--sunken-bg);
}

.bg-item-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bg-item.is-current {
  font-weight: bold;
  box-shadow:
    inset 1px 1px var(--face-darker),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-dark);
}

.chat-body-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.chat-body-row .chat-wrap { flex: 1; min-width: 0; }

.chat-online-panel {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  min-width: 0;

  height: var(--chat-box-h);
  margin-bottom: 10px;
  overflow: hidden;
}

.online-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  font-size: 11px;
}

.online-list li {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  line-height: 1.35;
}

.on-name {
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.on-time {
  flex: none;
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
  .chat-body-row { flex-direction: column; }

  .chat-online-panel {
    flex: none;
    height: auto;
    margin-bottom: 6px;

    order: -1;
  }

  .online-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px 10px;
    max-height: 52px;
  }

  .online-list li { max-width: 46%; }

  .chat-picker { max-height: 190px; }
}

.chat-row-name { position: relative; }

.color-btn {
  flex: none;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  font: inherit;
  color: var(--text);
  background: var(--face);
  border: 0;
  cursor: pointer;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face);
}

.color-btn:active { box-shadow: inset 1px 1px var(--face-dark), inset -1px -1px var(--face-light); }

.color-btn-swatch {
  display: block;
  width: 15px;
  height: 15px;
  background: #000;
  box-shadow: inset 1px 1px var(--face-dark), inset -1px -1px var(--face-light);
}

.paint-palette {
  position: absolute;
  left: 98px;
  bottom: calc(100% + 4px);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  background: var(--face);
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face);
}

.paint-palette[hidden] { display: none; }

.paint-current {
  flex: none;
  display: block;
  padding: 2px;
  box-shadow: inset 1px 1px var(--face-dark), inset -1px -1px var(--face-light);
}

.paint-current i {
  display: block;
  width: 20px;
  height: 20px;
  background: #000;
  box-shadow: inset 1px 1px var(--face-darker);
}

.paint-grid {
  display: grid;
  grid-template-columns: repeat(14, 16px);
  grid-auto-rows: 16px;
  gap: 1px;
}

.paint-cell {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  cursor: pointer;
  box-shadow: inset 1px 1px var(--face-dark), inset -1px -1px var(--face-light);
}

.paint-cell[aria-pressed="true"] {
  outline: 2px solid var(--text);
  outline-offset: -2px;
}

.paint-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (max-width: 700px) {
  .paint-palette { left: 0; }
  .paint-grid { grid-template-columns: repeat(7, 16px); }
}

.name-hint {
  position: absolute;
  left: 98px;
  bottom: calc(100% + 4px);
  z-index: 10;
  font-size: 11px;
  padding: 3px 8px;
  background: #ffffe1;
  color: #000;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    1px 1px 3px rgba(0, 0, 0, .35);
  white-space: nowrap;
}

.name-hint[hidden] { display: none; }

@media (max-width: 760px) {
  .name-hint { left: 0; }
}

.start-sub { position: relative; }

.start-sub-btn { width: 100%; }

.start-arrow { margin-left: auto; font-size: 9px; }

.start-sub-menu {
  position: absolute;
  left: calc(100% + 1px);
  top: -3px;
  z-index: 52;
  min-width: 150px;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 3px;
  background: var(--face);
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face),
    2px 2px 6px rgba(0, 0, 0, .4);
}

.start-sub:hover > .start-sub-menu,
.start-sub:focus-within > .start-sub-menu,
.start-sub.is-open > .start-sub-menu { display: flex; }

.start-sub:hover > .start-sub-btn,
.start-sub.is-open > .start-sub-btn {
  background: var(--title-from);
  color: var(--title-text);
}

@media (min-height: 560px) {
  .start-menu { overflow: visible; }
}

@media (max-height: 559px), (max-width: 480px) {
  .start-sub-menu {
    position: static;
    min-width: 0;
    padding: 2px 0 2px 24px;
    box-shadow: none;
  }
}

.game-window {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 45;
  transform: translate(-50%, -50%);
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - var(--taskbar-h) - var(--taskbar-gap) - 24px);
  display: flex;
  flex-direction: column;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face),
    0 6px 18px rgba(0, 0, 0, .45);
}

.game-window[hidden] { display: none; }

.game-window > .titlebar { flex: none; }

.game-window.is-dragging { user-select: none; }

@media (min-width: 760px) and (pointer: fine) {
  .game-window > .titlebar { cursor: move; }
}

.game-window-body {
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px;
}

.mines {
  --face: #d4d0c8;
  --face-light: #ffffff;
  --face-dark: #808080;
  --face-darker: #404040;
  --sunken-bg: #d4d0c8;
  --text: #000000;
  --muted: #404040;
  color: var(--text);
  background: var(--face);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 6px;
  width: max-content;
}

.mines-levels { display: flex; gap: 4px; }

.mines-levels .btn.is-on {
  font-weight: bold;
  box-shadow:
    inset 1px 1px var(--face-darker),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-dark);
}

.mines-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px;
}

.mines-led {
  font: bold 18px/1 "Courier New", monospace;
  color: #ff2020;
  background: #000000;
  padding: 2px 4px;
  letter-spacing: 1px;
}

.mines-face {
  width: 26px;
  height: 26px;
  flex: none;
  font: bold 12px/1 Tahoma, sans-serif;
  color: var(--text);
  background: var(--face);
  border: none;
  cursor: pointer;
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face);
}

.mines-face:active {
  box-shadow:
    inset 1px 1px var(--face-darker),
    inset -1px -1px var(--face-light);
}

.mines-field {
  display: grid;
  grid-template-columns: repeat(var(--mines-cols, 9), 16px);
  padding: 3px;
  width: max-content;
}

.mines-cell {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: var(--face);
  font: bold 11px/16px Tahoma, sans-serif;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow:
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face-light);
}

.mines-cell.is-open {
  cursor: default;
  box-shadow: inset 1px 1px var(--face-dark);
}

.mines-cell.is-boom { background: #d40000; }

.mines-cell.is-wrong { position: relative; }

.mines-cell.is-wrong::after {
  content: "X";
  position: absolute;
  inset: 0;
  font: bold 15px/16px Tahoma, sans-serif;
  color: #d40000;
}

.mines-pic {
  display: block;
  width: 14px;
  height: 14px;
  margin: 1px;
}

.mines-cell.n1 { color: #0000ff; }
.mines-cell.n2 { color: #008000; }
.mines-cell.n3 { color: #ff0000; }
.mines-cell.n4 { color: #000080; }
.mines-cell.n5 { color: #800000; }
.mines-cell.n6 { color: #008080; }
.mines-cell.n7 { color: #000000; }
.mines-cell.n8 { color: #808080; }

.mines-best,
.mines-record,
.mines-hint { color: var(--muted); }

.mines-hint { max-width: 260px; }

.mines-record[hidden] { display: none; }

.mines-record-title { font-weight: bold; }

.mines-record-list {
  margin: 2px 0 0;
  padding-left: 22px;
  text-align: left;
}

.ttt {
  --face: #d4d0c8;
  --face-light: #ffffff;
  --face-dark: #808080;
  --face-darker: #404040;
  --sunken-bg: #d4d0c8;
  --text: #000000;
  --muted: #404040;
  color: var(--text);
  background: var(--face);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  width: max-content;
}

.ttt-status { font-weight: bold; }

.ttt-players { color: var(--muted); }

.ttt-field {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  gap: 2px;
  padding: 3px;
}

.ttt-cell {
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  background: var(--face);
  font: bold 30px/56px Tahoma, sans-serif;
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow:
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face-light);
}

.ttt-cell:disabled { cursor: default; }

.ttt-cell.is-x { color: #0000a8; }

.ttt-cell.is-o { color: #a80000; }

.ttt-cell:not(:disabled):active {
  box-shadow:
    inset 2px 2px var(--face-dark),
    inset -2px -2px var(--face-light);
}

.ttt-hint {
  max-width: 220px;
  text-align: center;
  color: var(--muted);
}

.ttt-ask {
  width: 100%;
  padding: 6px 8px;
  text-align: center;
  background: var(--face);
  box-shadow:
    inset -1px -1px var(--face-darker),
    inset 1px 1px var(--face-light),
    inset -2px -2px var(--face-dark),
    inset 2px 2px var(--face);
}

.ttt-ask[hidden] { display: none; }

.ttt-ask-text { font-weight: bold; }

.ttt-ask-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
}

.ttt-ask-row[hidden] { display: none; }

.ttt-sit[hidden] { display: none; }

.chat-record {
  color: var(--gold);
  font-weight: bold;
}

@media (max-width: 760px) {
  #playerCard { order: -2; }
  .chat-window { order: -1; }
  .tracks .t-name { min-width: 0; }
  .tracks th,
  .tracks td { padding-left: 4px; padding-right: 4px; }
  .req-btn { min-width: 0; }
}

@media (pointer: coarse) {
  .btn-vote,
  .btn-copy { min-height: 32px; padding: 2px 12px; }
  .btn-vote:active,
  .btn-copy:active { padding: 3px 11px 1px 13px; }
  .tb-btn { width: 26px; height: 22px; font-size: 12px; }
  .nav-item { padding: 8px 4px; }
  .vol input[type="range"] { height: 8px; }
  .vol input[type="range"]::-webkit-slider-thumb { width: 20px; height: 32px; }
  .vol input[type="range"]::-moz-range-thumb { width: 20px; height: 32px; }
}

.sol {
  --card-w: 71px;
  --card-h: 96px;
  --fan: 19px;
  --waste-shift: 16px;
  --pile-gap: 8px;
  --felt: #008000;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: max-content;
}

.sol-bar { display: flex; gap: 6px; }

.sol-board {
  position: relative;
  padding: 10px;
  background: var(--felt);
  box-shadow:
    inset 1px 1px var(--face-dark),
    inset -1px -1px var(--face-light),
    inset 2px 2px var(--face-darker);
}

.sol-row { display: flex; gap: var(--pile-gap); }

.sol-tab { margin-top: 14px; align-items: flex-start; }

.sol-pile {
  position: relative;
  flex: none;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
}

.sol-gap { flex: none; width: var(--card-w); }

.sol-col {
  height: auto;
  min-height: calc(var(--card-h) + 12 * var(--fan));
  box-shadow: none;
}

.sol-col::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--card-h);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
}

.sol-card {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--card-w);
  height: var(--card-h);
  background: #ffffff;
  border: 1px solid #000000;
  border-radius: 4px;
  color: #000000;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.sol-card.is-red { color: #c00000; }

.sol-card.is-back {
  background: var(--card-back, none) center / cover no-repeat, #ffffff;
}

.sol-card.is-picked { box-shadow: 0 0 0 2px #ffd24a; }

.sol-card.is-lifted { visibility: hidden; }

.sol-col .sol-card { top: calc(var(--shift, 0) * var(--fan)); }

.sol-waste .sol-card { left: calc(var(--shift, 0) * var(--waste-shift)); }

.sol-corner {
  position: absolute;
  top: 2px;
  left: 4px;
  font: bold 14px/1 Tahoma, sans-serif;
  text-align: center;
}

.sol-corner i { display: block; font-style: normal; font-size: 12px; }

.sol-pip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--card-w) * .45);
  line-height: 1;
}

.sol-drag {
  position: absolute;
  z-index: 5;
  width: var(--card-w);
  pointer-events: none;
}

.sol-drag .sol-card { top: calc(var(--shift, 0) * var(--fan)); }

.sol-cascade {
  position: absolute;
  inset: 0;
  z-index: 6;
  cursor: pointer;
}

.sol-cascade[hidden] { display: none; }

.sol-status { font-weight: bold; }

.sol-best-title { font-weight: bold; }

.sol-best-list {
  margin: 2px 0 0 18px;
  color: var(--muted);
}

.sol-best-none { list-style: none; margin-left: -18px; }

@media (max-width: 720px) {
  .sol {
    --card-w: 44px;
    --card-h: 62px;
    --fan: 13px;
    --waste-shift: 11px;
    --pile-gap: 4px;
  }

  .sol-corner { font-size: 11px; left: 2px; }
  .sol-corner i { font-size: 9px; }
}

@media (max-width: 700px) {
  .nav-bar { overflow: hidden; }
  .nav-item,
  .nav-item + .nav-item {
    margin-right: -2px;
    padding: 6px 8px;
    box-shadow: inset -1px 0 var(--face-dark), inset -2px 0 var(--face-light);
  }
}
