* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #05030f;
  color: #fff;
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#drive-ov-canvas {
  pointer-events: none;
}

#fade {
  position: fixed;
  inset: 0;
  background: #05030f;
  opacity: 1;
  transition: opacity 0.55s ease;
  pointer-events: none;
  z-index: 30;
}

#boot-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090b1a;
  color: rgba(255, 240, 224, 0.88);
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  z-index: 40;
}

.ui { transition: opacity 0.55s ease; z-index: 10; }
body.idle .ui, body.cinema .ui { opacity: 0; pointer-events: none; }
body.idle, body.cinema { cursor: none; }

#brand {
  position: fixed;
  top: 18px;
  left: 22px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
#brand b {
  font-weight: 700;
  letter-spacing: 0.30em;
  font-size: 13px;
  color: #ffd8b0;
}
#brand span {
  display: block;
  font-weight: 300;
  font-size: 22px;
  margin-top: 3px;
  opacity: 0.94;
}
#brand i {
  display: block;
  font-style: normal;
  font-weight: 300;
  font-size: 13px;
  opacity: 0.72;
  margin-top: 2px;
}

#hint {
  position: fixed;
  top: 20px;
  right: 22px;
  font-size: 12px;
  font-weight: 300;
  opacity: 0.62;
  text-align: right;
  line-height: 1.7;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

#bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: calc(100% - 20px);
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(12, 10, 26, 0.52);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}

.grp { display: flex; gap: 5px; align-items: center; }
.sep { width: 1px; height: 20px; background: rgba(255, 255, 255, 0.16); margin: 0 3px; }
.brk { flex-basis: 100%; height: 0; }

button, .btn {
  font: 500 12.5px 'Outfit', system-ui, sans-serif;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
button:hover, .btn:hover { background: rgba(255, 255, 255, 0.19); }
button.on { background: #fff; color: #14122a; border-color: #fff; }
button:disabled { opacity: 0.34; cursor: default; pointer-events: none; }

input[type="range"] { width: 84px; accent-color: #ffd8b0; cursor: pointer; }
label.s { font-size: 12px; opacity: 0.72; }
#track {
  font-size: 12px;
  opacity: 0.8;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#kmh {
  font-size: 12px;
  min-width: 58px;
  opacity: 0.88;
  font-variant-numeric: tabular-nums;
}

#panel {
  position: fixed;
  right: 18px;
  top: 90px;
  width: min(368px, calc(100% - 24px));
  max-height: calc(100% - 230px);
  overflow: auto;
  padding: 15px;
  border-radius: 18px;
  background: rgba(12, 10, 26, 0.74);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.sec { display: flex; flex-direction: column; gap: 10px; }
.gtitle { font-weight: 700; font-size: 14px; letter-spacing: 0.04em; }
.gtitle span { font-weight: 300; opacity: 0.62; margin-left: 8px; font-size: 12px; letter-spacing: 0; }
.lbl { font-size: 12px; opacity: 0.62; margin-top: 4px; }
.wrap { flex-wrap: wrap; }
.note { font-size: 12px; opacity: 0.66; line-height: 1.4; }

button.sw {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
}
button.sw.on {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}
input[type="color"] {
  width: 34px;
  height: 30px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.worlds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.worlds button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 11px;
  white-space: normal;
  text-align: left;
}
.worlds button b { font-weight: 500; font-size: 14px; }
.worlds button small { font-size: 11px; opacity: 0.65; }
.worlds button.on small { opacity: 0.82; }

#toast {
  position: fixed;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  background: rgba(12, 10, 26, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 9px 16px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  max-width: calc(100% - 40px);
  text-align: center;
  z-index: 25;
}

.hidden { display: none !important; }

@media (max-width: 680px) {
  #hint { display: none; }
  #brand span { font-size: 18px; }
  #panel { top: 68px; max-height: calc(100% - 210px); }
  button, .btn { padding: 6px 9px; font-size: 12px; }
}
