:root {
  --canvas-w: 1280px;
  --canvas-h: 720px;
  --margin-x: 20px;
  --margin-y: 10px;
  --game-w: 933px;
  --game-h: 700px;
  --rail-w: 291px;
  --gap: 16px;
  --ink: #fff2b7;
  --paper: #f8e6a0;
  --muted: #a8d8c1;
  --dim: #70958b;
  --black: #07090f;
  --deep: #0d1424;
  --blue: #172e59;
  --cyan: #49d7d1;
  --green: #77d66b;
  --gold: #ffd65a;
  --red: #ff5c7a;
  --line: #31486b;
  --line-hot: #e8c65e;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: transparent;
  color: var(--ink);
  font-family: "Fira Code", "Courier New", Consolas, monospace;
}

.overlay {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: var(--canvas-w);
  min-height: var(--canvas-h);
  pointer-events: none;
  text-rendering: geometricPrecision;
}

.overlay::after {
  display: none;
}

.game-frame {
  position: absolute;
  left: var(--margin-x);
  top: var(--margin-y);
  width: var(--game-w);
  height: var(--game-h);
  border: 3px solid #0b0d12;
  box-shadow:
    0 0 0 2px rgba(232, 198, 94, 0.7),
    4px 4px 0 rgba(0, 0, 0, 0.72);
}

.frame-line {
  position: absolute;
  display: block;
  background: rgba(73, 215, 209, 0.35);
  pointer-events: none;
}

.frame-line-top,
.frame-line-bottom {
  left: 18px;
  right: 18px;
  height: 2px;
}

.frame-line-top {
  top: 14px;
}

.frame-line-bottom {
  bottom: 14px;
}

.frame-line-left,
.frame-line-right {
  top: 14px;
  bottom: 14px;
  width: 2px;
}

.frame-line-left {
  left: 14px;
}

.frame-line-right {
  right: 14px;
}

.side-panel {
  position: absolute;
  top: var(--margin-y);
  right: var(--margin-x);
  width: var(--rail-w);
  height: var(--game-h);
  display: grid;
  grid-template-rows: 104px 178px 124px 124px 1fr;
  gap: 8px;
  padding: 10px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 4px),
    linear-gradient(180deg, rgba(7, 13, 29, 0.98), rgba(5, 8, 16, 0.98));
  border-left: 4px solid #0b0d12;
  box-shadow: -4px 0 0 rgba(255, 214, 90, 0.42);
}

.brand-block,
.card,
.bottom-strip {
  border: 2px solid var(--line);
  border-radius: 2px;
  background: rgba(7, 9, 15, 0.94);
  box-shadow:
    inset 0 0 0 2px rgba(255, 242, 183, 0.06),
    4px 4px 0 rgba(0, 0, 0, 0.72);
}

.brand-block {
  display: grid;
  align-content: start;
  min-width: 0;
  padding: 9px 11px;
  border-color: var(--line-hot);
  background:
    linear-gradient(180deg, rgba(23, 46, 89, 0.92), rgba(7, 9, 15, 0.95)),
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(255, 214, 90, 0.06) 10px 12px);
}

.live-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 19px;
  padding: 0 7px;
  border: 2px solid var(--green);
  border-radius: 2px;
  background: #102b21;
  color: #d9ffd0;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(119, 214, 107, 0.25);
}

.kicker {
  margin: 9px 0 2px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

h1 {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--gold);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 3px 3px 0 #111827;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtitle {
  margin: 7px 0 0;
  color: var(--paper);
  font-size: 12px;
  font-weight: 900;
}

.card {
  min-width: 0;
  overflow: hidden;
}

.card.hidden,
.bottom-strip.hidden {
  display: none;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 6px 8px;
  border-bottom: 2px solid var(--line);
  background: #111c31;
}

.card-heading span,
.strip-label {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.card-heading small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-cluster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 9px;
}

.command-cluster span,
.strip-commands span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 30px;
  gap: 6px;
  overflow: visible;
  border: 2px solid #293a5b;
  border-radius: 2px;
  background: #111827;
  color: var(--paper);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.command-cluster span {
  padding: 5px 6px;
  min-height: 22px;
  font-size: 10px;
}

.strip-commands span {
  min-height: 26px;
  padding: 4px 8px;
}

code {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 22px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid #9a7728;
  border-radius: 1px;
  background: #3c3218;
  color: #fff0a8;
  font-family: "Fira Code", "Courier New", Consolas, monospace;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.32);
}

.rank-list,
.message-list {
  list-style: none;
  margin: 0;
  padding: 7px 9px;
}

.rank-list {
  display: grid;
  gap: 5px;
}

.rank-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) minmax(30px, auto);
  align-items: center;
  gap: 6px;
  min-height: 24px;
  overflow: hidden;
  border: 1px solid #213454;
  background: #101723;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.small-list li {
  min-height: 24px;
}

.rank {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 3px;
  border: 1px solid #399490;
  background: #12343f;
  color: #a8fff6;
  font-size: 10px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.player-name,
.vote-name {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  line-height: 1.1;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.count {
  min-width: 30px;
  margin-right: 5px;
  padding: 3px 6px;
  border: 1px solid #9a7728;
  background: #3a3017;
  color: #ffe58b;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.message-list {
  display: grid;
  gap: 6px;
  max-height: none;
  overflow: hidden;
}

.message-list li {
  display: -webkit-box;
  overflow: hidden;
  color: var(--paper);
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.empty-state {
  display: block !important;
  min-height: 28px;
  padding: 7px 8px;
  color: var(--dim);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.bottom-strip {
  position: absolute;
  left: calc(var(--margin-x) + 8px);
  bottom: 24px;
  width: calc(var(--game-w) - 16px);
  min-height: 46px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-color: var(--line-hot);
  background:
    linear-gradient(90deg, rgba(7, 9, 15, 0.96), rgba(13, 20, 36, 0.9)),
    repeating-linear-gradient(90deg, rgba(73, 215, 209, 0.06) 0 10px, transparent 10px 20px);
}

.strip-label {
  color: var(--cyan);
  white-space: nowrap;
  text-shadow: 2px 2px 0 #0b0d12;
}

.strip-commands {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  overflow: hidden;
}

.strip-commands span:first-child code + code {
  margin-left: -3px;
}

.strip-commands code + code {
  margin-left: -3px;
}

@media (max-width: 1000px) {
  .overlay {
    transform: scale(calc(100vw / 1280));
    transform-origin: top left;
  }
}
