/*
 * Reading Pac-Man mockup shell
 * --------------------------------
 * This layer matches the supplied design on every setup, question, feedback,
 * and results screen. The actual #game-screen is deliberately excluded so
 * the production maze, HUD, controls, and canvas remain unchanged.
 */

#readingPacmanGame {
  --mm-bg: #05070f;
  --mm-panel: rgba(255,255,255,.035);
  --mm-panel-hover: rgba(255,255,255,.055);
  --mm-line: rgba(120,160,255,.18);
  --mm-line-soft: rgba(120,160,255,.14);
  --mm-text: #eaf0ff;
  --mm-muted: #94a5cb;
  --mm-dim: #7d8fc0;
  --mm-cyan: #5ff0ff;
  --mm-cyan-deep: #22c6e6;
  --mm-gold: #ffd21e;
  --mm-green: #46e39b;
  --mm-purple: #a97bff;
  background: var(--mm-bg);
  color: var(--mm-text);
}

#readingPacmanGame .cp_app {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  overflow-y: visible;
  padding: 0;
  color: var(--mm-text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: radial-gradient(1200px 720px at 50% -12%, #16274a 0%, #0a1224 42%, #05070f 100%);
}

#readingPacmanGame .cp_app::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(120,160,255,.07) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000, transparent 80%);
  mask-image: radial-gradient(circle at 50% 30%, #000, transparent 80%);
}

/* Restore the original game-stage presentation whenever the maze is active. */
#readingPacmanGame[data-active-screen="game-screen"] .cp_app {
  overflow: hidden;
  padding: 18px;
  font-family: "Orbitron", "Audiowide", system-ui, sans-serif;
  background:
    radial-gradient(circle at 50% -10%, rgba(0,55,255,.28), transparent 34%),
    radial-gradient(circle at 13% 82%, rgba(255,59,59,.16), transparent 34%),
    radial-gradient(circle at 88% 80%, rgba(255,237,0,.14), transparent 38%),
    linear-gradient(180deg,#090d1f 0%,#050507 100%);
}

#readingPacmanGame[data-active-screen="game-screen"] .cp_app::before {
  display: none;
}

#readingPacmanGame .screen:not(#game-screen) {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  min-height: var(--abz-game-stage-height, 100dvh);
  margin: 0 auto;
  padding: 34px 22px 60px;
  gap: 24px;
  color: var(--mm-text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: transparent;
  box-shadow: none;
}

#readingPacmanGame .screen:not(#game-screen)::before,
#readingPacmanGame .screen:not(#game-screen)::after {
  display: none;
}

#readingPacmanGame .screen:not(#game-screen) h1,
#readingPacmanGame .screen:not(#game-screen) h2,
#readingPacmanGame .screen:not(#game-screen) h3,
#readingPacmanGame .screen:not(#game-screen) .screen-title,
#readingPacmanGame .screen:not(#game-screen) .pill-title,
#readingPacmanGame .screen:not(#game-screen) .btn {
  font-family: "Chakra Petch", "Space Grotesk", system-ui, sans-serif;
}

#readingPacmanGame .screen:not(#game-screen) h1,
#readingPacmanGame .screen:not(#game-screen) h2,
#readingPacmanGame .screen:not(#game-screen) h3,
#readingPacmanGame .screen:not(#game-screen) .screen-title {
  color: var(--mm-text) !important;
  text-shadow: none;
}

#readingPacmanGame [hidden] {
  display: none !important;
}

#readingPacmanGame .mockup-step {
  display: block;
  color: var(--mm-dim);
  font: 600 12px/1.2 "Chakra Petch", sans-serif;
  letter-spacing: .32em;
  text-transform: uppercase;
}

#readingPacmanGame .mockup-screen-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

#readingPacmanGame .mockup-screen-head .screen-title {
  margin: 2px 0 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

#readingPacmanGame .mockup-screen-subtitle {
  max-width: 560px;
  margin: 0;
  color: var(--mm-muted);
}

#readingPacmanGame .mockup-back-btn,
#readingPacmanGame .mockup-text-back,
#readingPacmanGame .pac-redesign-login-link {
  appearance: none;
  cursor: pointer;
  color: #c7d3ef;
  font-family: "Space Grotesk", sans-serif;
}

#readingPacmanGame .mockup-back-btn {
  flex: none;
  padding: 9px 16px;
  border: 1px solid var(--mm-line);
  border-radius: 11px;
  background: rgba(255,255,255,.05);
  font-size: 14px;
}

#readingPacmanGame .mockup-text-back {
  border: 0;
  padding: 5px 10px;
  color: var(--mm-dim);
  background: transparent;
  font-size: 14px;
}

#readingPacmanGame .mockup-back-btn:hover,
#readingPacmanGame .mockup-text-back:hover {
  color: #fff;
  border-color: rgba(95,240,255,.42);
}

#readingPacmanGame .screen:not(#game-screen) .btn {
  cursor: pointer;
  transform: none;
}

/* Home */
#readingPacmanGame #start-screen {
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 40px 20px;
  text-align: center;
}

#readingPacmanGame #start-screen .cover {
  display: none;
}

#readingPacmanGame .pac-redesign-mark {
  display: flex;
  align-items: center;
  gap: 16px;
  animation: mm-float 4s ease-in-out infinite;
}

#readingPacmanGame .pac-redesign-player {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff2a8, #ffd21e 55%, #f0a500);
  box-shadow: 0 0 34px rgba(255,210,30,.6);
  animation: mm-chomp .5s ease-in-out infinite;
}

#readingPacmanGame .pac-redesign-pellets {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 22px 0 0 #fff, 44px 0 0 rgba(255,255,255,.5);
}

#readingPacmanGame .pac-redesign-kicker {
  margin: 0 0 -22px;
  color: var(--mm-dim);
  font: 600 15px/1.2 "Chakra Petch", sans-serif;
  letter-spacing: .42em;
  text-transform: uppercase;
}

#readingPacmanGame #start-screen .app-title {
  margin: 0;
  line-height: .92;
}

#readingPacmanGame #start-screen .title-top,
#readingPacmanGame #start-screen .title-bottom {
  display: block;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: clamp(46px,9vw,88px);
  letter-spacing: .01em;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

#readingPacmanGame #start-screen .title-top {
  background-image: linear-gradient(180deg,#fff,#8fe9ff);
  text-shadow: 0 0 60px rgba(95,240,255,.25);
}

#readingPacmanGame #start-screen .title-bottom {
  background-image: linear-gradient(180deg,#ffe680,#ffbe2e);
}

#readingPacmanGame .pac-redesign-intro {
  max-width: 440px;
  margin: -10px auto 0;
  color: #9fb0d4;
  font-size: 17px;
  line-height: 1.55;
}

#readingPacmanGame .pac-redesign-intro em {
  color: var(--mm-text);
  border-bottom: 2px solid var(--mm-gold);
  font-style: normal;
}

#readingPacmanGame #start-screen .start-btn {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 19px 52px;
  border: 0;
  border-radius: 16px;
  color: #04121a;
  background: linear-gradient(180deg,#5ff0ff,#22c6e6);
  box-shadow: 0 14px 40px rgba(62,230,255,.4);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

#readingPacmanGame #start-screen .start-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

#readingPacmanGame .pac-redesign-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: -6px;
}

#readingPacmanGame .pac-redesign-badges span {
  padding: 8px 15px;
  border: 1px solid var(--mm-line);
  border-radius: 999px;
  color: #8595bd;
  font-size: 13px;
}

#readingPacmanGame .pac-redesign-login-link {
  border: 0;
  padding: 0;
  color: var(--mm-dim);
  background: transparent;
  font-size: 14px;
}

#readingPacmanGame .pac-redesign-login-link:hover {
  color: var(--mm-cyan);
}

/* Optional local player setup: styled in the same mockup language. */
#readingPacmanGame #player-screen {
  align-items: center;
  justify-content: center;
}

#readingPacmanGame .pac-player-card {
  width: min(100%, 620px);
  padding: 28px;
  border: 1px solid var(--mm-line);
  border-radius: 20px;
  color: var(--mm-text);
  background: var(--mm-panel);
  box-shadow: 0 24px 60px rgba(0,0,0,.46);
}

#readingPacmanGame .pac-player-card input {
  border: 1px solid rgba(120,160,255,.22);
  border-radius: 12px;
  color: var(--mm-text);
  background: rgba(0,0,0,.25);
}

/* Game style */
#readingPacmanGame #mode-screen {
  align-items: stretch;
  max-width: 1080px;
  gap: 26px;
}

#readingPacmanGame .mode-search-wrap,
#readingPacmanGame .skill-search {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0;
}

#readingPacmanGame .mode-search-wrap::before,
#readingPacmanGame .skill-search::before {
  content: "⌕";
  position: absolute;
  z-index: 2;
  left: 15px;
  top: 21px;
  transform: translateY(-50%);
  color: var(--mm-dim);
  font-size: 17px;
  pointer-events: none;
}

#readingPacmanGame .mode-search,
#readingPacmanGame #skillFilter {
  width: 100%;
  height: 43px;
  padding: 12px 58px 12px 40px;
  border: 1px solid rgba(120,160,255,.2);
  border-radius: 12px;
  outline: none;
  color: #eef2ff;
  background: rgba(255,255,255,.05);
  font: 15px/1.2 "Space Grotesk", sans-serif;
  box-shadow: none;
}

#readingPacmanGame .mode-search::placeholder,
#readingPacmanGame #skillFilter::placeholder {
  color: #7182aa;
}

#readingPacmanGame .mode-search:focus,
#readingPacmanGame #skillFilter:focus {
  border-color: rgba(95,240,255,.55);
  box-shadow: 0 0 0 3px rgba(95,240,255,.08);
}

#readingPacmanGame .mode-search-clear,
#readingPacmanGame #skillClear {
  position: absolute;
  z-index: 3;
  right: 9px;
  top: 8px;
  min-width: 0;
  min-height: 0;
  padding: 6px 8px;
  border: 0;
  color: #8595bd;
  background: transparent;
  font-size: 12px;
}

#readingPacmanGame .mode-search-results,
#readingPacmanGame .skill-results {
  min-height: 0;
  margin: 7px 0 0;
  color: var(--mm-dim);
  font-size: 12px;
}

#readingPacmanGame .mode-section {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#readingPacmanGame .mode-section-head,
#readingPacmanGame .mode-helper,
#readingPacmanGame .mode-stat,
#readingPacmanGame .mode-diff-list {
  display: none !important;
}

#readingPacmanGame .mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(232px,1fr));
  gap: 18px;
  width: 100%;
}

#readingPacmanGame .mode-pill {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  min-height: 230px;
  overflow: hidden;
  padding: 0;
  border: 2px solid rgba(120,160,255,.16);
  border-radius: 20px;
  color: var(--mm-text);
  background: rgba(255,255,255,.035);
  box-shadow: 0 18px 44px rgba(0,0,0,.42);
  text-align: left;
}

#readingPacmanGame .mode-pill:hover {
  border-color: var(--mode-accent, var(--mm-cyan));
  background: rgba(255,255,255,.055);
  transform: translateY(-3px);
}

#readingPacmanGame .mode-visual {
  order: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 118px;
  min-height: 118px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--mode-preview, linear-gradient(135deg,#071a37,#0b2954));
}

#readingPacmanGame .mode-visual::before {
  content: "";
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--mode-accent, var(--mm-cyan));
  box-shadow: 0 0 24px var(--mode-accent, var(--mm-cyan));
}

#readingPacmanGame .mode-preview-canvas {
  display: none;
}

#readingPacmanGame .mode-pill > .pill-title {
  order: 2;
  display: block;
  padding: 16px 18px 0;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

#readingPacmanGame .mode-pill > .pill-sub {
  order: 3;
  display: block;
  padding: 6px 18px 20px;
  color: #9fb0d4;
  font: 400 13px/1.5 "Space Grotesk", sans-serif;
}

#readingPacmanGame .mode-badge {
  position: absolute;
  z-index: 4;
  right: 12px;
  top: 12px;
  padding: 5px 9px;
  border: 0;
  border-radius: 8px;
  color: var(--mode-accent, var(--mm-cyan));
  background: rgba(0,0,0,.4);
  font: 600 11px/1.2 "Chakra Petch", sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}

#readingPacmanGame .mode-pill.is-hidden-by-search {
  display: none !important;
}

#readingPacmanGame .mode-pill-dumpling { --mode-accent:#ffd21e; --mode-preview:linear-gradient(135deg,#3c2512,#15100d); }
#readingPacmanGame .mode-pill-neon { --mode-accent:#5ff0ff; --mode-preview:linear-gradient(135deg,#130032,#001b31); }
#readingPacmanGame .mode-pill-mspacman { --mode-accent:#ff6b9d; --mode-preview:linear-gradient(135deg,#321126,#120d22); }
#readingPacmanGame .mode-pill-pacman { --mode-accent:#ffd21e; --mode-preview:linear-gradient(135deg,#071a37,#0b2954); }
#readingPacmanGame .mode-pill-cat { --mode-accent:#a97bff; --mode-preview:linear-gradient(135deg,#25183e,#0e1022); }
#readingPacmanGame .mode-pill-dog { --mode-accent:#ffab3d; --mode-preview:linear-gradient(135deg,#35210d,#17120b); }

/* Skills */
#readingPacmanGame #select-screen {
  align-items: stretch;
  max-width: 1080px;
  gap: 24px;
}

#readingPacmanGame .select-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(250px,1fr));
  gap: 16px;
  width: 100%;
  max-height: none;
  padding: 0;
  overflow: visible;
}

#readingPacmanGame .skill-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 18px 18px 16px;
  border: 1px solid var(--mm-line-soft);
  border-radius: 18px;
  color: var(--mm-text);
  background: var(--mm-panel);
  box-shadow: none;
}

#readingPacmanGame .skill-card:hover {
  border-color: rgba(120,160,255,.3);
  background: var(--mm-panel-hover);
}

#readingPacmanGame .skill-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
}

#readingPacmanGame .skill-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #06101c;
  background: var(--skill-accent,#5ff0ff);
  box-shadow: 0 0 18px color-mix(in srgb,var(--skill-accent,#5ff0ff) 70%,transparent);
  font-size: 15px;
}

#readingPacmanGame .skill-card:nth-child(6n+2) { --skill-accent:#46e39b; }
#readingPacmanGame .skill-card:nth-child(6n+3) { --skill-accent:#ffd21e; }
#readingPacmanGame .skill-card:nth-child(6n+4) { --skill-accent:#a97bff; }
#readingPacmanGame .skill-card:nth-child(6n+5) { --skill-accent:#ff6b9d; }
#readingPacmanGame .skill-card:nth-child(6n+6) { --skill-accent:#ffab3d; }

#readingPacmanGame .skill-title {
  margin: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
}

#readingPacmanGame .skill-sub {
  margin: 2px 0 0;
  color: #8fa0c6;
  font-size: 12px;
  line-height: 1.35;
}

#readingPacmanGame .grade-grid {
  display: flex !important;
  flex-wrap: wrap;
  gap: 7px !important;
}

#readingPacmanGame .grade-btn {
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 6px 11px !important;
  border: 1px solid rgba(120,160,255,.22) !important;
  border-radius: 9px !important;
  color: #d5deff !important;
  background: rgba(120,160,255,.1) !important;
  box-shadow: none !important;
  font: 600 12.5px/1.2 "Space Grotesk", sans-serif !important;
}

#readingPacmanGame .grade-btn strong {
  font: inherit;
}

#readingPacmanGame .grade-btn span {
  display: none;
}

#readingPacmanGame .grade-btn:hover {
  border-color: rgba(95,240,255,.55) !important;
  color: #fff !important;
  background: rgba(95,240,255,.13) !important;
  transform: translateY(-1px);
}

/* Difficulty */
#readingPacmanGame #difficulty-screen {
  align-items: center;
  justify-content: center;
  max-width: 900px;
  padding: 40px 22px;
  gap: 26px;
}

#readingPacmanGame .mockup-centered-head {
  text-align: center;
}

#readingPacmanGame .mockup-centered-head .screen-title {
  margin: 6px 0 0;
  font-size: 32px;
  line-height: 1.15;
}

#readingPacmanGame .mockup-centered-head p {
  margin: 10px 0 0;
  color: var(--mm-muted);
}

#readingPacmanGame .difficulty-top-row {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 14px;
  width: 100%;
}

#readingPacmanGame #difficulty-screen .pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  min-height: 142px;
  padding: 24px 16px;
  border: 2px solid rgba(120,160,255,.16);
  border-radius: 20px;
  color: var(--mm-text);
  background: var(--mm-panel);
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
}

#readingPacmanGame #difficulty-screen .pill::before {
  content: "●  ●  ●";
  position: absolute;
  top: 25px;
  color: var(--ghost-color,#5ff0ff);
  font-size: 13px;
  letter-spacing: 4px;
  text-shadow: 0 0 10px var(--ghost-color,#5ff0ff);
}

#readingPacmanGame #difficulty-screen .pill-title {
  color: #fff;
  font-size: 19px;
}

#readingPacmanGame #difficulty-screen .pill-sub {
  margin-top: 5px;
  color: #8fa0c6;
  font: 400 13px/1.3 "Space Grotesk", sans-serif;
}

#readingPacmanGame #difficulty-easy { --ghost-color:#46e39b; }
#readingPacmanGame #difficulty-medium { --ghost-color:#5ff0ff; }
#readingPacmanGame #difficulty-hard { --ghost-color:#ffab3d; }
#readingPacmanGame #difficulty-extreme { --ghost-color:#ff6b9d; }

#readingPacmanGame #difficulty-screen .pill:hover {
  border-color: var(--ghost-color,var(--mm-cyan));
  background: rgba(255,255,255,.055);
  transform: translateY(-3px);
}

#readingPacmanGame .difficulty-bottom-row {
  width: 100%;
}

#readingPacmanGame #difficulty-unbeatable {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "over sub" "title note";
  align-items: center;
  width: 100%;
  min-height: 0;
  padding: 20px 26px;
  border-color: rgba(255,77,157,.42);
  text-align: left;
  --ghost-color:#ff4d9d;
}

#readingPacmanGame #difficulty-unbeatable::before {
  content: "● ● ● ● ● ●";
  top: 50%;
  right: 30px;
  left: auto;
  transform: translateY(-50%);
  opacity: .5;
}

#readingPacmanGame .difficulty-overline {
  grid-area: over;
  color: #ff6b9d;
  font: 600 11px/1.2 "Chakra Petch", sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}

#readingPacmanGame #difficulty-unbeatable .pill-title { grid-area:title; margin-top:4px; }
#readingPacmanGame #difficulty-unbeatable .pill-sub { grid-area:sub; visibility:hidden; }
#readingPacmanGame .difficulty-note { grid-area:note; padding-right:150px; color:#9fb0d4; font-size:13px; }

/* Controls */
#readingPacmanGame #control-screen {
  align-items: center;
  justify-content: center;
  max-width: 760px;
  padding: 40px 22px;
  gap: 26px;
}

#readingPacmanGame #control-screen > .pill-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

#readingPacmanGame #control-screen .pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 190px;
  padding: 34px;
  border: 2px solid rgba(120,160,255,.16);
  border-radius: 20px;
  color: var(--mm-text);
  background: var(--mm-panel);
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
}

#readingPacmanGame #control-screen .pill::before {
  display: block;
  margin-bottom: 18px;
  color: var(--mm-cyan);
  font: 700 38px/1 "Chakra Petch", sans-serif;
  text-shadow: 0 0 22px rgba(95,240,255,.5);
}

#readingPacmanGame #control-mouse::before { content:"◉"; }
#readingPacmanGame #control-keyboard::before { content:"↑ ← ↓ →"; font-size:23px; letter-spacing:2px; }

#readingPacmanGame #control-screen .pill-title {
  color: #fff;
  font-size: 22px;
}

#readingPacmanGame #control-screen .pill-sub {
  margin-top: 6px;
  color: #8fa0c6;
  font: 400 14px/1.4 "Space Grotesk", sans-serif;
}

#readingPacmanGame #control-screen .pill:hover {
  border-color: var(--mm-cyan);
  background: rgba(95,240,255,.06);
  transform: translateY(-3px);
}

#readingPacmanGame .control-hint {
  margin: 0;
  color: var(--mm-dim);
  font-size: 13px;
}

/* Questions */
#readingPacmanGame #question-screen {
  align-items: stretch;
  justify-content: center;
  max-width: 680px;
  padding: 40px 20px 60px;
  gap: 14px;
}

#readingPacmanGame .mockup-question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  color: #8fa0c6;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

#readingPacmanGame .question-panel {
  width: 100%;
  padding: 28px;
  border: 1px solid var(--mm-line-soft);
  border-radius: 22px;
  color: var(--mm-text);
  background: var(--mm-panel);
  box-shadow: 0 24px 60px rgba(0,0,0,.46);
}

#readingPacmanGame .mockup-read-label {
  margin: 0 0 12px;
  color: var(--mm-cyan);
  font: 600 11px/1.2 "Chakra Petch", sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
}

#readingPacmanGame #question-screen .prompt {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid rgba(120,160,255,.13);
  border-radius: 14px;
  color: #dce5ff;
  background: rgba(0,0,0,.2);
  font-size: 16px;
  line-height: 1.65;
}

#readingPacmanGame #question-screen .question-text {
  margin: 24px 0 16px;
  color: #fff;
  font: 700 21px/1.4 "Chakra Petch", sans-serif;
  text-align: left;
}

#readingPacmanGame #question-screen .choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#readingPacmanGame #question-screen .choice-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid rgba(120,160,255,.18);
  border-radius: 13px;
  color: #dbe4ff;
  background: rgba(120,160,255,.055);
  box-shadow: none;
  font: 500 15px/1.4 "Space Grotesk", sans-serif;
  text-align: left;
}

#readingPacmanGame #question-screen .choice-btn:hover {
  border-color: rgba(95,240,255,.55);
  background: rgba(95,240,255,.08);
  transform: translateX(3px);
}

#readingPacmanGame .choice-letter {
  display: flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(120,160,255,.25);
  border-radius: 9px;
  color: var(--mm-cyan);
  background: rgba(95,240,255,.07);
  font: 700 14px/1 "Chakra Petch", sans-serif;
}

#readingPacmanGame #question-screen .choice-btn.correct {
  border-color: rgba(70,227,155,.6);
  background: rgba(70,227,155,.1);
}

#readingPacmanGame #question-screen .choice-btn.incorrect {
  border-color: rgba(255,107,157,.55);
  background: rgba(255,107,157,.09);
}

#readingPacmanGame #question-screen .retry,
#readingPacmanGame #question-screen .hint {
  margin: 12px 0 0;
  color: #ffbe75;
  font-size: 13px;
}

#readingPacmanGame #question-screen .progress-bar {
  display: flex;
  gap: 6px;
  margin-top: 18px;
}

#readingPacmanGame #question-screen .progress-bar .segment {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: rgba(255,255,255,.08);
}

#readingPacmanGame #question-screen .progress-bar .segment.filled {
  background: linear-gradient(90deg,#5ff0ff,#22c6e6);
}

#readingPacmanGame #question-screen .bottom-ui {
  display: none;
}

/* Longer answer discussion */
#readingPacmanGame #answer-feedback-screen {
  align-items: stretch;
  max-width: 720px;
  padding: 36px 20px 60px;
}

#readingPacmanGame .answer-feedback-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

#readingPacmanGame .answer-feedback-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 20px;
  border: 1px solid rgba(70,227,155,.3);
  border-radius: 16px;
  background: rgba(70,227,155,.08);
}

#readingPacmanGame .answer-feedback-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #06101c;
  background: var(--mm-green);
  font: 700 20px/1 "Chakra Petch", sans-serif;
}

#readingPacmanGame .answer-feedback-kicker,
#readingPacmanGame .answer-feedback-label {
  margin: 0;
  color: #73efb4;
  font: 600 11px/1.2 "Chakra Petch", sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
}

#readingPacmanGame .answer-feedback-banner h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

#readingPacmanGame .answer-feedback-banner p:last-child {
  margin: 3px 0 0;
  color: #c9d4ef;
  font-size: 13px;
}

#readingPacmanGame .answer-feedback-card,
#readingPacmanGame .answer-reflection-card {
  padding: 22px;
  border: 1px solid var(--mm-line-soft);
  border-radius: 18px;
  background: var(--mm-panel);
}

#readingPacmanGame .answer-feedback-passage {
  margin: 12px 0 0;
  padding: 15px 17px;
  border-radius: 12px;
  color: #dce5ff;
  background: rgba(0,0,0,.22);
  font-size: 14px;
  line-height: 1.6;
}

#readingPacmanGame .answer-feedback-question {
  margin: 18px 0 12px;
  font-size: 18px;
  line-height: 1.4;
}

#readingPacmanGame .answer-feedback-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(210px,1fr));
  gap: 10px;
}

#readingPacmanGame .answer-feedback-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(120,160,255,.16);
  border-radius: 12px;
  color: #dce5ff;
  background: rgba(120,160,255,.05);
}

#readingPacmanGame .answer-feedback-choice.is-correct {
  border-color: rgba(70,227,155,.35);
  background: rgba(70,227,155,.08);
}

#readingPacmanGame .answer-feedback-choice small,
#readingPacmanGame .answer-feedback-choice strong {
  display: block;
}

#readingPacmanGame .answer-feedback-choice small {
  color: #8fa0c6;
  font-size: 11px;
}

#readingPacmanGame .answer-feedback-why {
  margin-top: 14px;
  padding: 16px;
  border-left: 3px solid var(--mm-cyan);
  border-radius: 0 12px 12px 0;
  background: rgba(95,240,255,.055);
}

#readingPacmanGame .answer-feedback-why h3,
#readingPacmanGame .answer-reflection-heading h3 {
  margin: 0;
  font-size: 16px;
}

#readingPacmanGame .answer-feedback-why p,
#readingPacmanGame .answer-reflection-heading p {
  margin: 6px 0 0;
  color: #aebdde;
  font-size: 13.5px;
  line-height: 1.55;
}

#readingPacmanGame .answer-reflection-heading {
  display: flex;
  gap: 11px;
}

#readingPacmanGame .answer-reflection-heading > span {
  display: flex;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #07101d;
  background: var(--mm-gold);
  font-weight: 700;
}

#readingPacmanGame .answer-reflection-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}

#readingPacmanGame .answer-reflection-starters button {
  padding: 7px 10px;
  border: 1px solid rgba(120,160,255,.22);
  border-radius: 9px;
  color: #d5deff;
  background: rgba(120,160,255,.08);
  font: 500 12px/1.2 "Space Grotesk", sans-serif;
}

#readingPacmanGame #answerReflectionText {
  width: 100%;
  min-height: 88px;
  margin-top: 12px;
  padding: 12px 14px;
  resize: vertical;
  border: 1px solid rgba(120,160,255,.22);
  border-radius: 11px;
  outline: none;
  color: #eef2ff;
  background: rgba(0,0,0,.25);
  font: 14px/1.5 "Space Grotesk", sans-serif;
}

#readingPacmanGame .answer-reflection-note {
  margin: 7px 0 0;
  color: var(--mm-dim);
  font-size: 12px;
}

#readingPacmanGame .answer-feedback-continue {
  align-self: flex-end;
  min-height: 0;
  padding: 14px 28px;
  border: 0;
  border-radius: 13px;
  color: #04121a;
  background: linear-gradient(180deg,#5ff0ff,#22c6e6);
  box-shadow: 0 12px 32px rgba(62,230,255,.28);
  font-size: 16px;
}

/* Results: preserve the production leaderboard, match the mockup recap cards. */
#readingPacmanGame .pac-end-screen {
  position: relative;
  z-index: 1;
  min-height: var(--abz-game-stage-height,100dvh);
  padding: 36px 20px 60px;
  color: var(--mm-text);
  background: transparent;
}

#readingPacmanGame .pac-end-shell {
  width: min(100%,760px);
  margin: 0 auto;
}

#readingPacmanGame .pac-end-hero,
#readingPacmanGame .pac-end-leaderboards,
#readingPacmanGame .pac-end-board-card,
#readingPacmanGame .pac-end-actions,
#readingPacmanGame .pac-end-screen form {
  border-color: var(--mm-line-soft) !important;
  color: var(--mm-text) !important;
  background: var(--mm-panel) !important;
  box-shadow: none !important;
}

#readingPacmanGame .pac-end-kicker {
  color: var(--mm-cyan) !important;
  font-family: "Chakra Petch",sans-serif;
  letter-spacing: .3em;
}

#readingPacmanGame .pac-end-screen h2,
#readingPacmanGame .pac-end-screen h3,
#readingPacmanGame .pac-end-screen strong {
  color: #fff;
  font-family: "Chakra Petch",sans-serif;
}

#readingPacmanGame .pac-end-screen p,
#readingPacmanGame .pac-end-screen small,
#readingPacmanGame .pac-end-screen span {
  color: #aebdde;
}

#readingPacmanGame .pac-end-screen button {
  border-radius: 13px;
  font-family: "Chakra Petch",sans-serif;
}

@keyframes mm-float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes mm-chomp {
  0%,100% { clip-path: polygon(100% 25%,44% 50%,100% 75%,100% 100%,0 100%,0 0,100% 0); }
  50% { clip-path: polygon(100% 48%,44% 50%,100% 52%,100% 100%,0 100%,0 0,100% 0); }
}

@media (max-width: 760px) {
  #readingPacmanGame .screen:not(#game-screen) {
    padding: 28px 16px 46px;
  }

  #readingPacmanGame .mockup-screen-head {
    align-items: flex-start;
  }

  #readingPacmanGame .mockup-screen-head .screen-title {
    font-size: 25px;
  }

  #readingPacmanGame .mode-grid,
  #readingPacmanGame .select-wrap {
    grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
  }

  #readingPacmanGame .difficulty-top-row {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  #readingPacmanGame #difficulty-unbeatable::before {
    display: none;
  }

  #readingPacmanGame .difficulty-note {
    padding-right: 0;
  }
}

@media (max-width: 520px) {
  #readingPacmanGame #start-screen {
    gap: 24px;
  }

  #readingPacmanGame .pac-redesign-kicker {
    margin-bottom: -16px;
    font-size: 12px;
  }

  #readingPacmanGame .pac-redesign-intro {
    font-size: 15px;
  }

  #readingPacmanGame #start-screen .start-btn {
    padding: 16px 42px;
    font-size: 18px;
  }

  #readingPacmanGame .mockup-screen-head {
    flex-direction: column;
  }

  #readingPacmanGame .mode-grid,
  #readingPacmanGame .select-wrap,
  #readingPacmanGame .difficulty-top-row,
  #readingPacmanGame #control-screen > .pill-row {
    grid-template-columns: 1fr;
  }

  #readingPacmanGame #difficulty-unbeatable {
    display: flex;
    align-items: flex-start;
  }

  #readingPacmanGame .question-panel,
  #readingPacmanGame .answer-feedback-card,
  #readingPacmanGame .answer-reflection-card {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #readingPacmanGame .pac-redesign-mark,
  #readingPacmanGame .pac-redesign-player {
    animation: none;
  }

  #readingPacmanGame .screen:not(#game-screen) *,
  #readingPacmanGame .screen:not(#game-screen) *::before,
  #readingPacmanGame .screen:not(#game-screen) *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Custom-question builder: visible requirements and recoverable validation. */
body .pac-custom-builder-card .pac-custom-field b,
#readingPacmanGame .pac-custom-builder-card .pac-custom-field b {
  color: #ff7a8f;
  font-size: 1rem;
}

body .pac-custom-builder-card .pac-custom-question-completeness,
#readingPacmanGame .pac-custom-builder-card .pac-custom-question-completeness {
  display: block;
  margin-top: 6px;
  color: #ffb0bd;
  font: 600 .72rem/1.35 "Space Grotesk", sans-serif;
}

body .pac-custom-builder-card .pac-custom-question-completeness.is-ready,
#readingPacmanGame .pac-custom-builder-card .pac-custom-question-completeness.is-ready {
  color: #5fe3a8;
}

body .pac-custom-builder-card .pac-custom-question-row.is-incomplete,
#readingPacmanGame .pac-custom-builder-card .pac-custom-question-row.is-incomplete {
  border-color: rgba(255,84,112,.66) !important;
  box-shadow: 0 0 0 3px rgba(255,84,112,.08) !important;
}

body .pac-custom-builder-card input.is-invalid,
#readingPacmanGame .pac-custom-builder-card input.is-invalid {
  border-color: #ff5470 !important;
  box-shadow: 0 0 0 4px rgba(255,84,112,.12) !important;
}

body .pac-custom-builder-card .pac-custom-sticky-actions,
#readingPacmanGame .pac-custom-builder-card .pac-custom-sticky-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center !important;
  gap: 18px !important;
}

body .pac-custom-builder-card .pac-custom-save-requirements,
#readingPacmanGame .pac-custom-builder-card .pac-custom-save-requirements {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255,230,128,.25);
  border-radius: 14px;
  background: rgba(255,230,128,.06);
  color: #eaf0ff;
}

body .pac-custom-builder-card .pac-custom-save-requirements strong,
#readingPacmanGame .pac-custom-builder-card .pac-custom-save-requirements strong {
  color: #ffe680;
  font: 700 .82rem/1.2 "Chakra Petch", sans-serif;
}

body .pac-custom-builder-card .pac-custom-save-requirements span,
body .pac-custom-builder-card .pac-custom-save-requirements small,
#readingPacmanGame .pac-custom-builder-card .pac-custom-save-requirements span,
#readingPacmanGame .pac-custom-builder-card .pac-custom-save-requirements small {
  color: #b7c4e3;
  font: 500 .72rem/1.35 "Space Grotesk", sans-serif;
}

body .pac-custom-builder-card .pac-custom-save-requirements.is-ready,
#readingPacmanGame .pac-custom-builder-card .pac-custom-save-requirements.is-ready {
  border-color: rgba(95,227,168,.38);
  background: rgba(95,227,168,.08);
}

body .pac-custom-builder-card .pac-custom-save-requirements.is-ready strong,
#readingPacmanGame .pac-custom-builder-card .pac-custom-save-requirements.is-ready strong {
  color: #5fe3a8;
}

body .pac-custom-builder-card .pac-custom-action-buttons,
#readingPacmanGame .pac-custom-builder-card .pac-custom-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 850px) {
  body .pac-custom-builder-card .pac-custom-sticky-actions,
  #readingPacmanGame .pac-custom-builder-card .pac-custom-sticky-actions {
    grid-template-columns: 1fr;
  }

  body .pac-custom-builder-card .pac-custom-action-buttons,
  #readingPacmanGame .pac-custom-builder-card .pac-custom-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* July 21 mockup parity: exact cover-led home and educator-only custom sets. */
@keyframes pac-home-float-glow {
  0%,100% { transform: translateY(0) rotate(-.4deg); box-shadow: 0 24px 70px rgba(0,0,0,.55),0 0 60px rgba(95,240,255,.12); }
  50% { transform: translateY(-12px) rotate(.4deg); box-shadow: 0 40px 90px rgba(0,0,0,.6),0 0 90px rgba(95,240,255,.28); }
}

@keyframes pac-home-drift {
  from { transform: translateX(-14vw); }
  to { transform: translateX(114vw); }
}

@keyframes pac-home-twinkle {
  0%,100% { opacity: .15; transform: scale(.7); }
  50% { opacity: 1; transform: scale(1); }
}

#readingPacmanGame #start-screen {
  width: 100% !important;
  height: var(--abz-game-stage-height,100dvh) !important;
  min-height: 0 !important;
  justify-content: center !important;
  gap: clamp(9px,1.5vh,16px) !important;
  padding: clamp(12px,2vh,24px) 20px !important;
  overflow: hidden !important;
}

#readingPacmanGame #start-screen .pac-home-arcade-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

#readingPacmanGame #start-screen .pac-home-ghost {
  position: absolute;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 42px;
  padding-top: 13px;
  border-radius: 20px 20px 6px 6px;
  animation: pac-home-drift 15s linear infinite;
}

#readingPacmanGame #start-screen .pac-home-ghost i {
  display: block;
  width: 9px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
}

#readingPacmanGame #start-screen .pac-home-ghost-red { top:16%; background:#ff4d5e; box-shadow:0 0 24px rgba(255,77,94,.5); animation-delay:-2s; }
#readingPacmanGame #start-screen .pac-home-ghost-cyan { top:66%; width:34px; height:38px; padding-top:12px; background:#5ff0ff; box-shadow:0 0 24px rgba(95,240,255,.5); animation-duration:21s; animation-delay:-9s; }
#readingPacmanGame #start-screen .pac-home-ghost-cyan i { width:8px; height:10px; background:#04121a; }
#readingPacmanGame #start-screen .pac-home-ghost-pink { top:40%; width:30px; height:34px; padding-top:11px; background:#f78fd0; box-shadow:0 0 22px rgba(247,143,208,.5); animation-duration:27s; animation-delay:-16s; }
#readingPacmanGame #start-screen .pac-home-ghost-pink i { width:7px; height:9px; }

#readingPacmanGame #start-screen .pac-home-arcade-bg b {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffe27a;
  animation: pac-home-twinkle 2.4s ease-in-out infinite;
}

#readingPacmanGame #start-screen .pac-home-arcade-bg b:nth-of-type(1) { top:11%; left:8%; }
#readingPacmanGame #start-screen .pac-home-arcade-bg b:nth-of-type(2) { top:24%; right:12%; animation-duration:3s; animation-delay:-1s; }
#readingPacmanGame #start-screen .pac-home-arcade-bg b:nth-of-type(3) { bottom:20%; left:14%; width:10px; height:10px; animation-duration:2.8s; animation-delay:-.6s; }
#readingPacmanGame #start-screen .pac-home-arcade-bg b:nth-of-type(4) { bottom:14%; right:18%; width:8px; height:8px; animation-duration:2.2s; animation-delay:-1.4s; }
#readingPacmanGame #start-screen .pac-home-arcade-bg b:nth-of-type(5) { top:50%; right:7%; animation-duration:3.2s; animation-delay:-2s; }

#readingPacmanGame #start-screen .pac-home-kicker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: #7d8fc0;
  font: 600 15px/1.2 "Chakra Petch",sans-serif;
  letter-spacing: .42em;
  text-transform: uppercase;
  animation: mm-float 4s ease-in-out infinite;
}

#readingPacmanGame #start-screen .pac-home-kicker > span {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%,#fff2a8,#ffd21e 55%,#f0a500);
  box-shadow: 0 0 16px rgba(255,210,30,.7);
  animation: mm-chomp .5s ease-in-out infinite;
}

#readingPacmanGame #start-screen .cover.pac-home-cover {
  position: relative;
  display: block !important;
  width: min(100%,560px) !important;
  height: auto !important;
  max-height: min(43svh,330px) !important;
  object-fit: cover;
  margin: 0 !important;
  border: 1px solid rgba(120,160,255,.2) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 70px rgba(0,0,0,.55),0 0 60px rgba(95,240,255,.12) !important;
  animation: pac-home-float-glow 6s ease-in-out infinite;
}

#readingPacmanGame #start-screen .pac-redesign-intro {
  width: min(100%,420px) !important;
  max-width: 420px !important;
  margin: 0 !important;
  color: #9fb0d4 !important;
  font-size: 17px !important;
  line-height: 1.55 !important;
}

#readingPacmanGame #start-screen .start-btn {
  width: auto !important;
  min-width: 0 !important;
  padding: 19px 52px !important;
  border-radius: 16px !important;
}

#readingPacmanGame #start-screen .pac-redesign-badges {
  margin: 0 !important;
}

#readingPacmanGame #start-screen .pac-redesign-login-link {
  display: inline-flex !important;
  min-height: 0 !important;
  margin: -4px 0 0 !important;
  color: #7d8fc0 !important;
  font: 500 14px/1.3 "Space Grotesk",sans-serif !important;
  text-decoration: none;
}

#readingPacmanGame .pac-educator-only {
  display: none !important;
}

#readingPacmanGame .pac-guest-create-prompt {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: min(700px, 100%) !important;
  max-width: 700px !important;
  margin: 8px auto 16px !important;
  padding: 9px 10px 9px 12px !important;
  border: 1px solid rgba(228,105,255,.44) !important;
  border-radius: 999px !important;
  background: linear-gradient(100deg,rgba(111,36,143,.3),rgba(35,20,62,.88)) !important;
  box-shadow: 0 9px 28px rgba(57,15,88,.24), inset 0 0 24px rgba(235,112,255,.045) !important;
}

body.abz-shell-signed-in #readingPacmanGame .pac-guest-create-prompt,
body.abz-teacher-logged-in #readingPacmanGame .pac-guest-create-prompt,
body.abz-student-logged-in #readingPacmanGame .pac-guest-create-prompt {
  display: none !important;
}

#readingPacmanGame .pac-guest-create-icon {
  display: grid;
  place-items: center;
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  color: #fff !important;
  background: linear-gradient(145deg,#ff75e6,#8c4dff) !important;
  box-shadow: 0 0 20px rgba(227,92,255,.38) !important;
  font: 800 17px/1 "Chakra Petch",sans-serif !important;
}

#readingPacmanGame .pac-guest-create-copy {
  min-width: 0;
  text-align: left !important;
}

#readingPacmanGame .pac-guest-create-copy strong,
#readingPacmanGame .pac-guest-create-copy small {
  display: block;
}

#readingPacmanGame .pac-guest-create-copy strong {
  color: #fff !important;
  font: 700 14px/1.2 "Chakra Petch",sans-serif !important;
}

#readingPacmanGame .pac-guest-create-copy small {
  margin-top: 2px !important;
  color: #d8c5e8 !important;
  font: 500 11.5px/1.3 "Space Grotesk",sans-serif !important;
}

#readingPacmanGame .pac-guest-create-login {
  min-height: 36px !important;
  padding: 0 15px !important;
  border: 1px solid rgba(244,157,255,.48) !important;
  border-radius: 999px !important;
  color: #fbeaff !important;
  background: rgba(225,105,255,.12) !important;
  font: 700 11.5px/1 "Chakra Petch",sans-serif !important;
  cursor: pointer;
}

#readingPacmanGame .pac-guest-create-login:hover {
  color: #25102d !important;
  background: #f09cff !important;
}

body.abz-teacher-logged-in #readingPacmanGame .pac-created-sets-panel.pac-educator-only {
  display: block !important;
}

body.abz-teacher-logged-in #readingPacmanGame .pac-ready-made-label.pac-educator-only {
  display: block !important;
}

@media (max-width: 720px) {
  #readingPacmanGame .pac-guest-create-prompt {
    grid-template-columns: 36px minmax(0,1fr) !important;
    border-radius: 18px !important;
    padding: 10px !important;
  }
  #readingPacmanGame .pac-guest-create-icon {
    width: 36px !important;
    height: 36px !important;
  }
  #readingPacmanGame .pac-guest-create-login {
    grid-column: 1 / -1;
    width: 100%;
  }
}

#readingPacmanGame #select-screen .pac-created-sets-panel {
  width: 100% !important;
  max-width: 1080px !important;
  margin: 8px auto 12px !important;
  padding: 20px 22px !important;
  border: 1px solid rgba(95,240,255,.24) !important;
  border-radius: 18px !important;
  background: rgba(95,240,255,.05) !important;
  box-shadow: none !important;
}

#readingPacmanGame #select-screen .pac-created-title-row {
  align-items: flex-start !important;
  gap: 14px !important;
}

#readingPacmanGame #select-screen .pac-created-kicker,
body .pac-custom-modal .pac-created-kicker {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #5ff0ff !important;
  background: transparent !important;
  font: 700 11px/1.2 "Chakra Petch",sans-serif !important;
  letter-spacing: .16em !important;
  text-transform: uppercase;
}

#readingPacmanGame #select-screen .pac-created-sets-panel h3 {
  margin: 4px 0 0 !important;
  color: #fff !important;
  font: 700 20px/1.2 "Chakra Petch",sans-serif !important;
  text-shadow: none !important;
}

#readingPacmanGame #select-screen .pac-created-sets-panel p {
  max-width: 540px;
  margin: 4px 0 0 !important;
  color: #9fb0d4 !important;
  font: 400 13px/1.5 "Space Grotesk",sans-serif !important;
}

#readingPacmanGame #select-screen #pacCreateSetBtn {
  flex: none;
  min-height: 0 !important;
  padding: 12px 20px !important;
  border: 0 !important;
  border-radius: 12px !important;
  color: #04121a !important;
  background: linear-gradient(180deg,#5ff0ff,#22c6e6) !important;
  box-shadow: none !important;
  font: 700 14px/1.2 "Chakra Petch",sans-serif !important;
  white-space: nowrap;
}

#readingPacmanGame #select-screen .pac-created-status {
  max-width: none !important;
  margin: 14px 0 0 !important;
}

#readingPacmanGame #select-screen #pacMySetsGrid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  margin-top: 12px !important;
}

#readingPacmanGame #select-screen #pacMySetsGrid .pac-created-set-card {
  display: grid !important;
  grid-template-columns: minmax(210px,1.25fr) minmax(180px,1fr) auto !important;
  grid-template-areas: "title desc actions" "meta stats actions" !important;
  align-items: center !important;
  gap: 4px 16px !important;
  min-height: 0 !important;
  padding: 14px 16px !important;
  border: 1px solid rgba(120,160,255,.14) !important;
  border-radius: 13px !important;
  background: rgba(120,160,255,.05) !important;
  box-shadow: none !important;
}

#readingPacmanGame #select-screen #pacMySetsGrid h5 { grid-area: title; color:#eef2ff !important; font:700 16px/1.2 "Chakra Petch",sans-serif !important; text-shadow:none !important; }
#readingPacmanGame #select-screen #pacMySetsGrid .pac-created-set-meta { grid-area: meta; }
#readingPacmanGame #select-screen #pacMySetsGrid .pac-created-set-desc { grid-area: desc; }
#readingPacmanGame #select-screen #pacMySetsGrid .pac-created-set-stats { grid-area: stats; margin:0 !important; }
#readingPacmanGame #select-screen #pacMySetsGrid .pac-created-set-actions { grid-area: actions; flex-wrap:nowrap; }

#readingPacmanGame #select-screen .pac-mini-btn {
  padding: 9px 15px !important;
  border: 1px solid rgba(120,160,255,.2) !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.05) !important;
  color: #c7d3ef !important;
  box-shadow: none !important;
  font: 600 13px/1.2 "Space Grotesk",sans-serif !important;
}

#readingPacmanGame #select-screen .pac-mini-btn:not(.secondary):not(.danger) {
  border: 0 !important;
  color: #04121a !important;
  background: linear-gradient(180deg,#5ff0ff,#22c6e6) !important;
  font-family: "Chakra Petch",sans-serif !important;
  font-weight: 700 !important;
}

#readingPacmanGame #select-screen .pac-mini-btn.danger {
  color: #ff9aad !important;
  background: rgba(255,84,112,.08) !important;
  border-color: rgba(255,84,112,.28) !important;
}

#readingPacmanGame #select-screen .pac-created-empty {
  min-height: 0 !important;
  padding: 20px !important;
  border: 1.5px dashed rgba(95,240,255,.32) !important;
  border-radius: 13px !important;
  color: #9fb0d4 !important;
  background: transparent !important;
  text-align: center;
}

#readingPacmanGame #select-screen .pac-ready-made-label {
  width: 100%;
  max-width: 1080px;
  margin: 2px auto -4px;
  color: #7d8fc0;
  font: 700 12px/1.2 "Chakra Petch",sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Custom-set dialogs use the same calm mockup surfaces, while retaining the
   game's existing full-screen canvas shell and responsive behavior. */
body .pac-custom-modal {
  background: rgba(2,5,15,.82) !important;
  backdrop-filter: blur(14px) !important;
}

body .pac-custom-modal-card {
  border: 1px solid rgba(120,160,255,.22) !important;
  border-radius: 20px !important;
  color: #eaf0ff !important;
  background: radial-gradient(900px 480px at 50% -20%,#16274a 0%,#0a1224 48%,#05070f 100%) !important;
  background-size: auto !important;
  box-shadow: 0 28px 80px rgba(0,0,0,.62) !important;
  font-family: "Space Grotesk",system-ui,sans-serif !important;
}

body .pac-custom-modal-card h2,
body .pac-custom-modal-card h3 {
  color: #eaf0ff !important;
  font-family: "Chakra Petch",sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
}

body .pac-custom-modal-card h2 {
  font-size: clamp(1.8rem,3.4vw,2.8rem) !important;
  line-height: 1.05 !important;
}

body .pac-custom-close {
  width: 42px !important;
  height: 42px !important;
  border: 1px solid rgba(120,160,255,.22) !important;
  background: rgba(255,255,255,.05) !important;
  color: #c7d3ef !important;
  box-shadow: none !important;
}

body .pac-custom-builder-head,
body .pac-custom-play-hero {
  background: rgba(255,255,255,.025) !important;
  border-bottom-color: rgba(120,160,255,.14) !important;
}

body .pac-custom-builder-section,
body .pac-custom-play-settings-card,
body .pac-custom-question-row {
  border: 1px solid rgba(120,160,255,.14) !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.035) !important;
  box-shadow: none !important;
}

body .pac-custom-section-title > span {
  color: #04121a !important;
  background: linear-gradient(180deg,#5ff0ff,#22c6e6) !important;
  box-shadow: none !important;
}

body .pac-custom-two-col,
body .pac-custom-three-col,
body .pac-custom-four-col,
body .pac-custom-browser-tools {
  display: grid !important;
  gap: 16px !important;
  margin-top: 16px !important;
}

body .pac-custom-four-col { grid-template-columns: repeat(4,minmax(0,1fr)) !important; }

body .pac-custom-field {
  color: #9fb0d4 !important;
  font: 700 12px/1.2 "Chakra Petch",sans-serif !important;
  letter-spacing: .08em !important;
}

body .pac-custom-field input,
body .pac-custom-field select,
body .pac-custom-field textarea,
body .pac-custom-browser-tools input,
body .pac-custom-browser-tools select {
  min-height: 50px !important;
  border: 1px solid rgba(120,160,255,.22) !important;
  border-radius: 12px !important;
  color: #eef2ff !important;
  background-color: rgba(0,0,0,.25) !important;
  box-shadow: none !important;
  font: 500 15px/1.4 "Space Grotesk",sans-serif !important;
  text-transform: none !important;
}

body .pac-custom-sticky-actions {
  background: linear-gradient(180deg,rgba(5,7,15,.7),#05070f) !important;
  border-top-color: rgba(120,160,255,.14) !important;
}

body .pac-custom-modal .btn,
body .pac-custom-modal .pac-mini-btn {
  border: 0 !important;
  border-radius: 12px !important;
  color: #04121a !important;
  background: linear-gradient(180deg,#5ff0ff,#22c6e6) !important;
  box-shadow: none !important;
  font-family: "Chakra Petch",sans-serif !important;
  font-weight: 700 !important;
}

body .pac-custom-modal .btn:disabled {
  opacity: .42 !important;
  cursor: not-allowed !important;
  filter: saturate(.45) !important;
}

body .pac-custom-modal .secondary-btn,
body .pac-custom-modal .pac-mini-btn.secondary {
  border: 1px solid rgba(120,160,255,.22) !important;
  color: #c7d3ef !important;
  background: rgba(255,255,255,.05) !important;
}

body .pac-custom-modal .pac-mini-btn.danger {
  border: 1px solid rgba(255,84,112,.28) !important;
  color: #ff9aad !important;
  background: rgba(255,84,112,.08) !important;
}

@media (max-width: 860px) {
  #readingPacmanGame #start-screen .cover.pac-home-cover { max-height: min(42svh,330px) !important; }
  #readingPacmanGame #select-screen .pac-created-title-row { flex-direction: column; }
  #readingPacmanGame #select-screen #pacMySetsGrid .pac-created-set-card {
    grid-template-columns: 1fr !important;
    grid-template-areas: "title" "meta" "desc" "stats" "actions" !important;
  }
  #readingPacmanGame #select-screen #pacMySetsGrid .pac-created-set-actions { flex-wrap: wrap; }
  body .pac-custom-four-col { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}

@media (max-width: 520px) {
  #readingPacmanGame #start-screen { gap: 11px !important; padding: 12px 14px 18px !important; }
  #readingPacmanGame #start-screen .pac-home-kicker { font-size: 11px; letter-spacing: .3em; }
  #readingPacmanGame #start-screen .cover.pac-home-cover { max-height: 36svh !important; border-radius: 14px !important; }
  #readingPacmanGame #start-screen .pac-redesign-intro { font-size: 14px !important; }
  #readingPacmanGame #start-screen .start-btn { padding: 14px 38px !important; }
  #readingPacmanGame #start-screen .pac-redesign-badges span { padding: 6px 9px !important; font-size: 10px !important; }
  body .pac-custom-four-col { grid-template-columns: 1fr !important; }
}

@media (prefers-reduced-motion: reduce) {
  #readingPacmanGame #start-screen .pac-home-kicker,
  #readingPacmanGame #start-screen .pac-home-kicker > span,
  #readingPacmanGame #start-screen .cover.pac-home-cover,
  #readingPacmanGame #start-screen .pac-home-ghost,
  #readingPacmanGame #start-screen .pac-home-arcade-bg b {
    animation: none !important;
  }
}

/* Screen geometry wins over the high-specificity legacy layout rules. */
#readingPacmanGame .screen#start-screen {
  display: flex;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: var(--abz-game-stage-height,100dvh) !important;
  padding: 40px 20px !important;
}

#readingPacmanGame .screen#mode-screen,
#readingPacmanGame .screen#select-screen {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 1080px !important;
  padding: 34px 22px 60px !important;
}

#readingPacmanGame .screen#difficulty-screen {
  display: flex;
  flex-direction: column;
  max-width: 900px !important;
  padding: 40px 22px !important;
}

#readingPacmanGame .screen#control-screen {
  display: flex;
  flex-direction: column;
  max-width: 760px !important;
  padding: 40px 22px !important;
}

#readingPacmanGame .screen#question-screen {
  display: none;
  flex-direction: column;
  max-width: 680px !important;
  padding: 40px 20px 60px !important;
}

#readingPacmanGame .screen#answer-feedback-screen {
  display: none;
  flex-direction: column;
  max-width: 720px !important;
  padding: 36px 20px 60px !important;
}

/* Neutralize the old embedded-player compaction rules on redesigned screens. */
#readingPacmanGame .screen#mode-screen:not([style*="display: none"]) {
  height: auto !important;
  min-height: var(--abz-game-stage-height,100dvh) !important;
  gap: 26px !important;
  padding: 34px 22px 60px !important;
  overflow-y: auto !important;
}

#readingPacmanGame #mode-screen .mockup-screen-head .screen-title {
  margin: 2px 0 0 !important;
  font-size: 30px !important;
  line-height: 1.15 !important;
}

#readingPacmanGame #mode-screen .mode-search-wrap {
  width: 100% !important;
  max-width: 360px !important;
  margin: 0 !important;
  gap: 0 !important;
}

#readingPacmanGame #mode-screen .mode-search {
  height: 43px !important;
  min-height: 43px !important;
  padding: 12px 58px 12px 40px !important;
  border: 1px solid rgba(120,160,255,.2) !important;
  border-radius: 12px !important;
  color: #eef2ff !important;
  background: rgba(255,255,255,.05) !important;
  box-shadow: none !important;
  font: 15px/1.2 "Space Grotesk",sans-serif !important;
}

#readingPacmanGame #mode-screen .mode-search-clear {
  top: 8px !important;
  right: 9px !important;
  width: auto !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 6px 8px !important;
  border: 0 !important;
  color: #8595bd !important;
  background: transparent !important;
  box-shadow: none !important;
}

#readingPacmanGame #mode-screen .mode-section {
  display: block !important;
  flex: none !important;
  width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
}

#readingPacmanGame #mode-screen .mode-grid,
#readingPacmanGame #mode-screen .mode-trending-grid,
#readingPacmanGame #mode-screen .mode-all-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill,minmax(232px,1fr)) !important;
  gap: 18px !important;
  width: 100% !important;
  height: auto !important;
}

#readingPacmanGame #mode-screen .mode-pill,
#readingPacmanGame #mode-screen .mode-pill-featured {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  min-height: 230px !important;
  height: auto !important;
  padding: 0 !important;
  border-radius: 20px !important;
  gap: 0 !important;
}

#readingPacmanGame #mode-screen .mode-visual,
#readingPacmanGame #mode-screen .mode-canvas-preview {
  display: flex !important;
  order: 1 !important;
  grid-column: auto !important;
  grid-row: auto !important;
  width: 100% !important;
  height: 118px !important;
  min-height: 118px !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

#readingPacmanGame #mode-screen .mode-preview-canvas {
  display: none !important;
}

#readingPacmanGame #mode-screen .mode-pill .pill-title {
  order: 2 !important;
  margin: 0 !important;
  padding: 16px 18px 0 !important;
  font-size: 19px !important;
  line-height: 1.2 !important;
}

#readingPacmanGame #mode-screen .mode-pill .pill-sub {
  display: block !important;
  order: 3 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 6px 18px 20px !important;
  color: #9fb0d4 !important;
  font: 400 13px/1.5 "Space Grotesk",sans-serif !important;
}

#readingPacmanGame #mode-screen .mode-badge {
  position: absolute !important;
  z-index: 4 !important;
  top: 12px !important;
  right: 12px !important;
  left: auto !important;
  width: auto !important;
  min-height: 0 !important;
  padding: 5px 9px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: rgba(0,0,0,.4) !important;
}

#readingPacmanGame .screen#select-screen:not([style*="display: none"]) {
  height: auto !important;
  min-height: var(--abz-game-stage-height,100dvh) !important;
  gap: 24px !important;
  overflow-y: auto !important;
}

#readingPacmanGame #select-screen .mockup-screen-head .screen-title {
  margin: 2px 0 0 !important;
  font-size: 30px !important;
}

#readingPacmanGame #select-screen .select-wrap {
  grid-template-columns: repeat(auto-fill,minmax(250px,1fr)) !important;
  gap: 16px !important;
  width: 100% !important;
  max-height: none !important;
  overflow: visible !important;
}

#readingPacmanGame #select-screen .skill-card {
  min-height: 0 !important;
  padding: 18px 18px 16px !important;
  border-radius: 18px !important;
  gap: 12px !important;
  border: 1px solid rgba(120,160,255,.14) !important;
  background: rgba(255,255,255,.035) !important;
  box-shadow: none !important;
}

#readingPacmanGame #select-screen .skill-search {
  width: 100% !important;
  max-width: 360px !important;
  margin: 0 !important;
}

#readingPacmanGame #select-screen #skillFilter {
  width: 100% !important;
  height: 43px !important;
  min-height: 43px !important;
  padding: 12px 45px 12px 40px !important;
  border: 1px solid rgba(120,160,255,.2) !important;
  border-radius: 12px !important;
  color: #eef2ff !important;
  background: rgba(255,255,255,.05) !important;
  box-shadow: none !important;
  font: 15px/1.2 "Space Grotesk",sans-serif !important;
}

#readingPacmanGame #select-screen #skillClear {
  top: 8px !important;
  right: 9px !important;
  width: auto !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 6px 8px !important;
  border: 0 !important;
  color: #8595bd !important;
  background: transparent !important;
  box-shadow: none !important;
}

#readingPacmanGame .screen#difficulty-screen:not([style*="display: none"]) {
  height: auto !important;
  min-height: var(--abz-game-stage-height,100dvh) !important;
  gap: 26px !important;
  padding: 40px 22px !important;
  overflow-y: auto !important;
}

#readingPacmanGame #difficulty-screen .difficulty-top-row {
  display: grid !important;
  grid-template-columns: repeat(4,minmax(0,1fr)) !important;
  gap: 14px !important;
  width: 100% !important;
}

#readingPacmanGame #difficulty-screen .pill,
#readingPacmanGame #difficulty-screen .difficulty-top-row .pill {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  min-width: 0 !important;
  min-height: 142px !important;
  height: auto !important;
  padding: 24px 16px !important;
  border: 2px solid rgba(120,160,255,.16) !important;
  border-radius: 20px !important;
  background: rgba(255,255,255,.035) !important;
  box-shadow: 0 16px 40px rgba(0,0,0,.4) !important;
  animation: none !important;
}

#readingPacmanGame #difficulty-screen .pill::before {
  content: "●  ●  ●" !important;
  position: absolute !important;
  top: 25px !important;
  right: auto !important;
  left: auto !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
  color: var(--ghost-color,#5ff0ff) !important;
  background: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
  font-size: 13px !important;
  letter-spacing: 4px !important;
  text-shadow: 0 0 10px var(--ghost-color,#5ff0ff) !important;
}

#readingPacmanGame #difficulty-screen .pill::after {
  display: none !important;
  content: none !important;
}

#readingPacmanGame #difficulty-screen .pill-title {
  margin: 0 !important;
  color: #fff !important;
  font-size: 19px !important;
  line-height: 1.2 !important;
  text-shadow: none !important;
}

#readingPacmanGame #difficulty-screen .pill-sub {
  margin: 5px 0 0 !important;
  color: #8fa0c6 !important;
  font: 400 13px/1.3 "Space Grotesk",sans-serif !important;
  text-shadow: none !important;
}

#readingPacmanGame #difficulty-screen #difficulty-unbeatable {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  grid-template-areas: "over sub" "title note" !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 20px 26px !important;
  border-color: rgba(255,77,157,.42) !important;
  background: rgba(255,255,255,.035) !important;
}

#readingPacmanGame #difficulty-screen #difficulty-unbeatable::before {
  content: "● ● ● ● ● ●" !important;
  top: 50% !important;
  right: 30px !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  opacity: .5 !important;
}

#readingPacmanGame .screen#control-screen:not([style*="display: none"]) {
  height: auto !important;
  min-height: var(--abz-game-stage-height,100dvh) !important;
  gap: 26px !important;
  padding: 40px 22px !important;
  overflow-y: auto !important;
}

#readingPacmanGame #control-screen > .pill-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
  width: 100% !important;
}

#readingPacmanGame #control-screen .pill {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  min-height: 190px !important;
  height: auto !important;
  padding: 34px !important;
  border: 2px solid rgba(120,160,255,.16) !important;
  border-radius: 20px !important;
  color: var(--mm-text) !important;
  background: rgba(255,255,255,.035) !important;
  box-shadow: 0 16px 40px rgba(0,0,0,.4) !important;
}

#readingPacmanGame #control-screen .pill-title {
  margin: 0 !important;
  color: #fff !important;
  font-size: 22px !important;
  text-shadow: none !important;
}

#readingPacmanGame #control-screen .pill-sub {
  margin: 6px 0 0 !important;
  color: #8fa0c6 !important;
  font: 400 14px/1.4 "Space Grotesk",sans-serif !important;
}

#readingPacmanGame #control-screen #control-mouse::before {
  content: "◉" !important;
}

#readingPacmanGame #control-screen #control-keyboard::before {
  content: "↑ ← ↓ →" !important;
  font-size: 23px !important;
  letter-spacing: 2px !important;
}

#readingPacmanGame #control-screen #control-mouse::before,
#readingPacmanGame #control-screen #control-keyboard::before {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  margin: 0 0 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--mm-cyan) !important;
  background: none !important;
  box-shadow: none !important;
  text-shadow: 0 0 22px rgba(95,240,255,.5) !important;
}

#readingPacmanGame .screen#question-screen:not([style*="display: none"]) {
  height: auto !important;
  min-height: var(--abz-game-stage-height,100dvh) !important;
  overflow-y: auto !important;
}

#readingPacmanGame .screen#answer-feedback-screen:not([style*="display: none"]) {
  height: auto !important;
  min-height: var(--abz-game-stage-height,100dvh) !important;
  justify-content: flex-start !important;
  overflow-y: auto !important;
}

/* =========================================================
   SOURCE-OF-TRUTH DESIGN SPEC OVERRIDES
   These rules intentionally come last so the old arcade skin cannot leak
   into the redesign. The maze screen remains excluded.
   ========================================================= */

#readingPacmanGame .screen:not(#game-screen),
#readingPacmanGame .screen:not(#game-screen) p,
#readingPacmanGame .screen:not(#game-screen) input,
#readingPacmanGame .screen:not(#game-screen) textarea,
#readingPacmanGame .screen:not(#game-screen) .pill-sub,
#readingPacmanGame .pac-end-screen,
#readingPacmanGame .pac-end-screen p,
#readingPacmanGame .pac-end-screen input,
#readingPacmanGame .pac-end-screen textarea {
  font-family: "Space Grotesk",system-ui,sans-serif !important;
  font-weight: 400;
}

#readingPacmanGame .screen:not(#game-screen) h1,
#readingPacmanGame .screen:not(#game-screen) h2,
#readingPacmanGame .screen:not(#game-screen) h3,
#readingPacmanGame .screen:not(#game-screen) h4,
#readingPacmanGame .screen:not(#game-screen) button,
#readingPacmanGame .screen:not(#game-screen) .pill-title,
#readingPacmanGame .screen:not(#game-screen) .mockup-step,
#readingPacmanGame .pac-end-screen h2,
#readingPacmanGame .pac-end-screen h3,
#readingPacmanGame .pac-end-screen h4,
#readingPacmanGame .pac-end-screen button,
#readingPacmanGame .pac-end-screen strong,
#readingPacmanGame .pac-end-screen .pac-end-kicker {
  font-family: "Chakra Petch",sans-serif !important;
  font-weight: 700 !important;
}

#readingPacmanGame .mockup-back-btn,
#readingPacmanGame .mockup-text-back {
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 4px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #7d8fc0 !important;
  background: none !important;
  box-shadow: none !important;
  font: 500 14px/1.3 "Space Grotesk",sans-serif !important;
}

#readingPacmanGame #mode-screen .mode-search,
#readingPacmanGame #select-screen #skillFilter {
  border-radius: 999px !important;
}

#readingPacmanGame #mode-screen .mode-pill,
#readingPacmanGame #mode-screen .mode-pill-featured,
#readingPacmanGame #select-screen .skill-card,
#readingPacmanGame #difficulty-screen .pill,
#readingPacmanGame #control-screen .pill,
#readingPacmanGame #question-screen .question-panel,
#readingPacmanGame .answer-feedback-card,
#readingPacmanGame .answer-reflection-card {
  border: 1px solid rgba(120,160,255,.14) !important;
  background: rgba(255,255,255,.035) !important;
  box-shadow: 0 18px 44px rgba(0,0,0,.28) !important;
}

/* Subject-separated skill browser */
#readingPacmanGame #select-screen .select-wrap {
  display: block !important;
  width: 100% !important;
}

#readingPacmanGame .skill-subject-group {
  display: block;
  width: 100%;
  margin: 0 0 30px;
}

#readingPacmanGame .skill-subject-group.is-hidden {
  display: none !important;
}

#readingPacmanGame .skill-subject-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 0 0 12px;
  padding: 0 2px 10px;
  border-bottom: 1px solid rgba(120,160,255,.12);
}

#readingPacmanGame .skill-subject-head span {
  color: #eaf0ff;
  font: 700 18px/1.2 "Chakra Petch",sans-serif;
}

#readingPacmanGame .skill-subject-head p {
  margin: 4px 0 0;
  color: #8fa0c6;
  font-size: 12px;
}

#readingPacmanGame .skill-subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(250px,1fr));
  gap: 16px;
}

#readingPacmanGame #select-screen .skill-card {
  border-radius: 18px !important;
  padding: 18px 18px 16px !important;
}

#readingPacmanGame #select-screen .skill-icon {
  width: 34px !important;
  height: 34px !important;
  border: 0 !important;
  border-radius: 10px !important;
  box-shadow: 0 0 18px var(--skill-accent,#5ff0ff) !important;
}

#readingPacmanGame #select-screen .grade-btn {
  padding: 6px 11px !important;
  border: 1px solid rgba(120,160,255,.22) !important;
  border-radius: 999px !important;
  color: #d5deff !important;
  background: rgba(120,160,255,.1) !important;
  box-shadow: none !important;
  font: 600 12.5px/1.2 "Space Grotesk",sans-serif !important;
}

/* Challenge cards: quiet, fixed counts, separate danger option. */
#readingPacmanGame #difficulty-screen .pill {
  border-radius: 20px !important;
  box-shadow: 0 16px 40px rgba(0,0,0,.28) !important;
}

#readingPacmanGame #difficulty-screen #difficulty-unbeatable {
  position: relative !important;
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  grid-template-areas: "badge title count" "note note note" !important;
  gap: 5px 14px !important;
  align-items: center !important;
  padding: 21px 24px !important;
  border: 1px solid rgba(255,84,112,.38) !important;
  background: rgba(255,84,112,.07) !important;
  text-align: left !important;
  box-shadow: 0 16px 40px rgba(0,0,0,.28) !important;
}

#readingPacmanGame #difficulty-screen #difficulty-unbeatable::before,
#readingPacmanGame #difficulty-screen #difficulty-unbeatable::after {
  display: none !important;
}

#readingPacmanGame #difficulty-unbeatable .difficulty-overline {
  grid-area: badge !important;
  padding: 6px 9px !important;
  border-radius: 8px !important;
  color: #04121a !important;
  background: #ff5470 !important;
  font: 700 11px/1 "Chakra Petch",sans-serif !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
}

#readingPacmanGame #difficulty-unbeatable .pill-title {
  grid-area: title !important;
  color: #fff !important;
  font-size: 22px !important;
}

#readingPacmanGame #difficulty-unbeatable .pill-sub {
  grid-area: count !important;
  visibility: visible !important;
  margin: 0 !important;
  color: #ff8aa0 !important;
  font: 700 22px/1 "Chakra Petch",sans-serif !important;
}

#readingPacmanGame #difficulty-unbeatable .difficulty-note {
  grid-area: note !important;
  padding: 0 !important;
  color: #ffb3c1 !important;
  font: 500 13px/1.45 "Space Grotesk",sans-serif !important;
}

/* Question */
#readingPacmanGame #question-screen .mockup-question-meta > span:first-child {
  color: #5ff0ff !important;
  font-family: "Chakra Petch",sans-serif !important;
}

#readingPacmanGame #question-screen .mockup-read-label {
  margin-bottom: 8px !important;
  color: #7d8fc0 !important;
}

#readingPacmanGame #question-screen .prompt {
  padding: 0 !important;
  border: 0 !important;
  color: #eaf0ff !important;
  background: none !important;
  font: 400 18px/1.62 "Space Grotesk",sans-serif !important;
  text-align: left !important;
}

#readingPacmanGame #question-screen .question-text {
  margin: 22px 0 15px !important;
  color: #fff !important;
  font: 700 20px/1.4 "Chakra Petch",sans-serif !important;
}

#readingPacmanGame #question-screen .choice-btn {
  gap: 11px !important;
  min-height: 52px !important;
  padding: 10px 13px !important;
  border: 1px solid rgba(120,160,255,.18) !important;
  border-radius: 13px !important;
  color: #eaf0ff !important;
  background: rgba(120,160,255,.055) !important;
  box-shadow: none !important;
  font: 500 16.5px/1.4 "Space Grotesk",sans-serif !important;
}

#readingPacmanGame #question-screen .choice-letter {
  flex-basis: 30px !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 9px !important;
  font: 700 13px/1 "Chakra Petch",sans-serif !important;
}

#readingPacmanGame #question-screen .retry:not(:empty),
#readingPacmanGame #question-screen .hint:not(:empty) {
  display: block !important;
  padding: 13px 15px !important;
  border: 1px solid rgba(255,210,30,.3) !important;
  border-radius: 12px !important;
  color: #ffe680 !important;
  background: rgba(255,210,30,.08) !important;
}

/* Rich answer discussion */
#readingPacmanGame .answer-feedback-banner {
  border: 1px solid rgba(70,227,155,.3) !important;
  border-radius: 16px !important;
  background: rgba(70,227,155,.08) !important;
}

#readingPacmanGame .answer-feedback-icon {
  width: 46px !important;
  height: 46px !important;
}

#readingPacmanGame .answer-evidence-highlight {
  padding: 2px 4px;
  border-radius: 5px;
  color: #eef8ff;
  background: rgba(95,240,255,.14);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

#readingPacmanGame .answer-feedback-why {
  border: 1px solid rgba(70,227,155,.28) !important;
  border-left: 3px solid #5fe3a8 !important;
  border-radius: 12px !important;
  background: rgba(70,227,155,.07) !important;
}

#readingPacmanGame .answer-feedback-why h3 {
  color: #5fe3a8 !important;
}

#readingPacmanGame .answer-feedback-misses {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(255,107,107,.2);
  border-radius: 12px;
  background: rgba(255,107,107,.035);
}

#readingPacmanGame .answer-feedback-misses h3 {
  margin: 0 0 10px;
  color: #eaf0ff !important;
  font-size: 15px;
}

#readingPacmanGame .answer-miss-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 7px 0;
  opacity: .78;
}

#readingPacmanGame .answer-miss-row > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #ff6b6b;
  background: rgba(255,107,107,.1);
  font: 700 12px/1 "Chakra Petch",sans-serif;
}

#readingPacmanGame .answer-miss-row p {
  margin: 3px 0 0;
  color: #9fb0d4;
  font-size: 13px;
  line-height: 1.45;
}

#readingPacmanGame .answer-reflection-card {
  border-color: rgba(169,123,255,.28) !important;
  background: rgba(169,123,255,.1) !important;
}

#readingPacmanGame .answer-feedback-continue.enters-maze {
  color: #04121a !important;
  background: linear-gradient(180deg,#ffe680,#ffbe2e) !important;
  box-shadow: 0 12px 32px rgba(255,210,30,.22) !important;
  text-transform: uppercase !important;
}

/* Recap — no leaderboard, one full-width run card. */
#readingPacmanGame .pac-end-screen {
  display: none;
  min-height: 100vh;
  padding: 36px 20px 60px !important;
  color: #eaf0ff !important;
  background: transparent !important;
}

#readingPacmanGame .pac-end-shell {
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
  width: min(100%,760px) !important;
  margin: 0 auto !important;
}

#readingPacmanGame .pac-end-heading {
  text-align: center;
}

#readingPacmanGame .pac-end-heading .pac-end-kicker {
  margin: 0;
  color: #5ff0ff !important;
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
}

#readingPacmanGame .pac-end-heading h2 {
  margin: 6px 0 0;
  color: #fff !important;
  font-size: clamp(34px,7vw,52px);
}

#readingPacmanGame .pac-end-heading > p:last-child {
  margin: 7px 0 0;
  color: #9fb0d4 !important;
}

#readingPacmanGame .pac-run-card,
#readingPacmanGame .pac-remaining-assignments,
#readingPacmanGame .pac-recap-feedback-card {
  padding: 24px !important;
  border: 1px solid rgba(120,160,255,.14) !important;
  border-radius: 20px !important;
  color: #eaf0ff !important;
  background: rgba(255,255,255,.035) !important;
  box-shadow: none !important;
}

#readingPacmanGame .pac-run-kicker,
#readingPacmanGame .pac-recap-feedback-kicker,
#readingPacmanGame .pac-remaining-head > p {
  margin: 0 !important;
  color: #8fa0c6 !important;
  font: 600 12px/1.2 "Chakra Petch",sans-serif !important;
  letter-spacing: .14em;
  text-transform: uppercase;
}

#readingPacmanGame .pac-run-stats {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 20px;
  margin-top: 18px;
}

#readingPacmanGame .pac-run-stats div {
  min-width: 0;
}

#readingPacmanGame .pac-run-stats strong,
#readingPacmanGame .pac-run-stats span {
  display: block;
}

#readingPacmanGame .pac-run-stats strong {
  font-size: 32px;
  line-height: 1;
}

#readingPacmanGame .pac-run-stats div:nth-child(1) strong { color:#ffe680 !important; }
#readingPacmanGame .pac-run-stats div:nth-child(2) strong { color:#5fe3a8 !important; }
#readingPacmanGame .pac-run-stats div:nth-child(3) strong { color:#5ff0ff !important; }
#readingPacmanGame .pac-run-stats div:nth-child(4) strong { color:#a97bff !important; }

#readingPacmanGame .pac-run-stats span {
  margin-top: 5px;
  color: #8fa0c6 !important;
  font-size: 12px;
}

#readingPacmanGame .pac-mastery-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(120,160,255,.12);
}

#readingPacmanGame .pac-mastery-block > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #c7d3ef;
  font-size: 13px;
}

#readingPacmanGame .pac-mastery-track {
  height: 10px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.06);
}

#readingPacmanGame .pac-mastery-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg,#5fe3a8,#46e39b);
  transition: width .4s ease;
}

#readingPacmanGame #pacCoachNote {
  margin: 12px 0 0;
  color: #94a5cb !important;
  font-size: 13px;
  line-height: 1.55;
}

#readingPacmanGame .pac-assignment-complete-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 20px !important;
  border: 1px solid rgba(70,227,155,.3) !important;
  border-radius: 16px !important;
  background: rgba(70,227,155,.08) !important;
  box-shadow: none !important;
}

#readingPacmanGame .pac-assignment-complete-icon {
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #06101c;
  background: #46e39b;
  font-size: 20px;
}

#readingPacmanGame .pac-assignment-complete-card h3 {
  margin: 0;
  font-size: 18px;
}

#readingPacmanGame .pac-assignment-complete-card p {
  margin: 3px 0 0;
  color: #c9d4ef !important;
  font-size: 13px;
}

#readingPacmanGame .pac-remaining-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

#readingPacmanGame .pac-remaining-head span,
#readingPacmanGame #pacRemainingAssignmentsTeacher {
  color: #8fa0c6 !important;
  font-size: 12px;
}

#readingPacmanGame #pacRemainingAssignmentsTeacher {
  margin: 5px 0 14px;
}

#readingPacmanGame #pacRemainingAssignmentsList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#readingPacmanGame .pac-remaining-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border: 1px solid rgba(120,160,255,.12);
  border-radius: 12px;
  background: rgba(120,160,255,.05);
}

#readingPacmanGame .pac-remaining-item h4,
#readingPacmanGame .pac-remaining-item p {
  margin: 0;
}

#readingPacmanGame .pac-remaining-item h4 { color:#eef2ff; font-size:15px; }
#readingPacmanGame .pac-remaining-item p { margin-top:2px; color:#8fa0c6 !important; font-size:12.5px; }
#readingPacmanGame .pac-remaining-item button {
  padding: 9px 18px;
  border: 0;
  border-radius: 10px;
  color: #04121a;
  background: linear-gradient(180deg,#5ff0ff,#22c6e6);
  font-size: 13px;
}

#readingPacmanGame .pac-practice-card {
  padding: 15px 20px;
  border: 1px solid rgba(120,160,255,.16);
  border-radius: 14px;
  color: #c9d4ef;
  background: rgba(120,160,255,.05);
  font-size: 14px;
}

#readingPacmanGame .pac-practice-card span { color:#5fe3a8 !important; }

#readingPacmanGame .pac-zpoints-earned {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border: 1px solid rgba(255,210,30,.28);
  border-radius: 14px;
  background: linear-gradient(180deg,rgba(255,230,128,.1),rgba(255,210,30,.035));
  color: #ffe680;
}

#readingPacmanGame .pac-zpoints-earned > span { font-size: 28px; }
#readingPacmanGame .pac-zpoints-earned strong {
  display: block;
  color: #ffe680 !important;
  font: 700 17px/1.2 "Chakra Petch",sans-serif;
}
#readingPacmanGame .pac-zpoints-earned p {
  margin: 3px 0 0;
  color: #9fb0d4 !important;
  font-size: 13px;
}

#readingPacmanGame .pac-guest-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid rgba(255,210,30,.3);
  border-radius: 16px;
  background: linear-gradient(180deg,rgba(255,210,30,.09),rgba(255,210,30,.03));
}

#readingPacmanGame .pac-guest-card h3,
#readingPacmanGame .pac-guest-card p { margin:0; }
#readingPacmanGame .pac-guest-card p { margin-top:3px; color:#e6d9ae !important; font-size:13.5px; }
#readingPacmanGame .pac-guest-card a {
  margin-left: auto;
  padding: 13px 22px;
  border-radius: 12px;
  color: #04121a;
  background: linear-gradient(180deg,#ffe680,#ffbe2e);
  font: 700 14px/1.2 "Chakra Petch",sans-serif;
  white-space: nowrap;
}

#readingPacmanGame .pac-end-actions {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  border: 0 !important;
  background: transparent !important;
}

#readingPacmanGame .pac-end-actions .btn {
  min-height: 0 !important;
  padding: 16px 34px !important;
  border: 0 !important;
  border-radius: 14px !important;
  color: #04121a !important;
  background: linear-gradient(180deg,#5ff0ff,#22c6e6) !important;
  box-shadow: none !important;
  font-size: 17px !important;
  text-transform: uppercase;
}

#readingPacmanGame .pac-end-actions .secondary-btn {
  border: 1px solid rgba(120,160,255,.2) !important;
  color: #c7d3ef !important;
  background: rgba(255,255,255,.05) !important;
  font-family: "Space Grotesk",sans-serif !important;
  font-weight: 600 !important;
  text-transform: none;
}

#readingPacmanGame .pac-recap-feedback-card h3 {
  margin: 8px 0 0;
  color: #fff;
  font-size: 20px;
}

#readingPacmanGame .pac-recap-feedback-card > p:not(.pac-recap-feedback-kicker) {
  margin: 4px 0 16px;
  color: #94a5cb !important;
  font-size: 14px;
}

#readingPacmanGame .pac-recap-feedback-card form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#readingPacmanGame .pac-recap-feedback-card input,
#readingPacmanGame .pac-recap-feedback-card textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(120,160,255,.22);
  border-radius: 11px;
  color: #eef2ff;
  background: rgba(0,0,0,.25);
  font-size: 15px;
}

#readingPacmanGame .pac-recap-feedback-card textarea {
  grid-column: 1 / -1;
  min-height: 84px;
  resize: vertical;
}

#readingPacmanGame .pac-recap-feedback-card button {
  justify-self: start;
  padding: 14px 28px;
  border: 0;
  border-radius: 13px;
  color: #04121a;
  background: linear-gradient(180deg,#ff9ec4,#ff6b9d);
  font-size: 16px;
}

#readingPacmanGame .pac-end-screen .hidden {
  display: none !important;
}

@media (max-width: 620px) {
  #readingPacmanGame .skill-subject-grid,
  #readingPacmanGame .pac-run-stats,
  #readingPacmanGame .pac-recap-feedback-card form {
    grid-template-columns: 1fr !important;
  }

  #readingPacmanGame .pac-recap-feedback-card textarea {
    grid-column: auto;
  }

  #readingPacmanGame .pac-guest-card,
  #readingPacmanGame .pac-remaining-item {
    align-items: flex-start;
    flex-direction: column;
  }

  #readingPacmanGame .pac-guest-card a {
    margin-left: 0;
  }
}

/* Final setup polish: centered hierarchy, roomy phonics, and scroll cues. */
#readingPacmanGame #start-screen {
  gap: 18px !important;
  padding: clamp(30px,5vh,58px) 24px !important;
  background:
    radial-gradient(620px 360px at 50% 42%,rgba(95,240,255,.07),transparent 72%),
    transparent !important;
}

#readingPacmanGame[data-active-screen="start-screen"] .cp_app {
  overflow: hidden !important;
}

#readingPacmanGame #start-screen .pac-redesign-mark {
  gap: 13px;
  padding: 12px 18px;
  border: 1px solid rgba(120,160,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
}

#readingPacmanGame #start-screen .pac-redesign-player {
  width: 46px;
  height: 46px;
}

#readingPacmanGame #start-screen .pac-redesign-pellets {
  width: 9px;
  height: 9px;
  box-shadow: 19px 0 0 #fff,38px 0 0 rgba(255,255,255,.46);
}

#readingPacmanGame #start-screen .pac-redesign-kicker {
  margin: 5px 0 -5px;
  font-size: 12px;
}

#readingPacmanGame #start-screen .title-top,
#readingPacmanGame #start-screen .title-bottom {
  font-size: clamp(54px,8vw,88px);
  line-height: .9;
}

#readingPacmanGame #start-screen .pac-redesign-intro {
  width: min(100%,540px) !important;
  max-width: 540px !important;
  margin: 3px auto 0;
  font-size: clamp(15px,1.7vw,18px);
  line-height: 1.62;
}

#readingPacmanGame #start-screen .start-btn {
  width: min(100%,460px);
  padding: 16px 38px;
}

#readingPacmanGame .screen#mode-screen:not([style*="display: none"]),
#readingPacmanGame .screen#select-screen:not([style*="display: none"]),
#readingPacmanGame .screen#answer-feedback-screen:not([style*="display: none"]) {
  width: 100% !important;
  height: var(--abz-game-stage-height,100dvh) !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-gutter: stable;
}

#readingPacmanGame .screen#mode-screen,
#readingPacmanGame .screen#select-screen {
  max-width: 1180px !important;
}

#readingPacmanGame #mode-screen .mockup-screen-head,
#readingPacmanGame #select-screen .mockup-screen-head {
  position: relative;
  justify-content: center;
  width: 100%;
  text-align: center;
}

#readingPacmanGame #mode-screen .mockup-screen-head > div,
#readingPacmanGame #select-screen .mockup-screen-head > div {
  margin-inline: auto;
}

#readingPacmanGame #mode-screen .mockup-back-btn,
#readingPacmanGame #select-screen .mockup-back-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

#readingPacmanGame #mode-screen .mockup-screen-subtitle {
  align-self: center;
  max-width: 660px;
  text-align: center;
}

#readingPacmanGame #mode-screen .mode-search-wrap,
#readingPacmanGame #select-screen .skill-search {
  align-self: center;
  margin-inline: auto !important;
}

#readingPacmanGame #mode-screen .mode-section,
#readingPacmanGame #select-screen .select-wrap {
  max-width: 1020px;
  margin-inline: auto !important;
}

#readingPacmanGame #mode-screen .mode-grid,
#readingPacmanGame #mode-screen .mode-trending-grid,
#readingPacmanGame #mode-screen .mode-all-grid {
  grid-template-columns: repeat(3,minmax(230px,300px)) !important;
  justify-content: center !important;
}

#readingPacmanGame .skill-subject-head {
  justify-content: center;
  text-align: center;
}

#readingPacmanGame .skill-subject-grid {
  grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
  justify-content: center;
}

#readingPacmanGame .skill-subject-phonics .skill-card {
  grid-column: 1 / -1;
  display: grid !important;
  grid-template-columns: minmax(190px,230px) 1fr;
  align-items: center;
  gap: 22px !important;
  padding: 24px !important;
}

#readingPacmanGame .skill-subject-phonics .grade-grid {
  display: grid !important;
  grid-template-columns: repeat(5,minmax(120px,1fr));
  gap: 10px !important;
}

#readingPacmanGame .skill-subject-phonics .grade-btn {
  width: 100% !important;
  min-height: 52px !important;
  border-radius: 12px !important;
  white-space: normal;
}

#readingPacmanGame .pac-scroll-cues {
  position: absolute;
  z-index: 70;
  inset: 0;
  pointer-events: none;
}

#readingPacmanGame .pac-scroll-cue {
  position: absolute;
  left: 50%;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(95,240,255,.32);
  border-radius: 50%;
  color: #eaf0ff;
  background: rgba(5,9,19,.88);
  box-shadow: 0 8px 28px rgba(0,0,0,.42),0 0 20px rgba(95,240,255,.12);
  font: 700 21px/1 "Chakra Petch",sans-serif;
  transform: translateX(-50%);
  pointer-events: auto;
  cursor: pointer;
}

#readingPacmanGame .pac-scroll-up { top: 16px; }
#readingPacmanGame .pac-scroll-down { bottom: 16px; animation: pac-scroll-nudge 1.4s ease-in-out infinite; }
#readingPacmanGame .pac-scroll-cue[hidden],
#readingPacmanGame .pac-scroll-cues[hidden] { display: none !important; }

@keyframes pac-scroll-nudge {
  0%,100% { transform: translate(-50%,0); }
  50% { transform: translate(-50%,5px); }
}

/* Keep the skip action attached to the immediate feedback summary. */
#readingPacmanGame .answer-feedback-banner {
  display: grid !important;
  grid-template-columns: auto minmax(0,1fr) auto;
}

#readingPacmanGame .answer-feedback-banner .answer-feedback-continue {
  align-self: center;
  white-space: nowrap;
  margin-left: 10px;
  padding: 12px 20px;
  font-size: 14px;
}

/* Small HUD additions; the maze dimensions and rendering stay unchanged. */
#readingPacmanGame #game-screen .hud {
  flex-wrap: wrap;
}

#readingPacmanGame #game-screen .pac-lives-chip span {
  color: #ff5470;
  letter-spacing: 5px;
  text-shadow: 0 0 10px rgba(255,84,112,.7);
}

#readingPacmanGame #game-screen .pac-maze-progress {
  width: min(100%,900px);
  height: 6px;
  margin: 8px auto 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
}

#readingPacmanGame #game-screen .pac-maze-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg,#5ff0ff,#ffe680);
  box-shadow: 0 0 14px rgba(255,230,128,.5);
  transition: width .18s linear;
}

#readingPacmanGame #game-screen.caught-pulse {
  animation: pac-caught-edge 1.05s ease-out;
}

@keyframes pac-caught-edge {
  0%,100% { box-shadow: inset 0 0 0 rgba(255,45,75,0); }
  25% { box-shadow: inset 0 0 70px rgba(255,45,75,.7); }
  60% { box-shadow: inset 0 0 34px rgba(255,45,75,.32); }
}

#readingPacmanGame .pac-end-screen.is-loss .pac-end-kicker { color: #ff8da2 !important; }
#readingPacmanGame .pac-end-screen.is-loss .pac-run-card { border-color: rgba(255,84,112,.22); }
#readingPacmanGame .pac-end-screen.show {
  height: var(--abz-game-stage-height,100dvh);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

@media (max-width: 820px) {
  #readingPacmanGame #mode-screen .mode-grid,
  #readingPacmanGame #mode-screen .mode-trending-grid,
  #readingPacmanGame #mode-screen .mode-all-grid {
    grid-template-columns: repeat(2,minmax(220px,1fr)) !important;
  }

  #readingPacmanGame .skill-subject-phonics .skill-card { grid-template-columns: 1fr; }
  #readingPacmanGame .skill-subject-phonics .grade-grid { grid-template-columns: repeat(2,minmax(130px,1fr)); }
}

@media (max-width: 540px) {
  #readingPacmanGame #mode-screen .mockup-screen-head,
  #readingPacmanGame #select-screen .mockup-screen-head { padding-top: 40px; }
  #readingPacmanGame #mode-screen .mockup-back-btn,
  #readingPacmanGame #select-screen .mockup-back-btn { top: 0; transform: none; }
  #readingPacmanGame #mode-screen .mode-grid,
  #readingPacmanGame #mode-screen .mode-trending-grid,
  #readingPacmanGame #mode-screen .mode-all-grid,
  #readingPacmanGame .skill-subject-phonics .grade-grid { grid-template-columns: 1fr !important; }
  #readingPacmanGame .answer-feedback-banner { grid-template-columns: auto 1fr !important; }
  #readingPacmanGame .answer-feedback-banner .answer-feedback-continue {
    grid-column: 1 / -1;
    width: 100%;
    margin: 8px 0 0;
  }
}

/* Account-aware recap cards from the final mockup. */
#readingPacmanGame .pac-account-recap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  width: 100%;
  padding: 20px 22px;
  border-radius: 18px;
}

#readingPacmanGame .pac-account-recap.hidden { display: none !important; }

#readingPacmanGame .pac-account-recap-copy {
  flex: 1;
  min-width: 230px;
}

#readingPacmanGame .pac-account-recap h3 {
  margin: 0;
  color: #fff !important;
  font: 700 18px/1.25 "Chakra Petch",sans-serif;
}

#readingPacmanGame .pac-account-recap p {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
}

#readingPacmanGame .pac-account-recap a,
#readingPacmanGame .pac-account-recap button {
  flex: none;
  padding: 13px 24px;
  border: 0;
  border-radius: 12px;
  color: #04121a !important;
  font: 700 14px/1.2 "Chakra Petch",sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

#readingPacmanGame .pac-zpoints-tile,
#readingPacmanGame .pac-account-recap-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  color: #04121a;
}

#readingPacmanGame .pac-zpoints-tile {
  flex-direction: column;
  background: linear-gradient(180deg,#ffe680,#ffbe2e);
  font-family: "Chakra Petch",sans-serif;
  font-weight: 700;
  line-height: 1;
}

#readingPacmanGame .pac-zpoints-tile strong { color: #04121a !important; font-size: 20px; }
#readingPacmanGame .pac-zpoints-tile span { margin-top: 3px; color: #463400 !important; font-size: 9px; letter-spacing: .1em; }

#readingPacmanGame .pac-student-recap {
  border: 1px solid rgba(255,210,30,.3);
  background: linear-gradient(180deg,rgba(255,210,30,.1),rgba(70,227,155,.04));
}

#readingPacmanGame .pac-student-recap p { color: #f0e6c4 !important; }
#readingPacmanGame .pac-student-recap p strong { color: #ffe680 !important; }
#readingPacmanGame .pac-student-recap a { background: linear-gradient(180deg,#ffe680,#ffbe2e); }

#readingPacmanGame .pac-guest-recap {
  border: 1px solid rgba(255,210,30,.32);
  background: linear-gradient(180deg,rgba(255,210,30,.1),rgba(255,210,30,.03));
}

#readingPacmanGame .pac-guest-recap .pac-account-recap-icon {
  background: linear-gradient(180deg,#ffe680,#ffbe2e);
  font-size: 24px;
}

#readingPacmanGame .pac-guest-recap p { color: #e6d9ae !important; }
#readingPacmanGame .pac-guest-recap a { background: linear-gradient(180deg,#ffe680,#ffbe2e); }

#readingPacmanGame .pac-teacher-recap {
  border: 1px solid rgba(95,240,255,.3);
  background: linear-gradient(180deg,rgba(95,240,255,.09),rgba(95,240,255,.03));
}

#readingPacmanGame .pac-teacher-recap .pac-account-recap-icon {
  background: linear-gradient(180deg,#5ff0ff,#22c6e6);
  font-size: 24px;
}

#readingPacmanGame .pac-teacher-recap p { color: #c9e8ef !important; }
#readingPacmanGame .pac-teacher-recap p strong { color: #eaf0ff !important; }
#readingPacmanGame .pac-teacher-recap button { background: linear-gradient(180deg,#5ff0ff,#22c6e6); }

#readingPacmanGame .pac-remaining-assignments {
  border-radius: 18px;
  padding: 20px 22px;
}

@media (max-width: 620px) {
  #readingPacmanGame .pac-account-recap { align-items: flex-start; flex-direction: column; }
  #readingPacmanGame .pac-account-recap a,
  #readingPacmanGame .pac-account-recap button { width: 100%; text-align: center; }
}

/* Final recap guard: remove the legacy arcade frame and preserve the mockup layout. */
#readingPacmanGame #final-popup.pac-end-screen.show {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  width: 100% !important;
  height: var(--abz-game-stage-height,100dvh) !important;
  min-height: 0 !important;
  padding: 36px 20px 60px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: transparent !important;
  backdrop-filter: none !important;
}

#readingPacmanGame #final-popup .pac-end-shell {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 22px !important;
  width: min(100%,760px) !important;
  max-width: 760px !important;
  height: auto !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

#readingPacmanGame #final-popup .pac-end-heading,
#readingPacmanGame #final-popup .pac-run-card,
#readingPacmanGame #final-popup .pac-account-recap,
#readingPacmanGame #final-popup .pac-remaining-assignments,
#readingPacmanGame #final-popup .pac-end-actions,
#readingPacmanGame #final-popup .pac-recap-feedback-card {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
  align-self: stretch !important;
}

#readingPacmanGame #final-popup .pac-end-heading .pac-end-kicker {
  display: block !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #5ff0ff !important;
  background: transparent !important;
  box-shadow: none !important;
  font: 600 13px/1.3 "Chakra Petch",sans-serif !important;
  letter-spacing: .3em !important;
  text-shadow: none !important;
  text-transform: uppercase !important;
}

#readingPacmanGame #final-popup.is-loss .pac-end-heading .pac-end-kicker {
  color: #ffe680 !important;
}

#readingPacmanGame #final-popup .pac-end-heading h2 {
  margin: 6px 0 0 !important;
  color: #fff !important;
  font: 700 clamp(34px,7vw,52px)/1.06 "Chakra Petch",sans-serif !important;
  letter-spacing: normal !important;
  text-shadow: none !important;
}

#readingPacmanGame #final-popup .pac-end-heading > p:last-child {
  margin: 7px 0 0 !important;
  color: #9fb0d4 !important;
  font: 400 16px/1.5 "Space Grotesk",sans-serif !important;
  letter-spacing: normal !important;
  text-shadow: none !important;
}

/* Responsive canvas sizing and dependable direct-finger steering. */
#readingPacmanGame #game-screen canvas#game {
  display: block;
  touch-action: none !important;
  -webkit-user-select: none;
  user-select: none;
}

@media (max-width: 760px), (pointer: coarse) {
  #readingPacmanGame #start-screen {
    gap: 16px !important;
    padding: 26px 16px 38px !important;
  }

  #readingPacmanGame #start-screen .title-top,
  #readingPacmanGame #start-screen .title-bottom {
    font-size: clamp(48px,15vw,72px);
  }

  #readingPacmanGame #start-screen .pac-redesign-intro {
    max-width: 34ch;
    font-size: 15px;
    line-height: 1.55;
  }

  #readingPacmanGame #game-screen.abz-shell-active-screen,
  #readingPacmanGame #game-screen:not([style*="display: none"]) {
    grid-template-rows: auto auto auto minmax(0,1fr) !important;
    align-content: stretch !important;
    width: 100% !important;
    height: var(--abz-game-stage-height,100dvh) !important;
    min-height: 0 !important;
    padding: 8px 5px 12px !important;
    overflow: hidden !important;
  }

  #readingPacmanGame #game-screen canvas#game {
    align-self: center;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 3 / 2 !important;
    object-fit: contain;
  }

  #readingPacmanGame #game-screen #game-hint {
    max-width: 46ch;
    font-size: 11px;
  }

  #readingPacmanGame #final-popup.pac-end-screen.show {
    padding: 28px 14px 54px !important;
  }
}

@media (max-width: 420px) {
  #readingPacmanGame #start-screen .pac-redesign-player {
    width: 38px;
    height: 38px;
  }

  #readingPacmanGame #start-screen .pac-redesign-badges {
    gap: 7px;
  }

  #readingPacmanGame #start-screen .pac-redesign-badges span {
    padding: 7px 10px;
    font-size: 11px;
  }

  #readingPacmanGame #final-popup .pac-run-stats {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  }
}

/* Start screen: larger title with more comfortable vertical rhythm. */
#readingPacmanGame #start-screen {
  gap: 23px !important;
  padding: clamp(28px,4.5vh,48px) 24px !important;
}

#readingPacmanGame #start-screen .pac-redesign-mark {
  padding: 13px 20px;
}

#readingPacmanGame #start-screen .pac-redesign-player {
  width: 52px;
  height: 52px;
}

#readingPacmanGame #start-screen .pac-redesign-kicker {
  margin: 1px 0 -2px !important;
  font-size: 13px;
  line-height: 1.35;
}

#readingPacmanGame #start-screen .app-title {
  display: grid;
  gap: 7px;
  line-height: 1 !important;
}

#readingPacmanGame #start-screen .title-top,
#readingPacmanGame #start-screen .title-bottom {
  font-size: clamp(64px,8.5vw,98px) !important;
  line-height: 1 !important;
}

#readingPacmanGame #start-screen .pac-redesign-intro {
  width: min(100%,560px) !important;
  max-width: 560px !important;
  margin: 0 auto !important;
  font-size: clamp(16px,1.55vw,18px) !important;
  line-height: 1.75 !important;
}

/* Restore the actual per-theme player artwork instead of placeholder dots. */
#readingPacmanGame #mode-screen .mode-visual::before,
#readingPacmanGame #mode-screen .mode-canvas-preview::before {
  display: none !important;
  content: none !important;
}

#readingPacmanGame #mode-screen .mode-preview-canvas {
  display: block !important;
  width: 108px !important;
  height: 108px !important;
  max-width: 76% !important;
  max-height: 92% !important;
  filter: drop-shadow(0 0 18px var(--mode-accent,#5ff0ff));
}

/* Make skill and grade choices feel clearly interactive. */
#readingPacmanGame #select-screen .skill-card,
#readingPacmanGame #select-screen .grade-btn {
  transition: transform .18s ease,border-color .18s ease,background-color .18s ease,box-shadow .18s ease !important;
}

#readingPacmanGame #select-screen .skill-card:hover,
#readingPacmanGame #select-screen .skill-card:focus-within {
  z-index: 2;
  border-color: rgba(95,240,255,.48) !important;
  background: rgba(95,240,255,.065) !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.32),0 0 0 3px rgba(95,240,255,.07) !important;
  transform: translateY(-4px);
}

#readingPacmanGame #select-screen .grade-btn:hover,
#readingPacmanGame #select-screen .grade-btn:focus-visible {
  border-color: rgba(95,240,255,.68) !important;
  color: #fff !important;
  background: rgba(95,240,255,.16) !important;
  box-shadow: 0 8px 22px rgba(5,10,28,.28),0 0 18px rgba(95,240,255,.12) !important;
  outline: none;
  transform: translateY(-2px);
}

/* Fit the entire question, choices, and progress bar in one stage. */
#readingPacmanGame .screen#question-screen:not([style*="display: none"]) {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 1160px !important;
  height: var(--abz-game-stage-height,100dvh) !important;
  min-height: 0 !important;
  padding: clamp(12px,2vh,20px) 24px 18px !important;
  gap: 10px !important;
  overflow: hidden !important;
}

#readingPacmanGame #question-screen .mockup-question-meta {
  width: min(100%,1100px) !important;
  flex: none;
}

#readingPacmanGame #question-screen .question-panel {
  display: flex !important;
  flex: none !important;
  width: min(100%,1100px) !important;
  max-width: 1100px !important;
  max-height: none !important;
  padding: clamp(16px,2.2vh,24px) clamp(18px,2.5vw,30px) !important;
  gap: 0 !important;
  overflow: visible !important;
}

#readingPacmanGame #question-screen .mockup-read-label {
  margin: 0 0 7px !important;
}

#readingPacmanGame #question-screen .prompt {
  font-size: clamp(17px,1.65vw,19px) !important;
  line-height: 1.5 !important;
}

#readingPacmanGame #question-screen .question-text {
  margin: clamp(13px,2vh,20px) 0 12px !important;
  font-size: clamp(20px,2vw,23px) !important;
  line-height: 1.35 !important;
}

#readingPacmanGame #question-screen .choices {
  display: grid !important;
  grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  gap: 9px 11px !important;
  width: 100% !important;
  margin: 0 !important;
}

#readingPacmanGame #question-screen .choice-btn {
  min-height: 48px !important;
  padding: 8px 12px !important;
  font-size: clamp(15.5px,1.55vw,17.5px) !important;
  line-height: 1.32 !important;
}

#readingPacmanGame #question-screen .choice-letter {
  flex-basis: 28px !important;
  width: 28px !important;
  height: 28px !important;
}

#readingPacmanGame #question-screen .progress-bar {
  height: 6px !important;
  margin-top: 12px !important;
  padding: 0 !important;
  border: 0 !important;
  background: rgba(255,255,255,.07) !important;
  box-shadow: none !important;
}

#readingPacmanGame #question-screen .retry:empty,
#readingPacmanGame #question-screen .hint:empty {
  display: none !important;
}

/* Guest recap role choice. */
#readingPacmanGame .pac-account-role-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 9px;
  margin-left: auto;
}

#readingPacmanGame .pac-guest-recap .pac-account-role-actions a {
  margin: 0 !important;
  padding: 12px 18px;
}

#readingPacmanGame .pac-guest-recap .pac-guest-student {
  background: linear-gradient(180deg,#ffe680,#ffbe2e) !important;
}

#readingPacmanGame .pac-guest-recap .pac-guest-teacher {
  border: 1px solid rgba(95,240,255,.34) !important;
  color: #dffbff !important;
  background: rgba(95,240,255,.08) !important;
}

@media (max-width: 760px) {
  #readingPacmanGame #start-screen {
    gap: 18px !important;
    padding: 24px 16px 34px !important;
  }

  #readingPacmanGame #start-screen .app-title { gap: 4px; }
  #readingPacmanGame #start-screen .title-top,
  #readingPacmanGame #start-screen .title-bottom {
    font-size: clamp(52px,16vw,76px) !important;
  }

  #readingPacmanGame .screen#question-screen:not([style*="display: none"]) {
    justify-content: flex-start !important;
    padding: 9px 10px 12px !important;
    gap: 7px !important;
  }

  #readingPacmanGame #question-screen .mockup-question-meta {
    font-size: 10px;
    letter-spacing: .08em;
  }

  #readingPacmanGame #question-screen .question-panel {
    padding: 13px 14px !important;
    border-radius: 16px !important;
  }

  #readingPacmanGame #question-screen .prompt {
    font-size: 14.5px !important;
    line-height: 1.4 !important;
  }

  #readingPacmanGame #question-screen .question-text {
    margin: 10px 0 8px !important;
    font-size: 17px !important;
    line-height: 1.28 !important;
  }

  #readingPacmanGame #question-screen .choices {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  #readingPacmanGame #question-screen .choice-btn {
    min-height: 42px !important;
    padding: 6px 9px !important;
    font-size: 14.5px !important;
  }

  #readingPacmanGame #question-screen .progress-bar {
    margin-top: 8px !important;
  }

  #readingPacmanGame .pac-account-role-actions {
    width: 100%;
    margin-left: 0;
  }

  #readingPacmanGame .pac-account-role-actions a {
    flex: 1 1 170px;
    width: auto !important;
    text-align: center;
  }
}

@media (min-width: 761px) and (max-height: 700px) {
  #readingPacmanGame .screen#question-screen:not([style*="display: none"]) {
    padding-block: 8px 10px !important;
    gap: 6px !important;
  }

  #readingPacmanGame #question-screen .question-panel {
    padding-block: 12px !important;
  }

  #readingPacmanGame #question-screen .prompt {
    font-size: 14px !important;
    line-height: 1.38 !important;
  }

  #readingPacmanGame #question-screen .question-text {
    margin: 9px 0 7px !important;
    font-size: 17px !important;
  }

  #readingPacmanGame #question-screen .choice-btn {
    min-height: 40px !important;
    padding-block: 5px !important;
  }

  #readingPacmanGame #question-screen .progress-bar {
    margin-top: 7px !important;
  }
}

/* ================================================================
   Solo / Compete play choice and head-to-head maze layout
   ================================================================ */
#readingPacmanGame #match-mode-screen {
  justify-content: center;
  gap: 22px;
  padding-inline: clamp(22px,6vw,84px);
}

#readingPacmanGame #match-mode-screen .mockup-screen-head,
#readingPacmanGame #match-mode-screen .mockup-screen-subtitle {
  width: min(100%,980px);
  margin-inline: auto;
}

#readingPacmanGame #match-mode-screen .screen-title {
  font-size: clamp(34px,5vw,58px) !important;
}

#readingPacmanGame .pac-match-mode-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 18px;
  width: min(100%,980px);
  margin: 10px auto 0;
}

#readingPacmanGame .pac-match-mode-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 220px;
  padding: 28px;
  color: #eaf0ff;
  text-align: left;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(120,160,255,.2);
  border-radius: 20px;
  box-shadow: 0 18px 55px rgba(0,0,0,.2);
  cursor: pointer;
  transition: transform .2s ease,border-color .2s ease,background .2s ease,box-shadow .2s ease;
}

#readingPacmanGame .pac-match-mode-card:hover,
#readingPacmanGame .pac-match-mode-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(95,240,255,.65);
  background: rgba(95,240,255,.07);
  box-shadow: 0 24px 64px rgba(0,0,0,.3),0 0 0 3px rgba(95,240,255,.08);
  outline: none;
}

#readingPacmanGame .pac-match-mode-card-compete {
  border-color: rgba(255,210,30,.3);
  background: linear-gradient(145deg,rgba(95,240,255,.06),rgba(255,210,30,.055));
}

#readingPacmanGame .pac-match-mode-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  color: #04121a;
  font: 700 32px/1 "Chakra Petch",sans-serif;
  background: linear-gradient(180deg,#ffe680,#ffd21e);
  box-shadow: 0 0 28px rgba(255,210,30,.3);
}

#readingPacmanGame .pac-match-mode-versus {
  color: #04121a;
  font-size: 20px;
  background: linear-gradient(180deg,#5ff0ff,#22c6e6);
  box-shadow: 0 0 28px rgba(95,240,255,.3);
}

#readingPacmanGame .pac-match-mode-copy {
  display: grid;
  gap: 7px;
}

#readingPacmanGame .pac-match-mode-copy strong {
  font: 700 clamp(28px,3vw,38px)/1 "Chakra Petch",sans-serif;
}

#readingPacmanGame .pac-match-mode-copy > span:last-child {
  color: #9fb0d4;
  font: 500 16px/1.55 "Space Grotesk",sans-serif;
}

#readingPacmanGame .pac-match-mode-kicker {
  color: #7d8fc0;
  font: 700 12px/1 "Chakra Petch",sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
}

#readingPacmanGame .pac-match-mode-arrow {
  color: #5ff0ff;
  font-size: 30px;
}

#readingPacmanGame .pac-match-mode-bonus {
  position: absolute;
  top: 16px;
  right: 18px;
  padding: 7px 10px;
  color: #07131a;
  font: 700 11px/1 "Chakra Petch",sans-serif;
  background: #ffe680;
  border-radius: 999px;
}

#readingPacmanGame .pac-match-mode-note {
  margin: 0 auto;
  color: #8fa0c6;
  text-align: center;
  font-size: 14px;
}

#readingPacmanGame #game-screen .pac-arena-layout {
  display: grid;
  min-width: 0;
  min-height: 0;
  width: min(100%,900px);
  margin-inline: auto;
}

#readingPacmanGame #game-screen .pac-player-arena {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
}

#readingPacmanGame #game-screen .pac-arena-heading,
#readingPacmanGame #game-screen .pac-compete-matchbar {
  font-family: "Chakra Petch",sans-serif;
}

#readingPacmanGame #game-screen .pac-player-arena-heading {
  display: none;
}

#readingPacmanGame #game-screen.is-compete {
  width: 100% !important;
  padding-inline: clamp(6px,1.6vw,22px) !important;
}

#readingPacmanGame #game-screen.is-compete .pac-arena-layout {
  grid-template-columns: minmax(0,2.15fr) minmax(260px,.85fr);
  align-items: center;
  gap: clamp(10px,1.5vw,20px);
  width: min(100%,1280px);
  height: 100%;
}

#readingPacmanGame #game-screen.is-compete .pac-player-arena {
  align-self: stretch;
  grid-template-rows: auto minmax(0,1fr);
}

#readingPacmanGame #game-screen.is-compete .pac-player-arena-heading {
  display: flex;
}

#readingPacmanGame #game-screen.is-compete canvas#game {
  width: 100% !important;
  height: auto !important;
  max-width: 900px !important;
  max-height: 100% !important;
  aspect-ratio: 3/2;
  object-fit: contain;
}

#readingPacmanGame #game-screen .pac-compete-matchbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  width: min(100%,780px);
  margin: 0 auto 5px;
  padding: 7px 12px;
  border: 1px solid rgba(95,240,255,.24);
  border-radius: 14px;
  background: rgba(5,11,24,.86);
}

#readingPacmanGame #game-screen .pac-compete-matchbar.hidden,
#readingPacmanGame #game-screen .pac-cpu-arena.hidden {
  display: none !important;
}

#readingPacmanGame .pac-compete-score {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #9fb0d4;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

#readingPacmanGame .pac-compete-score strong {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  color: #04121a;
  font-size: 18px;
  background: #5ff0ff;
  border-radius: 50%;
}

#readingPacmanGame .pac-compete-score-cpu { justify-content: flex-end; }
#readingPacmanGame .pac-compete-score-cpu strong { background: #ffe680; }

#readingPacmanGame .pac-compete-round-label {
  display: grid;
  gap: 1px;
  text-align: center;
}

#readingPacmanGame .pac-compete-round-label span { color: #8fa0c6; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
#readingPacmanGame .pac-compete-round-label strong { color: #eaf0ff; font-size: 15px; }

#readingPacmanGame #game-screen .pac-arena-heading {
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 3px 5px 6px;
  color: #eaf0ff;
  font-size: 13px;
}

#readingPacmanGame #game-screen .pac-arena-heading span { color: #7d8fc0; font-size: 11px; }

#readingPacmanGame #game-screen .pac-cpu-arena {
  display: grid;
  gap: 8px;
  align-content: center;
  min-width: 0;
  padding: 12px;
  background: rgba(8,14,29,.92);
  border: 1px solid rgba(120,160,255,.24);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
}

#readingPacmanGame #game-screen .pac-cpu-lives {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #ff5470;
  font: 700 14px/1 "Chakra Petch",sans-serif;
}

#readingPacmanGame #game-screen .pac-cpu-lives small {
  color: #7d8fc0;
  font: 500 9px/1.2 "Space Grotesk",sans-serif;
  text-align: right;
}

#readingPacmanGame #game-screen .pac-cpu-progress {
  height: 5px;
  overflow: hidden;
  background: rgba(255,255,255,.1);
  border-radius: 999px;
}

#readingPacmanGame #game-screen .pac-cpu-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg,#ffe680,#ffb84d);
  border-radius: inherit;
  transition: width .18s linear;
}

#readingPacmanGame #game-screen canvas#cpu-game {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3/2;
  border: 1px solid rgba(255,230,128,.22);
  border-radius: 10px;
  background: #000;
}

#readingPacmanGame .pac-compete-recap {
  display: grid;
  gap: 18px;
  padding: clamp(20px,3vw,30px);
  background: linear-gradient(145deg,rgba(95,240,255,.07),rgba(255,210,30,.055));
  border: 1px solid rgba(95,240,255,.24);
  border-radius: 18px;
}

#readingPacmanGame .pac-compete-recap.hidden { display: none !important; }

#readingPacmanGame .pac-compete-recap-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

#readingPacmanGame .pac-compete-recap-heading p {
  margin: 0 0 5px;
  color: #7d8fc0;
  font: 700 11px/1 "Chakra Petch",sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
}

#readingPacmanGame .pac-compete-recap-heading h3 {
  margin: 0 0 5px;
  color: #eaf0ff;
  font: 700 clamp(24px,4vw,36px)/1.1 "Chakra Petch",sans-serif;
}

#readingPacmanGame .pac-compete-recap-heading > div > span { color: #9fb0d4; }

#readingPacmanGame .pac-compete-final-score {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding: 13px 16px;
  color: #9fb0d4;
  background: rgba(0,0,0,.22);
  border-radius: 14px;
}

#readingPacmanGame .pac-compete-final-score strong { color: #ffe680; font: 700 28px/1 "Chakra Petch",sans-serif; }

#readingPacmanGame .pac-compete-round-results {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
}

#readingPacmanGame .pac-compete-round-results article {
  display: grid;
  gap: 4px;
  padding: 13px;
  background: rgba(5,10,22,.65);
  border: 1px solid rgba(120,160,255,.16);
  border-radius: 12px;
}

#readingPacmanGame .pac-compete-round-results article.is-player-win { border-color: rgba(95,227,168,.35); }
#readingPacmanGame .pac-compete-round-results article.is-cpu-win { border-color: rgba(255,84,112,.28); }
#readingPacmanGame .pac-compete-round-results span { color: #7d8fc0; font: 700 10px/1 "Chakra Petch",sans-serif; letter-spacing: .13em; text-transform: uppercase; }
#readingPacmanGame .pac-compete-round-results strong { color: #eaf0ff; font: 700 17px/1.2 "Chakra Petch",sans-serif; }
#readingPacmanGame .pac-compete-round-results small { color: #9fb0d4; line-height: 1.35; }
#readingPacmanGame .pac-compete-rival-reveal { margin: 0; color: #8fa0c6; font-size: 14px; }
#readingPacmanGame .pac-compete-rival-reveal strong { color: #ffe680; }

@media (max-width: 880px) {
  #readingPacmanGame .pac-match-mode-grid { grid-template-columns: 1fr; }
  #readingPacmanGame .pac-match-mode-card { min-height: 170px; }

  #readingPacmanGame #game-screen.is-compete .pac-arena-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0,1fr) auto;
    gap: 7px;
  }

  #readingPacmanGame #game-screen.is-compete .pac-player-arena { min-height: 0; }

  #readingPacmanGame #game-screen.is-compete .pac-cpu-arena {
    grid-template-columns: minmax(0,1fr) minmax(130px,36%);
    grid-template-rows: auto auto auto;
    gap: 5px 12px;
    padding: 7px 9px;
  }

  #readingPacmanGame #game-screen.is-compete .pac-cpu-arena .pac-arena-heading,
  #readingPacmanGame #game-screen.is-compete .pac-cpu-lives,
  #readingPacmanGame #game-screen.is-compete .pac-cpu-progress { grid-column: 1; }
  #readingPacmanGame #game-screen.is-compete canvas#cpu-game { grid-column: 2; grid-row: 1/4; max-height: 100px; }
}

@media (max-width: 620px) {
  #readingPacmanGame #match-mode-screen { justify-content: flex-start; padding-top: 54px !important; }
  #readingPacmanGame .pac-match-mode-card { grid-template-columns: auto minmax(0,1fr); min-height: 0; padding: 20px 17px; }
  #readingPacmanGame .pac-match-mode-icon { width: 52px; height: 52px; font-size: 24px; }
  #readingPacmanGame .pac-match-mode-versus { font-size: 16px; }
  #readingPacmanGame .pac-match-mode-arrow { display: none; }
  #readingPacmanGame .pac-match-mode-bonus { position: static; grid-column: 2; justify-self: start; }

  #readingPacmanGame #game-screen.is-compete .hud { gap: 4px !important; }
  #readingPacmanGame #game-screen.is-compete .hud-chip { padding: 4px 7px !important; font-size: 9px !important; }
  #readingPacmanGame #game-screen.is-compete #game-hint { display: none; }
  #readingPacmanGame #game-screen.is-compete .pac-maze-progress { margin-block: 3px 5px; }
  #readingPacmanGame #game-screen.is-compete .pac-compete-matchbar { padding: 4px 8px; }
  #readingPacmanGame #game-screen.is-compete .pac-arena-heading { padding-block: 1px 3px; }
  #readingPacmanGame #game-screen.is-compete canvas#cpu-game { max-height: 82px; }

  #readingPacmanGame .pac-compete-recap-heading { align-items: flex-start; flex-direction: column; }
  #readingPacmanGame .pac-compete-round-results { grid-template-columns: 1fr; }
}

/* First Compete round: a shared three-second race countdown. */
#readingPacmanGame #game-screen {
  position: relative;
}

#readingPacmanGame .pac-compete-countdown {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  overflow: hidden;
  color: #eaf0ff;
  pointer-events: none;
  background: radial-gradient(circle at center,rgba(12,30,58,.7),rgba(2,5,13,.82) 55%,rgba(2,5,13,.92));
  backdrop-filter: blur(3px);
}

#readingPacmanGame .pac-compete-countdown::before,
#readingPacmanGame .pac-compete-countdown::after {
  content: "";
  position: absolute;
  width: min(54vw,420px);
  aspect-ratio: 1;
  border: 2px solid rgba(95,240,255,.22);
  border-radius: 50%;
  animation: pac-compete-countdown-ring 1s ease-out infinite;
}

#readingPacmanGame .pac-compete-countdown::after {
  animation-delay: .5s;
}

#readingPacmanGame .pac-compete-countdown > span {
  color: #9fb0d4;
  font: 700 clamp(12px,2vw,18px)/1 "Chakra Petch",sans-serif;
  letter-spacing: .26em;
  text-transform: uppercase;
}

#readingPacmanGame .pac-compete-countdown > strong {
  position: relative;
  z-index: 1;
  min-width: 2ch;
  color: #5ff0ff;
  font: 700 clamp(92px,18vw,180px)/.9 "Chakra Petch",sans-serif;
  text-align: center;
  text-shadow: 0 0 18px rgba(95,240,255,.75),0 0 56px rgba(34,198,230,.42);
}

#readingPacmanGame .pac-compete-countdown > strong.is-popping {
  animation: pac-compete-countdown-pop .78s cubic-bezier(.2,.8,.2,1) both;
}

#readingPacmanGame .pac-compete-countdown.is-go > strong {
  color: #ffe680;
  font-size: clamp(72px,15vw,150px);
  text-shadow: 0 0 18px rgba(255,230,128,.8),0 0 58px rgba(255,210,30,.5);
}

#readingPacmanGame .pac-compete-countdown.is-round-ready {
  gap: 10px;
  background: rgba(2,5,13,.62);
  backdrop-filter: blur(2px);
  animation: pac-compete-ready-fade 2s ease both;
}

#readingPacmanGame .pac-compete-countdown.is-round-ready::before,
#readingPacmanGame .pac-compete-countdown.is-round-ready::after {
  display: none;
}

#readingPacmanGame .pac-compete-countdown.is-round-ready > strong {
  min-width: 0;
  padding: 14px 24px;
  color: #eaf0ff;
  font-size: clamp(28px,6vw,54px);
  line-height: 1;
  background: rgba(5,12,26,.88);
  border: 1px solid rgba(95,240,255,.3);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0,0,0,.28),0 0 24px rgba(95,240,255,.12);
  text-shadow: none;
}

@keyframes pac-compete-countdown-pop {
  0% { opacity: 0; transform: scale(.45); }
  24% { opacity: 1; transform: scale(1.14); }
  55% { transform: scale(1); }
  100% { opacity: .9; transform: scale(.92); }
}

@keyframes pac-compete-countdown-ring {
  from { opacity: .75; transform: scale(.45); }
  to { opacity: 0; transform: scale(1.1); }
}

@keyframes pac-compete-ready-fade {
  0% { opacity: 0; }
  14%,78% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #readingPacmanGame .pac-compete-countdown::before,
  #readingPacmanGame .pac-compete-countdown::after,
  #readingPacmanGame .pac-compete-countdown > strong.is-popping,
  #readingPacmanGame .pac-compete-countdown.is-round-ready {
    animation: none !important;
  }
}
