#phoneConnection,
#phoneConnection * {
  box-sizing: border-box;
}

body.racer-platform {
  margin: 0;
  overflow: hidden;
  background: #05070b;
}

body.racer-platform #controls,
body.racer-platform #instructions {
  display: none;
}

body.racer-platform #racer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  border: 0;
  overflow: hidden;
}

body.racer-platform #canvas {
  width: 100vw;
  height: 100vh;
}

body.racer-platform #hud {
  width: 100vw;
}

body.racer-platform #mute {
  position: fixed;
  z-index: 5;
  left: 12px;
  bottom: 12px;
  margin-left: 0;
}

#phoneConnection {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#phoneConnection.hidden {
  display: none;
}

#phoneConnection .panel {
  width: min(360px, calc(100% - 32px));
  padding: 22px;
  border: 1px solid rgba(63, 241, 255, 0.36);
  border-radius: 8px;
  background: rgba(6, 9, 15, 0.9);
  box-shadow: 0 0 36px rgba(0, 229, 255, 0.22);
  color: #eef7ff;
  pointer-events: auto;
  text-align: center;
}

#phoneConnection h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: 0;
}

#phoneConnection p {
  margin: 6px 0;
  color: #9fb0c5;
  font-size: 12px;
  font-weight: 800;
}

#phoneConnection .qr {
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  margin: 16px auto;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
}

#phoneConnection .qr svg,
#phoneConnection .qr img {
  width: 100%;
  height: 100%;
  display: block;
}

#phoneConnection .controllerLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 4px 0 8px;
  padding: 0 12px;
  border: 1px solid rgba(93, 255, 155, 0.38);
  border-radius: 8px;
  background: rgba(93, 255, 155, 0.1);
  color: #5dff9b;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

#phoneConnection .room {
  display: inline-block;
  margin: 4px 0 8px;
  padding: 8px 12px;
  border: 1px solid rgba(63, 241, 255, 0.32);
  border-radius: 8px;
  background: rgba(63, 241, 255, 0.08);
  color: #3ff1ff;
  font-size: 20px;
  font-weight: 900;
}

#phoneConnection .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffd966;
}

#phoneConnection .dot,
#phoneStatus .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ffd966;
  box-shadow: 0 0 14px currentColor;
}

#phoneConnection.connected .status {
  color: #5dff9b;
}

#phoneConnection.connected .dot,
#phoneStatus.connected .dot {
  background: #5dff9b;
}

#phoneConnection button,
#showQrButton {
  min-height: 34px;
  border: 1px solid rgba(63, 241, 255, 0.42);
  border-radius: 8px;
  background: rgba(63, 241, 255, 0.12);
  color: #eef7ff;
  cursor: pointer;
  font: 800 12px Inter, system-ui, sans-serif;
}

#phoneConnection .actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

#phoneConnection .actions button {
  padding: 0 14px;
}

#phoneStatus {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.58);
  color: #ffd966;
  font: 800 11px Inter, system-ui, sans-serif;
}

#phoneStatus.connected {
  color: #5dff9b;
}

#showQrButton {
  position: absolute;
  z-index: 3;
  left: 10px;
  bottom: 10px;
  padding: 0 12px;
}

#remoteDebug {
  position: absolute;
  z-index: 3;
  left: 10px;
  top: 42px;
  min-width: 150px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.56);
  color: #c9d7ea;
  font: 11px Consolas, monospace;
}

#remoteDebug.hidden {
  display: none;
}

#remoteDebug p {
  margin: 2px 0;
}
