* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.view {
  display: block;
}

.hidden {
  display: none;
}

.title {
  margin: 0 0 8px;
}

.subtitle {
  margin: 0 0 16px;
  color: #94a3b8;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel {
  margin-top: 16px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 14px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.btn.primary {
  background: #2563eb;
  color: #ffffff;
}

.btn.secondary {
  background: #1f2937;
  color: #e2e8f0;
  border-color: #334155;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 8px;
  border-bottom: 1px solid #1f2937;
  text-align: left;
}

#race-canvas {
  width: 100%;
  height: auto;
  margin-top: 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0b1220;
}

.race-stage {
  position: relative;
  margin-top: 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  width: min(100%, 980px);
}

.race-stage #race-canvas {
  margin-top: 0;
  border: none;
  border-radius: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  background: rgba(8, 14, 24, 0.76);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 118px;
  backdrop-filter: blur(2px);
}

.hud-top-left { top: 12px; left: 12px; }
.hud-top-right { top: 12px; right: 12px; text-align: right; }
.hud-bottom-left { bottom: 12px; left: 12px; }

.hud-value {
  color: #f8fafc;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.hud-subvalue {
  color: #93c5fd;
  font-size: 12px;
  margin-top: 4px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 12px 14px;
  border-radius: 8px;
  min-width: 240px;
}
