/* זהירות בדרכים (/road-safety) — the road-safety mini site: its own colors
   (asphalt, road yellow, traffic-light red and green), header, hero, lesson
   and game cards, and the game screens (road-safety.js). The exercises use
   the English page's styles (english-learning.css). */

:root {
  --rs-asphalt: #2f3a45;
  --rs-asphalt-2: #3d4a56;
  --rs-yellow: #ffd23f;
  --rs-red: #ff5a5a;
  --rs-green: #2ecc71;
  --rs-sky: #dff0ff;
  --rs-tint: #eaf5ff;
  --rs-cream: #fff6d6;
  --rs-ink: #000;
  --rs-shadow: 6px 7px 0 0 var(--rs-ink);
  --rs-bar-h: 64px;
}

html {
  background: var(--rs-sky);
  scroll-padding-top: 12px;
}

body.page-road {
  background: var(--rs-sky);
  min-height: 100vh;
}

/* styles.css gives every section 80px top and bottom. */
body.page-road section.rs-hero,
body.page-road section.rs-section {
  padding: 0;
  scroll-margin-top: 12px;
}

/* The asphalt marker for headings and dialog titles, like the top bar. */
.rs-key {
  padding: 0 0.2em;
  border-radius: 6px;
  background: var(--rs-asphalt);
  color: #fff;
  font-weight: 900;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* The lessons path's stage headings ("שלב 1 הולכי רגל"): a strip of road —
   black asphalt, white letters. */
body.page-road .eng-path-title {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 10px 26px;
  border: 3px solid var(--rs-ink);
  border-radius: 12px;
  background: #26282c;
  box-shadow: var(--rs-shadow);
  color: #fff;
}

body.page-road .eng-path-title .eng-path-stage-num {
  padding: 0;
  background: none;
  color: #fff;
}

/* The table of contents' "שלב 1" in the same asphalt: black, white letters. */
body.page-road .eng-toc-stage-head .eng-path-stage-num {
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: 8px;
  background: #26282c;
  color: #fff;
}

/* ── Top bar: no strip, only the buttons over the page, as on the Pleyi
   site — the three pages as separate white pills (the open page yellow),
   sign-in, and on phones the menu button. ── */

.rs-bar {
  position: relative !important;
  z-index: 60 !important;
  background: transparent;
  padding-top: env(safe-area-inset-top, 0px);
  color: #fff;
}

/* Three columns, as on the Pleyi site: the arrow, the tabs in the middle of
   the screen (with or without the arrow), and sign-in. */
.rs-bar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: var(--rs-bar-h);
  padding-block: 8px 13px;
}

.rs-bar .eng-bar-back {
  grid-column: 1;
  justify-self: start;
}

.rs-bar .eng-bar-back:empty {
  display: none;
}

/* No arrow on the home page. On the other pages it leads home, and from an
   exercise topic up to the exercises (road-safety.js). */
html[data-rs-page="home"] .rs-bar .eng-bar-back {
  display: none;
}

.rs-bar .eng-back {
  width: 42px;
  height: 42px;
  box-shadow: 3px 3px 0 0 var(--rs-ink);
}

/* The same pills as the Pleyi site's .nav-pill (styles.css, clean-site.css). */
.rs-tabs {
  grid-column: 2;
  display: flex;
  gap: 8px;
}

.rs-tab {
  flex-shrink: 0;
  padding: 10px 18px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: clamp(15px, 1.75vw, 18px);
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: var(--shadow-sticker);
  transition: transform 0.15s ease, background 0.15s ease;
}

.rs-tab:hover {
  background: var(--memyellow);
  color: var(--ink);
  transform: scale(1.04);
}

.rs-tab[aria-current="page"] {
  background: var(--memyellow);
}

.rs-bar-end {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rs-login {
  padding: 8px 18px;
  border: 3px solid var(--rs-ink);
  border-radius: 999px;
  background: var(--rs-tint);
  color: #000;
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 0 0 var(--rs-ink);
  transition: transform 0.12s ease;
}

.rs-login:hover {
  transform: translateY(-2px);
}

/* Signed in: the user circle (auth.js shows it), next to the menu button on
   phones, as on the Pleyi site. Its dropdown has "החדר שלי" and "יציאה". */
.rs-bar .nav-user-avatar {
  width: 44px;
  height: 44px;
}

/* ── Phone menu: the yellow button opens the parts full screen, under the
   bar, as on the Pleyi site ── */

.rs-bar .rs-menu-toggle {
  display: none;
  padding: 9px 10px;
  border-width: 3px;
  border-radius: 12px;
  box-shadow: 3px 3px 0 0 var(--rs-ink);
}

.rs-menu-toggle span {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Open: the three lines turn into an X. */
.rs-menu-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.rs-menu-toggle.open span:nth-child(2) { opacity: 0; }
.rs-menu-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* !important: clean-site.css puts every child of body at z-index 1. */
.rs-menu {
  position: fixed !important;
  inset: 0;
  z-index: 59 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: calc(env(safe-area-inset-top, 0px) + 88px) 34px calc(32px + env(safe-area-inset-bottom, 0px));
  /* A road: yellow edge lines down both sides over smooth black, the
     dividers' black (road-traffic.js). */
  background:
    linear-gradient(var(--rs-yellow), var(--rs-yellow)) left 12px top 0 / 5px 100% no-repeat,
    linear-gradient(var(--rs-yellow), var(--rs-yellow)) right 12px top 0 / 5px 100% no-repeat,
    #2a2c30;
  background-attachment: fixed;
  scrollbar-color: #555 transparent;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.rs-menu.open {
  opacity: 1;
  visibility: visible;
}

html.rs-menu-open {
  overflow: hidden;
}

/* The user circle stays out of the open menu (it keeps its place, so the
   X doesn't move). */
html.rs-menu-open .rs-bar .nav-user {
  visibility: hidden;
}

/* Each button is a white crosswalk stripe across the road. */
.rs-menu-link,
.rs-menu .mobile-nav-auth,
.rs-menu a {
  display: block;
  /* A short screen scrolls the menu instead of squeezing the buttons. */
  flex-shrink: 0;
  width: 100%;
  max-width: 300px;
  padding: 13px 14px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 1.12rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 0 #000;
}

.rs-menu-link:active,
.rs-menu .mobile-nav-auth:active,
.rs-menu a:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 0 #000;
}

/* No "יציאה" in this menu: signing out is in the user circle and the
   personal area. */
.rs-menu #mobileLogoutBtn {
  display: none;
}

/* The Pleyi link and sign-in (or, signed in, "החדר שלי" that auth.js puts
   here) are a little smaller than the three parts, with the same gap. */
.rs-menu .rs-menu-link--home,
.rs-menu .mobile-nav-auth,
.rs-menu a[href="/my-room"] {
  font-size: 1rem;
}

/* clean-site.css makes the phone sign-in button taller. */
body.page-road .rs-menu .mobile-nav-auth {
  min-height: 0;
  padding: 13px 14px;
  font-size: 1rem;
}

.rs-menu .mobile-nav-auth.hidden {
  display: none;
}

/* ── Home: the title with the pedestrian light standing right beside it,
   as one piece, and under them two lines and the button to the lessons
   library ── */

/* Clipped only sideways, so the mascot can somersault up past the top. */
.rs-hero {
  overflow-x: clip;
  overflow-y: visible;
}

/* --rs-title-size sizes the title and the light together. It follows the
   screen's height too, so the whole hero and the road under it fit on the
   first screen. */
.rs-hero-inner {
  --rs-title-size: clamp(6rem, min(15.6vw, (100svh - 440px) / 2.55), 11.5rem);
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas: "title art";
  justify-content: center;
  gap: 0;
  padding-block: clamp(8px, 1.4vw, 16px) clamp(14px, 1.8vw, 20px);
  text-align: center;
}

.rs-hero-text {
  padding-block: clamp(12px, 1.6vw, 18px) clamp(28px, 3vw, 40px);
  text-align: center;
}

/* No outline on the heading itself (styles.css outlines cartoon headings):
   the title's letters carry their own. */
.rs-title,
.rs-game-title {
  -webkit-text-stroke: 0 !important;
  paint-order: normal !important;
  text-shadow: none !important;
}

/* The Pleyi home title's letters (clean-site.css): Fredoka with a thick
   outline, lit like the pedestrian light beside it: the top word red, the
   bottom word green, each lit while its lamp is on (road-safety.js splits
   the title into words and letters and gives it the light's data-on). The
   outline is the home title's (20px on its 192px letters), at this title's
   size; the hero light's outline matches it. Room above for the mascot on
   the first word. */
.rs-title {
  --rs-lamp-red: #ff4d4d;
  --rs-lamp-green: #2bd96b;
  --rs-ch-off: brightness(0.4) saturate(0.5);
  grid-area: title;
  margin: 0.55em 0 0;
  font-family: "Fredoka", var(--font-sans);
  font-size: var(--rs-title-size);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #000;
}

/* Each word only as wide as its letters, so the mascot stands on the
   first letter. */
.rs-word {
  display: block;
  position: relative;
  width: fit-content;
  margin-inline: auto;
  white-space: nowrap;
}

.rs-word--red { --ch-color: var(--rs-lamp-red); }
.rs-word--green { --ch-color: var(--rs-lamp-green); }

.rs-ch {
  display: inline-block;
  position: relative;
  color: var(--ch-color);
  -webkit-text-fill-color: var(--ch-color);
  -webkit-text-stroke: clamp(9px, 0.104em, 20px) var(--rs-ink) !important;
  paint-order: stroke fill !important;
  /* Switches as fast as the light's lamps. */
  transition: filter 0.3s ease;
  /* Each letter comes on like a lamp, one after another. */
  animation: rs-ch-on 0.3s steps(1) var(--ch-delay, 0s) backwards;
}

/* A word whose lamp is off: dark and dull, like an unlit lamp. */
.rs-title[data-on="red"] .rs-word--green .rs-ch,
.rs-title[data-on="green"] .rs-word--red .rs-ch {
  filter: var(--rs-ch-off);
}

@keyframes rs-ch-on {
  0% { filter: var(--rs-ch-off); }
  100% { filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rs-ch {
    animation: none;
  }
}

/* As the Pleyi home's "לומדים במשחקים!" (styles.css .hero-title): light
   letters in a thick ink outline, the key words yellow. */
.rs-hero-line {
  margin: 0;
  font-size: clamp(1.6rem, 4.4vw, 2.5rem);
  line-height: 1.25;
  color: var(--text-soft-turquoise, #f0fffd);
  -webkit-text-fill-color: var(--text-soft-turquoise, #f0fffd);
  -webkit-text-stroke: min(0.3em, 24px) var(--rs-ink);
  paint-order: stroke fill;
  text-shadow: none;
  letter-spacing: 0;
  text-wrap: balance;
}

.rs-hero-accent {
  color: var(--memyellow);
  -webkit-text-fill-color: var(--memyellow);
}

/* The button to the lessons library, as on the Pleyi home page. */
.rs-hero-actions {
  margin-top: clamp(16px, 2.4vw, 24px);
}

.rs-hero-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 20px 42px;
  border-width: 5px;
  font-size: clamp(30px, 4.2vw, 46px);
  white-space: nowrap;
  text-decoration: none;
}

/* The pedestrian light, as tall as the title's two words and standing on
   the last word's line, close to its letters (road-safety.js switches
   data-on: red, green; the walkers' green doesn't flash in Israel). The negative margins take away the svg's
   empty room beside the light. */
.rs-hero-art {
  --rs-light-h: calc(var(--rs-title-size) * 2.1);
  grid-area: art;
  align-self: end;
  margin-bottom: calc(var(--rs-title-size) * 0.12);
}

.rs-hero-art svg {
  display: block;
  height: var(--rs-light-h);
  width: auto;
  margin-inline: calc(var(--rs-light-h) * -0.07) calc(var(--rs-light-h) * -0.1);
}

.rs-tl .rs-tl-on,
.rs-tl .rs-tl-off {
  transition: opacity 0.3s ease;
}

.rs-tl .rs-tl-on,
.rs-tl[data-on="red"] .rs-tl-red .rs-tl-off,
.rs-tl[data-on="green"] .rs-tl-green .rs-tl-off {
  opacity: 0;
}

.rs-tl[data-on="red"] .rs-tl-red .rs-tl-on,
.rs-tl[data-on="green"] .rs-tl-green .rs-tl-on {
  opacity: 1;
}

/* ── The mascot: the Pleyi fox (its drawing and colors: site-fox.js and
   site-fox.css), on the title's first letter (road-safety.js) ── */

/* Big enough and low enough to sit on the first letter, its feet over the
   letter's top, so it reads as part of the title. */
.rs-buddy {
  position: absolute;
  inset-inline-start: -0.08em;
  bottom: calc(100% - 0.27em);
  width: clamp(56px, 0.8em, 110px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rs-buddy-fig {
  display: block;
  transform-origin: 50% 100%;
  filter: drop-shadow(2px 3px 0 var(--rs-ink));
  /* Lands once the letters have come in. */
  animation: rs-buddy-land 0.8s linear 1.1s backwards;
}

/* Without this, the landing would replay after every hop. */
.rs-buddy.is-landed:not(.is-hop) .rs-buddy-fig {
  animation: none;
}

.rs-buddy.is-hop .rs-buddy-fig {
  animation: rs-buddy-hop 0.7s ease-in-out;
}

@keyframes rs-buddy-hop {
  0%, 100% { transform: none; }
  15% { transform: scale(1.12, 0.86); }
  45% { transform: translateY(-22%) scale(0.94, 1.08); }
  75% { transform: scale(1.1, 0.9); }
}

@keyframes rs-buddy-land {
  0% {
    translate: 0 -160%;
    opacity: 0;
    animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
  }
  20% { opacity: 1; }
  55% {
    translate: 0 0;
    scale: 1;
    animation-timing-function: ease-out;
  }
  70% { scale: 1.16 0.84; }
  86% { scale: 0.95 1.06; }
  100% {
    translate: 0 0;
    scale: 1;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rs-buddy-fig {
    animation: none !important;
  }
}

/* ── מי אנחנו: a few lines right on the page (no card), and under them the
   demo of the site (about-demo.js, as on the Pleyi home page) ── */

.rs-about-lead {
  max-width: 680px;
  margin: 0 auto clamp(20px, 4vw, 28px);
  text-align: center;
}

.rs-about-lead p {
  margin: 0;
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  font-weight: 800;
  line-height: 1.5;
  color: #000;
  /* A wrapped line breaks evenly, without one word alone on the second line. */
  text-wrap: balance;
}

/* The demo: plain drawn screens, no browser bar. Sizes are in cqw (% of the
   screen's width), so they follow the screen.
   Computers: a drawn monitor – an even dark edge with a camera dot, a lower
   chin with a green light, and a stand behind it (.rs-monitor-stand).
   Phones (max-width 640px, below): a phone instead, with a tall screen. */
.rs-about .about-demo-scene {
  /* The stand and the phone's side buttons go behind the frame (z-index -1)
     but stay in front of the section. */
  isolation: isolate;
}

.rs-demo {
  --rs-bezel: clamp(10px, 2.2vw, 14px);
  --rs-chin: clamp(26px, 5.4vw, 38px);
  overflow: visible;
  padding: var(--rs-bezel) var(--rs-bezel) var(--rs-chin);
  border-radius: 22px;
  /* A plain matte gray-black, no gradient or shine. */
  background: #2a2e33;
  box-shadow: var(--rs-shadow);
}

/* The camera, in the middle of the top edge. */
.rs-demo::before {
  content: "";
  position: absolute;
  top: calc(var(--rs-bezel) / 2 - 3.5px);
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: #10161b;
  box-shadow: 0 0 0 2px #5d6a76;
}

/* The power light, on the chin's right. */
.rs-demo::after {
  content: "";
  position: absolute;
  bottom: calc(var(--rs-chin) / 2 - 4px);
  right: calc(var(--rs-bezel) + 6px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rs-green);
  box-shadow: 0 0 0 2px #10161b, 0 0 8px 1px rgba(46, 204, 113, 0.7);
}

/* The ring is a shadow, not a border, so the cursor's spots (measured from
   the screen's box in about-demo.js) don't move. */
.rs-demo .about-demo-screen {
  container-type: inline-size;
  border-radius: 8px;
  background: var(--rs-tint);
  box-shadow: 0 0 0 3px var(--rs-ink);
}

/* A shine across the screen's corner, over the screens and the cursor. */
.rs-demo .about-demo-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.55) 0 7%, transparent 7.2% 9.6%, rgba(255, 255, 255, 0.4) 9.8% 11.6%, transparent 11.8%);
  pointer-events: none;
}

.rs-monitor-stand {
  position: relative;
  z-index: -1;
  margin-top: -6px;
}

.rs-monitor-stand svg {
  display: block;
  width: 100%;
  height: auto;
}

.rs-demo .rs-demo-touch {
  display: none;
}

.rs-demo-shot {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3cqw;
  padding: 0 5cqw;
  background: var(--rs-tint);
  color: #000;
  text-align: center;
  line-height: 1.3;
}

.rs-demo-shot p {
  margin: 0;
}

.rs-demo-shot mark {
  padding: 0 0.18em;
  border-radius: 0.25em;
  background: color-mix(in srgb, var(--memteal) 45%, #fff);
  color: #000;
}

.rs-demo-shot mark.rs-demo-red { background: #ffc9c9; }
.rs-demo-shot mark.rs-demo-green { background: #b8f2cd; }

.rs-demo-tiles {
  display: flex;
  gap: 3.4cqw;
}

.rs-demo-tile {
  display: grid;
  place-items: center;
  width: 23cqw;
  aspect-ratio: 1;
  padding: 2cqw;
  border: 0.7cqw solid var(--rs-ink);
  border-radius: 3cqw;
  box-shadow: 1cqw 1.2cqw 0 var(--rs-ink);
  font-size: 4cqw;
  font-weight: 900;
}

.rs-demo-tile--teal { background: #00e0c6; }
.rs-demo-tile--yellow { background: var(--rs-yellow); }
.rs-demo-tile--lilac { background: #dcc9ff; }

.rs-demo-title {
  font-size: 5.6cqw;
  font-weight: 900;
}

.rs-demo-signs {
  width: 58cqw;
  height: auto;
}

.rs-demo-light-row {
  display: flex;
  align-items: center;
  gap: 5cqw;
}

.rs-demo-light {
  width: 11cqw;
  height: auto;
}

.rs-demo-lines {
  display: grid;
  gap: 1.6cqw;
  font-size: 4.4cqw;
  font-weight: 800;
}

/* "הבא" – a teal pill at the bottom-left corner (forward, in Hebrew). */
.rs-demo-next {
  position: absolute;
  bottom: 4cqw;
  left: 4cqw;
  display: flex;
  align-items: center;
  gap: 1cqw;
  padding: 1cqw 2.4cqw;
  border: 0.6cqw solid var(--rs-ink);
  border-radius: 2.2cqw;
  background: #00e0c6;
  box-shadow: 0.6cqw 0.7cqw 0 var(--rs-ink);
  font-size: 3.6cqw;
  font-weight: 900;
}

.rs-demo-next svg {
  width: 1em;
  height: 1em;
}

.rs-demo-card {
  min-width: 56cqw;
  padding: 4cqw 5cqw;
  border: 0.7cqw solid var(--rs-ink);
  border-radius: 2.6cqw;
  background: var(--rs-cream);
  box-shadow: 1cqw 1.2cqw 0 var(--rs-ink);
  font-size: 4.4cqw;
  font-weight: 800;
}

.rs-demo-choices {
  display: flex;
  gap: 3.4cqw;
}

.rs-demo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2cqw;
  width: 25cqw;
  padding: 1.8cqw 0;
  border: 0.6cqw solid var(--rs-ink);
  border-radius: 2.2cqw;
  box-shadow: 0.7cqw 0.9cqw 0 var(--rs-ink);
  font-size: 3.8cqw;
  font-weight: 900;
  transition: background-color 0.25s ease, opacity 0.25s ease;
}

.rs-demo-btn svg {
  width: 1em;
  height: 1em;
}

.rs-demo-btn--safe { background: #c9f5d8; }
.rs-demo-btn--danger { background: #ffd2d2; }

.rs-demo-q {
  font-size: 4.8cqw;
  font-weight: 800;
}

.rs-demo-options {
  display: grid;
  gap: 1.6cqw;
  width: 60cqw;
}

.rs-demo-opt {
  padding: 1cqw 2cqw;
  border: 0.5cqw solid var(--rs-ink);
  border-radius: 1.8cqw;
  background: #ddf6f1;
  box-shadow: 0.5cqw 0.6cqw 0 var(--rs-ink);
  font-size: 3.7cqw;
  font-weight: 700;
  transition: background-color 0.25s ease, opacity 0.25s ease;
}

/* The answer comes out right: the clicked one turns green, the rest fade. */
.rs-demo-yes {
  font-size: 3.6cqw;
  font-weight: 900;
  color: #14833f;
  visibility: hidden;
}

.rs-demo-shot.is-done .rs-demo-yes {
  visibility: visible;
  animation: rs-demo-pop 0.35s ease-out;
}

.rs-demo-shot.is-done :is(.rs-demo-btn--safe, .rs-demo-opt--right) {
  background: var(--rs-green);
}

.rs-demo-shot.is-done :is(.rs-demo-btn--danger, .rs-demo-opt:not(.rs-demo-opt--right)) {
  opacity: 0.4;
}

@keyframes rs-demo-pop {
  0% { transform: scale(0.6); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* Phones: the demo plays on a drawn phone – a tall screen in a round dark
   body, the camera pill on top, buttons on its sides – and each screen lays
   out top to bottom. A fingertip taps instead of the arrow. */
@media (max-width: 640px) {
  .rs-about .about-demo-scene {
    width: min(240px, 68%);
  }

  .rs-demo {
    --rs-bezel: 9px;
    padding: var(--rs-bezel);
    border-radius: 40px;
  }

  /* The side buttons: volume on the left, power on the right. */
  .rs-demo::before,
  .rs-demo::after {
    top: 22%;
    bottom: auto;
    z-index: -1;
    width: 12px;
    height: 13%;
    margin: 0;
    border: 3px solid var(--rs-ink);
    border-radius: 5px;
    background: #2a2e33;
    box-shadow: none;
  }

  .rs-demo::before {
    left: -13px;
  }

  .rs-demo::after {
    top: 27%;
    right: -13px;
    height: 10%;
  }

  .rs-demo .about-demo-screen {
    aspect-ratio: 9 / 17;
    border-radius: 31px;
  }

  /* No shine on the phone; the camera pill instead. */
  .rs-demo .about-demo-screen::after {
    inset: 4cqw auto auto 50%;
    width: 28cqw;
    height: 8cqw;
    border-radius: 999px;
    background: #10161b;
    translate: -50% 0;
  }

  .rs-monitor-stand {
    display: none;
  }

  .rs-demo .about-demo-cursor {
    width: 30px;
    margin: 0;
    translate: -50% -50%;
  }

  .rs-demo .rs-demo-arrow {
    display: none;
  }

  .rs-demo .rs-demo-touch {
    display: inline;
  }

  .rs-demo-shot {
    gap: 5cqw;
    padding: 0 7cqw;
  }

  .rs-demo-tiles {
    flex-direction: column;
    gap: 4.5cqw;
  }

  .rs-demo-tile {
    width: 66cqw;
    aspect-ratio: auto;
    padding: 5.5cqw 3cqw;
    border-width: 1.1cqw;
    border-radius: 4cqw;
    box-shadow: 1.4cqw 1.6cqw 0 var(--rs-ink);
    font-size: 7.4cqw;
  }

  .rs-demo-title {
    font-size: 9cqw;
  }

  .rs-demo-signs {
    width: 90cqw;
  }

  .rs-demo-light-row {
    flex-direction: column;
    gap: 5cqw;
  }

  .rs-demo-light {
    width: 22cqw;
  }

  .rs-demo-lines {
    gap: 3cqw;
    font-size: 8cqw;
  }

  .rs-demo-next {
    bottom: 7cqw;
    left: 50%;
    gap: 1.6cqw;
    padding: 2.2cqw 6cqw;
    border-width: 1cqw;
    border-radius: 3.6cqw;
    box-shadow: 1cqw 1.2cqw 0 var(--rs-ink);
    font-size: 6.6cqw;
    translate: -50% 0;
  }

  .rs-demo-card {
    min-width: 0;
    width: 86cqw;
    padding: 7cqw 5cqw;
    border-width: 1.1cqw;
    border-radius: 4cqw;
    box-shadow: 1.4cqw 1.6cqw 0 var(--rs-ink);
    font-size: 7.6cqw;
  }

  .rs-demo-choices {
    flex-direction: column;
    gap: 3.6cqw;
  }

  .rs-demo-btn {
    gap: 2cqw;
    width: 62cqw;
    padding: 3.4cqw 0;
    border-width: 1cqw;
    border-radius: 3.6cqw;
    box-shadow: 1.1cqw 1.3cqw 0 var(--rs-ink);
    font-size: 7cqw;
  }

  .rs-demo-q {
    font-size: 8.2cqw;
  }

  .rs-demo-options {
    gap: 3cqw;
    width: 86cqw;
  }

  .rs-demo-opt {
    padding: 2.8cqw 3cqw;
    border-width: 1cqw;
    border-radius: 3.2cqw;
    box-shadow: 1cqw 1.2cqw 0 var(--rs-ink);
    font-size: 6.2cqw;
  }

  .rs-demo-yes {
    font-size: 7cqw;
  }
}

.rs-doors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 18px);
  max-width: 680px;
  margin: clamp(22px, 3.6vw, 32px) auto 0;
}

.rs-door {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: clamp(12px, 2.2vw, 18px) 8px;
  border: 4px solid var(--rs-ink);
  border-radius: 20px;
  color: #000;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--rs-shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.rs-door:hover {
  transform: translateY(-3px);
}

.rs-door:active {
  transform: translate(4px, 4px);
  box-shadow: 2px 3px 0 0 var(--rs-ink);
}

.rs-door--lessons { background: #ffe873; }
.rs-door--games { background: #9ff0b5; }
.rs-door--practice { background: #a9d8ff; }

.rs-door-icon svg {
  display: block;
  width: clamp(34px, 6vw, 46px);
  height: clamp(34px, 6vw, 46px);
}

.rs-door-title {
  font-size: clamp(1.05rem, 2.6vw, 1.45rem);
}

/* ── צור קשר: the Pleyi home page's two buttons (clean-site.css) ── */

.rs-contact .clean-contact {
  max-width: 720px;
}

/* ── Sections (the roads between them: road-traffic.css) ── */

.rs-section {
  padding-block: clamp(32px, 6vw, 56px) !important;
}

.rs-heading {
  margin: 0 0 clamp(18px, 3vw, 28px);
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 900;
  text-align: center;
  color: #000;
}

/* The lessons, games and exercises pages' titles: the Pleyi pages' big
   yellow title with the thick ink outline (styles.css .hero-title).
   מי אנחנו / צור קשר use it too, at the Pleyi home's section size. */
.rs-heading.rs-page-title,
.rs-heading.rs-section-title {
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  line-height: 1.1;
  color: var(--memyellow);
  -webkit-text-fill-color: var(--memyellow);
  paint-order: stroke fill;
  -webkit-text-stroke: min(0.3em, 24px) var(--ink);
  text-shadow: none;
  letter-spacing: 0;
}

.rs-heading.rs-section-title {
  font-size: clamp(2.35rem, 6.8vw, 3.75rem);
}

/* The games page: a little more room between its title and the cards. */
.rs-page-games .rs-heading.rs-page-title {
  margin-bottom: clamp(30px, 5vw, 46px);
}

/* The lessons' table of contents: buttons in the English page's link rows. */
.rs-toc-lesson {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
}

/* Each page shows its own parts: html[data-rs-page] is home, lessons,
   games, practice, news, or engine (an exercise topic or the exercise
   screen, in #engMain). road-safety.js and a script in the page's <head>
   set it. */
html:not([data-rs-page="home"]) .rs-page-home,
html:not([data-rs-page="lessons"]) .rs-page-lessons,
html:not([data-rs-page="games"]) .rs-page-games,
html:not([data-rs-page="news"]) .rs-page-news,
html[data-rs-page="home"] #engMain,
html[data-rs-page="lessons"] #engMain,
html[data-rs-page="games"] #engMain,
html[data-rs-page="news"] #engMain {
  display: none !important;
}

/* ── מה חדש: on the home page the Pleyi home's cards (clean-site.css
   .news-*), each opening its material on a click; on #news every update,
   by kind under a road-strip heading, each card with a button to the
   material (road-news.js) ── */

.rs-news-open {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* The pale blue tint read as white on the blue page: a cream white. */
.news-item.rs-news-open {
  background: #fff8e7;
}

.rs-news-open .news-shot {
  cursor: inherit;
}

.rs-news-open:hover .news-shot > *,
.rs-news-open:focus-visible .news-shot > * {
  transform: rotate(-2deg) scale(1.04);
}

.rs-news-open:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

/* A new lesson, exercise or game, with no screenshot yet: its drawing in
   the screenshot's frame. */
.news-shot--art {
  display: block;
}

.news-shot--art > * {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  padding: 12%;
  box-sizing: border-box;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #b8fff5;
  box-shadow: var(--shadow-sticker);
  transition: transform 0.2s ease;
}

.rs-news-page {
  max-width: 760px;
}

.rs-news-lead {
  margin: 0 auto clamp(24px, 4vw, 34px);
  text-align: center;
}

.rs-news-lead p {
  margin: 0;
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  font-weight: 800;
  line-height: 1.5;
  color: #000;
}

.rs-news-group + .rs-news-group {
  margin-top: clamp(30px, 5vw, 44px);
}

.rs-news-cards {
  display: grid;
  gap: clamp(16px, 2.5vw, 22px);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The home cards' look, standing still, with no room kept for arrows. */
.rs-news-card {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 24px);
  padding: clamp(16px, 3.5vw, 22px) clamp(16px, 4vw, 26px);
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #fff8e7;
  box-shadow: var(--shadow-sticker);
  color: #000;
}

.rs-news-actions {
  margin-top: 14px;
}

.rs-news-card .rs-news-go {
  padding: 9px 20px;
  border-width: 3px !important;
  font-size: 1.05rem;
  box-shadow: 4px 5px 0 0 var(--rs-ink);
}

@media (max-width: 480px) {
  .rs-news-card {
    flex-direction: column;
    gap: 14px;
  }

  .rs-news-card .news-shot {
    order: -1;
    width: 104px;
  }
}

/* ── The lessons library: the English page's numbered path tiles and
   stage headings (english-learning.css), here as buttons ── */

.rs-lessons .eng-topic-tile {
  width: 100%;
  font: inherit;
  cursor: pointer;
}

.rs-lessons .eng-topic-tile .eng-topic-open {
  background: var(--rs-yellow);
}

/* A lesson tile: the "i" in the top-right corner, the name in the middle and
   "פתיחה" at the bottom. The pill's ::after covers the whole tile, so a tap
   anywhere opens the lesson; only the "i" sits above it. */
.rs-lessons .rs-lesson-tile {
  padding-top: 52px;
  padding-bottom: 12px;
}

.rs-lessons .rs-lesson-tile .eng-topic-title {
  margin-block: auto;
}

/* The tile's back (the "i" flips it, road-safety.js): the lesson in two short
   lines between the "i" and "פתיחה". The name and number stay in place,
   hidden, so the tile keeps its size; road-safety.js sets the bottom and
   shrinks the lines until they fit. */
.rs-lessons .rs-lesson-back {
  position: absolute;
  top: 48px;
  bottom: 64px;
  inset-inline: 8px;
  display: none;
  align-items: center;
  justify-content: center;
}

.rs-lessons .rs-lesson-tile.is-flipped .rs-lesson-back {
  display: flex;
}

.rs-lessons .rs-lesson-tile.is-flipped :is(.eng-topic-title, .eng-path-num) {
  visibility: hidden;
}

.rs-lesson-back-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
  color: #000;
  font-size: clamp(1.1rem, 4.4vw, 1.35rem);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.rs-lesson-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  margin-top: 10px;
}

.rs-lessons .rs-lesson-tile .rs-lesson-open {
  position: static;
  transform: none;
  cursor: pointer;
}

.rs-lessons .rs-lesson-open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.rs-lessons .rs-lesson-tile .rs-lesson-open:focus-visible {
  outline: 3px solid var(--rs-ink);
  outline-offset: 2px;
}

.rs-lessons .rs-lesson-tile:has(.rs-lesson-open:focus-visible) {
  transform: scale(1.06);
}

.rs-lessons .rs-lesson-info {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 36px;
  height: 36px;
  transition: scale 0.14s ease;
}

.rs-lessons .rs-lesson-info svg {
  width: 18px;
  height: 18px;
}

.rs-lessons .rs-lesson-info:hover,
.rs-lessons .rs-lesson-info:focus-visible {
  scale: 1.12;
}

.rs-lessons .rs-lesson-info:active {
  translate: 1px 2px;
  box-shadow: 1px 1px 0 0 var(--rs-ink);
}

/* Over the "i" the tile stays put: only the "i" grows or sinks. */
.rs-lessons .rs-lesson-tile:has(.rs-lesson-info:hover),
.rs-lessons .eng-topic-grid .rs-lesson-tile:has(.rs-lesson-info:active) {
  transform: none;
  box-shadow: var(--eng-card-shadow);
}

@media (max-width: 480px) {
  .rs-lessons .rs-lesson-tile .rs-lesson-open {
    padding-inline: 12px;
  }

  .rs-lessons .rs-lesson-tile {
    padding-top: 46px;
  }

  .rs-lessons .rs-lesson-back {
    top: 42px;
    inset-inline: 6px;
  }

  .rs-lessons .rs-lesson-info {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
  }

  .rs-lessons .rs-lesson-info svg {
    width: 16px;
    height: 16px;
  }
}

/* Bigger lesson names than the English tiles (1.2rem on phones) */
.rs-lessons .eng-topic-title {
  font-size: clamp(1.5rem, 6.5vw, 2.1rem);
}

/* ── Game cards: same size, the picture, the title and two buttons; the
   details are in the "i" dialog. ── */

.rs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: clamp(16px, 2.5vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.rs-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 4px solid var(--rs-ink);
  border-radius: 22px;
  background: var(--rs-cream);
  box-shadow: var(--rs-shadow);
  overflow: hidden;
}

.rs-card-art {
  display: grid;
  place-items: center;
  height: 150px;
  padding: 10px;
  border: 0;
  border-bottom: 4px solid var(--rs-ink);
  background: var(--rs-tint);
  cursor: pointer;
}

.rs-card-art svg {
  display: block;
  max-width: 100%;
  max-height: 128px;
  width: auto;
  height: auto;
}

.rs-card-title {
  margin: 14px 12px 10px;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  color: #000;
}

.rs-card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
  padding: 0 12px 16px;
}

.rs-card-actions .rs-open {
  padding: 13px 30px;
  font-size: 1.3rem;
  border-width: 3px !important;
  box-shadow: 4px 5px 0 0 var(--rs-ink);
}

.rs-info-btn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 3px solid var(--rs-ink);
  border-radius: 50%;
  background: var(--rs-tint);
  color: #000;
  cursor: pointer;
  box-shadow: 2px 3px 0 0 var(--rs-ink);
}

.rs-info-btn svg {
  width: 24px;
  height: 24px;
}

/* Every game card on a road: the dividers' asphalt, only a little rough
   (rs-asphalt--soft, road-traffic.js), and a white title. */
.rs-game-card .rs-card-title {
  font-size: 1.6rem;
  color: #fff;
}

/* ── Exercises: the engine's path, under its heading ── */

.rs-practice {
  background: var(--rs-sky);
}

/* ── Footer ── */

.rs-footer {
  padding: 16px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 4px solid var(--rs-ink);
  background: var(--rs-asphalt);
  color: #fff;
  text-align: center;
}

.rs-footer-brand {
  margin: 0 0 4px;
  font-size: 1.5rem;
  color: #fff;
}

.rs-footer-by {
  margin: 0 0 6px;
  font-weight: 800;
}

.rs-footer a {
  color: var(--rs-yellow);
}

.rs-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  font-size: 0.95rem;
}

/* The exercise screen is fixed, without the top bar or the footer. */
html.eng-runner-open .rs-bar,
html.eng-runner-open .rs-footer {
  display: none !important;
}

/* ── The "i" dialog ── */

.modal-overlay > .modal.rs-info {
  --modal-fill: var(--rs-tint);
  background: var(--rs-tint) !important;
  border: 4px solid var(--rs-ink);
  box-shadow: var(--rs-shadow);
  max-width: 460px;
}

.rs-info .rs-info-title {
  margin: 0 0 14px;
  padding-inline-end: 36px;
  font-size: 1.6rem;
  font-weight: 900;
}

/* Dialog titles in plain black: styles.css outlines every .modal h2, and
   its :is() list outweighs a two-class rule. */
body.page-road .modal h2,
body.page-road .modal h2 * {
  paint-order: normal;
  -webkit-text-stroke: 0;
  -webkit-text-fill-color: #000;
  color: #000;
  text-shadow: none;
}

.rs-info-lines {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rs-info-lines li {
  position: relative;
  padding-inline-start: 22px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.45;
  color: #000;
}

.rs-info-lines li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.5em;
  width: 11px;
  height: 11px;
  border: 2px solid var(--rs-ink);
  border-radius: 50%;
  background: var(--rs-yellow);
}

.rs-info-actions {
  display: flex;
  justify-content: center;
}

/* ── Game screen: fixed over the page, no scrolling ── */

html.rs-game-open,
html.rs-game-open body {
  overflow: hidden;
}

.rs-game {
  position: fixed !important;
  inset: 0;
  z-index: 3000 !important;
  display: grid;
  place-items: center;
  padding: clamp(0px, 2vw, 20px);
  background: rgba(20, 28, 36, 0.62);
}

.rs-game-shell {
  display: flex;
  flex-direction: column;
  width: min(100%, 780px);
  /* The screen's padding around it comes off, so its bottom is never cut. */
  height: min(calc(100dvh - 2 * clamp(0px, 2vw, 20px)), 780px);
  border: 4px solid var(--rs-ink);
  border-radius: 24px;
  background: var(--rs-tint);
  box-shadow: var(--rs-shadow);
  overflow: hidden;
}

.rs-game-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  background: var(--rs-asphalt);
  border-bottom: 3px solid var(--rs-ink);
  color: #fff;
}

.rs-game-title {
  margin: 0;
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rs-game-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

/* Plain black letters on the yellow pill. */
.rs-chip {
  padding: 3px 10px;
  border: 2px solid var(--rs-ink);
  border-radius: 999px;
  background: var(--rs-yellow);
  box-shadow: 2px 3px 0 0 var(--rs-ink);
  color: #000;
  -webkit-text-fill-color: #000;
  -webkit-text-stroke: 0;
  font-size: 0.95rem;
  font-weight: 900;
  white-space: nowrap;
}

.rs-hearts {
  display: flex;
  gap: 5px;
}

/* The thick outline reaches a little past the svg's box. */
.rs-heart {
  width: 24px;
  height: 24px;
  overflow: visible;
  fill: var(--rs-red);
}

.rs-heart.is-empty {
  fill: #6b7783;
}

.rs-game-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 3px solid var(--rs-ink);
  border-radius: 50%;
  background: var(--rs-yellow);
  color: #000;
  cursor: pointer;
  box-shadow: 2px 3px 0 0 var(--rs-ink);
}

.rs-game-close svg {
  width: 22px;
  height: 22px;
}

.rs-game-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(12px, 2.5dvh, 24px) clamp(12px, 3vw, 28px) max(clamp(12px, 2.5dvh, 24px), env(safe-area-inset-bottom, 0px));
}

.rs-feedback {
  min-height: 1.5em;
  margin: 0;
  font-size: clamp(1.05rem, 2.6dvh, 1.3rem);
  font-weight: 900;
  line-height: 1.3;
  text-align: center;
  color: #000;
}

.rs-feedback.is-good { color: #12733a; }
.rs-feedback.is-bad { color: #b3261e; }

/* חוצים בירוק */

.rs-lg {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1.8dvh, 16px);
}

/* The street: the PAT map's soft meadow (its two greens in diamond tiles,
   tufts and a few flowers), a sidewalk on each side of the road, a long
   crossing, and the hero's light on the far sidewalk beside it. */
.rs-lg-scene {
  --rs-zebra-w: clamp(110px, 28vw, 150px);
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 16px minmax(90px, 0.8fr) 16px 22px;
  border: 4px solid var(--rs-ink);
  border-radius: 18px;
  box-shadow: 4px 5px 0 0 var(--rs-ink);
  overflow: hidden;
  direction: ltr;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='96'%3E%3Cpath fill='%239fc972' d='M0-24l48 24-48 24-48-24zM96-24l48 24-48 24-48-24zM192-24l48 24-48 24-48-24zM0 24l48 24-48 24-48-24zM96 24l48 24-48 24-48-24zM192 24l48 24-48 24-48-24zM0 72l48 24-48 24-48-24zM96 72l48 24-48 24-48-24zM192 72l48 24-48 24-48-24z'/%3E%3Cpath fill='none' stroke='%237cb85a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M28 18l3 4.5 3-6 1.5 6 3-4.5M118 12l3 4.5 3-6 1.5 6 3-4.5M68 56l3 4.5 3-6 1.5 6 3-4.5M158 64l3 4.5 3-6 1.5 6 3-4.5M16 78l3 4.5 3-6 1.5 6 3-4.5M102 84l3 4.5 3-6 1.5 6 3-4.5'/%3E%3Ccircle cx='150' cy='34' r='2.2' fill='%23fff'/%3E%3Ccircle cx='52' cy='40' r='2.2' fill='%23fff6a8'/%3E%3Ccircle cx='182' cy='88' r='2.2' fill='%23fff'/%3E%3C/svg%3E") 0 0 / 192px 96px,
    #a5d275;
}

.rs-lg-scene::before,
.rs-lg-scene::after {
  content: "";
  grid-column: 1;
  background:
    repeating-linear-gradient(to right, transparent 0 30px, rgb(0 0 0 / 0.1) 30px 32px),
    #e4dccb;
}

.rs-lg-scene::before {
  grid-row: 2;
  border-top: 3px solid var(--rs-ink);
}

.rs-lg-scene::after {
  grid-row: 4;
  border-bottom: 3px solid var(--rs-ink);
}

/* Its foot on the far sidewalk, a little to the side of the crossing. */
.rs-lg-light {
  grid-row: 1 / 3;
  grid-column: 1;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 10px;
  transform: translateX(calc(var(--rs-zebra-w) / 2 + 30px));
}

.rs-lg-light svg {
  height: 100%;
  max-height: 300px;
  width: auto;
}

.rs-lg-road {
  position: relative;
  grid-row: 3;
  grid-column: 1;
  border-block: 4px solid var(--rs-ink);
  background:
    repeating-linear-gradient(to right, #f2c94c 0 26px, transparent 26px 52px) center / 100% 4px no-repeat,
    var(--rs-asphalt-2);
  overflow: hidden;
  transition: background-color 0.2s ease;
}

.rs-lg-road.is-safe { background-color: #2f8a55; }
.rs-lg-road.is-bad { background-color: #a3352f; }

.rs-lg-zebra {
  position: absolute;
  inset: 3px auto 3px 50%;
  width: var(--rs-zebra-w);
  transform: translateX(-50%);
  /* Whole stripes at any road height: "round" fits a whole number of them. */
  background: linear-gradient(to bottom, transparent 25%, #fff 25% 75%, transparent 75%) 0 0 / 100% 20px no-repeat round;
}

.rs-lg-car {
  position: absolute;
  top: 50%;
  left: 0;
  width: clamp(80px, 18vw, 120px);
  transform: translate(-120%, -50%);
}

.rs-lg-car svg {
  display: block;
  width: 100%;
  height: auto;
}

.rs-lg-car.is-driving {
  animation: rs-car-pass 1.5s linear forwards;
}

@keyframes rs-car-pass {
  from { left: 0; transform: translate(-120%, -50%); }
  to { left: 100%; transform: translate(20%, -50%); }
}

.rs-lg-dots {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.rs-lg-dots span {
  width: 18px;
  height: 18px;
  border: 3px solid var(--rs-ink);
  border-radius: 50%;
  background: #fff;
}

.rs-lg-dots span.is-done {
  background: var(--rs-green);
}

.rs-go-btn {
  flex-shrink: 0;
  min-width: min(100%, 280px);
  padding: clamp(12px, 2.4dvh, 20px) 28px;
  border-radius: 999px;
  background: var(--rs-green);
  color: #000;
  font-size: clamp(1.5rem, 4dvh, 2.1rem);
}

/* זיכרון תמרורים */

.rs-mem {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.6dvh, 14px);
}

.rs-mem-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.5vw, 14px);
}

.rs-mem-card {
  position: relative;
  min-height: 0;
  padding: 6px;
  border: 3px solid var(--rs-ink);
  border-radius: 16px;
  background:
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(255, 255, 255, 0.08) 12px 24px),
    var(--rs-asphalt-2);
  color: #000;
  cursor: pointer;
  box-shadow: 3px 4px 0 0 var(--rs-ink);
  overflow: hidden;
}

.rs-mem-back {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--rs-yellow);
  font-size: clamp(1.8rem, 5dvh, 2.6rem);
  font-weight: 900;
}

.rs-mem-face {
  display: none;
  place-items: center;
  height: 100%;
}

.rs-mem-card.is-open {
  background: var(--rs-cream);
}

.rs-mem-card.is-open .rs-mem-back {
  display: none;
}

.rs-mem-card.is-open .rs-mem-face {
  display: grid;
}

.rs-mem-card.is-matched {
  background: #c9f5d9;
  cursor: default;
}

.rs-mem-face svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: 100%;
}

.rs-mem-name {
  font-size: clamp(0.95rem, 2.4dvh, 1.25rem);
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

/* מה אומר התמרור? and איזה תמרור?: the sign (or the name) on top, and four
   answers in two rows of two, all the same size. */

.rs-sq-sign {
  flex-shrink: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  margin-bottom: clamp(10px, 2.4dvh, 24px);
}

.rs-sq-sign svg {
  display: block;
  width: auto;
  height: clamp(100px, 24dvh, 210px);
  max-width: 100%;
}

.rs-quiz .rs-sq-answers {
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 2dvh, 16px);
}

.rs-quiz .rs-sq-answers .eng-option {
  min-width: 0;
  padding-inline: 10px;
  line-height: 1.25;
}

.rs-quiz .rs-sq-pic {
  display: grid;
  place-items: center;
  padding: clamp(6px, 1.4dvh, 12px);
}

.rs-sq-pic svg {
  display: block;
  width: auto;
  height: clamp(64px, 15dvh, 130px);
  max-width: 100%;
}

/* The two big answer buttons of תקין או לא תקין? (road-cases.js). */

.rs-safe-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 3vw, 22px);
}

.rs-safe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: clamp(14px, 3dvh, 22px) 12px;
  border-radius: 20px;
  color: #000;
  font-size: clamp(1.4rem, 4dvh, 1.9rem);
}

.rs-safe-btn svg {
  width: 1.2em;
  height: 1.2em;
}

.rs-safe-btn--yes { background: #9ff0b5; }
.rs-safe-btn--no { background: #ff9a9a; }

.rs-safe-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.rs-safe-btn.is-right {
  opacity: 1;
  outline: 5px solid var(--rs-green);
  outline-offset: 3px;
}

.rs-safe-btn.is-wrong {
  opacity: 1;
  outline: 5px solid var(--rs-red);
  outline-offset: 3px;
}

/* ── The question games (בטוח או מסוכן?, מה קודם?): the exercises' soft
   question screen (english-learning.css, html.eng-soft) on this site's
   light page. The round back arrow and the title on top, then the
   instructions and the progress dots, the question and its answers right
   under it. Soft fills; only the answers get the ink frame. The
   content uses the exercises' own classes (eng-sentence, eng-option…). ── */

.rs-game.is-soft {
  --soft-fill: #dbf2ee;
  --soft-fill-hover: #c8ebe5;
  --soft-edge: #bfe2dc;
  --soft-tint: #e3f5f2;
  --soft-accent: #00bfae;
  --soft-muted: #3d5754;
  --soft-yellow-edge: #d9bc00;
}

.rs-game.is-soft .rs-game-shell {
  border: 0;
  background: #dff0ff;
  box-shadow: 0 24px 60px -24px rgba(0, 40, 80, 0.55);
}

/* The exercises' top row: the back arrow on the start side, the title in
   the middle, an empty column of the same width on the end side. */
.rs-game.is-soft .rs-game-top {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  grid-template-areas: "close title status";
  gap: 8px;
  padding: max(clamp(12px, 2.5dvh, 24px), env(safe-area-inset-top, 0px)) clamp(14px, 3vw, 28px) 0;
  border: 0;
  background: none;
}

.rs-game.is-soft .rs-game-close {
  grid-area: close;
  border-color: transparent;
  background: #d5f2ee;
  box-shadow: none;
}

.rs-game.is-soft .rs-game-close:hover {
  background: var(--soft-fill-hover);
}

.rs-game.is-soft .rs-game-title {
  grid-area: title;
  min-width: 0;
  color: #000;
  -webkit-text-fill-color: #000;
  font-size: clamp(1.1rem, min(4.6vw, 3.4dvh), 1.7rem);
  line-height: 1.15;
  white-space: normal;
  text-align: center;
}

.rs-game.is-soft .rs-game-status {
  grid-area: status;
  margin: 0;
}

.rs-quiz {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 640px);
  margin-inline: auto;
}

.rs-quiz .eng-instructions {
  margin: 0 0 clamp(8px, 1.5dvh, 14px);
  font-size: clamp(0.95rem, 2.4dvh, 1.1rem);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  color: var(--soft-muted);
}

/* Progress: dots, the current question a wider teal pill. */
.rs-quiz .eng-progress {
  flex-shrink: 0;
  margin-bottom: clamp(12px, 3dvh, 32px);
}

.rs-quiz .eng-bar {
  justify-content: center;
  gap: 6px;
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.rs-quiz .eng-bar-seg {
  flex: 0 1 8px;
  min-width: 3px;
  height: 8px;
  background: #c3e7e2;
}

.rs-quiz .eng-bar-seg::after {
  background: var(--soft-accent);
}

.rs-quiz .eng-bar-seg.is-current {
  flex-basis: 24px;
}

.rs-quiz .eng-bar-seg.is-current::after {
  opacity: 1;
}

.rs-quiz .eng-sentence {
  align-self: stretch;
  margin: 0 0 clamp(12px, 2.6dvh, 26px);
  padding: clamp(6px, 1.4dvh, 14px) 8px;
  background: transparent;
  font-size: clamp(1.25rem, min(4.4vw, 4dvh), 2.2rem);
  line-height: 1.5;
}

/* Answers: soft fill, no outline. */
/* The answers keep the site's ink frame: a thick dark outline and the
   hard offset shadow behind it. */
.rs-quiz :is(.eng-option, .eng-chip) {
  border: 3px solid var(--rs-ink);
  background: var(--soft-fill);
  box-shadow: 3px 4px 0 0 var(--rs-ink);
}

.rs-quiz .eng-option {
  padding-block: clamp(8px, 1.6dvh, 14px);
}

.rs-quiz :is(.eng-option, .eng-chip):hover:not(:disabled) {
  background: var(--soft-fill-hover);
  transform: translateY(-1px);
}

.rs-quiz :is(.eng-option, .eng-chip):active:not(:disabled) {
  transform: translate(2px, 3px);
  box-shadow: 1px 1px 0 0 var(--rs-ink);
}

.rs-quiz .eng-option.is-right {
  background: var(--eng-right-soft);
  border-color: var(--eng-right);
  box-shadow: 3px 4px 0 0 var(--rs-ink);
}

.rs-quiz :is(.eng-option, .eng-chip).is-wrong {
  background: var(--eng-wrong-soft);
  border-color: var(--eng-wrong);
  box-shadow: 3px 4px 0 0 var(--rs-ink);
}

.rs-quiz .eng-feedback {
  align-self: stretch;
  flex-shrink: 0;
  min-height: clamp(48px, 7dvh, 64px);
  margin-top: clamp(8px, 2dvh, 20px);
}

/* After a wrong answer the message and "הבא" share one row. */
.rs-quiz .eng-feedback:has(> .eng-next) {
  flex-wrap: nowrap;
  gap: 12px;
}

.rs-quiz .eng-feedback-msg {
  min-width: 0;
  font-size: clamp(1rem, 2.6dvh, 1.2rem);
  line-height: 1.35;
}

.rs-quiz .eng-next {
  flex-shrink: 0;
}

/* The yellow buttons ("הבא", and the results' buttons) with a soft edge.
   !important because .btn-candy sets its outline with !important. */
.rs-game.is-soft .btn-candy {
  border-color: transparent !important;
  box-shadow: 0 4px 0 var(--soft-yellow-edge);
}

.rs-game.is-soft .btn-candy:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--soft-yellow-edge);
}

.rs-game.is-soft .rs-btn-soft {
  background: var(--soft-fill);
  box-shadow: 0 4px 0 var(--soft-edge);
}

/* מה קודם?: numbered places for the steps, and the steps under them. On a
   short screen the empty places shrink, so the steps below still fit. */
.rs-order-slots {
  align-self: stretch;
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1dvh, 8px);
  margin: 0 0 clamp(12px, 2.4dvh, 22px);
  padding: 0;
  list-style: none;
  counter-reset: rs-step;
}

.rs-order-slots li {
  counter-increment: rs-step;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 clamp(34px, 5.6dvh, 48px);
  min-height: 0;
  padding: 2px 12px;
  border: 2px dashed #a9cfc9;
  border-radius: 14px;
  background: var(--soft-tint);
  font-family: "Varela Round", var(--font-sans), system-ui, sans-serif;
  font-size: clamp(0.98rem, 2.4dvh, 1.2rem);
  font-weight: 700;
  color: #000;
}

.rs-order-slots li::before {
  content: counter(rs-step);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: clamp(22px, 4dvh, 28px);
  height: clamp(22px, 4dvh, 28px);
  border-radius: 50%;
  background: #c3e7e2;
  font-family: var(--font-sans);
  font-size: clamp(0.82rem, 2dvh, 0.95rem);
  font-weight: 900;
  color: var(--soft-muted);
}

.rs-order-slots li.is-filled {
  border: 2px solid var(--eng-right);
  background: var(--eng-right-soft);
  box-shadow: 0 3px 0 #9fdcb8;
}

.rs-order-slots li.is-filled::before {
  background: var(--eng-right);
  color: #fff;
}

.rs-order-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 1.4dvh, 12px);
}

.rs-order-step {
  padding: clamp(7px, 1.4dvh, 10px) 14px;
  font-size: clamp(1rem, 2.5dvh, 1.25rem);
  line-height: 1.25;
}

/* A used step keeps its place, so the others don't jump. */
.rs-order-step.is-used {
  visibility: hidden;
}

.rs-order-step.is-wrong {
  animation: rs-shake 0.35s ease;
}

@keyframes rs-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* מצאו בתמונה, מה לא בסדר? */

.rs-card-img {
  display: block;
  max-width: 100%;
  max-height: 128px;
  border: 3px solid var(--rs-ink);
  border-radius: 10px;
  object-fit: cover;
}

.rs-pg {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.4dvh, 12px);
}

.rs-pic-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

/* The picture pans inside this view when zoomed in. */
.rs-pic-view {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  border: 3px solid var(--rs-ink);
  border-radius: 14px;
  background: var(--rs-asphalt-2);
  scrollbar-width: none;
}

.rs-pic-view::-webkit-scrollbar {
  display: none;
}

.rs-pic {
  position: relative;
  cursor: crosshair;
  touch-action: pan-x pan-y;
}

.rs-pic img,
.rs-pic-marks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.rs-pic img {
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
}

.rs-pic-marks {
  pointer-events: none;
  fill: none;
}

.rs-pic-marks .is-found {
  stroke: var(--rs-green);
  stroke-width: 5px;
}

.rs-pic-marks .is-wrong {
  stroke: var(--rs-red);
  stroke-width: 5px;
}

.rs-pic-marks .is-hint {
  stroke: var(--rs-yellow);
  stroke-width: 5px;
  stroke-dasharray: 10 8;
  animation: rs-blink 0.6s steps(2) infinite;
}

.rs-pic-miss {
  stroke: var(--rs-red);
  stroke-width: 4px;
  stroke-linecap: round;
}

@keyframes rs-blink {
  50% { opacity: 0; }
}

.rs-pic-tools {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rs-pic-btn {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 8px;
  border: 3px solid var(--rs-ink);
  border-radius: 12px;
  background: var(--rs-yellow);
  color: #000;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 2px 3px 0 0 var(--rs-ink);
}

.rs-pic-btn--hint {
  font-size: 0.95rem;
  background: var(--rs-cream);
}

.rs-pic-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.rs-pg-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rs-pg-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 2.5px solid var(--rs-ink);
  border-radius: 999px;
  background: var(--rs-cream);
  font-size: clamp(0.9rem, 2.2dvh, 1.05rem);
  font-weight: 900;
  color: #000;
}

.rs-pg-list li img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.rs-pg-list li.is-found {
  background: #c9f5d9;
  text-decoration: line-through;
}

.rs-pg-found {
  max-height: 22dvh;
  margin: 0;
  padding: 0 1.4em 0 0;
  overflow-y: auto;
  font-size: clamp(0.9rem, 2.2dvh, 1.05rem);
  font-weight: 700;
  color: #000;
}

.rs-pg-found:empty {
  display: none;
}

/* Results */

.rs-results {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.4dvh, 18px);
  text-align: center;
}

.rs-stars {
  display: flex;
  gap: 8px;
}

.rs-star {
  width: clamp(54px, 11dvh, 84px);
  height: clamp(54px, 11dvh, 84px);
  fill: #cfd8dc;
}

.rs-star.is-on {
  fill: var(--rs-yellow);
}

.rs-results-score {
  margin: 0;
  font-size: clamp(1.8rem, 5dvh, 2.6rem);
  color: #000;
}

.rs-results-text {
  margin: 0;
  max-width: 26em;
  font-size: clamp(1.05rem, 2.6dvh, 1.3rem);
  font-weight: 800;
  color: #000;
}

.rs-results-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.rs-results-actions .btn {
  padding: 12px 24px;
  font-size: 1.15rem;
}

.rs-btn-soft {
  background: var(--rs-cream);
  color: #000;
}

@media (prefers-reduced-motion: reduce) {
  .rs-lg-car.is-driving { animation-duration: 2.2s; }
  .rs-order-step.is-wrong { animation: none; }
}

/* ── Tablets and phones ── */

@media (max-width: 860px) {
  .rs-bar-inner {
    gap: 10px;
    padding-block: 8px 10px;
  }

  /* The tabs and sign-in move into the phone menu. */
  .rs-tabs,
  .rs-bar .rs-login {
    display: none;
  }

  .rs-bar .rs-menu-toggle {
    display: flex;
  }
}

@media (min-width: 861px) {
  .rs-menu {
    display: none;
  }
}

@media (max-width: 640px) {
  /* A shorter top bar: it stays on screen while scrolling. */
  .rs-bar-inner {
    gap: 6px 8px;
    padding-block: 6px 9px;
  }

  .rs-bar .eng-back {
    width: 38px;
    height: 38px;
  }

  .rs-hero-inner {
    --rs-title-size: clamp(4.3rem, 22.5vw, 6rem);
  }

  .rs-title {
    margin-top: 0.6em;
  }

  .rs-hero-actions {
    margin-top: 18px;
  }

  .rs-hero-actions .btn {
    padding: 16px 28px;
    border-width: 5px;
    /* As big as fits one line beside the 16px side gutters. */
    font-size: clamp(22px, calc(11vw - 8px), 40px);
  }

  .rs-doors {
    width: 100%;
  }

  /* A lesson or game card on one row: the picture beside the title. */
  .rs-cards {
    grid-template-columns: 1fr;
  }

  .rs-card {
    display: grid;
    grid-template-columns: 112px 1fr;
    grid-template-rows: 1fr auto;
  }

  .rs-card-art {
    grid-row: 1 / 3;
    height: 100%;
    min-height: 118px;
    border-bottom: 0;
    border-inline-end: 4px solid var(--rs-ink);
    padding: 6px;
  }

  .rs-card-art svg {
    max-height: 96px;
  }

  .rs-card-title {
    align-self: end;
    margin: 12px 12px 8px;
    font-size: 1.2rem;
    text-align: start;
  }

  .rs-card-actions {
    justify-content: flex-start;
    padding: 0 12px 12px;
  }

  .rs-card-actions .rs-open {
    padding: 11px 26px;
    font-size: 1.22rem;
  }

  /* A game's name big, and its play button at the left end. */
  .rs-game-card .rs-card-title {
    font-size: 1.5rem;
  }

  .rs-game-card .rs-card-actions {
    justify-content: flex-end;
  }

  .rs-game {
    padding: 0;
  }

  .rs-game-shell {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* The game's name may take two lines beside the score chips, so it is
     never cut short. */
  .rs-game-top {
    gap: 8px;
    padding-inline: 10px;
  }

  .rs-game-title {
    min-width: 0;
    white-space: normal;
    line-height: 1.1;
  }

  /* The legal links keep clear of the round up-arrow button at the left,
     so the footer needs no empty room under them. */
  .rs-legal {
    padding-inline: 58px;
    gap: 4px 14px;
  }

  .rs-mem-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .rs-door {
    padding: 10px 4px;
    border-width: 3px;
    border-radius: 16px;
  }

  .rs-card {
    grid-template-columns: 92px 1fr;
  }

  .rs-chip {
    padding: 2px 7px;
    font-size: 0.85rem;
  }

  /* Each word of the game's name whole on its line, beside the chips. */
  .rs-game-title {
    font-size: 1.05rem;
  }

  .rs-game-status {
    gap: 5px;
  }

  .rs-heart {
    width: 20px;
    height: 20px;
  }
}
