/* Homepage-only visual system. The shared stylesheet still powers both mini games. */
.dashboard-page {
  --dashboard-ink: #203252;
  --dashboard-muted: #64738b;
  --dashboard-line: #dceaf2;
  --dashboard-surface: #ffffff;
  --dashboard-cream: #fff9eb;
  --dashboard-pink: #f4517d;
  --dashboard-pink-dark: #d93a67;
  --dashboard-blue: #36aee2;
  --dashboard-mint: #55c98c;
  --dashboard-yellow: #ffc94f;
  background:
    linear-gradient(180deg, #eaf9ff 0 38%, #f5fff9 62%, #fff9e9 100%);
  color: var(--dashboard-ink);
}

.dashboard-page::before,
.dashboard-page::after {
  display: none;
}

.dashboard-page .app-shell {
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 328px;
  margin: 0 auto;
  max-width: 1600px;
  min-height: 100vh;
  padding: 12px;
}

.dashboard-page .lesson-area {
  gap: 12px;
  grid-template-rows: auto minmax(0, 1fr);
}

.dashboard-page .hero,
.dashboard-page .practice-panel,
.dashboard-page .map-card,
.dashboard-page .tips {
  border: 1px solid rgba(199, 222, 234, 0.92);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(53, 91, 121, 0.11);
}

/* Compact hero: illustration, actions, and progress each have a fixed lane. */
.dashboard-page .hero {
  align-items: center;
  background: #dff7ff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  height: 176px;
  min-height: 176px;
  overflow: hidden;
  padding: 14px 16px 14px 250px;
}

.dashboard-page .hero::before {
  background:
    linear-gradient(90deg, transparent 0 30%, rgba(223, 247, 255, 0.18) 43%, #dff7ff 78%),
    image-set(
      url("assets/hero-candy-island.webp") type("image/webp"),
      url("assets/hero-candy-island.png") type("image/png")
    );
  background-position: left center;
  background-repeat: no-repeat;
  background-size: auto 100%;
  inset: 0;
  opacity: 1;
}

.dashboard-page .hero::after {
  background: linear-gradient(
    90deg,
    #ff6f91 0 20%,
    #ffc857 20% 40%,
    #61cf92 40% 60%,
    #43b9e8 60% 80%,
    #9a83e8 80% 100%
  );
  bottom: 0;
  height: 4px;
  left: 0;
  opacity: 1;
  right: 0;
}

.dashboard-page .hero > div:first-child {
  align-content: center;
  align-self: stretch;
  display: grid;
  grid-template-columns: auto auto;
  justify-items: start;
  margin-left: 0;
  max-width: 470px;
  padding: 0;
  text-align: left;
  z-index: 2;
}

.dashboard-page .eyebrow {
  color: #b84365;
  font-size: 10px;
  grid-column: 1 / -1;
  letter-spacing: 0.08em;
}

.dashboard-page .hero h1 {
  color: var(--dashboard-pink);
  font-size: clamp(38px, 4vw, 52px);
  grid-column: 1 / -1;
  line-height: 1;
  margin-top: 1px;
  text-shadow:
    0 2px 0 #ffffff,
    0 4px 0 rgba(255, 255, 255, 0.9),
    0 7px 12px rgba(165, 61, 94, 0.16);
}

.dashboard-page .hero__copy {
  background: transparent;
  border: 0;
  color: #405473;
  font-size: 13px;
  grid-column: 1 / -1;
  line-height: 1.35;
  margin-top: 3px;
  padding: 0;
}

.dashboard-page .hero-actions {
  gap: 8px;
  margin-top: 8px;
}

.dashboard-page .hero .hero-action {
  border: 0;
  border-radius: 8px;
  box-shadow:
    0 5px 12px rgba(66, 93, 125, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  font-size: 14px;
  min-height: 36px;
  min-width: 118px;
  padding: 0 11px;
}

.dashboard-page .hero .hero-action::before {
  height: 23px;
  margin-right: 6px;
  width: 23px;
}

.dashboard-page #heroReviewButton {
  display: none;
}

.dashboard-page .hero .mini-game-links {
  align-items: stretch;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, 78px);
  justify-content: start;
  left: auto;
  margin: 8px 0 0 8px;
  padding: 0;
  position: static;
  top: auto;
  width: auto;
}

.dashboard-page .hero .mini-game-title {
  display: none;
}

.dashboard-page .hero .mini-game-link {
  align-items: center;
  border-radius: 7px;
  box-shadow: none;
  display: grid;
  font-size: 11px;
  grid-template-columns: 18px minmax(0, 1fr);
  grid-template-rows: auto auto;
  justify-items: start;
  min-height: 36px;
  padding: 4px 5px;
  text-align: left;
}

.dashboard-page .hero .mini-game-link::before {
  grid-row: 1 / 3;
  height: 16px;
  margin: 0;
  width: 16px;
}

.dashboard-page .hero .mini-game-link small {
  font-size: 8px;
}

.dashboard-page .hero .mini-game-link--memory {
  background: linear-gradient(180deg, #f2fbf2, #d8f2e2);
  border-color: rgba(98, 178, 137, 0.68);
  color: #256c50;
}

.dashboard-page .hero .mini-game-link--memory::before {
  background:
    radial-gradient(circle at 38% 30%, #ffffff 0 18%, transparent 20%),
    linear-gradient(180deg, #64c49a, #319271);
  color: #ffffff;
  content: "M";
}

.dashboard-page .hero__badge {
  align-self: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d7e9f2;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(50, 91, 121, 0.12);
  display: grid;
  gap: 7px;
  grid-template-columns: 1fr 1fr;
  min-width: 0;
  padding: 10px;
  position: static;
  text-align: center;
  width: 190px;
}

.dashboard-page .hero__badge-title {
  color: #344765;
  font-size: 12px;
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.dashboard-page .hero__badge-title::before {
  height: 17px;
  width: 17px;
}

.dashboard-page .hero__metric {
  background: #f8fbfd;
  border: 1px solid #e1edf3;
  border-radius: 7px;
  min-height: 50px;
  padding: 6px;
}

.dashboard-page .hero__metric strong {
  color: #213556;
  font-size: 22px;
}

.dashboard-page .hero__metric em,
.dashboard-page .hero__metric span {
  color: #697990;
  font-size: 10px;
}

.dashboard-page .hero__metric--accuracy::before {
  color: var(--dashboard-yellow);
  font-size: 20px;
}

.dashboard-page .hero__metric--accuracy strong {
  font-size: 15px;
}

.dashboard-page .hero__badge-progress {
  gap: 4px;
}

.dashboard-page .hero__badge-progress span,
.dashboard-page .hero__badge-progress strong {
  color: #52637c;
  font-size: 10px;
}

.dashboard-page .hero__badge-bar {
  background: #e7eef2;
  height: 7px;
}

.dashboard-page .hero__badge-bar i {
  background: linear-gradient(90deg, var(--dashboard-mint), var(--dashboard-blue));
}

/* Practice board: higher contrast, less empty height, clearer interaction state. */
.dashboard-page .practice-panel {
  background: var(--dashboard-surface);
  box-shadow: 0 12px 30px rgba(48, 83, 111, 0.1);
  gap: 9px;
  padding: 14px 16px 12px;
}

.dashboard-page .practice-panel::before {
  background: linear-gradient(90deg, #ff6f91, #ffc857, #61cf92, #43b9e8);
  height: 4px;
}

.dashboard-page .practice-panel::after {
  display: none;
}

.dashboard-page .level-meta {
  align-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 48px;
  padding: 2px 0;
}

.dashboard-page .level-meta > div {
  align-items: center;
  display: flex;
  gap: 10px;
}

.dashboard-page .level-meta h2 {
  color: #203252;
  font-size: 19px;
  margin: 0;
}

.dashboard-page .level-pill {
  background: var(--dashboard-pink);
  border: 0;
  border-radius: 7px;
  box-shadow: 0 5px 10px rgba(217, 58, 103, 0.18);
  color: #ffffff;
  font-size: 12px;
  padding: 6px 10px;
}

.dashboard-page .level-meta p {
  background: #f5fbfe;
  border: 1px solid #e0edf3;
  border-radius: 7px;
  color: #5f7088;
  font-size: 12px;
  line-height: 1.35;
  max-width: 440px;
  padding: 7px 10px;
}

.dashboard-page .star-goals {
  background: var(--dashboard-cream);
  border: 1px solid #f4dfac;
  box-shadow: none;
  gap: 0;
  grid-template-columns: 134px 1fr;
  min-height: 46px;
  padding: 0;
}

.dashboard-page .star-goals > div {
  border-right: 1px solid #f1dba5;
  padding: 5px 12px;
}

.dashboard-page .star-goals strong {
  color: var(--dashboard-pink-dark);
  font-size: 20px;
}

.dashboard-page .star-goals li {
  border-color: #f1dba5;
  color: #44536b;
  font-size: 12px;
  min-height: 44px;
  padding: 5px 10px;
}

.dashboard-page .star-goals li::after {
  color: #e7aa22;
  font-size: 21px;
}

.dashboard-page .prompt-board {
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 92px;
}

.dashboard-page .prompt-text {
  background: #fbfdff;
  border: 1px solid #cfe6f2;
  box-shadow: inset 0 1px 0 #ffffff;
  gap: 7px;
  min-height: 62px;
  padding: 9px 13px;
}

.dashboard-page .prompt-char {
  color: #223455;
  font-size: 22px;
  height: 38px;
  min-width: 27px;
}

.dashboard-page .prompt-char.is-current {
  border: 2px solid #f4b833;
  box-shadow: 0 0 0 3px rgba(255, 201, 79, 0.28);
  color: var(--dashboard-pink-dark);
}

.dashboard-page .current-target {
  background: #fff4f7;
  border: 1px solid #ffd2dd;
  border-radius: 8px;
  box-shadow: none;
  min-height: 62px;
  padding: 6px;
}

.dashboard-page .current-target span {
  color: #7a6470;
  font-size: 10px;
}

.dashboard-page .current-target strong {
  color: var(--dashboard-pink);
  font-size: 35px;
}

.dashboard-page .keyboard-panel {
  background: #f7fbfd;
  border: 1px solid #d8e8ef;
  box-shadow: inset 0 1px 0 #ffffff;
  min-height: 164px;
  padding: 10px 12px;
}

.dashboard-page .keyboard-panel::before,
.dashboard-page .keyboard::before {
  display: none;
}

.dashboard-page .keyboard {
  gap: 5px;
}

.dashboard-page .key-row {
  gap: 5px;
}

.dashboard-page .key-row--home {
  padding-left: 34px;
}

.dashboard-page .key-row--bottom {
  padding-left: 68px;
}

.dashboard-page .key {
  border-radius: 6px;
  box-shadow:
    0 3px 0 rgba(125, 150, 166, 0.24),
    inset 0 1px 0 #ffffff;
  color: #3a4b63;
  font-size: 15px;
  height: 28px;
  min-height: 28px;
  min-width: clamp(36px, 4.3vw, 53px);
  padding: 0 6px;
}

.dashboard-page .key.hand-left,
.dashboard-page .key-row:nth-child(1) .key {
  background: linear-gradient(180deg, #fff9fb, #ffdce7);
  border-color: #f4b7c9;
}

.dashboard-page .key.hand-right,
.dashboard-page .key-row:nth-child(2) .key {
  background: linear-gradient(180deg, #fffdf5, #ffe7a7);
  border-color: #e8c76e;
}

.dashboard-page .key-row:nth-child(3) .key {
  background: linear-gradient(180deg, #f7fff9, #d8f4df);
  border-color: #a9d8b7;
}

.dashboard-page .key-row:nth-child(4) .key {
  background: linear-gradient(180deg, #f7fbff, #d8eaf7);
  border-color: #a9cce1;
}

.dashboard-page .key-row:nth-child(5) .key {
  background: linear-gradient(180deg, #fff8fc, #f5dced);
  border-color: #d8b2cf;
}

.dashboard-page .key.is-target,
.dashboard-page .key.is-home.is-target {
  background: linear-gradient(180deg, #fff7b9, #ffc94f) !important;
  border-color: #e6aa22 !important;
  box-shadow:
    0 0 0 3px rgba(255, 201, 79, 0.24),
    0 3px 0 rgba(193, 132, 17, 0.35) !important;
  color: #664511 !important;
  transform: none !important;
}

.dashboard-page .key--wide {
  min-width: min(40vw, 340px);
}

.dashboard-page .score-strip {
  background: #f9fcfd;
  border: 1px solid #e1ecf1;
  border-radius: 7px;
  box-shadow: none;
  margin-top: 0;
  min-height: 46px;
  padding: 5px 8px;
}

.dashboard-page .score-strip div {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 36px;
}

.dashboard-page .score-strip strong {
  color: #23698c;
  font-size: 17px;
}

/* The map remains playful but supports the practice board instead of dominating it. */
.dashboard-page .side-panel {
  align-content: start;
  background: transparent;
  border: 0;
  box-shadow: none;
  gap: 10px;
  max-height: none;
  min-height: 0;
  overflow: visible;
  padding: 0;
  position: static;
}

.dashboard-page .map-card {
  background: #ffffff;
  min-height: 470px;
  overflow: hidden;
  padding: 10px;
  position: relative;
}

.dashboard-page .map-card::before {
  background-image: image-set(
    url("assets/map-candy-island.webp") type("image/webp"),
    url("assets/map-candy-island.png") type("image/png")
  );
  background-position: center;
  background-size: cover;
  display: block;
  inset: 0;
  filter: saturate(1.08) contrast(1.02);
  opacity: 0.94;
  z-index: 0;
}

.dashboard-page .map-card::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 24% 82%, rgba(255, 255, 255, 0.12));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.dashboard-page .map-card .section-head,
.dashboard-page .map-card .level-map {
  position: relative;
  z-index: 1;
}

.dashboard-page .map-card .section-head {
  margin: 0;
}

.dashboard-page .map-card .section-head h2 {
  background: var(--dashboard-pink);
  border-radius: 7px;
  box-shadow: 0 5px 12px rgba(217, 58, 103, 0.2);
  color: #ffffff;
  font-size: 14px;
  padding: 7px 12px;
}

.dashboard-page .map-card .ghost-button {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #cfe2ec;
  box-shadow: none;
  color: #3c5c76;
  min-height: 30px;
}

.dashboard-page .level-map {
  gap: 9px 13px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 23px 15px 13px;
}

.dashboard-page .level-map::before {
  opacity: 0.4;
}

.dashboard-page .map-card .level-map .level-button {
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 4px 9px rgba(59, 78, 98, 0.14),
    inset 0 2px 4px rgba(255, 255, 255, 0.78);
  filter: grayscale(1) saturate(0.25);
  min-height: 0;
  opacity: 0.92;
  padding: 3px;
}

.dashboard-page .map-card .level-map .level-button span {
  font-size: 16px;
}

.dashboard-page .map-card .level-map .level-button em {
  font-size: 9px;
}

.dashboard-page .map-card .level-map .level-button.is-current:not(.is-complete) {
  box-shadow:
    0 0 0 4px rgba(255, 201, 79, 0.72),
    0 5px 10px rgba(72, 84, 94, 0.18),
    inset 0 2px 4px rgba(255, 255, 255, 0.8);
  filter: grayscale(0.65) saturate(0.55);
}

.dashboard-page .map-card .level-map .level-button.is-complete {
  filter: none;
  opacity: 1;
}

.dashboard-page .level-button.is-locked::after {
  bottom: -10px;
  font-size: 10px;
}

.dashboard-page .side-duo {
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.dashboard-page .side-duo .tips,
.dashboard-page .achievement-card {
  background: #ffffff;
  min-height: 116px;
  padding: 10px;
}

.dashboard-page .section-head {
  margin-bottom: 8px;
}

.dashboard-page .section-head h2,
.dashboard-page .tips h2 {
  color: #d83f6a;
  font-size: 13px;
}

.dashboard-page .section-head h2::before,
.dashboard-page .tips h2::before {
  background: var(--dashboard-pink);
  height: 15px;
  width: 4px;
}

.dashboard-page .ghost-button {
  background: #f5fbfe;
  border: 1px solid #d2e6f0;
  box-shadow: none;
  color: #35617d;
  min-height: 29px;
  font-size: 12px;
  padding: 0 7px;
}

.dashboard-page .mistake-card::after {
  opacity: 0.45;
}

.dashboard-page .today-card p,
.dashboard-page .mistake-card p {
  background: #f8fbfd;
  color: #586a82;
  font-size: 11px;
  line-height: 1.35;
  padding: 6px 7px;
}

.dashboard-page .today-metrics,
.dashboard-page .wrong-key-list {
  display: none;
}

.dashboard-page .achievement-card {
  min-height: 94px;
}

.dashboard-page .achievement-card .sticker-grid {
  gap: 6px;
  margin-top: 6px;
}

.dashboard-page .achievement-card .sticker {
  background: #f8fbfd;
  border-color: #dce8ee;
  height: 42px;
}

.dashboard-page .achievement-card .sticker__icon {
  height: 27px;
  width: 27px;
}

.dashboard-page .utility-tip,
.dashboard-page .parent-summary {
  display: none;
}

.dashboard-page button,
.dashboard-page .page-link,
.dashboard-page .sticker,
.dashboard-page .level-button,
.dashboard-page .key {
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .dashboard-page button:hover:not(:disabled),
  .dashboard-page .page-link:hover {
    border-color: #9ecbdf;
    box-shadow: 0 6px 14px rgba(44, 84, 113, 0.13);
    transform: none;
  }

  .dashboard-page .level-button:hover,
  .dashboard-page .sticker:hover,
  .dashboard-page .key:hover {
    transform: none !important;
  }
}

@media (max-width: 1100px) {
  .dashboard-page .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-page .side-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  }

  .dashboard-page .map-card {
    grid-row: span 2;
  }

  .dashboard-page .side-duo {
    align-self: start;
  }
}

@media (max-width: 760px) {
  .dashboard-page .app-shell {
    padding: 8px;
  }

  .dashboard-page .hero {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 330px;
    padding: 16px;
  }

  .dashboard-page .hero::before {
    background:
      linear-gradient(90deg, rgba(223, 247, 255, 0.22), rgba(223, 247, 255, 0.88) 58%, #dff7ff 100%),
      image-set(
        url("assets/hero-candy-island.webp") type("image/webp"),
        url("assets/hero-candy-island.png") type("image/png")
      );
    background-position: 18% center;
    background-size: auto 100%;
  }

  .dashboard-page .hero > div:first-child {
    justify-items: end;
    margin-left: auto;
    max-width: 72%;
    text-align: right;
  }

  .dashboard-page .hero h1 {
    font-size: clamp(34px, 10vw, 44px);
  }

  .dashboard-page .hero-actions,
  .dashboard-page .hero .mini-game-links {
    justify-content: end;
  }

  .dashboard-page .hero .mini-game-links {
    grid-template-columns: repeat(3, 78px);
    margin-left: 8px;
  }

  .dashboard-page .hero__badge {
    align-self: end;
    gap: 4px;
    margin-left: auto;
    margin-top: 8px;
    padding: 8px;
    width: min(100%, 320px);
  }

  .dashboard-page .hero__badge-title {
    display: none;
  }

  .dashboard-page .hero__metric {
    min-height: 42px;
    padding: 4px 6px;
  }

  .dashboard-page .hero__metric strong {
    font-size: 18px;
  }

  .dashboard-page .hero__badge-progress {
    margin-top: 2px;
  }

  .dashboard-page .level-meta {
    align-items: flex-start;
    display: grid;
    gap: 7px;
  }

  .dashboard-page .level-meta p {
    max-width: none;
    text-align: left;
  }

  .dashboard-page .star-goals {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-page .star-goals > div {
    align-items: center;
    border-bottom: 1px solid #f1dba5;
    border-right: 0;
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
  }

  .dashboard-page .star-goals ul {
    gap: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-page .star-goals li {
    font-size: 10px;
    padding: 4px 8px;
  }

  .dashboard-page .keyboard-panel {
    overflow: hidden;
    padding-left: 5px;
    padding-right: 5px;
  }

  .dashboard-page .keyboard {
    gap: 3px;
    min-width: 0;
  }

  .dashboard-page .key-row {
    gap: 2px;
  }

  .dashboard-page .key-row--home {
    padding-left: 10px;
  }

  .dashboard-page .key-row--bottom {
    padding-left: 20px;
  }

  .dashboard-page .key {
    font-size: 12px;
    min-width: 28px;
    padding: 0 2px;
  }

  .dashboard-page .key--wide {
    min-width: min(62vw, 220px);
  }

  .dashboard-page .side-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-page .map-card {
    grid-row: auto;
  }
}

@media (max-width: 480px) {
  .dashboard-page .hero {
    min-height: 326px;
  }

  .dashboard-page .hero > div:first-child {
    grid-template-columns: minmax(0, 1fr);
    max-width: 78%;
  }

  .dashboard-page .hero > div:first-child > * {
    grid-column: 1;
  }

  .dashboard-page .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .dashboard-page .hero .hero-action {
    font-size: 12px;
    min-width: 0;
    padding: 0 7px;
  }

  .dashboard-page .hero .mini-game-links {
    grid-template-columns: repeat(3, 72px);
    margin-left: 0;
  }

  .dashboard-page .hero .mini-game-link {
    padding: 4px 5px;
  }

  .dashboard-page .prompt-board {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .dashboard-page .prompt-text {
    gap: 3px;
    padding: 8px;
  }

  .dashboard-page .prompt-char {
    font-size: 18px;
    min-width: 22px;
  }

  .dashboard-page .current-target strong {
    font-size: 30px;
  }

  .dashboard-page .side-duo {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-page *,
  .dashboard-page *::before,
  .dashboard-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
