:root {
  color-scheme: dark;
  font-family: "Courier New", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #14110f;
  color: #fff2d0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 209, 102, 0.14), transparent 210px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 8px),
    #14110f;
}

.account-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.account-nav > span {
  color: var(--muted);
  font-size: 13px;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-modal[hidden],
[hidden] {
  display: none !important;
}

.login-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(5, 2, 10, 0.78);
  backdrop-filter: blur(5px);
}

.login-dialog {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  padding: 24px;
  border-color: #9858ba;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65), 0 0 40px rgba(207, 70, 255, 0.16);
}

.login-dialog .panel-title {
  align-items: flex-start;
}

.login-dialog label {
  margin-top: 12px;
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.role-login-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
  margin-top: 16px;
  border-top: 1px solid #4c365c;
  color: #bda8c8;
  font-size: 13px;
}

.role-login-links a {
  color: #f0b8ff;
}

.owner-chat-dialog {
  width: min(620px, 100%);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  max-height: 42vh;
  overflow-y: auto;
  padding: 12px;
  border: 2px solid #4c365c;
  background: #0d0814;
}

.chat-message {
  width: fit-content;
  max-width: 78%;
  padding: 9px 11px;
  border: 2px solid #513663;
  background: #24142f;
}

.chat-message.mine {
  align-self: flex-end;
  border-color: #548d6d;
  background: #193529;
}

.chat-message > span {
  display: block;
  margin-bottom: 5px;
  color: #bda8c8;
  font-size: 11px;
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-message img {
  display: block;
  max-width: min(100%, 320px);
  max-height: 240px;
  margin-bottom: 7px;
  object-fit: contain;
  image-rendering: auto;
}

.chat-actions,
.chat-transfer {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.chat-transfer label {
  flex: 1;
  margin: 0;
}

.file-button {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 8px 14px;
  margin: 0 !important;
  border: 2px solid #4f3c2c;
  background: #2b241e;
  cursor: pointer;
  box-shadow: 3px 3px 0 #080706;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.login-error {
  min-height: 20px;
  margin: 12px 0 0;
  color: #ff8ca0;
}

body.modal-open {
  overflow: hidden;
}

.hall-editor-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hall-layout-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 2px solid #7b4a91;
  border-radius: 8px;
  background:
    linear-gradient(to bottom, transparent 47%, #120b22 47%, #120b22 49%, transparent 49%),
    url('/assets/arcade/hall-base-v2.png') center / 100% 100% no-repeat;
  touch-action: none;
}

.hall-layout-item {
  position: absolute;
  min-width: 42px;
  min-height: 30px;
  transform: translate(-50%, -100%);
  display: grid;
  place-items: center;
  padding: 6px 8px;
  border: 2px solid #72e3ff;
  border-radius: 5px;
  color: #fff;
  background: #28143bd9;
  font-size: 11px;
  cursor: grab;
  user-select: none;
  box-shadow: 0 3px 0 #10091d;
}

.hall-layout-item.selected {
  border-color: #ffe36c;
  background: #6a2855e8;
}

.hall-layout-item.image-item {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-color: transparent;
  border-radius: 0;
  background-color: transparent;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: none;
}

.hall-layout-item.image-item.selected {
  border-color: #ffe36c;
  filter: drop-shadow(0 0 6px #ffe36c);
}

.hall-layout-item[data-kind='neon_sign'],
.hall-layout-item[data-kind='lamp'] {
  transform: translate(-50%, -50%);
}

body.player-authenticated #player-auth-panel .player-auth-fields,
.admin-panel,
#hall-mint,
#mint {
  display: none;
}

@media (max-width: 900px) {
  .account-nav {
    width: 100%;
    justify-content: flex-end;
  }

  .login-actions {
    grid-template-columns: 1fr;
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 2px solid #4f3c2c;
  border-radius: 0;
  background: #2b241e;
  color: #fff2d0;
  cursor: pointer;
  box-shadow: 3px 3px 0 #080706;
}

button:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  border-color: #ffd166;
  box-shadow: 4px 4px 0 #080706;
}

button:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #080706;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.primary {
  border-color: #7ee081;
  background: #1d5f38;
}

button.danger {
  border-color: #ff7a59;
  background: #6d2f25;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 2px solid #4f3c2c;
  border-radius: 0;
  background: #0d0b0a;
  color: #fff2d0;
  padding: 0 10px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
.screen:focus-visible {
  outline: 2px solid #7ee081;
  outline-offset: 2px;
}

textarea {
  padding: 9px 10px;
  resize: vertical;
}

input[readonly] {
  color: #ffd166;
}

select {
  appearance: none;
}

.shell {
  width: min(1600px, calc(100vw - 28px));
  margin: 20px auto 28px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.eyebrow,
p {
  margin: 0;
}

.eyebrow {
  margin-bottom: 6px;
  color: #b3a783;
  font-size: 12px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  color: #ffd166;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 0.96;
  text-shadow: 4px 4px 0 #6d2f25;
}

h2 {
  font-size: 16px;
}

.session-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 2px solid #4f3c2c;
  padding: 0 12px;
  background: #211b18;
  box-shadow: 3px 3px 0 #080706;
}

.session-pill strong,
.panel-title span,
.marquee strong {
  color: #7ee081;
  font-size: 12px;
  text-transform: uppercase;
}

.arcade-layout {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(320px, 380px);
  gap: 16px;
  align-items: start;
}

.admin-shell {
  max-width: 1180px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(520px, 1fr);
  gap: 16px;
  align-items: start;
}

.tenant-list-panel,
.admin-grid .timeline-panel {
  grid-column: 2;
}

.management-list {
  display: grid;
  gap: 10px;
}

.management-list.compact {
  max-height: 260px;
  overflow: auto;
}

.management-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(120px, 150px)) minmax(150px, auto);
  gap: 10px;
  align-items: end;
  border: 2px solid #4f3c2c;
  padding: 10px;
  background: #181310;
}

.management-item.compact {
  grid-template-columns: minmax(180px, 1fr) auto;
}

.management-item strong {
  display: block;
  color: #ffd166;
}

.management-item span {
  display: block;
  margin-top: 4px;
  color: #c7b98c;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.management-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.management-actions a {
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  border: 2px solid #4f3c2c;
  padding: 0 10px;
  background: #2b241e;
  color: #fff2d0;
  text-decoration: none;
  box-shadow: 3px 3px 0 #080706;
}

.management-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

body[data-view="hall"] .play-deck {
  display: none;
}

body[data-view="play"] .hall {
  display: none;
}

body[data-view="play"] .shell {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(320px, 380px);
  grid-template-areas:
    "topbar topbar"
    "screen controls";
  gap: 16px;
  align-items: start;
}

body[data-view="play"] .topbar {
  grid-area: topbar;
  margin-bottom: 0;
}

body[data-view="play"] .arcade-layout {
  grid-area: controls;
  display: block;
  width: 100%;
}

body[data-view="play"] .play-deck {
  grid-area: screen;
  margin-top: 0;
}

body[data-view="play"] .operator {
  width: 100%;
}

.hall,
.panel,
.cabinet {
  border: 2px solid #4f3c2c;
  background: #201915;
  box-shadow: 5px 5px 0 #080706;
}

.hall {
  min-height: 690px;
  padding: 16px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(26, 19, 23, 0.7), rgba(31, 25, 18, 0.92)),
    repeating-linear-gradient(45deg, #2a2017 0 18px, #231a14 18px 36px);
}

.hall-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.hall-header p {
  margin-top: 6px;
  color: #c7b98c;
  font-size: 13px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
  color: #d6c894;
  font-size: 12px;
}

.hall-hud {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-left: auto;
}

.hall-hud label {
  display: grid;
  gap: 4px;
  color: #c7b98c;
  font-size: 12px;
}

.hall-hud input {
  width: 150px;
  min-height: 34px;
}

.hall-hud button,
.hall-hud a {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 0 12px;
}

.hall-hud a {
  border: 2px solid #4f3c2c;
  background: #2b241e;
  color: #fff2d0;
  text-decoration: none;
  box-shadow: 3px 3px 0 #080706;
}

.hall-wallet {
  display: grid;
  align-content: center;
  min-height: 34px;
  border: 2px solid #4f3c2c;
  padding: 0 10px;
  background: #100d0b;
  color: #c7b98c;
  font-size: 12px;
}

.hall-wallet strong {
  color: #ffd166;
  font-size: 16px;
}

body[data-view="hall"] .arcade-layout {
  display: block;
}

body[data-view="hall"] .operator {
  display: none;
}

body[data-view="hall"] .hall {
  min-height: 0;
}

body[data-view="play"] .admin-panel {
  display: none;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dot,
.status-light {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #7ee081;
  box-shadow: 0 0 10px #7ee081;
}

.dot.busy,
.busy .status-light {
  background: #ff5d4f;
  box-shadow: 0 0 10px #ff5d4f;
}

.dot.seated,
.seated .status-light {
  background: #ffd166;
  box-shadow: 0 0 10px #ffd166;
}

.machine-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 18px 14px;
  align-items: end;
}

.hall-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 12px;
  margin-bottom: 16px;
}

.hall-actions summary,
.hall-gift-counter summary {
  cursor: pointer;
}

.hall .machine-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  align-items: stretch;
}

.classic-machine button {
  width: 100%;
}

.hall-gift-counter {
  margin-top: 16px;
}

.phaser-hall {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 3px solid #10091a;
  background: #160d28;
  box-shadow:
    0 0 0 3px #392153,
    0 14px 34px rgba(0, 0, 0, 0.45);
  image-rendering: pixelated;
}

.phaser-hall canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  border: 0;
  aspect-ratio: 16 / 9;
  image-rendering: pixelated;
}

.arcade-scene {
  position: relative;
  width: 1280px;
  min-height: 720px;
  overflow: hidden;
  border: 3px solid #111;
  background:
    linear-gradient(180deg, #20172b 0 170px, transparent 170px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 160px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 3px, transparent 3px 18px),
    #2a1d39;
  image-rendering: pixelated;
  box-shadow: inset 0 0 0 5px #31214a, inset 0 0 60px rgba(0, 0, 0, 0.55);
}

.scene-wall,
.scene-floor,
.scene-players {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene-wall {
  z-index: 1;
}

.scene-floor {
  top: 170px;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 40%, rgba(255, 209, 102, 0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 65%, rgba(126, 224, 129, 0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 45% 75%, rgba(255, 93, 79, 0.08) 0 2px, transparent 3px),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0 5px, transparent 5px 34px),
    #302044;
  background-size: 64px 64px, 78px 78px, 88px 88px, auto, auto;
}

.neon-sign,
.exit-sign,
.toilet-sign,
.ufo-sign {
  position: absolute;
  display: grid;
  place-items: center;
  border: 3px solid #20102e;
  background: #21152c;
  font-weight: 800;
  line-height: 0.95;
  text-align: center;
  text-shadow: 0 0 8px currentColor, 3px 3px 0 #070508;
}

.neon-sign {
  left: 410px;
  top: 28px;
  width: 250px;
  height: 88px;
  color: #f184ff;
  font-size: 34px;
  box-shadow: 0 0 18px rgba(241, 132, 255, 0.5);
}

.exit-sign {
  left: 56px;
  top: 58px;
  width: 90px;
  height: 34px;
  color: #7ee081;
  font-size: 22px;
}

.toilet-sign {
  left: 850px;
  top: 62px;
  width: 100px;
  height: 34px;
  color: #58a6ff;
  font-size: 20px;
}

.ufo-sign {
  right: 64px;
  top: 40px;
  width: 220px;
  height: 44px;
  color: #ff66bd;
  font-size: 24px;
}

.snack-bar {
  position: absolute;
  left: 370px;
  top: 115px;
  width: 330px;
  height: 95px;
  border: 5px solid #21120e;
  background:
    linear-gradient(90deg, #412018 0 62%, #6d3b24 62%),
    repeating-linear-gradient(90deg, #ffd166 0 14px, #7ee081 14px 25px, #ff7a59 25px 38px);
  box-shadow: 8px 8px 0 #0d0908;
}

.snack-bar::after {
  content: "";
  position: absolute;
  left: -18px;
  right: -18px;
  bottom: -42px;
  height: 48px;
  border: 5px solid #160c09;
  background: #5a2c1d;
}

.vending-machine {
  position: absolute;
  left: 720px;
  top: 112px;
  width: 72px;
  height: 150px;
  border: 5px solid #14101e;
  background:
    repeating-linear-gradient(0deg, #ffd166 0 10px, #58a6ff 10px 20px, #7ee081 20px 30px),
    #3b5dac;
  box-shadow: 7px 7px 0 #0d0908;
}

.plant,
.sofa,
.air-table {
  position: absolute;
  display: block;
}

.plant {
  width: 44px;
  height: 70px;
  border-bottom: 24px solid #7a5c42;
  background: radial-gradient(circle at 50% 34%, #3f9b55 0 8px, transparent 9px);
}

.plant-a {
  left: 810px;
  top: 140px;
}

.plant-b {
  left: 45px;
  top: 555px;
}

.sofa {
  left: 60px;
  top: 575px;
  width: 190px;
  height: 58px;
  border: 5px solid #260d12;
  background: #9b2d30;
  box-shadow: 8px 8px 0 #12080a;
}

.air-table {
  left: 500px;
  top: 595px;
  width: 230px;
  height: 84px;
  border: 6px solid #181923;
  background:
    radial-gradient(circle at 45% 45%, #ff5d4f 0 5px, transparent 6px),
    radial-gradient(circle at 65% 42%, #ffd166 0 4px, transparent 5px),
    linear-gradient(90deg, #345ba8 0 48%, #fff2d0 48% 52%, #345ba8 52%);
  box-shadow: 8px 8px 0 #0d0908;
}

.arcade-machine {
  position: relative;
  display: grid;
  gap: 7px;
  justify-items: center;
  min-height: 188px;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  color: #fff2d0;
  box-shadow: none;
}

.scene-machine {
  position: absolute;
  z-index: 20;
  width: 120px;
  min-height: 176px;
  transform-origin: center bottom;
}

.scene-machine:hover:not(:disabled) {
  transform: translateY(-5px);
}

.machine-sign {
  display: grid;
  place-items: center;
  min-width: 92px;
  min-height: 24px;
  border: 3px solid #211120;
  background: #202034;
  color: #ffd166;
  font-weight: 800;
  text-shadow: 0 0 7px currentColor;
}

.scene-machine.dance .machine-sign {
  color: #ff66bd;
}

.scene-machine.shooter .machine-sign {
  color: #58a6ff;
}

.scene-machine.race .machine-sign {
  color: #ff7a59;
}

.scene-machine.table .pixel-cabinet {
  transform: scaleX(1.25);
}

.arcade-machine:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: none;
}

.arcade-machine.selected .pixel-cabinet {
  outline: 3px solid #ffd166;
  outline-offset: 4px;
}

.arcade-machine.busy {
  cursor: help;
}

.machine-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 92px;
  color: #c7b98c;
  font-size: 12px;
}

.pixel-cabinet {
  position: relative;
  display: grid;
  grid-template-rows: 82px 34px 20px;
  width: 92px;
  image-rendering: pixelated;
  filter: drop-shadow(6px 7px 0 #080706);
}

.cabinet-bezel {
  display: grid;
  place-items: center;
  border: 4px solid #111;
  background: #b94034;
}

.cyan .cabinet-bezel {
  background: #2386a3;
}

.yellow .cabinet-bezel {
  background: #c89a28;
}

.green .cabinet-bezel {
  background: #2f8a55;
}

.blue .cabinet-bezel {
  background: #335dba;
}

.pink .cabinet-bezel {
  background: #b94780;
}

.cabinet-screen {
  width: 58px;
  height: 42px;
  border: 4px solid #050505;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 45%),
    #101610;
}

.busy .cabinet-screen {
  background:
    repeating-linear-gradient(0deg, #34100e 0 3px, #130907 3px 6px),
    #34100e;
}

.mine .cabinet-screen,
.seated .cabinet-screen {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 45%),
    #173522;
}

.cabinet-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-inline: 4px solid #111;
  background: #3a3028;
}

.cabinet-panel span {
  width: 8px;
  height: 8px;
  background: #ff5d4f;
}

.cabinet-panel span:nth-child(2) {
  background: #ffd166;
}

.cabinet-panel span:nth-child(3) {
  background: #7ee081;
}

.cabinet-base {
  border-inline: 8px solid transparent;
  border-top: 20px solid #14110f;
}

.machine-name {
  color: #fff2d0;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.machine-state {
  min-width: 56px;
  border: 1px solid #4f3c2c;
  padding: 2px 5px;
  background: #181310;
  color: #7ee081;
  font-size: 12px;
  text-align: center;
}

.busy .machine-state {
  color: #ff9280;
}

.seated .machine-state,
.mine .machine-state {
  color: #ffd166;
}

.operator {
  display: grid;
  gap: 12px;
}

.panel {
  padding: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #c7b98c;
  font-size: 13px;
}

.identity-panel {
  display: grid;
  gap: 10px;
}

.admin-panel {
  display: grid;
  gap: 10px;
}

.compact-list {
  display: grid;
  gap: 6px;
  max-height: 140px;
  overflow: auto;
}

.compact-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  border: 1px solid #4f3c2c;
  padding: 6px 8px;
  background: #181310;
  color: #e9dbac;
  font-size: 12px;
}

.compact-item button,
.machine-delete {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  padding: 0 8px;
  border: 2px solid #ff7a59;
  background: #6d2f25;
  color: #fff2d0;
  font-size: 12px;
}

.machine-delete.disabled {
  opacity: 0.45;
}

.scene-players {
  z-index: 200;
}

.pixel-player {
  position: absolute;
  width: 42px;
  height: 64px;
  transform: translate(-50%, -100%);
  transition: left 620ms steps(6), top 620ms steps(6);
  pointer-events: none;
}

.avatar-shadow,
.avatar-head,
.avatar-body,
.avatar-legs,
.avatar-name,
.speech {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.avatar-shadow {
  bottom: 0;
  width: 34px;
  height: 9px;
  background: rgba(0, 0, 0, 0.42);
}

.avatar-head {
  top: 6px;
  width: 24px;
  height: 24px;
  border: 3px solid #120c0a;
  background: #f0b174;
  box-shadow: inset 0 6px 0 #5a2c1d;
}

.avatar-body {
  top: 29px;
  width: 26px;
  height: 24px;
  border: 3px solid #120c0a;
  background: #2f8a55;
}

.avatar-body.color-0 {
  background: #335dba;
}

.avatar-body.color-1 {
  background: #b94780;
}

.avatar-body.color-2 {
  background: #2f8a55;
}

.avatar-body.color-3 {
  background: #c89a28;
}

.avatar-body.color-4 {
  background: #2386a3;
}

.avatar-body.color-5 {
  background: #b94034;
}

.avatar-legs {
  top: 50px;
  width: 22px;
  height: 12px;
  border-left: 7px solid #17161f;
  border-right: 7px solid #17161f;
}

.pixel-player.me .avatar-head {
  box-shadow: inset 0 6px 0 #1b1524, 0 0 0 3px #ffd166;
}

.pixel-player.walking .avatar-body {
  animation: player-bob 620ms steps(2) infinite;
}

.pixel-player.playing .avatar-body {
  box-shadow: 0 0 12px rgba(126, 224, 129, 0.7);
}

.pixel-player.clerk .avatar-body {
  background: #202034;
}

.avatar-name {
  top: 66px;
  padding: 2px 5px;
  border: 1px solid #4f3c2c;
  background: rgba(13, 11, 10, 0.86);
  color: #fff2d0;
  font-size: 11px;
  white-space: nowrap;
}

.speech {
  top: -34px;
  min-width: 58px;
  border: 2px solid #211120;
  padding: 4px 7px;
  background: #fff2d0;
  color: #181310;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 3px 3px 0 #080706;
}

.speech::after {
  content: "";
  position: absolute;
  left: 20px;
  bottom: -9px;
  width: 12px;
  height: 12px;
  background: #fff2d0;
  border-right: 2px solid #211120;
  border-bottom: 2px solid #211120;
}

@keyframes player-bob {
  from {
    transform: translateX(-50%) translateY(0);
  }
  to {
    transform: translateX(-50%) translateY(-3px);
  }
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 2px dashed #4f3c2c;
  color: #c7b98c;
  text-align: center;
}

.arcade-scene .empty-state {
  position: absolute;
  left: 330px;
  top: 330px;
  width: 560px;
  min-height: 150px;
  background: rgba(24, 19, 16, 0.84);
  z-index: 40;
}

.metrics {
  display: grid;
  gap: 8px;
  margin: 0;
}

.metrics div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  gap: 12px;
  border-bottom: 1px solid #4f3c2c;
}

.metrics div:last-child {
  border-bottom: 0;
}

dt {
  color: #c7b98c;
}

dd {
  margin: 0;
  color: #fff2d0;
  font-variant-numeric: tabular-nums;
}

.amount-row,
.action-grid,
.utility-row {
  display: grid;
  gap: 8px;
}

.amount-row {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 10px;
}

.action-grid,
.utility-row {
  grid-template-columns: 1fr 1fr;
}

.utility-row {
  margin-top: 8px;
}

.timeline-panel button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

pre {
  min-height: 172px;
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 2px solid #4f3c2c;
  background: #0d0b0a;
  color: #e9dbac;
  white-space: pre-wrap;
}

.play-deck {
  margin-top: 16px;
}

.cabinet {
  overflow: hidden;
}

.marquee {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 54px;
  padding: 0 16px;
  border-bottom: 2px solid #4f3c2c;
  background:
    repeating-linear-gradient(90deg, rgba(255, 209, 102, 0.15) 0 8px, transparent 8px 16px),
    #2b241e;
}

.marquee span {
  color: #ffd166;
  font-size: 18px;
  font-weight: 800;
  text-shadow: 3px 3px 0 #080706;
}

.screen {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(300px, 38vw, 580px);
  padding: 18px;
  background:
    radial-gradient(circle at 50% 40%, rgba(126, 224, 129, 0.08), transparent 36%),
    #080706;
  outline: none;
}

canvas,
iframe {
  width: min(100%, 840px);
  border: 3px solid #111;
  background: #050605;
}

canvas {
  aspect-ratio: 4 / 3;
  image-rendering: pixelated;
}

iframe {
  height: min(52vw, 620px);
  min-height: 260px;
}

.screen-overlay {
  position: absolute;
  inset: auto 28px 28px;
  display: grid;
  gap: 5px;
  max-width: 380px;
  padding: 12px;
  border: 2px solid #ffd166;
  background: rgba(13, 11, 10, 0.88);
  color: #e9dbac;
}

.screen-overlay strong {
  color: #ffd166;
}

.screen-overlay span {
  font-size: 13px;
}

.cabinet-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-height: 56px;
  padding: 10px 16px;
  border-top: 2px solid #4f3c2c;
  background: #201915;
}

.muted {
  color: #c7b98c;
}

.cabinet-footer strong {
  display: block;
  font-size: 13px;
}

.runtime-link {
  color: #7ee081;
  text-align: right;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.runtime-link[href="#"] {
  color: #c7b98c;
}

body[data-phase="running"] .session-pill strong,
body[data-phase="running"] .marquee strong {
  color: #7ee081;
}

body[data-phase="seated"] .session-pill strong,
body[data-phase="seated"] .marquee strong {
  color: #ffd166;
}

@media (max-width: 1060px) {
  .admin-grid,
  .arcade-layout {
    grid-template-columns: 1fr;
  }

  .tenant-list-panel,
  .admin-grid .timeline-panel {
    grid-column: auto;
  }

  .management-item,
  .management-item.compact {
    grid-template-columns: 1fr;
  }

  .management-actions {
    justify-content: start;
  }

  body[data-view="play"] .shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "screen"
      "controls";
  }

  body[data-view="play"] .play-deck,
  body[data-view="play"] .arcade-layout {
    grid-column: 1;
  }

  .hall {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .topbar,
  .hall-header,
  .cabinet-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .legend {
    justify-content: start;
  }

  .hall-hud {
    width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .machine-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .amount-row,
  .action-grid,
  .utility-row {
    grid-template-columns: 1fr;
  }

  .runtime-link {
    text-align: left;
  }
}
