/* Car Arcade shared base. Everything is in rem; shared/scale.js sets the root font size from the viewport. */
:root {
  --ink: #2a1f4a;
  --cream: #fff7e8;
  --card: #fffaf0;
  --night-1: #120d30;
  --night-2: #2b1f66;
  --dusk: #6b3fa0;
  --glow: #ff8a5c;
  --orange: #ff8a3d;
  --orange-deep: #b8541a;
  --teal: #20c3a6;
  --teal-deep: #118a76;
  --sun: #ffd23f;
  --good: #2fb67c;
  --good-deep: #1b7f55;
  --oops: #f08a24;
  --radius: 1.2rem;
  --font: 'Fredoka', 'Baloo 2', 'Trebuchet MS', 'DejaVu Sans', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--night-1);
  color: var(--cream);
  font-family: var(--font);
  font-size: 20px; /* replaced at runtime by scale.js */
  line-height: 1.2;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

button,
input {
  font-family: inherit;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

/* The one place vertical scrolling is allowed (game selector, long option lists). */
.scroll-y {
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-width: 4rem;
  min-height: 4rem;
  padding: 0.5rem 1.6rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--orange);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.02rem;
  box-shadow: 0 0.3rem 0 var(--orange-deep), 0 0.7rem 1.1rem rgba(0, 0, 0, 0.3);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
  cursor: pointer;
}
a.btn {
  text-decoration: none;
}
.btn:active {
  transform: translateY(0.22rem);
  box-shadow: 0 0.08rem 0 var(--orange-deep), 0 0.3rem 0.6rem rgba(0, 0, 0, 0.3);
}
.btn.teal {
  background: var(--teal);
  box-shadow: 0 0.3rem 0 var(--teal-deep), 0 0.7rem 1.1rem rgba(0, 0, 0, 0.3);
}
.btn.teal:active {
  box-shadow: 0 0.08rem 0 var(--teal-deep), 0 0.3rem 0.6rem rgba(0, 0, 0, 0.3);
}
.btn.ghost {
  background: rgba(40, 28, 100, 0.78);
  box-shadow: 0 0.3rem 0 rgba(0, 0, 0, 0.35);
}
.btn.purple {
  background: #7a5cf0;
  box-shadow: 0 0.3rem 0 #4b34b0, 0 0.7rem 1.1rem rgba(0, 0, 0, 0.3);
}
.btn.purple:active {
  box-shadow: 0 0.08rem 0 #4b34b0, 0 0.3rem 0.6rem rgba(0, 0, 0, 0.3);
}
.btn.big {
  min-height: 6rem;
  font-size: 2.1rem;
  padding: 0.6rem 2rem;
}
.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

/* Big up/down scroll buttons (shared/scroll.js): no swiping needed in the car */
.scrollbtn {
  position: absolute;
  z-index: 8;
  width: 5.6rem;
  height: 5.6rem;
  min-width: 5.6rem;
  padding: 0;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0.3rem 0 var(--teal-deep), 0 0.6rem 1rem rgba(0, 0, 0, 0.35);
  color: #fff;
}
.scrollbtn .ico,
.scrollbtn svg {
  width: 3rem;
  height: 3rem;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 6, 30, 0.82);
}

.panel {
  background: var(--card);
  color: var(--ink);
  border-radius: 1.6rem;
  padding: 1.6rem 2rem;
  box-shadow: 0 0.6rem 0 rgba(0, 0, 0, 0.25), 0 1.2rem 2.4rem rgba(0, 0, 0, 0.35);
}

/* Calm / lite motion: set on <html> by shared/motion.js */
html[data-motion='calm'] *,
html[data-motion='calm'] *::before,
html[data-motion='calm'] *::after {
  animation-play-state: paused !important;
  transition-duration: 0s !important;
}
html[data-motion='lite'] .fx-heavy {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* PIN pad */
.pin-card {
  width: 30rem;
  text-align: center;
}
.pin-card h2 {
  margin: 0 0 0.4rem;
  font-size: 2.2rem;
}
.pin-card p {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  opacity: 0.8;
}
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  min-height: 2.6rem;
  margin-bottom: 0.8rem;
}
.pin-dots i {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--orange);
}
.pin-error {
  min-height: 1.6rem;
  margin-bottom: 0.6rem;
  color: #c2410c;
  font-size: 1.2rem;
  font-weight: 600;
}
.pin-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}
.pin-glyph {
  display: inline-flex;
  width: 2.6rem;
  height: 2.6rem;
}
.pin-glyph svg {
  width: 100%;
  height: 100%;
}
.pin-keys .btn {
  min-height: 4.6rem;
  font-size: 2rem;
  padding: 0;
}
