:root {
  color-scheme: dark;
  --orange: #ff5a1f;
  --orange-hot: #ff7443;
  --green: #53d98c;
  --red: #ff6b5f;
  --ink: #f8f6f2;
  --muted: #99948d;
  --line: #34322f;
  --black: #090909;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 240px;
  height: 282px;
  margin: 0;
  overflow: hidden;
  background: var(--black);
}

body {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

button {
  color: inherit;
  font: inherit;
}

[hidden] {
  display: none !important;
}

.remote {
  position: relative;
  display: flex;
  width: 240px;
  height: 282px;
  flex-direction: column;
  padding: 13px 12px 10px;
  background:
    radial-gradient(circle at 92% -5%, rgba(255, 90, 31, 0.19), transparent 33%),
    var(--black);
}

.remote::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 68px;
  height: 3px;
  background: var(--orange);
  content: "";
}

.topbar {
  display: flex;
  height: 43px;
  flex: 0 0 43px;
  align-items: flex-start;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 1px;
  color: var(--orange);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.24em;
  line-height: 1;
}

h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1;
}

.connection-badge {
  max-width: 86px;
  overflow: hidden;
  padding: 4px 6px 3px;
  border: 1px solid rgba(255, 90, 31, 0.65);
  border-radius: 4px;
  color: var(--orange-hot);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-badge.paired {
  border-color: rgba(83, 217, 140, 0.52);
  color: var(--green);
}

.connection-badge.error {
  border-color: rgba(255, 107, 95, 0.58);
  color: var(--red);
}

.selector,
.pair-panel {
  height: 91px;
  flex: 0 0 91px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(160deg, #1f1e1c, #131312);
  overflow: hidden;
}

.selector {
  display: grid;
  grid-template-columns: 35px 1fr 35px;
  align-items: stretch;
}

.nav-button,
.destination,
.select-button,
.retry-button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.nav-button {
  padding: 0;
  background: transparent;
  color: #726d66;
  font-family: Georgia, serif;
  font-size: 37px;
  line-height: 1;
}

.nav-button:active:not(:disabled) {
  color: var(--orange);
  background: rgba(255, 255, 255, 0.035);
}

.nav-button:disabled,
.destination:disabled {
  cursor: default;
  opacity: 0.38;
}

.destination {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 0 1px;
  background: transparent;
  text-align: center;
}

.destination-kind {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.19em;
}

.destination strong {
  max-width: 128px;
  overflow: hidden;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.position {
  display: flex;
  margin-top: 10px;
  gap: 5px;
}

.position i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #4a4743;
}

.position i.active {
  background: var(--orange);
  transform: scale(1.35);
}

.pair-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.panel-label {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.pair-code {
  color: var(--orange-hot);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.1;
}

.pair-help {
  width: 188px;
  margin: 5px 0 0;
  color: #8e8982;
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.05em;
  line-height: 1.25;
}

.live-line {
  display: flex;
  height: 30px;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: #8e8982;
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.075em;
}

.live-line span {
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: #75716c;
}

.live-line b {
  margin-right: 4px;
  color: #75716c;
}

.live-line.confirmed span {
  background: var(--green);
  box-shadow: 0 0 6px rgba(83, 217, 140, 0.55);
}

.live-line.confirmed b {
  color: var(--green);
}

.live-line.error span {
  background: var(--red);
}

.live-line.error b {
  color: var(--red);
}

.live-line em {
  max-width: 125px;
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-button {
  display: flex;
  height: 62px;
  flex: 0 0 62px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--orange);
  box-shadow: 0 8px 22px rgba(255, 90, 31, 0.15);
  color: #130b07;
  transform: translateZ(0);
  transition: background 110ms ease, color 110ms ease, transform 110ms ease;
}

.select-button:active:not(:disabled),
.select-button.pressed:not(:disabled) {
  background: var(--ink);
  color: var(--black);
  transform: scale(0.975);
}

.select-button.pending {
  background: #d44b19;
  color: #180a04;
}

.select-button.live {
  background: var(--green);
  color: #06170d;
}

.select-button.failed {
  background: var(--red);
  color: #1e0806;
}

.select-button:disabled {
  cursor: default;
  box-shadow: none;
  opacity: 0.58;
}

.select-label {
  max-width: 198px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-button small {
  margin-top: 4px;
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.11em;
  opacity: 0.67;
}

.status-line {
  display: flex;
  min-height: 33px;
  flex: 1;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 2px 1px;
  color: #6f6b65;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.045em;
  white-space: nowrap;
}

.status-line > span {
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.retry-button {
  padding: 2px 4px;
  border: 1px solid #4a4743;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font-size: 7px;
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
