:root {
  color-scheme: dark;
  --ink: #f7f8f3;
  --muted: #a7aaa4;
  --panel: rgba(12, 16, 17, 0.82);
  --panel-strong: #101516;
  --line: rgba(255, 255, 255, 0.12);
  --lime: #d7ff3f;
  --amber: #ffb526;
  --red: #ff4c3f;
  --green: #54df78;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #91c8dc;
}

button {
  font: inherit;
}

.app,
#game-canvas {
  position: relative;
  width: 100%;
  height: 100%;
}

#game-canvas {
  display: block;
  outline: none;
}

.is-hidden {
  display: none !important;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.game-hud {
  position: fixed;
  z-index: 10;
  top: 20px;
  left: 20px;
  right: 20px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  pointer-events: none;
}

.hud-card {
  min-height: 62px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  color: var(--ink);
  backdrop-filter: blur(16px);
}

.hud-card strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.rule-card {
  width: min(620px, 100%);
  border-left: 3px solid var(--lime);
}

.lesson-objectives {
  display: grid;
  gap: 7px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.lesson-objective {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: #d8dbd4;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.lesson-objective__status {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.lesson-objective.is-passed {
  color: var(--ink);
}

.lesson-objective.is-passed .lesson-objective__status {
  border-color: var(--green);
  background: var(--green);
  color: #102316;
}

.lesson-objective.is-failed {
  color: #ffd0cc;
}

.lesson-objective.is-failed .lesson-objective__status {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.light-card {
  display: flex;
  min-width: 145px;
  align-items: center;
  gap: 12px;
}

.mini-light {
  width: 20px;
  height: 20px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 18px currentColor;
  color: var(--red);
}

.mini-light--yellow {
  color: var(--amber);
  background: var(--amber);
}

.mini-light--green {
  color: var(--green);
  background: var(--green);
}

.penalty-card {
  min-width: 124px;
}

.sign-card {
  display: grid;
  width: min(650px, 100%);
  min-height: 82px;
  grid-row: 2;
  grid-column: 1 / span 2;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-left: 3px solid rgba(215, 255, 63, 0.5);
  transition: opacity 180ms ease, transform 180ms ease;
}

.sign-card.is-empty {
  opacity: 0.7;
}

.sign-card__content {
  min-width: 0;
}

.sign-card__content strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sign-card__content p {
  display: -webkit-box;
  overflow: hidden;
  margin: 4px 0 0;
  color: #b8bcb5;
  font-size: 14px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.live-sign-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 5px solid #d73539;
  border-radius: 50%;
  background: white;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  color: #171a1b;
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
}

.live-sign-icon--stop {
  border: 3px solid white;
  border-radius: 0;
  background: #d7262f;
  color: white;
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
  font-size: 10px;
}

.live-sign-icon--parking,
.live-sign-icon--pedestrian-crossing {
  border: 3px solid white;
  border-radius: 5px;
  background: #176fc1;
  color: white;
  font-size: 26px;
}

.live-sign-icon--pedestrian-crossing {
  font-size: 21px;
}

.live-sign-icon--no-entry {
  border: 0;
  background: #d72d32;
  color: white;
  font-size: 32px;
}

.live-sign-icon--traffic-light {
  width: 34px;
  height: 54px;
  margin-left: 8px;
  border: 5px solid #171c1d;
  border-radius: 11px;
  background: #292e2f;
  color: var(--red);
  font-size: 27px;
  text-shadow: 0 0 14px currentColor;
}

.live-sign-icon--traffic-light[data-light="yellow"] {
  color: var(--amber);
}

.live-sign-icon--traffic-light[data-light="green"] {
  color: var(--green);
}

.live-sign-icon--no-sign {
  border-color: #6c7471;
  background: transparent;
  color: #9ba19e;
  font-size: 21px;
}

.controls-help {
  position: fixed;
  z-index: 12;
  right: 20px;
  bottom: 22px;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 10px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  backdrop-filter: blur(16px);
}

.controls-help__body {
  display: none;
  min-width: 245px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  backdrop-filter: blur(16px);
}

.controls-help.is-open .controls-help__body {
  display: block;
}

.controls-help__body p {
  margin: 7px 0 0;
  color: #d6d8d2;
  font-size: 12px;
}

.lesson-drawer {
  position: fixed;
  z-index: 16;
  bottom: 20px;
  left: 20px;
  display: flex;
  width: 310px;
  max-height: min(390px, calc(100vh - 40px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(10, 14, 15, 0.92);
  box-shadow: var(--shadow);
  color: var(--ink);
  backdrop-filter: blur(18px);
  transition: width 220ms ease, max-height 220ms ease, border-radius 220ms ease;
}

.lesson-drawer.is-expanded {
  top: 0;
  bottom: 0;
  left: 0;
  width: min(390px, 92vw);
  max-height: none;
  border-width: 0 1px 0 0;
  border-radius: 0 24px 24px 0;
  background: rgba(10, 14, 15, 0.97);
}

.lesson-drawer__toggle {
  display: flex;
  min-height: 62px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.lesson-drawer__toggle strong {
  font-size: 13px;
}

.lesson-drawer__chevron {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: rgba(215, 255, 63, 0.1);
  color: var(--lime);
  font-size: 17px;
  font-weight: 900;
  transition: transform 180ms ease;
}

.lesson-drawer.is-expanded .lesson-drawer__chevron {
  transform: rotate(180deg);
}

.lesson-drawer__body {
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.lesson-drawer.is-expanded .lesson-drawer__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 20px;
}

.lesson-drawer__intro,
.lesson-drawer__hint {
  display: none;
}

.lesson-drawer.is-expanded .lesson-drawer__intro,
.lesson-drawer.is-expanded .lesson-drawer__hint {
  display: block;
}

.lesson-drawer__intro {
  padding: 8px 4px 22px;
}

.lesson-drawer__intro h2 {
  margin: 3px 0 9px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.lesson-drawer__intro p,
.lesson-drawer__hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.lesson-drawer__list {
  display: grid;
  gap: 6px;
}

.drawer-lesson {
  display: grid;
  min-width: 0;
  grid-template-columns: 28px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.lesson-drawer.is-expanded .drawer-lesson {
  min-height: 88px;
  padding: 14px;
}

.drawer-lesson:hover:not(:disabled),
.drawer-lesson:focus-visible,
.drawer-lesson.is-active {
  border-color: rgba(215, 255, 63, 0.42);
  background: rgba(215, 255, 63, 0.075);
}

.drawer-lesson.is-active {
  box-shadow: inset 3px 0 var(--lime);
}

.drawer-lesson__status {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: #838b85;
  font-size: 11px;
  font-weight: 900;
}

.drawer-lesson.is-passed .drawer-lesson__status {
  background: rgba(84, 223, 120, 0.14);
  color: var(--green);
}

.drawer-lesson.is-active .drawer-lesson__status {
  color: var(--lime);
}

.drawer-lesson__copy {
  min-width: 0;
}

.drawer-lesson__number,
.drawer-lesson__copy strong,
.drawer-lesson__copy small {
  display: block;
}

.drawer-lesson__number {
  margin-bottom: 2px;
  color: var(--lime);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.drawer-lesson__copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-lesson__copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.drawer-lesson__arrow {
  color: #7f8781;
  font-weight: 900;
}

.drawer-lesson:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.lesson-drawer__hint {
  margin-top: auto;
  padding: 18px 5px 5px;
  border-top: 1px solid var(--line);
}

.lesson-drawer__hint span {
  margin-right: 6px;
  color: var(--lime);
  font-weight: 900;
}

kbd,
.key-chip {
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.driving-console {
  position: fixed;
  z-index: 10;
  bottom: 20px;
  left: 50%;
  display: flex;
  width: min(540px, calc(100vw - 120px));
  min-height: 86px;
  gap: 10px;
  transform: translateX(-50%);
}

.dashboard-panel {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 86px;
  grid-template-columns: 1fr 1.1fr 1fr;
  align-items: center;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(10, 14, 15, 0.88);
  box-shadow: var(--shadow);
  color: var(--ink);
  backdrop-filter: blur(18px);
}

.drive-pause-button {
  display: grid;
  width: 120px;
  flex: 0 0 120px;
  place-content: center;
  padding: 10px;
  border: 1px solid rgba(215, 255, 63, 0.32);
  border-radius: 22px;
  background: rgba(10, 14, 15, 0.88);
  box-shadow: var(--shadow);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  backdrop-filter: blur(18px);
}

.drive-pause-button > span {
  color: var(--lime);
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

.drive-pause-button strong {
  margin-top: 6px;
  font-size: 13px;
}

.drive-pause-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.25;
}

.drive-pause-button:hover,
.drive-pause-button:focus-visible {
  border-color: rgba(215, 255, 63, 0.7);
  background: rgba(30, 37, 36, 0.96);
}

.signal-state {
  display: flex;
  gap: 7px;
}

.turn-indicator {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #66706d;
  font-size: 22px;
  font-weight: 900;
  transition: 160ms ease;
}

.turn-indicator.is-active {
  background: rgba(215, 255, 63, 0.15);
  box-shadow: inset 0 0 0 1px rgba(215, 255, 63, 0.22);
  color: var(--lime);
  animation: signal-blink 0.8s steps(1) infinite;
}

@keyframes signal-blink {
  50% { opacity: 0.35; }
}

.speedometer {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.speedometer__value {
  min-width: 48px;
  font-size: 37px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  text-align: right;
}

.speedometer__value.is-over-limit {
  color: var(--red);
  text-shadow: 0 0 18px rgba(255, 76, 63, 0.4);
}

.speedometer__unit {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.pedals {
  display: grid;
  gap: 8px;
  padding-left: 14px;
}

.pedal {
  display: grid;
  grid-template-columns: 45px 1fr;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.pedal i {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
}

.pedal b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  transition: width 80ms linear;
}

.pedal--brake b {
  background: var(--red);
}

.notice {
  position: fixed;
  z-index: 25;
  top: 104px;
  left: 50%;
  display: flex;
  width: min(500px, calc(100vw - 30px));
  align-items: center;
  gap: 13px;
  padding: 14px 17px;
  transform: translate(-50%, -14px);
  border: 1px solid rgba(255, 76, 63, 0.45);
  border-radius: 15px;
  background: rgba(57, 14, 12, 0.94);
  box-shadow: 0 18px 55px rgba(30, 0, 0, 0.35);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: 220ms ease;
}

.notice.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.notice--success {
  border-color: rgba(84, 223, 120, 0.45);
  background: rgba(8, 51, 27, 0.94);
}

.notice__icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  font-weight: 900;
}

.notice--success .notice__icon {
  background: var(--green);
  color: #082a14;
}

.notice strong,
.notice span span {
  display: block;
}

.notice strong {
  margin-bottom: 2px;
  font-size: 13px;
}

.notice span span {
  color: #d9dbd7;
  font-size: 12px;
}

.start-screen,
.finish-screen,
.lesson-overlay,
.pause-screen,
.guide-screen {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(7, 12, 13, 0.97) 0%, rgba(7, 12, 13, 0.86) 46%, rgba(7, 12, 13, 0.3) 100%),
    radial-gradient(circle at 80% 20%, rgba(215, 255, 63, 0.18), transparent 30%);
  color: var(--ink);
}

.lesson-overlay {
  z-index: 31;
  background: rgba(7, 12, 13, 0.86);
  backdrop-filter: blur(16px);
}

.lesson-brief,
.phase-card {
  width: min(940px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #101516;
  box-shadow: var(--shadow);
}

.lesson-brief__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  padding: 30px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at 90% 20%, rgba(215, 255, 63, 0.12), transparent 38%);
}

.lesson-brief__header h2,
.phase-card h2 {
  margin: 4px 0 10px;
  font-size: clamp(30px, 5vw, 48px);
  letter-spacing: -0.05em;
  line-height: 1;
}

.lesson-brief__header p,
.phase-card > p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.theory-sign {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border: 12px solid #d72d32;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  color: #171a1b;
  font-size: 38px;
  font-weight: 950;
}

.lesson-brief__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 22px 30px 12px;
}

.theory-card {
  min-height: 170px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.theory-card__number {
  color: var(--lime);
  font-size: 10px;
  font-weight: 950;
}

.theory-card h3 {
  margin: 18px 0 8px;
  font-size: 15px;
}

.theory-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.lesson-warning {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 30px;
  padding: 15px 18px;
  border: 1px solid rgba(255, 181, 38, 0.24);
  border-radius: 14px;
  background: rgba(255, 181, 38, 0.06);
  color: #d8dbd4;
  font-size: 11px;
}

.lesson-warning strong {
  color: var(--amber);
}

.lesson-warning span::before {
  margin-right: 7px;
  color: var(--amber);
  content: "!";
  font-weight: 950;
}

.lesson-brief__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 30px 30px;
}

.lesson-brief__footer p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.lesson-brief__footer .secondary-button,
.phase-card .secondary-button {
  min-width: 240px;
}

.phase-card {
  width: min(680px, 100%);
  padding: 34px;
}

.phase-card .finish-card__icon {
  margin-bottom: 20px;
}

.phase-card .finish-details {
  margin: 24px 0;
}

.start-screen::after {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  content: "";
  pointer-events: none;
}

.start-screen__glow {
  position: absolute;
  right: 12%;
  width: 34vw;
  height: 34vw;
  border: 1px solid rgba(215, 255, 63, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 120px rgba(215, 255, 63, 0.08), inset 0 0 120px rgba(215, 255, 63, 0.04);
}

.start-card {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  margin-right: min(38vw, 430px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.brand__mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--lime);
  color: #121713;
  font-size: 15px;
}

.brand__tag {
  margin-left: 4px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.start-card__kicker {
  margin: 0 0 14px;
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.start-card h1 {
  margin: 0;
  font-size: clamp(46px, 5vw, 70px);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 0.9;
}

.start-card__lead {
  max-width: 520px;
  margin: 18px 0;
  color: #b7bbb4;
  font-size: 15px;
  line-height: 1.65;
}

.profile-row {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) 1fr;
  align-items: end;
  gap: 13px;
  margin-bottom: 12px;
}

.profile-field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  font: 750 13px/1.2 inherit;
}

.profile-field input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(215, 255, 63, 0.1);
}

.profile-progress {
  padding-bottom: 11px;
  color: #8f9690;
  font-size: 10px;
}

.continue-lesson {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(215, 255, 63, 0.3);
  border-radius: 13px;
  background: rgba(215, 255, 63, 0.065);
  box-shadow: inset 3px 0 var(--lime);
}

.continue-lesson__number {
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--lime);
  color: #151a12;
  font-size: 9px;
  font-weight: 950;
  white-space: nowrap;
}

.continue-lesson strong {
  display: block;
  font-size: 13px;
}

.continue-lesson p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.continue-lesson__status {
  color: #e9ff9a;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.mode-button {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.mode-button strong {
  font-size: 12px;
}

.mode-button span {
  color: var(--muted);
  font-size: 9px;
}

.mode-button.is-active {
  border-color: rgba(215, 255, 63, 0.5);
  background: rgba(215, 255, 63, 0.09);
  box-shadow: inset 3px 0 var(--lime);
}

.lesson-picker {
  margin-bottom: 12px;
}

.lesson-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.lesson-button {
  position: relative;
  min-height: 65px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.lesson-button__number {
  display: block;
  margin-bottom: 5px;
  color: var(--lime);
  font-size: 9px;
  font-weight: 900;
}

.lesson-button strong {
  display: block;
  font-size: 9px;
  line-height: 1.25;
}

.lesson-button small {
  display: block;
  margin-top: 4px;
  color: #78807a;
  font-size: 8px;
}

.lesson-button.is-selected {
  border-color: var(--lime);
  background: rgba(215, 255, 63, 0.1);
}

.lesson-button.is-passed::after {
  position: absolute;
  top: 6px;
  right: 7px;
  color: var(--green);
  content: "✓";
  font-size: 10px;
  font-weight: 900;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: #bcc0b9;
  font-size: 11px;
  font-weight: 700;
}

.connection-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7f8581;
  box-shadow: 0 0 0 3px rgba(127, 133, 129, 0.12);
}

.connection-status--online {
  border-color: rgba(84, 223, 120, 0.28);
  color: #dbffe5;
}

.connection-status--online .connection-status__dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(84, 223, 120, 0.14), 0 0 12px rgba(84, 223, 120, 0.55);
}

.start-button,
.secondary-button {
  border: 0;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease;
}

.start-button {
  display: flex;
  width: min(410px, 100%);
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 13px;
  background: var(--lime);
  box-shadow: 0 16px 40px rgba(181, 222, 32, 0.16);
  color: #11160f;
  text-align: left;
}

.start-button span {
  font-size: 15px;
  font-weight: 900;
}

.start-button small {
  opacity: 0.65;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.start-button:hover,
.secondary-button:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.start-button:focus-visible,
.secondary-button:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
}

.start-card__footer {
  display: flex;
  max-width: 480px;
  gap: 24px;
  margin-top: 18px;
  color: #7f8581;
  font-size: 10px;
  line-height: 1.5;
}

.start-card__footer p {
  margin: 0;
}

.finish-screen {
  z-index: 28;
  background: rgba(7, 12, 13, 0.7);
  backdrop-filter: blur(12px);
}

.pause-screen,
.guide-screen {
  z-index: 27;
  padding: 22px;
  background: rgba(5, 9, 10, 0.76);
  backdrop-filter: blur(12px);
}

.guide-screen {
  z-index: 29;
}

.learning-panel {
  width: min(920px, 100%);
  max-height: min(820px, calc(100vh - 44px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #101516;
  box-shadow: var(--shadow);
}

.learning-panel--pause {
  width: min(760px, 100%);
}

.learning-panel__header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 21, 22, 0.96);
  backdrop-filter: blur(12px);
}

.learning-panel__header h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 36px);
  letter-spacing: -0.04em;
}

.learning-panel__header p {
  max-width: 690px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.close-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.close-button:hover,
.close-button:focus-visible {
  border-color: rgba(215, 255, 63, 0.45);
  color: var(--lime);
}

.pause-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  margin: 22px 26px 0;
  padding: 16px 18px;
  border: 1px solid rgba(215, 255, 63, 0.18);
  border-radius: 15px;
  background: rgba(215, 255, 63, 0.05);
}

.pause-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.nearby-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 25px 26px 12px;
}

.nearby-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.count-badge {
  padding: 6px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  color: #cfd2cc;
  font-size: 10px;
  font-weight: 800;
}

.nearby-signs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 26px 24px;
}

.nearby-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.nearby-card__icon,
.guide-entry__icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(215, 255, 63, 0.2);
  border-radius: 13px;
  background: rgba(215, 255, 63, 0.08);
  color: var(--lime);
  font-size: 17px;
  font-weight: 900;
}

.nearby-card h3,
.guide-entry h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 13px;
}

.nearby-card p,
.guide-entry p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.nearby-card__action {
  display: block;
  margin-top: 7px;
  color: #eefdc0;
  font-size: 10px;
  font-weight: 750;
}

.empty-nearby {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.learning-panel__footer {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 26px;
  border-top: 1px solid var(--line);
  background: rgba(16, 21, 22, 0.96);
  backdrop-filter: blur(12px);
}

.ghost-button {
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.ghost-button--danger {
  margin-right: auto;
  border-color: rgba(255, 112, 90, 0.38);
  color: #ffad9d;
}

.guide-filters {
  position: sticky;
  z-index: 1;
  top: 109px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 14px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 21, 22, 0.94);
  scrollbar-width: none;
}

.filter-button {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.filter-button.is-active {
  border-color: var(--lime);
  background: var(--lime);
  color: #131911;
}

.guide-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 20px 26px 28px;
}

.guide-entry {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 160ms ease, background 160ms ease;
}

.guide-entry.is-nearby {
  border-color: rgba(215, 255, 63, 0.55);
  background: rgba(215, 255, 63, 0.06);
  box-shadow: inset 3px 0 var(--lime);
}

.guide-entry__meta {
  display: flex;
  gap: 5px;
  margin-top: 9px;
}

.guide-sources {
  margin: 0 26px 28px;
  padding: 18px;
  border: 1px solid rgba(255, 181, 38, 0.2);
  border-radius: 15px;
  background: rgba(255, 181, 38, 0.055);
}

.guide-sources p {
  margin: 5px 0 11px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.guide-sources a {
  display: inline-block;
  margin: 5px 14px 0 0;
  color: #f3ffc9;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.guide-sources a:hover,
.guide-sources a:focus-visible {
  color: var(--lime);
  text-decoration: underline;
}

.rule-tag {
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #aeb3ac;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.rule-tag--country {
  background: rgba(255, 181, 38, 0.1);
  color: #ffd58a;
}

.finish-card {
  width: min(430px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  text-align: center;
}

.finish-card--report {
  width: min(680px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  text-align: left;
}

.finish-card--report .finish-card__icon {
  margin-right: 0;
  margin-left: 0;
}

.finish-score {
  display: inline-flex;
  margin: 0 0 16px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(215, 255, 63, 0.1);
  color: var(--lime);
  font-size: 12px;
  font-weight: 900;
}

.finish-details {
  display: grid;
  gap: 7px;
}

.finish-details section {
  display: grid;
  gap: 7px;
}

.finish-details section + section {
  margin-top: 9px;
}

.finish-details h3 {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.report-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.report-item__icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: rgba(84, 223, 120, 0.12);
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.report-item--error .report-item__icon,
.report-item.is-error .report-item__icon {
  background: rgba(255, 76, 63, 0.13);
  color: var(--red);
}

.report-item strong,
.report-item p {
  display: block;
}

.report-item strong {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 11px;
}

.report-item p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.finish-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.finish-card__icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: #16200d;
  font-size: 27px;
  font-weight: 900;
}

.finish-card h2 {
  margin: 8px 0 10px;
  font-size: 30px;
}

.finish-card p:not(.eyebrow) {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.secondary-button {
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--lime);
  color: #121713;
  font-size: 13px;
  font-weight: 850;
}

noscript {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background: #111;
  color: white;
}

@media (max-width: 760px) {
  .game-hud {
    top: 10px;
    left: 10px;
    right: 10px;
    grid-template-columns: 1fr auto;
  }

  .rule-card {
    grid-column: 1 / -1;
    max-width: none;
  }

  .sign-card {
    width: 100%;
    min-height: 68px;
    grid-row: auto;
    grid-column: 1 / -1;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
  }

  .live-sign-icon {
    width: 42px;
    height: 42px;
    border-width: 4px;
    font-size: 14px;
  }

  .sign-card__content p {
    -webkit-line-clamp: 1;
  }

  .controls-help {
    left: 10px;
    right: auto;
  }

  .hud-card {
    min-height: 52px;
    padding: 11px 13px;
  }

  .start-screen {
    align-items: start;
    padding: 22px;
    background: rgba(7, 12, 13, 0.95);
  }

  .start-card {
    margin: 0;
  }

  .profile-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .profile-progress {
    padding-bottom: 0;
  }

  .continue-lesson {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .continue-lesson__status {
    grid-column: 2;
  }

  .lesson-drawer {
    bottom: 108px;
    left: 10px;
    width: min(290px, calc(100vw - 20px));
    max-height: min(350px, calc(100vh - 128px));
  }

  .lesson-drawer.is-expanded {
    top: 0;
    bottom: 0;
    left: 0;
    width: min(390px, 100vw);
    max-height: none;
  }

  .brand {
    margin-bottom: 55px;
  }

  .start-card__footer {
    flex-direction: column;
    gap: 7px;
  }

  .driving-console {
    bottom: 10px;
    width: calc(100vw - 20px);
    gap: 6px;
  }

  .dashboard-panel {
    padding: 8px 10px;
    border-radius: 18px;
  }

  .drive-pause-button {
    width: 78px;
    flex-basis: 78px;
    border-radius: 18px;
  }

  .drive-pause-button small {
    display: none;
  }

  .controls-help {
    right: 10px;
    bottom: 110px;
  }

  .notice {
    top: 148px;
  }

  .pause-screen,
  .lesson-overlay,
  .guide-screen {
    align-items: end;
    padding: 8px;
  }

  .lesson-brief,
  .phase-card {
    max-height: calc(100vh - 16px);
    border-radius: 20px;
  }

  .lesson-brief__header {
    gap: 16px;
    padding: 22px 18px;
  }

  .theory-sign {
    width: 74px;
    height: 74px;
    border-width: 8px;
    font-size: 25px;
  }

  .lesson-brief__grid {
    grid-template-columns: 1fr;
    padding: 16px 18px 10px;
  }

  .theory-card {
    min-height: 0;
  }

  .lesson-warning {
    margin: 0 18px;
  }

  .lesson-brief__footer {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .phase-card {
    padding: 24px 18px;
  }

  .learning-panel {
    max-height: calc(100vh - 16px);
    border-radius: 20px;
  }

  .learning-panel__header,
  .nearby-heading,
  .learning-panel__footer {
    padding-right: 17px;
    padding-left: 17px;
  }

  .pause-summary {
    margin-right: 17px;
    margin-left: 17px;
  }

  .nearby-signs,
  .guide-list {
    grid-template-columns: 1fr;
    padding-right: 17px;
    padding-left: 17px;
  }

  .guide-sources {
    margin-right: 17px;
    margin-left: 17px;
  }

  .guide-filters {
    top: 130px;
    padding-right: 17px;
    padding-left: 17px;
  }
}

@media (max-height: 650px) and (orientation: landscape) {
  .brand {
    margin-bottom: 28px;
  }

  .start-card h1 {
    font-size: 48px;
  }

  .start-card__lead {
    margin: 14px 0;
  }

  .start-card__footer {
    margin-top: 10px;
  }
}

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