@charset "UTF-8";
:root {
  color-scheme: dark;
  font-family: Arial, 'Segoe UI', sans-serif;
  color: #dededb;
  background: #151515;
  font-synthesis: none;
  --muted: #92928b;
  --line: #33332f;
  --accent: #ded5b8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  color: inherit;
  cursor: pointer;
  background: #252523;
  border: 1px solid #41413b;
  border-radius: 4px;
  padding: 9px 13px;
}
button:hover {
  background: #33332e;
}
button:disabled {
  opacity: 0.38;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
}
h1,
h2,
p {
  margin: 0;
}
h2 {
  font-size: 19px;
  font-weight: 500;
}
.icon-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.player {
  min-height: 100svh;
  overflow: hidden;
  background: #151515;
}
.topbar {
  height: 76px;
  max-width: 1240px;
  margin: auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #2c2c28;
}
.brand {
  text-decoration: none;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -1px;
}
.brand span {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 2px;
}
.connection {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.status-dot,
.device-led {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #696963;
}
.status-dot.ready,
.device-led.on {
  background: #a7b889;
}
.status-dot.error {
  background: #d88a72;
}
.menu-button {
  font-size: 20px;
  letter-spacing: 2px;
  border: 0;
  background: none;
  padding: 8px 4px;
}
.session-heading {
  max-width: 640px;
  height: 58px;
  margin: auto;
  padding: 18px 20px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.session-heading h1 {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-heading #runStatus {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.transport {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.transport button {
  border: 0;
  background: none;
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  padding: 8px 11px;
}
.transport button:hover {
  background: #2b2b27;
}
.transport button:first-child {
  color: var(--accent);
}
.screen-area {
  --lcd: min(440px, calc(100vw - 40px), max(220px, calc((100svh - 210px) * 0.48)));
  position: relative;
  height: calc(var(--lcd) * 850 / 440);
  isolation: isolate;
  overflow: hidden;
}
.device-label {
  position: absolute;
  top: 16px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.6px;
}
.device-shell {
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: calc(var(--lcd) * 1000 / 440);
  height: 100%;
  z-index: 0;
}
.device-shell > svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 14px 18px #0008);
}
.device-shell:empty:before {
  content: '';
  position: absolute;
  left: 24.5%;
  right: 24.5%;
  top: 8%;
  bottom: 2%;
  border: 1px solid #585851;
  border-radius: 36px;
  background: linear-gradient(125deg, #383835, #222220 45%, #31312d);
}
[data-kind='player'] .device-shell:empty:before {
  left: 7%;
  right: 7%;
  top: 9%;
  bottom: 35%;
  border-radius: 50px;
}
.lcd-window {
  position: absolute;
  left: 50%;
  top: calc(var(--lcd) * 110 / 440);
  transform: translateX(-50%);
  width: var(--lcd);
  aspect-ratio: 5/4;
  background: #000;
  z-index: 2;
  overflow: hidden;
  box-shadow:
    0 0 0 3px #151515,
    0 0 0 5px #58564e,
    0 5px 14px #0008;
}
.lcd-window canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  image-rendering: pixelated;
  max-width: 100%;
  max-height: 100%;
  background: #000;
}
.screen-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px;
  text-align: center;
  color: #cac8bb;
  font-size: 12px;
  background: #11120f;
}
.screen-empty strong {
  font-size: 17px;
  font-weight: 400;
}
.screen-empty span {
  font-size: 11px;
  color: #92968a;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.screen-empty button {
  font-size: 11px;
  background: #242820;
  border-color: #4b5140;
}
.error-banner {
  position: absolute;
  inset: 0;
  background: #14100ee8;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  font-size: 13px;
}
.error-banner strong {
  font-weight: 400;
}
.error-banner button {
  font-size: 12px;
}
.drag-over .lcd-window {
  outline: 2px solid var(--accent);
}
.controls {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: calc(var(--lcd) * 1000 / 440);
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
.controls button {
  pointer-events: auto;
  position: absolute;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(9px, 1.1vw, 13px);
  padding: 0;
  background: #232321e8;
  border: 1px solid #8d8c8055;
  border-radius: 8px;
  box-shadow: 0 2px 3px #0009;
  min-height: 28px;
}
.controls button.held {
  background: #bcb397;
  color: #151515;
  box-shadow: 0 0 10px #ddcda544;
}
.controls button:hover {
  border-color: #ded5b8;
}
.controls button:disabled {
  opacity: 0.55;
}
.session-note {
  height: 50px;
  padding: 7px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  overflow: auto;
}
.session-note span {
  display: block;
}
.page-footer {
  display: flex;
  gap: 24px;
  justify-content: center;
  padding: 18px 20px 25px;
  font-size: 11px;
  color: var(--muted);
}
.page-footer a {
  text-decoration: none;
}
.page-footer a:hover {
  color: var(--accent);
}
dialog {
  color: #dededb;
  background: #1b1b19;
  border: 1px solid #494940;
  border-radius: 7px;
  padding: 24px;
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100svh - 28px);
  overflow: auto;
}
dialog::backdrop {
  background: #0009;
  backdrop-filter: blur(3px);
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.dialog-header button {
  border: 0;
  background: none;
  font-size: 24px;
  padding: 0 4px;
}
.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  margin: 0;
  width: min(390px, 100vw);
  height: 100svh;
  max-height: 100svh;
  border: 0;
  border-right: 1px solid #4b4b43;
  border-radius: 0;
  padding: 22px;
  overscroll-behavior: contain;
}
.drawer .dialog-header {
  position: sticky;
  top: -22px;
  margin: 0 -1px 16px;
  padding: 14px 0;
  background: #1b1b19;
  z-index: 1;
}
.library-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 6px;
  margin-bottom: 14px;
}
.library-tabs button {
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 6px;
  border-bottom: 2px solid transparent;
}
.library-tabs button.selected {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.library-tabs span {
  font-size: 10px;
  margin-left: 3px;
}
.search-field {
  display: flex;
  align-items: center;
  border: 1px solid #44443d;
  border-radius: 4px;
  padding: 8px 10px;
  gap: 8px;
}
.search-field input {
  width: 100%;
  background: none;
  border: 0;
  outline: 0;
  color: inherit;
  font-size: 13px;
}
.library-hint {
  font-size: 10px;
  color: var(--muted);
  padding: 12px 0;
}
.library-list {
  max-height: 48svh;
  min-height: 180px;
  overflow: auto;
  overscroll-behavior: contain;
}
.library-item {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: none;
  display: flex;
  text-align: left;
  gap: 10px;
  align-items: center;
  padding: 11px 4px;
  border-bottom: 1px solid #2b2b27;
}
.library-item.active {
  background: #34342e;
}
.library-item .item-art {
  font-size: 9px;
  color: #a5a590;
  width: 28px;
  flex: none;
}
.item-copy {
  flex: 1;
  min-width: 0;
}
.item-title {
  font-size: 12px;
  display: block;
}
.item-subtitle {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
.verified-mark {
  color: #aaa994;
}
.research-mark {
  color: #b9a086;
}
.item-arrow {
  color: var(--muted);
}
.unavailable {
  opacity: 0.65;
}
.library-footer {
  padding: 14px 0 7px;
}
.local-note,
.fine-print,
.setup-hint,
.panel-description {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 8px 0 13px;
}
.setup-hint {
  color: #beb796;
}
.firmware-panel {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.small-heading {
  display: flex;
  gap: 8px;
  align-items: center;
}
.small-heading h2 {
  font-size: 15px;
}
.field-label,
dialog label {
  font-size: 12px;
  display: block;
  margin: 12px 0 8px;
}
select {
  width: 100%;
  padding: 10px;
  background: #252522;
  color: inherit;
  border: 1px solid #49493f;
  border-radius: 3px;
}
.wide {
  width: 100%;
  margin: 9px 0;
}
.quick-states {
  display: grid;
  gap: 6px;
}
.quick-state {
  display: flex;
  justify-content: space-between;
  text-align: left;
  font-size: 11px;
}
.menu-actions {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}
.menu-actions button {
  text-align: left;
}
#help p,
#errorText {
  font-size: 13px;
  line-height: 1.8;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: #e2dfcf;
  color: #191914;
  padding: 13px 18px;
  border-radius: 4px;
  max-width: calc(100vw - 30px);
  width: max-content;
  font-size: 12px;
  z-index: 10;
}
body > footer {
  display: none;
}
#player:fullscreen {
  overflow: auto;
}
.empty-list {
  font-size: 12px;
  color: var(--muted);
  padding: 20px 0;
}
@media (max-width: 600px) {
  .topbar {
    height: 64px;
    padding: 0 18px;
  }
  .brand {
    font-size: 22px;
  }
  .brand span {
    font-size: 8px;
  }
  .connection {
    font-size: 9px;
    max-width: 120px;
  }
  .session-heading {
    height: 52px;
    padding: 13px 20px 5px;
  }
  .transport {
    height: 44px;
  }
  .transport button {
    font-size: 11px;
    padding: 8px;
  }
  .transport button:last-child span {
    display: none;
  }
  .screen-area {
    --lcd: min(440px, calc(100vw - 36px));
    height: calc(var(--lcd) * 1.86 + 48px);
  }
  .device-shell {
    height: calc(var(--lcd) * 850 / 440);
  }
  .device-label {
    top: 12px;
    font-size: 9px;
  }
  .controls {
    height: auto;
    top: calc(var(--lcd) * 1.14 + 50px);
    width: min(330px, calc(100vw - 44px));
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }
  .controls button {
    position: static !important;
    width: auto !important;
    height: 31px !important;
    font-size: 11px;
    min-height: 31px;
  }
  [data-device='anycall'] .controls button[data-key='digit0'] {
    grid-column: 2;
  }
  .screen-area[data-kind='player'] .controls {
    grid-template-columns: repeat(3, 1fr);
  }
  .screen-area[data-kind='player'] .controls button {
    height: 46px !important;
  }
  .device-shell {
    opacity: 0.8;
  }
  .session-note {
    height: 60px;
  }
  .page-footer {
    padding-top: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

.menu-button {
  margin-left: auto;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  margin-right: 6px;
}
.volume-control input {
  width: 70px;
  accent-color: #c5baa0;
  cursor: pointer;
}
.volume-control output {
  width: 28px;
  text-align: right;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-width: 600px) {
  .volume-control input {
    width: 54px;
  }
  .volume-control {
    gap: 3px;
    margin-right: 0;
  }
  .transport button {
    padding: 8px 6px;
  }
}

@media (min-width: 601px) {
  .has-photo .controls button {
    color: transparent;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }
  .has-photo .controls button:hover,
  .has-photo .controls button:focus-visible {
    background: #fff2;
    color: #fff;
    border-color: #ddd8;
  }
  .has-photo .controls button.held {
    background: #d5c79866;
    color: white;
  }
  .has-photo .controls button[data-key='mode'],
  .has-photo .controls button[data-key='rec'] {
    color: #c9c4b6;
    background: #151515b0;
    font-size: 10px;
    height: 4% !important;
  }
}

@media (max-width: 600px) {
  .screen-area {
    height: calc(var(--lcd) * 1.14 + 350px);
  }
}

.screen-area {
  --lcd: min(440px, calc(100vw - 40px));
}
@media (min-width: 601px) {
  .has-photo[data-kind='phone'] .controls button {
    color: #dedbd3;
    background: #242422c9;
    border-color: #a19a8060;
    box-shadow: 0 1px 2px #0008;
    font-size: 11px;
  }
}
@media (max-width: 600px) {
  .screen-area {
    --lcd: min(440px, calc(100vw - 36px));
  }
}

#help {
  width: min(760px, calc(100vw - 24px));
}
.binding-scope {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.binding-scope select {
  width: 150px;
}
.binding-scope label {
  margin: 0;
}
.binding-row {
  display: grid;
  grid-template-columns: 105px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #33332e;
}
.binding-action {
  font-size: 12px;
}
.binding-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.binding-chip {
  display: inline-flex;
  border: 1px solid #44443b;
  border-radius: 3px;
  overflow: hidden;
}
.binding-chip button {
  border: 0;
  border-radius: 0;
  font-size: 11px;
  padding: 6px 8px;
  background: #242421;
}
.binding-chip button + button {
  border-left: 1px solid #44443b;
}
.binding-actions {
  display: flex;
  gap: 4px;
}
.binding-actions button {
  padding: 6px 8px;
  font-size: 11px;
}
#bindingCapture,
#bindingConflict {
  padding: 14px;
  border: 1px solid #827b65;
  background: #26251f;
  margin: 12px 0;
  position: sticky;
  top: 0;
  z-index: 2;
}
#capturePad {
  padding: 20px 8px;
  margin: 10px 0;
  border: 1px dashed #77715d;
  font-size: 13px;
  line-height: 1.6;
  cursor: crosshair;
}
#gamepadStatus {
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .binding-row {
    grid-template-columns: 78px 1fr;
    gap: 8px;
  }
  .binding-actions {
    grid-column: 2;
  }
  .binding-scope {
    gap: 8px;
  }
  .binding-chip button {
    padding: 8px;
  }
  .binding-actions button {
    padding: 8px;
  }
}
