:root {
  --ink: #273653;
  --purple: #6546c7;
  --purple-dark: #49319d;
  --yellow: #ffd84d;
  --cream: #fff9e9;
  --green: #29a96b;
  --red: #e45757;
  --shadow: 0 10px 0 rgba(44, 35, 85, 0.13);
  --card-shadow: 0 7px 0 rgba(44, 35, 85, .12), 0 14px 28px rgba(44, 35, 85, .09);
  --button-shadow: 0 6px 0 rgba(49, 31, 116, .28), 0 9px 16px rgba(49, 31, 116, .12);
  --border-soft: #d8cff5;
  --radius-card: 24px;
  --radius-control: 17px;
  --space-xs: 6px;
  --space-sm: 10px;
  --space-md: 16px;
  --space-lg: 24px;
  --state-success-soft: #eaf9ef;
  --state-error-soft: #fff1ed;
  --state-info-soft: #eef8ff;
  --focus-ring: 0 0 0 4px #fff, 0 0 0 8px var(--yellow);
  --player-accent: #6546c7;
  --player-accent-dark: #49319d;
  --player-accent-soft: #eee8ff;
}

:root[data-player-theme="blue"] { --player-accent: #2688c9; --player-accent-dark: #17618f; --player-accent-soft: #e5f6ff; }
:root[data-player-theme="green"] { --player-accent: #2d9b61; --player-accent-dark: #207044; --player-accent-soft: #e8f9e9; }
:root[data-player-theme="orange"] { --player-accent: #e47b25; --player-accent-dark: #a95218; --player-accent-soft: #fff0dc; }
html.text-large { font-size: 115%; }

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", Arial, sans-serif;
  background: #91dcf4;
  background-image:
    radial-gradient(circle at 9% 20%, rgba(255,255,255,.58) 0 36px, transparent 38px),
    radial-gradient(circle at 92% 15%, rgba(255,255,255,.45) 0 48px, transparent 50px),
    linear-gradient(#91dcf4 0 68%, #75c96c 68% 100%);
}

button { font: inherit; touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }

.game-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 0 28px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 24px;
  border: 4px solid #fff;
  border-radius: 24px;
  background: var(--purple);
  box-shadow: var(--shadow);
  color: #fff;
}

.brand, .game-stats, .stat-card, .customer-panel { display: flex; align-items: center; }
.brand { gap: 15px; }
.brand-icon { font-size: clamp(2.6rem, 5vw, 4.2rem); }
.shop-header-logo {
  display: block;
  width: clamp(54px, 6vw, 72px);
  height: clamp(54px, 6vw, 72px);
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(38,23,100,.28));
}
.eyebrow { margin: 0 0 2px; font-size: .95rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.65rem, 3.6vw, 3rem); line-height: 1; letter-spacing: .035em; }

.game-stats { gap: 12px; }
.stat-card { gap: 9px; min-width: 125px; padding: 9px 15px; border-radius: 16px; background: #fff; color: var(--ink); }
.stat-card > span { font-size: 2rem; }
.stat-card small { display: block; font-weight: 800; color: #66718a; }
.stat-card strong { display: block; font-size: 1.35rem; line-height: 1.2; }
.progress-card { min-width: 225px; }

.shop-scene {
  position: relative;
  overflow: hidden;
  margin-top: 24px;
  padding: 0 32px 30px;
  border: 5px solid #fff;
  border-radius: 30px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.shop-decoration {
  display: flex;
  justify-content: space-around;
  margin: 0 -32px 25px;
  padding: 12px;
  border-bottom: 6px solid #f1b932;
  background: repeating-linear-gradient(90deg, #ff705e 0 55px, #fff3d4 55px 110px);
  font-size: 2.2rem;
}

.customer-panel { justify-content: center; gap: 20px; margin-bottom: 24px; }
.customer-panel.customer-enter { animation: customerEnter 500ms ease-out both; }
.customer-panel.customer-active { transform: translateX(0); }
.customer-panel.customer-correct { animation: customerBounce 400ms ease-in-out both; }
.customer-panel.customer-wrong { animation: customerShake 400ms ease-in-out both; }
.customer-panel.customer-exit { animation: customerExit 500ms ease-in both; }
.customer-avatar { display: grid; place-items: center; flex: 0 0 112px; width: 112px; height: 112px; border: 5px solid #ffc83d; border-radius: 50%; background: transparent; overflow: hidden; }
.customer-avatar img { width: 100%; height: 100%; object-fit: contain; }
.customer-avatar.shop-dialog-badge {
  position: relative;
  padding: 12px;
  border: 6px solid #292354;
  background: linear-gradient(145deg, #fffdf4, #fff3c4);
  box-shadow:
    inset 0 0 0 4px #f2c744,
    inset 0 5px 7px rgba(255,255,255,.8),
    0 7px 0 rgba(40,34,82,.18),
    0 11px 18px rgba(40,34,82,.16);
}
.customer-avatar.shop-dialog-badge::after {
  position: absolute;
  top: 10px;
  left: 17px;
  width: 42%;
  height: 14%;
  border-radius: 50%;
  background: rgba(255,255,255,.62);
  content: "";
  pointer-events: none;
}
.customer-avatar.shop-dialog-badge img { width: 74%; height: 74%; object-fit: contain; }
.customer-avatar.shop-dialog-badge .avatar-fallback { color: #49319d; font-size: 1.45rem; font-weight: 1000; }
.avatar-fallback { font-size: 4.3rem; line-height: 1; }
.speech-bubble { position: relative; min-width: 360px; padding: 15px 25px; border: 3px solid #d7cdef; border-radius: 22px; background: #fff; }
.speech-bubble::before { content: ""; position: absolute; left: -15px; top: 38px; width: 24px; height: 24px; border-left: 3px solid #d7cdef; border-bottom: 3px solid #d7cdef; background: #fff; transform: rotate(45deg); }
.customer-label { margin: 0 0 4px; color: var(--purple); font-weight: 800; }
.speech-bubble h2 { margin: 0; font-size: clamp(1.4rem, 2.7vw, 2rem); }

.items-and-question { display: grid; grid-template-columns: 1fr 1.15fr; gap: 28px; align-items: stretch; }
.items-and-question { transition: opacity 160ms ease; }
.items-and-question.question-waiting { visibility: hidden; opacity: 0; pointer-events: none; }
.items-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.items-list.three-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.items-list.three-items .item-card { min-height: 200px; padding-inline: 10px; }
.items-list.three-items .item-visual { width: 82px; height: 82px; }
.items-list.three-items .item-emoji { font-size: clamp(3.2rem, 5.5vw, 5rem); }
.items-list.three-items .item-name { font-size: 1.2rem; }
.item-card { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 220px; padding: 18px; border: 4px solid #f2cf68; border-radius: 24px; background: #fff; box-shadow: 0 7px 0 #eadcae; text-align: center; }
.item-visual { display: grid; place-items: center; width: 96px; height: 96px; }
.item-image, .item-image-fallback { grid-area: 1 / 1; }
.item-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.item-image.hidden, .item-image-fallback.hidden { display: none; }
.item-emoji { font-size: clamp(4rem, 7vw, 6rem); line-height: 1.05; }
.item-name { display: flex; align-items: center; min-height: 2.4em; margin: 8px 0 2px; font-size: 1.45rem; font-weight: 900; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.item-price { margin: 0; padding: 5px 16px; border-radius: 999px; background: #fff0ad; color: #8b5a00; font-size: 1.4rem; font-weight: 900; }
.item-price.money-cents { white-space: nowrap; font-size: 1.28rem; }
.item-quantity { display: inline-block; margin-left: 3px; color: var(--purple-dark); font-size: 1.18em; font-weight: 900; }

.question-card { display: flex; flex-direction: column; justify-content: center; padding: 24px; border-radius: 25px; background: #eee8ff; text-align: center; }
.question-timer { margin: 0 auto 14px; width: min(330px, 100%); }
.question-timer.hidden { display: none; }
.timer-label { margin-bottom: 6px; color: var(--purple-dark); font-size: 1.05rem; font-weight: 900; }
.timer-label strong { display: inline-block; min-width: 38px; font-size: 1.2rem; }
.timer-track { overflow: hidden; height: 13px; border: 3px solid #fff; border-radius: 999px; background: #d8cfed; box-shadow: 0 2px 0 rgba(73,49,157,.16); }
.timer-track span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--green); transition: width 100ms linear, background-color .2s; }
.question-timer.timer-low .timer-label { color: #b13939; }
.question-timer.timer-low .timer-track span { background: #f0a33a; }
.transaction-summary { display: flex; justify-content: center; gap: 12px; margin-bottom: 16px; }
.transaction-summary.hidden { display: none; }
.transaction-summary span { min-width: 135px; padding: 10px 14px; border: 3px solid #d7cdef; border-radius: 14px; background: #fff; color: var(--ink); font-size: 1.15rem; font-weight: 800; }
.transaction-summary strong { display: block; margin-top: 2px; color: var(--purple-dark); font-size: 1.55rem; }
#question-text { margin: 0 0 20px; color: var(--purple-dark); font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 900; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.answer-button { min-height: 76px; padding: 12px; border: 0; border-bottom: 7px solid #44308e; border-radius: 18px; background: var(--purple); color: #fff; cursor: pointer; font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 900; transition: transform .12s, filter .12s; }
.answer-button:hover:not(:disabled), .answer-button:focus-visible { filter: brightness(1.12); transform: translateY(-2px); outline: 4px solid var(--yellow); outline-offset: 3px; }
.answer-button:active:not(:disabled) { border-bottom-width: 3px; transform: translateY(4px); }
.answer-button:disabled { cursor: default; opacity: .72; }
.answer-button.correct { border-bottom-color: #147743; background: var(--green); opacity: 1; animation: pop .45s ease; }
.answer-button.wrong { border-bottom-color: #a33131; background: var(--red); opacity: 1; animation: shake .35s ease; }
.answer-button.correct-answer-review { border-color: #147743; background: #218e59; opacity: 1; box-shadow: inset 0 0 0 4px #fff, 0 0 0 4px #147743; }
.answer-button.correct-answer { position:relative; border-color:#147743; background:linear-gradient(180deg,#42c47f,#218e59); color:#fff; filter:none; opacity:1; box-shadow:inset 0 0 0 3px #fff,0 0 0 5px #147743,0 7px 0 #11643a; animation:answerCelebrate 360ms ease-out both; }
.answer-button.correct-answer::after { position:absolute; top:5px; right:7px; display:grid; width:27px; height:27px; place-items:center; border-radius:50%; background:#fff; color:#147743; content:"✓"; font-size:1rem; font-weight:1000; }
.feedback.correct,.feedback.wrong { display:flex; align-items:center; justify-content:center; gap:9px; width:fit-content; max-width:100%; margin-inline:auto; padding:8px 14px; border:2px solid currentColor; border-radius:999px; background:#fff; font-size:clamp(1rem,2.4vw,1.35rem); line-height:1.2; }
.feedback.correct { color:#147743; background:var(--state-success-soft); }
.feedback.wrong { color:#9c3434; background:var(--state-error-soft); animation:feedbackNudge 240ms ease-out; }
.feedback.correct::before { content:"✓"; }
.feedback.wrong::before { content:"↻"; }
.session-stars { animation:starReveal 480ms ease-out both; }
@keyframes answerCelebrate { 0% { transform:scale(.94); } 60% { transform:scale(1.035); } 100% { transform:scale(1); } }
@keyframes feedbackNudge { 50% { transform:translateX(4px); } }
@keyframes starReveal { from { opacity:0; transform:translateY(7px) scale(.92); } to { opacity:1; transform:none; } }
.feedback { min-height: 38px; margin: 16px 0 0; font-size: 1.65rem; font-weight: 900; }
.feedback.success { color: #147743; }
.feedback.error { color: #b13939; }
.feedback-review { padding: 13px 15px; border: 3px solid #f0b1a7; border-radius: 16px; background: #fff7f3; line-height: 1.35; }
.next-question-button {
  align-self: center;
  min-width: min(280px, 100%);
  min-height: 56px;
  margin-top: 12px;
  padding: 12px 24px;
  border: 0;
  border-bottom: 6px solid #147743;
  border-radius: 16px;
  background: var(--green);
  color: #103f29;
  cursor: pointer;
  font-size: 1.35rem;
  font-weight: 900;
  transition: filter .12s, transform .12s;
}
.next-question-button:hover, .next-question-button:focus-visible { filter: brightness(1.08); outline: 4px solid var(--yellow); outline-offset: 3px; transform: translateY(-2px); }
.next-question-button:active:not(:disabled) { border-bottom-width: 3px; transform: translateY(3px); }
.next-question-button:disabled { cursor: default; opacity: .72; }

.game-over { display: grid; place-items: center; min-height: calc(100vh - 40px); }
.game-over-card { width: min(560px, 100%); padding: 42px 28px; border: 6px solid #fff; border-radius: 34px; background: var(--cream); box-shadow: var(--shadow); text-align: center; }
.game-over-icon { font-size: 6rem; }
.game-over h2 { margin: 8px 0 24px; color: var(--purple); font-size: clamp(2.2rem, 6vw, 4rem); }
.final-label { margin: 0; font-size: 1.3rem; font-weight: 800; }
.final-score { margin: 7px 0 28px; font-size: 3.4rem; font-weight: 900; }
.final-accuracy { margin: -18px 0 14px; color: var(--purple-dark); font-size: 1.55rem; font-weight: 900; }
.final-rating { margin: 0 0 28px; color: #147743; font-size: 1.65rem; font-weight: 900; }
.play-again-button { padding: 17px 38px; border: 0; border-bottom: 7px solid #b47700; border-radius: 18px; background: var(--yellow); color: #5f3d00; cursor: pointer; font-size: 1.7rem; font-weight: 900; }
.play-again-button:hover, .play-again-button:focus-visible { filter: brightness(1.06); outline: 4px solid var(--purple); outline-offset: 4px; }
.hidden { display: none; }

.temporary-title-logo {
  padding: .18em .42em;
  border: clamp(4px, .7vw, 9px) solid #fff;
  border-radius: .28em;
  background: linear-gradient(135deg, #6546c7, #8b65e8);
  color: #fff;
  box-shadow: 0 .12em 0 #35206f, 0 .28em .5em rgba(53,32,111,.25);
  font-size: clamp(2.5rem, 8vw, 6.8rem);
  font-weight: 1000;
  letter-spacing: .035em;
  line-height: 1;
  text-align: center;
}

.temporary-brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 15px;
  background: #6546c7;
  color: #fff;
  font-weight: 1000;
}

.p00-placeholder-card { text-align: center; }
.p00-placeholder-icon { display: block; margin-bottom: 8px; font-size: 4rem; }

.counting-items {
  display: grid;
  width: 100%;
  max-width: 720px;
  min-height: 180px;
  margin: 0 auto;
  padding: clamp(8px, 2vw, 18px);
  grid-template-columns: repeat(5, minmax(48px, 1fr));
  place-items: center;
  gap: clamp(6px, 1.4vw, 14px);
  border: 4px dashed rgba(101,70,199,.28);
  border-radius: 24px;
  background: rgba(255,255,255,.82);
}

.counting-items.quantity-1,
.counting-items.quantity-2,
.counting-items.quantity-3,
.counting-items.quantity-4 { grid-template-columns: repeat(4, minmax(58px, 110px)); justify-content: center; }

.counting-item {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 48px;
  min-height: 58px;
  aspect-ratio: 1;
  place-items: center;
  padding: 5px;
  border: 3px solid transparent;
  border-radius: 18px;
  background: #fffdf5;
  box-shadow: 0 4px 0 rgba(53,32,111,.12);
  cursor: pointer;
  transition: transform .12s, opacity .12s, border-color .12s;
}

.counting-item img { width: 88%; height: 88%; object-fit: contain; pointer-events: none; }
.counting-item:hover, .counting-item:focus-visible { border-color: var(--yellow); outline: 3px solid var(--purple); outline-offset: 2px; transform: translateY(-2px); }
.counting-item.counted { border-color: var(--green); background: #eaffed; opacity: .72; transform: scale(.92); }
.counting-marker { position: absolute; top: -7px; right: -7px; display: none; width: 30px; height: 30px; place-items: center; border: 3px solid #fff; border-radius: 50%; background: var(--green); color: #fff; font-weight: 1000; box-shadow: 0 2px 0 #27753a; }
.counting-item.counted .counting-marker { display: grid; }
.counting-answer { min-width: 88px; min-height: 58px; font-size: clamp(1.5rem, 5vw, 2.4rem); }
.counting-reset { min-width: 44px; min-height: 44px; margin: 0 auto 10px; padding: 8px 16px; border: 3px solid #a7d9e8; border-radius: 999px; background: #eafaff; color: var(--purple-dark); cursor: pointer; font: inherit; font-weight: 900; }
.counting-reset:hover, .counting-reset:focus-visible { outline: 4px solid var(--yellow); outline-offset: 2px; }
.counting-hint { color: #397540; }

.silhouette-stage {
  display: grid;
  width: min(100%, 620px);
  min-height: clamp(190px, 34vh, 330px);
  margin: 0 auto;
  place-items: center;
  border: 5px solid #fff;
  border-radius: 28px;
  background: radial-gradient(circle, #fffdf2 0 45%, #e9f8ff 100%);
  box-shadow: inset 0 0 0 3px rgba(101,70,199,.16), 0 7px 0 rgba(53,32,111,.1);
}
.mystery-silhouette { display: grid; width: min(52vw, 250px); height: min(52vw, 250px); place-items: center; overflow: visible; }
.mystery-silhouette img { width: 100%; height: 100%; object-fit: contain; object-position: center; filter: brightness(0); transform: translate(var(--silhouette-shift-x, 0), var(--silhouette-shift-y, 0)) rotate(var(--silhouette-rotation, 0deg)) scale(.84); transform-origin: center; transition: filter .3s, transform .3s; }
.mystery-silhouette.revealed img { filter: none; transform: translate(var(--silhouette-shift-x, 0), var(--silhouette-shift-y, 0)) rotate(0deg) scale(.96); }
.silhouette-answers { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: clamp(8px, 2vw, 18px); }
.silhouette-choice { display: grid; min-width: 0; min-height: 130px; place-items: center; gap: 4px; padding: 8px; }
.silhouette-choice img { width: min(100%, 100px); height: 86px; object-fit: contain; pointer-events: none; }
.silhouette-choice span { display: block; width: 100%; padding: 4px 7px; border: 2px solid #d9cef9; border-radius: 999px; background: #fff; color: #24154f; font-size: clamp(.82rem, 2vw, 1rem); font-weight: 1000; line-height: 1.2; text-align: center; text-shadow: none; text-transform: capitalize; }
.silhouette-hint { color: #397540; }

.colors-stage { display: grid; width: min(100%, 620px); min-height: clamp(190px, 34vh, 330px); margin: 0 auto; place-items: center; border: 5px solid #fff; border-radius: 28px; background: radial-gradient(circle, #fffdf2 0 45%, #e9f8ff 100%); box-shadow: inset 0 0 0 3px rgba(101,70,199,.16), 0 7px 0 rgba(53,32,111,.1); }
.color-target { display: grid; width: min(48vw, 230px); height: min(48vw, 230px); place-items: center; }
.colors-answers { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)); gap: clamp(8px, 2vw, 18px); }
.color-choice { display: grid; min-width: 0; min-height: 130px; place-items: center; padding: 10px; background: #fffdf5; }
.color-object { position: relative; display: block; width: min(22vw, 112px); height: min(22vw, 112px); border: 5px solid #fff; background: var(--object-color); box-shadow: 0 0 0 3px #4d4567, 0 7px 0 rgba(44,35,85,.18); }
.color-target .color-object { width: min(44vw, 210px); height: min(44vw, 210px); border-width: 8px; box-shadow: 0 0 0 4px #4d4567, 0 9px 0 rgba(44,35,85,.18); }
.color-object-ball { border-radius: 50%; }
.color-object-box { border-radius: 18px; }
.color-object-gift { border-radius: 14px; }
.color-object-gift::before, .color-object-gift::after { content: ""; position: absolute; z-index: 1; background: rgba(255,255,255,.78); }
.color-object-gift::before { top: 0; bottom: 0; left: 42%; width: 16%; }
.color-object-gift::after { top: 42%; right: 0; left: 0; height: 16%; }
.color-object.is-white { border-color: #fff; box-shadow: 0 0 0 4px #4d4567, 0 7px 0 rgba(44,35,85,.22); }
.colors-hint { color: #397540; }

.matching-stage { display: grid; width: min(100%, 620px); min-height: clamp(190px, 34vh, 330px); margin: 0 auto; place-items: center; border: 5px solid #fff; border-radius: 28px; background: radial-gradient(circle, #fffdf2 0 45%, #e9f8ff 100%); box-shadow: inset 0 0 0 3px rgba(101,70,199,.16), 0 7px 0 rgba(53,32,111,.1); }
.matching-target { display: grid; width: min(48vw, 230px); height: min(48vw, 230px); place-items: center; }
.matching-product { width: 100%; height: 100%; object-fit: contain; transform: scale(var(--matching-scale, 1)); transform-origin: center; }
.matching-answers { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)); gap: clamp(8px, 2vw, 18px); }
.matching-choice { display: grid; min-width: 0; min-height: 132px; place-items: center; gap: 5px; padding: 9px; background: #fffdf5; }
.matching-choice .matching-product { width: min(100%, 105px); height: 92px; }
.matching-choice .color-object { width: min(22vw, 106px); height: min(22vw, 106px); }
.matching-category, .matching-color-basket { border-color: #d9cef9; }
.matching-basket-icon, .matching-color-basket { display: grid; width: 82px; height: 72px; place-items: center; border: 4px solid #fff; border-radius: 15px 15px 25px 25px; background: #eee8ff; box-shadow: 0 0 0 3px #6546c7, 0 6px 0 rgba(44,35,85,.16); font-size: 2.5rem; }
.matching-color-basket { background: var(--object-color); color: #fff; text-shadow: 0 2px 2px rgba(0,0,0,.45); }
.matching-choice strong { display: block; width: 100%; padding: 4px; border-radius: 999px; background: #fff; color: #24154f; font-size: clamp(.78rem, 2vw, .98rem); line-height: 1.15; text-align: center; }
.matching-hint { color: #397540; }

@media (max-width: 520px) {
  .matching-stage { min-height: 180px; border-width: 3px; }
  .matching-target { width: min(42vw, 170px); height: min(42vw, 170px); }
  .matching-answers { grid-template-columns: repeat(3, minmax(80px, 1fr)); gap: 6px; }
  .matching-choice { min-height: 110px; padding: 5px 3px; }
  .matching-choice .matching-product { height: 68px; }
  .matching-basket-icon, .matching-color-basket { width: 58px; height: 54px; font-size: 1.75rem; }
}

@media (max-width: 520px) {
  .colors-stage { min-height: 180px; border-width: 3px; }
  .color-target { width: min(42vw, 170px); height: min(42vw, 170px); }
  .color-target .color-object { width: min(38vw, 155px); height: min(38vw, 155px); }
  .colors-answers { grid-template-columns: repeat(3, minmax(80px, 1fr)); gap: 6px; }
  .color-choice { min-height: 108px; padding: 6px; }
  .color-choice .color-object { width: min(20vw, 76px); height: min(20vw, 76px); border-width: 4px; }
}

@media (max-width: 520px) {
  .silhouette-stage { min-height: 180px; border-width: 3px; }
  .mystery-silhouette { width: min(44vw, 180px); height: min(44vw, 180px); }
  .silhouette-answers { grid-template-columns: repeat(3, minmax(82px, 1fr)); gap: 6px; }
  .silhouette-choice { min-height: 108px; padding: 5px 3px; }
  .silhouette-choice img { height: 68px; }
}

@media (max-width: 520px) {
  .counting-items { min-height: 150px; grid-template-columns: repeat(5, minmax(44px, 1fr)); gap: 5px; padding: 7px; border-width: 3px; }
  .counting-items.quantity-1, .counting-items.quantity-2, .counting-items.quantity-3, .counting-items.quantity-4 { grid-template-columns: repeat(4, minmax(52px, 76px)); }
  .counting-item { min-width: 44px; min-height: 48px; padding: 3px; border-radius: 13px; }
  .counting-marker { width: 25px; height: 25px; font-size: .78rem; }
}

/* Menu utama dan pilihan tahap */
.menu-screen {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 48px);
}

.menu-screen.hidden, .level-screen.hidden, .stats-screen.hidden, .practice-screen.hidden, .profile-screen.hidden, .daily-screen.hidden, .settings-screen.hidden, .category-screen.hidden, .time-level-screen.hidden, .measurement-level-screen.hidden, .fraction-level-screen.hidden, .geometry-level-screen.hidden, .profile-picker-screen.hidden, .parent-screen.hidden { display: none; }

.category-screen, .time-level-screen, .measurement-level-screen, .fraction-level-screen, .geometry-level-screen { min-height: calc(100vh - 48px); padding: 22px; border: 5px solid #fff; border-radius: 30px; background: var(--cream); box-shadow: var(--shadow); }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 24px; width: min(900px, 100%); margin: 8vh auto 0; }
.category-card { display: grid; place-items: center; gap: 9px; min-height: 270px; padding: 26px; border: 5px solid #fff; border-bottom: 10px solid var(--purple-dark); border-radius: 32px; color: var(--ink); cursor: pointer; box-shadow: 0 12px 25px rgba(51,35,112,.18); transition: transform .15s, filter .15s; }
.category-card:hover, .category-card:focus-visible { filter: brightness(1.04); outline: 5px solid var(--yellow); outline-offset: 3px; transform: translateY(-5px); }
.category-card > span { font-size: clamp(4rem, 8vw, 6rem); }
.category-card strong { color: var(--purple-dark); font-size: clamp(1.6rem, 3vw, 2.5rem); }
.category-card small { font-size: 1rem; font-weight: 800; }
.money-category { background: #fff5bd; }
.time-category { background: #dff5ff; border-bottom-color: #2988b7; }
.time-level-grid { grid-template-columns: repeat(5, minmax(145px, 1fr)); }
.measurement-level-grid { grid-template-columns: repeat(5, minmax(145px, 1fr)); }
.measurement-level-card { border-color: #b9df9f; }

.items-and-question.measurement-question { grid-template-columns: minmax(230px, .85fr) 1.15fr; }
.measurement-display {
  display: grid;
  min-height: 230px;
  padding: 18px;
  place-items: center;
  align-content: center;
  gap: 9px;
  border: 4px solid #84c778;
  border-bottom: 9px solid #3f9453;
  border-radius: 27px;
  background: #f0ffe8;
  text-align: center;
}
.measurement-visuals { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
.measurement-item-visual { position: relative; display: grid; width: clamp(76px, 8vw, 104px); aspect-ratio: 1; place-items: center; }
.measurement-item-visual img { display: block; width: 100%; height: 100%; object-fit: contain; }
.measurement-item-visual > span { display: none; font-size: clamp(3rem, 7vw, 5rem); }
.measurement-item-visual img:not([src]), .measurement-item-visual img.hidden { display: none; }
.measurement-item-visual img:not([src]) + span, .measurement-item-visual img.hidden + span { display: block; }
.measurement-item-emoji { font-size: clamp(4rem, 8vw, 6rem); line-height: 1; }
.measurement-copy { display: grid; gap: 8px; }
.measurement-copy strong { color: var(--purple-dark); font-size: clamp(1.15rem, 2vw, 1.5rem); text-transform: capitalize; }
.measurement-copy b { display: inline-block; padding: 8px 15px; border: 3px solid #efc94a; border-radius: 15px; background: #fff9cb; color: var(--ink); font-size: clamp(1.35rem, 3vw, 2rem); }

.items-and-question.time-question { grid-template-columns: minmax(230px, .85fr) 1.15fr; }
.items-and-question.time-question .items-list { display: none; }
.clock-stage { display: grid; place-items: center; align-content: center; gap: 8px; min-width: 0; padding: 10px; border: 4px solid #8dd5ef; border-bottom: 8px solid #398fae; border-radius: 26px; background: #e9f9ff; }
.clock-stage.hidden { display: none; }
.clock-display { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.clock-unit { display: grid; place-items: center; min-width: 0; }
.clock-label { margin-bottom: 2px; padding: 3px 10px; border-radius: 999px; background: var(--purple); color: #fff; font-size: .78rem; letter-spacing: .05em; }
.clock-arrow { color: var(--green); font-size: 2rem; font-weight: 1000; }
.analog-clock { width: min(280px, 100%); max-height: 290px; filter: drop-shadow(0 7px 5px rgba(45,68,108,.16)); }
.dual-clock .analog-clock { width: min(185px, 100%); }
.dual-clock .clock-unit { width: min(45%, 190px); }
.duration-chip { padding: 7px 14px; border: 3px solid #f2c13d; border-bottom-width: 6px; border-radius: 14px; background: #fff6bd; color: var(--purple-dark); font-weight: 1000; }
.clock-face { fill: #fffdf2; stroke: #6546c7; stroke-width: 7; }
.analog-clock text { fill: #2d3152; font-size: 15px; font-weight: 1000; }
.clock-hand { stroke-linecap: round; }
.hour-hand { stroke: #6546c7; stroke-width: 9; }
.minute-hand { stroke: #f2ae19; stroke-width: 6; }
.clock-pin { fill: #43a85b; stroke: #fff; stroke-width: 3; }
.clock-legend { display: none; flex-wrap: wrap; justify-content: center; gap: 12px; font-size: .78rem; font-weight: 900; }
html.visual-help-on .clock-legend { display: flex; }
.clock-legend span { display: flex; align-items: center; gap: 5px; }
.clock-legend i { width: 23px; height: 5px; border-radius: 999px; background: #6546c7; }
.clock-legend .legend-minute { background: #f2ae19; }
.shop-schedule { display: grid; width: min(420px, 100%); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.shop-schedule > div { display: grid; gap: 3px; padding: 11px 8px; border: 3px solid #8dd5ef; border-bottom-width: 6px; border-radius: 15px; background: #fff; text-align: center; }
.shop-schedule strong { color: var(--purple-dark); font-size: .9rem; }
.shop-schedule span { color: #276c3b; font-size: 1.15rem; font-weight: 1000; }

.menu-card {
  width: min(680px, 100%);
  padding: 48px 30px;
  border: 6px solid #fff;
  border-radius: 36px;
  background: var(--purple);
  box-shadow: var(--shadow);
  color: #fff;
  text-align: center;
}

.menu-shop-icon { font-size: clamp(5rem, 12vw, 8rem); line-height: 1; }
.menu-card h2 { margin: 8px 0 18px; font-size: clamp(2.5rem, 7vw, 5rem); line-height: 1; }
.menu-tagline { max-width: 500px; margin: 0 auto 30px; font-size: 1.25rem; font-weight: 700; }
.primary-menu-button, .secondary-button, .next-level-button, .back-button {
  border: 0;
  border-radius: 17px;
  cursor: pointer;
  font-weight: 900;
}
.primary-menu-button { padding: 18px 38px; border-bottom: 7px solid #b47700; background: var(--yellow); color: #5f3d00; font-size: 1.65rem; }
.primary-menu-button:hover, .primary-menu-button:focus-visible { filter: brightness(1.07); outline: 4px solid #fff; outline-offset: 4px; }

.level-screen { min-height: calc(100vh - 48px); padding: 22px; border: 5px solid #fff; border-radius: 30px; background: var(--cream); box-shadow: var(--shadow); }
.screen-heading { display: grid; grid-template-columns: 180px 1fr 180px; align-items: center; margin-bottom: 14px; text-align: center; }
.screen-heading h2 { margin: 0; color: var(--purple); font-size: clamp(2rem, 5vw, 3.4rem); }
.screen-heading .eyebrow { color: #7a6a9d; }
.back-button { justify-self: start; padding: 12px 17px; background: #e8e0ff; color: var(--purple-dark); font-size: 1rem; }
.level-notice { min-height: 28px; margin: 0 0 10px; color: var(--purple-dark); text-align: center; font-size: 1.15rem; font-weight: 900; }
.level-grid { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 15px; }
.level-card { position: relative; min-height: 165px; padding: 18px 12px; border: 3px solid #d4c7f5; border-bottom-width: 7px; border-radius: 20px; background: #fff; color: var(--ink); cursor: pointer; text-align: center; transition: transform .12s, filter .12s; }
.level-card:hover:not(:disabled), .level-card:focus-visible:not(:disabled) { transform: translateY(-3px); outline: 4px solid var(--yellow); outline-offset: 2px; }
.level-number { display: block; color: var(--purple); font-size: 1.3rem; font-weight: 900; }
.level-name { display: block; min-height: 42px; margin: 8px 0; font-size: 1.05rem; font-weight: 900; }
.level-stars { display: block; margin: -2px 0 7px; color: #e0a600; font-size: 1.16rem; font-weight: 900; letter-spacing: .08em; line-height: 1; text-shadow: 0 2px 0 #fff; }
.level-best { display: block; color: #8b5a00; font-weight: 800; }
.level-card.locked { border-color: #d8d8df; background: #ececf1; color: #7c7d88; cursor: not-allowed; filter: grayscale(.65); }
.level-card.locked .level-number { color: #767782; }
.level-lock { display: block; margin-bottom: 3px; font-size: 1.5rem; }
.level-card.coming-soon { border-color: #b9d9df; background: #f0fbfd; }
.coming-label { display: block; color: #427983; font-size: .85rem; font-weight: 900; }

.result-level { margin: -12px 0 10px; color: var(--purple-dark); font-size: 1.45rem; font-weight: 900; }
.session-stars { margin: -8px 0 6px; color: #e0a600; font-size: 2rem; font-weight: 900; letter-spacing: .12em; line-height: 1; text-shadow: 0 3px 0 #fff; }
.new-star-record { margin: 0 0 10px; color: #147743; font-size: 1rem; font-weight: 900; animation: pop .45s ease; }
.new-star-record.hidden { display: none; }
.final-best { margin: -5px 0 14px; color: #8b5a00; font-size: 1.35rem; font-weight: 900; }
.level-unlocked { margin: -4px 0 22px; color: #147743; font-size: 1.45rem; font-weight: 900; animation: pop .45s ease; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.secondary-button, .next-level-button { padding: 15px 22px; font-size: 1.2rem; }
.secondary-button { border-bottom: 6px solid #4b3996; background: #e7e0ff; color: var(--purple-dark); }
.next-level-button { border-bottom: 6px solid #147743; background: var(--green); color: #fff; }
.secondary-button:hover, .next-level-button:hover, .back-button:hover { filter: brightness(1.06); }

@keyframes pop { 50% { transform: scale(1.07); } }
@keyframes shake { 25% { transform: translateX(-7px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }
@keyframes customerEnter {
  from { opacity: 0; transform: translateX(calc(50vw + 160px)); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes customerBounce {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-13px); }
  70% { transform: translateY(3px); }
}
@keyframes customerShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}
@keyframes customerExit {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(calc(-50vw - 160px)); }
}

@media (max-width: 820px) {
  .category-grid { gap: 14px; margin-top: 5vh; }
  .category-card { min-height: 220px; padding: 18px; }
  .time-level-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .items-and-question.time-question { grid-template-columns: minmax(200px, .8fr) 1.2fr; }
  .analog-clock { width: min(240px, 100%); }
  .dual-clock .analog-clock { width: min(170px, 100%); }
  .game-shell { width: min(100% - 20px, 760px); padding-top: 10px; }
  .top-bar { padding: 12px 16px; }
  .brand .eyebrow { display: none; }
  .stat-card { min-width: auto; }
  .stat-card small { display: none; }
  .progress-card { min-width: 205px; }
  .shop-scene { padding: 0 20px 24px; }
  .shop-decoration { margin-left: -20px; margin-right: -20px; }
  .items-and-question { grid-template-columns: 1fr; }
  .item-card { min-height: 165px; }
  .level-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .screen-heading { grid-template-columns: 130px 1fr 130px; }
}

@media (max-width: 580px) {
  .category-grid { grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 3vh; }
  .category-card { min-height: 170px; padding: 10px; border-width: 4px; border-bottom-width: 7px; }
  .category-card > span { font-size: 3rem; }
  .category-card strong { font-size: 1.15rem; }
  .category-card small { font-size: .72rem; }
  .items-and-question.time-question { grid-template-columns: 1fr; }
  .analog-clock { width: 190px; }
  .dual-clock .analog-clock { width: 145px; }
  .top-bar { align-items: stretch; flex-direction: column; gap: 10px; }
  .brand { justify-content: center; }
  .game-stats { justify-content: center; }
  .stat-card { flex: 1; justify-content: center; }
  .customer-panel { gap: 10px; }
  .customer-avatar { flex-basis: 78px; width: 78px; height: 78px; }
  .avatar-fallback { font-size: 3rem; }
  .speech-bubble { min-width: 0; padding: 12px 15px; }
  .speech-bubble::before { top: 25px; }
  .items-list { gap: 10px; }
  .item-card { min-height: 150px; padding: 10px; }
  .item-visual { width: 72px; height: 72px; }
  .item-emoji { font-size: 3.7rem; }
  .item-name, .item-price { font-size: 1.15rem; }
  .items-list.three-items { gap: 7px; }
  .items-list.three-items .item-card { min-height: 145px; padding: 7px 4px; }
  .items-list.three-items .item-visual { width: 60px; height: 60px; }
  .items-list.three-items .item-emoji { font-size: 2.7rem; }
  .items-list.three-items .item-name { font-size: .95rem; }
  .items-list.three-items .item-price { padding-inline: 8px; font-size: 1rem; }
  .question-card { padding: 18px 14px; }
  .transaction-summary { gap: 7px; }
  .transaction-summary span { min-width: 0; flex: 1; padding: 8px; font-size: 1rem; }
  .answer-button { min-height: 66px; }
  .menu-card { padding: 38px 20px; }
  .level-screen { padding: 15px 10px; }
  .screen-heading { display: flex; flex-direction: column; gap: 12px; }
  .back-button { align-self: flex-start; }
  .level-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .level-card { min-height: 155px; padding: 14px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
html.reduce-motion { scroll-behavior: auto; }
html.reduce-motion .menu-cloud,
html.reduce-motion .helper-bubble,
html.reduce-motion .menu-decor,
html.reduce-motion .daily-sun,
html.reduce-motion .primary-menu-button,
html.reduce-motion .next-question-button,
html.reduce-motion .achievement-toast { animation: none !important; }
html.reduce-motion .next-question-button,
html.reduce-motion .achievement-card,
html.reduce-motion .achievement-summary-track span,
html.reduce-motion .achievement-detail-progress-track span { transition: none !important; }
html.reduce-motion .customer-panel.customer-enter,
html.reduce-motion .customer-panel.customer-exit,
html.reduce-motion .customer-panel.customer-correct,
html.reduce-motion .customer-panel.customer-wrong { animation-duration: 80ms !important; animation-iteration-count: 1 !important; }

/* Polish visual: papan kedai, kad misi dan kaunter permainan */
.menu-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 78px 38px 38px;
  border: 7px solid #fff3bd;
  border-bottom: 12px solid #49319d;
  border-radius: 38px 38px 28px 28px;
  box-shadow: 0 14px 0 rgba(57, 39, 120, .23), 0 24px 38px rgba(39, 54, 83, .2);
}

.menu-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 48px;
  border-bottom: 6px solid #f1b932;
  background: repeating-linear-gradient(90deg, #ff705e 0 52px, #fff3d4 52px 104px);
}

.menu-card::after {
  content: "⭐  🧺  ⭐";
  position: absolute;
  right: 22px;
  bottom: 15px;
  color: var(--yellow);
  font-size: 1.25rem;
  letter-spacing: .2em;
  opacity: .72;
}

.menu-shop-icon {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 0 auto 14px;
  border: 5px solid var(--yellow);
  border-radius: 50%;
  background: #fff8db;
  box-shadow: 0 7px 0 rgba(55, 36, 126, .3);
  font-size: 5.7rem;
}

.menu-card h2 {
  margin: 5px 0 15px;
  color: #fff;
  text-shadow: 0 4px 0 var(--purple-dark);
}

.menu-tagline { line-height: 1.45; }

.primary-menu-button {
  position: relative;
  min-width: 260px;
  border: 4px solid #fff1a7;
  border-bottom: 10px solid #a96d00;
  border-radius: 22px;
  box-shadow: 0 7px 14px rgba(37, 25, 84, .26);
  letter-spacing: .025em;
  transition: transform .12s ease, filter .12s ease;
}

.primary-menu-button:hover, .primary-menu-button:focus-visible { transform: translateY(-3px) rotate(-1deg); }
.primary-menu-button:active { border-bottom-width: 5px; transform: translateY(5px); }

.level-screen {
  border-color: #fff3bd;
  background-color: var(--cream);
  background-image: radial-gradient(#eadbaf 1.5px, transparent 1.5px);
  background-size: 20px 20px;
  box-shadow: 0 12px 0 rgba(73, 49, 157, .16), 0 20px 34px rgba(39, 54, 83, .14);
}

.screen-heading h2 {
  display: inline-block;
  padding: 5px 22px 8px;
  border-bottom: 6px solid var(--yellow);
  text-shadow: 0 2px 0 #fff;
}

.back-button {
  border: 3px solid #cbbcf1;
  border-bottom-width: 6px;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(73, 49, 157, .12);
}

.level-grid { gap: 17px; }

.level-card {
  overflow: visible;
  border: 4px solid #fff;
  border-bottom: 9px solid #d2ad3c;
  border-radius: 25px 20px 27px 19px;
  background: #fff1a9;
  box-shadow: 0 5px 13px rgba(57, 45, 92, .16);
  transform: rotate(-.5deg);
}

.level-card:nth-child(even) { background: #dff7ff; border-bottom-color: #6eb9cf; transform: rotate(.6deg); }
.level-card:nth-child(3n) { background: #eee7ff; border-bottom-color: #9079ce; }
.level-card:nth-child(4n) { background: #e3f7d8; border-bottom-color: #70b85f; }
.level-card:hover:not(:disabled), .level-card:focus-visible:not(:disabled) { transform: translateY(-5px) rotate(0); }

.level-number {
  display: inline-block;
  padding: 5px 13px;
  border: 3px solid currentColor;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  font-size: 1.14rem;
}

.level-name { display: flex; align-items: center; justify-content: center; margin: 10px 0 7px; line-height: 1.16; }
.level-best { display: inline-block; padding: 5px 9px; border-radius: 9px; background: rgba(255,255,255,.64); font-size: .92rem; }

.level-card.played { box-shadow: 0 0 0 4px #75cb70, 0 7px 14px rgba(57, 45, 92, .18); }
.level-card.played .level-best { background: #fff; color: #527300; }
.level-card.newly-unlocked { animation: newMissionGlow 1.5s ease-in-out infinite alternate; }
.level-card.newly-unlocked::after {
  content: "BARU!";
  position: absolute;
  top: -13px;
  right: -10px;
  padding: 5px 9px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: .76rem;
  font-weight: 900;
  transform: rotate(7deg);
}

.level-card.locked,
.level-card.locked:nth-child(even),
.level-card.locked:nth-child(3n),
.level-card.locked:nth-child(4n) {
  border-color: #d8d8df;
  border-bottom-color: #aaaab3;
  background: #e5e5e9;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.45);
  transform: none;
}

.level-lock { filter: grayscale(0); }
.level-card.coming-soon:not(.locked) { border-color: #fff; background: #dff7ff; }

.top-bar {
  border-color: #fff3bd;
  border-bottom-width: 7px;
  box-shadow: 0 8px 0 rgba(73, 49, 157, .2);
}

.brand-icon { filter: drop-shadow(0 4px 0 rgba(38, 23, 100, .32)); }
.stat-card { border: 3px solid #e8dfff; box-shadow: 0 4px 0 rgba(42, 25, 112, .24); }
.stars-card { background: #fff4b8; border-color: var(--yellow); }
.progress-card { background: #efffe9; border-color: #9bd78d; }

.shop-scene {
  border-color: #fff3bd;
  box-shadow: 0 11px 0 rgba(73, 49, 157, .16), 0 20px 32px rgba(39, 54, 83, .14);
}

.customer-avatar { border-width: 6px; box-shadow: 0 5px 0 #e3ae25; }
.speech-bubble { border-width: 4px; box-shadow: 0 6px 0 rgba(101, 70, 199, .12); }

.items-and-question {
  padding: 14px;
  border: 5px solid #a7662d;
  border-radius: 27px;
  background: #d99550;
  box-shadow: inset 0 5px 0 rgba(255,255,255,.25), 0 8px 0 #8e5124;
}

.item-card {
  border-color: #fff0ac;
  border-bottom-width: 8px;
  background: #fffdf5;
  box-shadow: 0 5px 0 #bc7a37;
}

.item-price { border: 2px dashed #e3b93a; box-shadow: 0 2px 0 rgba(139,90,0,.13); }

.question-card {
  border: 5px solid #fff;
  border-bottom: 9px solid #c7b8ef;
  background: #eee8ff;
  box-shadow: 0 5px 0 #a6632c;
}

.transaction-summary span { border-bottom-width: 6px; box-shadow: 0 3px 0 rgba(73,49,157,.1); }
.answer-button { border: 4px solid #8f78dd; border-bottom: 9px solid #44308e; box-shadow: 0 4px 8px rgba(49,31,116,.15); }

@keyframes newMissionGlow {
  from { box-shadow: 0 0 0 3px var(--yellow), 0 7px 14px rgba(57,45,92,.16); }
  to { box-shadow: 0 0 0 6px #ffec8a, 0 9px 18px rgba(57,45,92,.23); }
}

@media (max-width: 820px) {
  .menu-card { width: min(620px, 100%); padding-top: 68px; }
  .menu-shop-icon { width: 96px; height: 96px; font-size: 4.8rem; }
  .level-grid { gap: 14px; }
  .items-and-question { padding: 11px; }
}

@media (max-width: 580px) {
  .menu-card { padding: 68px 18px 32px; }
  .menu-card::after { display: none; }
  .primary-menu-button { min-width: min(260px, 100%); }
  .level-card.newly-unlocked::after { right: -4px; }
  .items-and-question { padding: 8px; border-width: 4px; }
}

@media (min-width: 821px) and (max-height: 820px) {
  .game-shell { padding-top: 12px; padding-bottom: 18px; }
  .menu-screen { min-height: calc(100vh - 30px); }
  .menu-card { padding-top: 62px; padding-bottom: 28px; }
  .menu-shop-icon { width: 88px; height: 88px; margin-bottom: 8px; font-size: 4.4rem; }
  .menu-card h2 { font-size: 3.8rem; }
  .menu-tagline { margin-bottom: 22px; }
  .shop-scene { margin-top: 15px; padding-bottom: 20px; }
  .shop-decoration { margin-bottom: 15px; padding-block: 8px; font-size: 1.8rem; }
  .customer-panel { margin-bottom: 14px; }
  .customer-avatar { width: 92px; height: 92px; flex-basis: 92px; }
  .item-card, .items-list.three-items .item-card { min-height: 190px; }
  html.text-large .top-bar { padding: 7px 14px; }
  html.text-large .brand-icon { font-size: 2.4rem; }
  html.text-large h1 { font-size: 1.8rem; }
  html.text-large .stat-card { padding: 5px 10px; }
  html.text-large .stat-card > span { font-size: 1.45rem; }
  html.text-large .stat-card strong { font-size: 1rem; }
  html.text-large .shop-decoration { margin-bottom: 8px; padding-block: 5px; }
  html.text-large .customer-panel { margin-bottom: 8px; }
  html.text-large .customer-avatar { width: 72px; height: 72px; flex-basis: 72px; }
  html.text-large .speech-bubble { padding-block: 8px; }
  html.text-large .speech-bubble h2 { font-size: 1.3rem; }
  html.text-large .items-and-question { gap: 12px; padding: 9px; }
  html.text-large .question-card { padding: 10px; }
  html.text-large #question-text { margin-bottom: 9px; font-size: 1.25rem; }
  html.text-large .answers { gap: 8px; }
  html.text-large .answer-button { min-height: 58px; padding: 6px; font-size: 1.25rem; }
  html.text-large .feedback { min-height: 26px; margin-top: 6px; font-size: 1.05rem; }
  html.text-large .feedback-review { padding: 8px 10px; }
  html.text-large .next-question-button { min-height: 48px; margin-top: 7px; padding: 8px 16px; font-size: 1.1rem; }
  html.text-large .dual-clock .analog-clock { width: min(145px, 100%); }
}

/* Sentuhan akhir khusus menu utama */
.menu-card {
  width: min(730px, 100%);
  padding: 66px 38px 22px;
}

.menu-card::after { display: none; }

.menu-shop-icon {
  position: relative;
  z-index: 2;
  width: 94px;
  height: 94px;
  margin-bottom: 10px;
  font-size: 4.65rem;
}

.menu-card h2 {
  position: relative;
  z-index: 2;
  font-size: clamp(2.8rem, 5.7vw, 4.35rem);
  letter-spacing: .018em;
}

.menu-tagline { max-width: 570px; margin-bottom: 20px; }

.menu-decor {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 3px 0 rgba(45, 27, 109, .25));
  user-select: none;
}

.menu-decor-star-one { top: 88px; left: 62px; color: var(--yellow); font-size: 2rem; animation: menuFloat 2.8s ease-in-out infinite; }
.menu-decor-star-two { top: 151px; right: 84px; color: #fff3a2; font-size: 2.5rem; animation: menuSparkle 1.8s ease-in-out infinite alternate; }
.menu-decor-tag { top: 245px; left: 18px; font-size: 2.5rem; transform: rotate(-12deg); animation: menuFloat 3.2s ease-in-out .4s infinite; }
.menu-decor-cart { top: 92px; right: 52px; font-size: 3rem; transform: rotate(5deg); animation: menuFloat 3s ease-in-out .8s infinite; }

.primary-menu-button {
  min-width: 280px;
  padding: 16px 40px;
  box-shadow: 0 8px 0 rgba(77, 43, 0, .3), 0 12px 20px rgba(37, 25, 84, .2);
  animation: ctaBreathe 2.5s ease-in-out infinite;
}

.primary-menu-button:hover, .primary-menu-button:focus-visible { animation-play-state: paused; }

.menu-status {
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 500px;
  margin: 18px auto 12px;
}

.menu-status-chip {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 9px;
  flex: 1;
  min-width: 0;
  padding: 8px 13px;
  border: 3px solid rgba(255,255,255,.85);
  border-bottom-width: 6px;
  border-radius: 16px;
  background: #fff8d8;
  box-shadow: 0 4px 0 rgba(42,25,112,.24);
  color: var(--ink);
  text-align: left;
}

.menu-status-chip:nth-child(2) { background: #e8ffe1; }
.menu-status-chip > span { grid-row: 1 / 3; align-self: center; font-size: 1.75rem; }
.menu-status-chip small { color: #6d7390; font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.menu-status-chip strong { color: var(--purple-dark); font-size: 1.08rem; }

.how-to-button {
  padding: 7px 14px;
  border: 2px solid rgba(255,255,255,.58);
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  transition: background .12s, transform .12s;
}

.how-to-button:hover, .how-to-button:focus-visible { background: rgba(255,255,255,.25); outline: 3px solid var(--yellow); outline-offset: 2px; transform: translateY(-1px); }

.how-to-card {
  max-width: 480px;
  margin: 9px auto 0;
  padding: 9px 14px;
  border: 3px dashed var(--yellow);
  border-radius: 13px;
  background: rgba(42,25,112,.28);
  color: #fff;
  font-size: .98rem;
  font-weight: 800;
  line-height: 1.35;
}

.how-to-card.hidden { display: none; }
.menu-secondary-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.settings-menu-button { border-color: #d8cff5; background: rgba(255,255,255,.2); }
.practice-menu-button { border-color: #bdf0b5; background: rgba(72,165,80,.22); }
.shop-challenge-menu-card { border-color: #f0c566; background: #fff4c8; }
.shop-challenge-menu-card > span:last-child { display: grid; gap: 1px; }
.shop-challenge-menu-card small { color: #77531b; font-size: .62rem; font-weight: 800; }

.stats-screen { display: grid; place-items: center; min-height: calc(100vh - 48px); }
.stats-panel { width: min(1000px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 26px; border: 6px solid #fff; border-radius: 32px; background: var(--cream); box-shadow: var(--shadow); text-align: center; scrollbar-color: #aa9bd7 transparent; }
.stats-panel h2 { margin: 3px 0 22px; color: var(--purple); font-size: clamp(2.2rem, 5vw, 3.5rem); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.stats-card { display: grid; place-items: center; min-height: 128px; padding: 13px 9px; border: 3px solid #d7cdef; border-bottom-width: 7px; border-radius: 20px; background: #fff; box-shadow: 0 5px 0 rgba(73,49,157,.12); }
.stats-card > span { font-size: 2rem; line-height: 1; }
.stats-card small { color: #6d7390; font-weight: 900; line-height: 1.15; }
.stats-card strong { color: var(--purple-dark); font-size: 1.45rem; }
.stats-card.stats-stars { border-color: #f2cf68; background: #fff8d8; }
.stats-back-button { margin-top: 22px; }
.skill-performance { margin-top: 22px; padding-top: 17px; border-top: 3px dashed #d7cdef; }
.skill-performance h3 { margin: 0 0 13px; color: var(--purple-dark); font-size: 1.15rem; letter-spacing: .04em; }
.skill-stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.skill-stat-card { min-width: 0; padding: 11px 9px; border: 3px solid #c9e7f2; border-bottom-width: 6px; border-radius: 18px; background: #fff; text-align: left; }
.skill-stat-card:nth-child(2n) { border-color: #cce6b8; background: #fbfff3; }
.skill-stat-heading { display: flex; align-items: center; gap: 6px; color: var(--purple-dark); }
.skill-category-icon { width: 1.7em; height: 1.7em; flex: 0 0 auto; object-fit: contain; }
.skill-stat-score { margin: 5px 0 3px; color: var(--purple); font-size: 1.45rem; font-weight: 1000; }
.skill-progress { height: 9px; overflow: hidden; border-radius: 999px; background: #e9e5f4; }
.skill-progress span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.skill-stat-card small, .skill-stat-card em { display: block; margin-top: 5px; color: #6d7390; font-size: .72rem; font-weight: 800; font-style: normal; line-height: 1.15; }
.skill-stat-card em { color: #397540; }
.skill-recommendation { display: inline-block; margin: 15px 6px 0; color: var(--purple-dark); font-weight: 900; }
.skill-recommendation-button { padding: 8px 14px; font-size: .82rem; }

.practice-screen { min-height: calc(100vh - 48px); padding: 22px; border: 5px solid #fff; border-radius: 30px; background: #f1ffe9; box-shadow: var(--shadow); }
.practice-note { margin: -5px 0 15px; color: #397540; text-align: center; font-weight: 900; }
.practice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.practice-card { min-height: 125px; padding: 14px; border: 3px solid #8bd17f; border-bottom: 7px solid #378648; border-radius: 20px; background: #fffdf2; color: var(--ink); cursor: pointer; box-shadow: 0 5px 0 rgba(52,125,62,.12); text-align: center; transition: transform .12s, filter .12s; }
.practice-card:nth-child(even) { background: #e8f8ff; border-color: #83c9df; border-bottom-color: #38869f; }
.practice-card:hover, .practice-card:focus-visible { filter: brightness(1.04); outline: 4px solid var(--yellow); outline-offset: 2px; transform: translateY(-3px); }
.practice-card span, .practice-card strong { display: block; }
.practice-card .practice-number { display: flex; align-items: center; justify-content: center; gap: .3em; color: #397540; font-size: .82rem; font-weight: 900; text-transform: uppercase; }
.practice-category-icon,
.fraction-inline-icon,
.practice-badge-icon,
.result-fraction-icon { display: inline-block; width: 1.45em; height: 1.45em; flex: 0 0 auto; object-fit: contain; vertical-align: middle; }
.fraction-inline-icon { width: 1.75em; height: 1.75em; }
.result-fraction-icon { width: 1.15em; height: 1.15em; }
.practice-card strong { margin: 8px 0; color: var(--purple-dark); font-size: 1.15rem; }
.practice-card > span:last-child { color: #6d7390; font-size: .82rem; font-weight: 800; }
.practice-badge { position: absolute; z-index: 4; top: 64px; right: 18px; display: flex; align-items: center; gap: .35em; padding: 6px 11px; border: 3px solid #fff; border-radius: 999px; background: var(--green); color: #fff; box-shadow: 0 4px 0 #378648; font-size: .8rem; font-weight: 900; }

.settings-screen { display: grid; place-items: center; min-height: calc(100vh - 48px); }
.settings-panel { width: min(760px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 25px; border: 6px solid #fff; border-radius: 32px; background: var(--cream); box-shadow: var(--shadow); text-align: center; scrollbar-color: var(--player-accent) transparent; }
.settings-panel h2 { margin: 3px 0 15px; color: var(--player-accent); font-size: clamp(2.2rem, 5vw, 3.4rem); }
.settings-group { margin: 0 0 12px; padding: 10px; border: 3px dashed var(--player-accent); border-radius: 17px; }
.settings-group legend { padding-inline: 9px; color: var(--player-accent-dark); font-weight: 900; }
.settings-choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.settings-choice-row label { cursor: pointer; }
.settings-choice-row input { position: absolute; opacity: 0; }
.settings-choice-row span { display: block; padding: 10px; border: 3px solid #d7cdef; border-bottom-width: 6px; border-radius: 13px; background: #fff; font-weight: 900; }
.settings-choice-row input:checked + span { border-color: var(--player-accent); background: var(--player-accent-soft); color: var(--player-accent-dark); }
.settings-choice-row input:focus-visible + span { outline: 4px solid var(--yellow); outline-offset: 2px; }
.settings-toggle-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.settings-toggle { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; min-width: 0; padding: 12px; border: 3px solid #d7cdef; border-radius: 16px; background: #fff; cursor: pointer; text-align: left; }
.settings-toggle > span { min-width: 0; }
.settings-toggle strong, .settings-toggle small { display: block; }
.settings-toggle strong { color: var(--player-accent-dark); }
.settings-toggle small { margin-top: 3px; color: #6d7390; font-size: .72rem; line-height: 1.2; }
.settings-toggle input { position: absolute; opacity: 0; }
.settings-toggle i { position: relative; width: 48px; height: 28px; border: 3px solid #8a8fa5; border-radius: 999px; background: #dfe1e8; }
.settings-toggle i::after { content: "OFF"; position: absolute; top: 50%; left: 3px; display: grid; place-items: center; width: 24px; height: 20px; border-radius: 999px; background: #fff; color: #656a7e; font-size: .43rem; font-weight: 1000; transform: translateY(-50%); transition: left .14s; }
.settings-toggle input:checked + i { border-color: var(--player-accent-dark); background: var(--player-accent); }
.settings-toggle input:checked + i::after { content: "ON"; left: 15px; color: var(--player-accent-dark); }
.settings-toggle input:focus-visible + i { outline: 4px solid var(--yellow); outline-offset: 3px; }
.system-motion-note { margin: 8px 0; color: #75520d; font-size: .78rem; font-weight: 900; }
.parent-info { margin: 12px 0; padding: 10px 14px; border: 3px solid #b9dce8; border-radius: 16px; background: #effaff; text-align: left; }
.parent-info h3 { margin: 0 0 5px; color: #17618f; font-size: 1rem; }
.parent-info ul { margin: 0; padding-left: 20px; color: #46536d; font-size: .78rem; font-weight: 700; line-height: 1.4; }
.privacy-policy-link { display: inline-flex; align-items: center; min-height: 36px; margin-top: 8px; padding: 5px 10px; border: 2px solid #8fc5d8; border-radius: 10px; background: #fff; color: #17618f; font-size: .78rem; font-weight: 900; text-decoration: none; }
.privacy-policy-link:hover { background: #ddf5ff; }
.privacy-policy-link:focus-visible { outline: 4px solid var(--yellow); outline-offset: 2px; }
.settings-actions { display: flex; justify-content: center; gap: 10px; }
.shop-challenge-stats { margin-top: 14px; padding: 13px; border: 3px solid #efcf72; border-radius: 20px; background: #fff8d8; }
.shop-challenge-stats h3 { margin: 0 0 9px; color: var(--purple-dark); text-align: center; }
.shop-challenge-stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.shop-challenge-stats-grid span { display: grid; gap: 3px; min-width: 0; padding: 9px 6px; border: 2px solid #ead48e; border-radius: 13px; background: #fff; text-align: center; }
.shop-challenge-stats-grid small { color: #6d6280; font-size: .7rem; font-weight: 800; }
.shop-challenge-stats-grid strong { color: var(--purple-dark); font-size: 1rem; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .shop-challenge-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-challenge-stats-grid span:last-child { grid-column: 1 / -1; }
}

@media (max-width: 820px) and (orientation: landscape) {
  .shop-challenge-stats { padding: 7px; }
  .shop-challenge-stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .shop-challenge-stats-grid span { padding: 5px 3px; }
}

.visual-help { margin: 0 auto 10px; padding: 7px 10px; border: 2px dashed #5d9fb8; border-radius: 11px; background: #effaff; color: #245c73; font-size: .8rem; font-weight: 900; line-height: 1.25; }
.visual-unit-label { display: none; margin-top: 3px; padding: 3px 8px; border-radius: 999px; background: #e9f7ff; color: #17618f; font-size: .72rem; font-weight: 900; }
html.visual-help-on .visual-unit-label { display: inline-block; }
html.visual-help-on .money-cents { text-decoration: underline 3px #ffd84d; text-underline-offset: 3px; }

.mini-shelf {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 22px;
  width: min(360px, 80%);
  margin: 11px auto 0;
  padding-bottom: 7px;
  border-bottom: 7px solid #9b5c27;
  font-size: 1.7rem;
  filter: drop-shadow(0 3px 0 rgba(42,25,112,.22));
}

.mini-shelf::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: -14px;
  left: 8px;
  height: 7px;
  border-radius: 0 0 8px 8px;
  background: #754019;
}

@keyframes menuFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}

@keyframes menuSparkle {
  from { opacity: .45; scale: .82; rotate: -8deg; }
  to { opacity: 1; scale: 1.08; rotate: 7deg; }
}

@keyframes ctaBreathe {
  0%, 100% { scale: 1; }
  50% { scale: 1.025; }
}

@media (max-width: 820px) {
  .menu-card { width: min(660px, 100%); padding: 62px 28px 18px; }
  .menu-shop-icon { width: 82px; height: 82px; font-size: 4rem; }
  .menu-decor-star-one { left: 38px; }
  .menu-decor-cart { right: 32px; }
  .menu-decor-tag { left: 16px; }
  .menu-decor-star-two { right: 55px; }
  .mini-shelf { margin-top: 9px; }
}

@media (max-width: 580px) {
  .menu-card { padding: 60px 16px 18px; }
  .menu-decor-tag, .menu-decor-star-two { display: none; }
  .menu-decor-star-one { top: 82px; left: 18px; }
  .menu-decor-cart { top: 82px; right: 16px; font-size: 2.3rem; }
  .menu-status { gap: 7px; }
  .menu-status-chip { padding: 7px 8px; column-gap: 5px; }
  .menu-status-chip > span { font-size: 1.35rem; }
  .menu-status-chip small { font-size: .62rem; }
  .menu-status-chip strong { font-size: .92rem; }
  .mini-shelf { gap: 13px; width: 88%; font-size: 1.45rem; }
}

@media (min-width: 821px) and (max-height: 820px) {
  .menu-card { padding: 56px 34px 16px; }
  .menu-shop-icon { width: 76px; height: 76px; font-size: 3.7rem; }
  .menu-card h2 { margin-block: 2px 10px; font-size: 3.45rem; }
  .menu-tagline { margin-bottom: 14px; }
  .primary-menu-button { padding-block: 13px; }
  .menu-status { margin-block: 14px 9px; }
  .mini-shelf { margin-top: 7px; font-size: 1.5rem; }
  .menu-decor-tag { top: 210px; }
}

/* Menu hidup: awan, maskot dan kawalan ringan */
.menu-screen { position: relative; overflow: hidden; }
.menu-card { z-index: 2; }

.menu-clouds {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.menu-cloud {
  position: absolute;
  width: 104px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  filter: drop-shadow(0 5px 0 rgba(94,176,207,.13));
  animation: cloudDrift 28s linear infinite;
}

.menu-cloud::before,
.menu-cloud::after {
  content: "";
  position: absolute;
  bottom: 8px;
  border-radius: 50%;
  background: inherit;
}

.menu-cloud::before { left: 17px; width: 43px; height: 43px; }
.menu-cloud::after { right: 15px; width: 57px; height: 57px; }
.cloud-one { top: 11%; left: -120px; animation-duration: 31s; }
.cloud-two { top: 38%; left: -150px; scale: .72; opacity: .78; animation-duration: 38s; animation-delay: -14s; }
.cloud-three { top: 68%; left: -130px; scale: .52; opacity: .65; animation-duration: 44s; animation-delay: -27s; }

.menu-tools {
  position: absolute;
  z-index: 5;
  top: 60px;
  right: 16px;
  display: flex;
  gap: 7px;
}

.menu-tool-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 3px solid #fff2ae;
  border-bottom: 6px solid #3b2789;
  border-radius: 13px;
  background: #8066dc;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(34,20,91,.25);
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
  transition: transform .12s, filter .12s;
}

.menu-tool-button:hover:not(:disabled), .menu-tool-button:focus-visible { filter: brightness(1.13); outline: 3px solid var(--yellow); outline-offset: 2px; transform: translateY(-2px); }
.menu-tool-button:active:not(:disabled) { border-bottom-width: 3px; transform: translateY(3px); }
.menu-tool-button:disabled { cursor: not-allowed; filter: grayscale(1); opacity: .5; }
.menu-decor-cart { top: 104px; right: 112px; }

.menu-helper {
  position: absolute;
  z-index: 3;
  bottom: 13px;
  left: 17px;
  width: 76px;
  height: 84px;
  pointer-events: none;
}

.helper-mascot {
  position: absolute;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 4px solid #fff0a6;
  border-radius: 50% 50% 43% 43%;
  background: #77d46f;
  box-shadow: 0 5px 0 #3e8e49;
  font-size: 2.75rem;
}

.helper-mascot span { transform: translateY(3px); }
.helper-mascot i {
  position: absolute;
  top: -10px;
  left: 9px;
  width: 42px;
  height: 16px;
  border: 3px solid #fff0a6;
  border-radius: 50% 50% 5px 5px;
  background: var(--yellow);
  transform: rotate(-4deg);
}

.helper-bubble {
  position: absolute;
  right: -150px;
  bottom: 66px;
  width: 170px;
  padding: 8px 10px;
  border: 3px solid var(--yellow);
  border-radius: 14px 14px 14px 5px;
  background: #fffdf2;
  box-shadow: 0 4px 0 rgba(45,27,109,.2);
  color: var(--purple-dark);
  font-size: .8rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  animation: helperHello 3s ease-in-out infinite;
}

.helper-bubble::after {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 13px;
  width: 14px;
  height: 14px;
  border-right: 3px solid var(--yellow);
  border-bottom: 3px solid var(--yellow);
  background: #fffdf2;
  transform: rotate(45deg);
}

.mini-shelf { padding-left: 28px; }

.app-version {
  position: absolute;
  right: 13px;
  bottom: 8px;
  color: rgba(255,255,255,.68);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
}

@keyframes cloudDrift {
  from { translate: -10vw 0; }
  to { translate: calc(100vw + 260px) 0; }
}

@keyframes helperHello {
  0%, 100% { translate: 0 0; rotate: -1deg; }
  50% { translate: 0 -3px; rotate: 1deg; }
}

@media (max-width: 820px) {
  .menu-tools { top: 57px; right: 13px; }
  .menu-tool-button { width: 44px; height: 44px; }
  .menu-decor-cart { top: 103px; right: 100px; }
  .menu-helper { left: 10px; scale: .9; transform-origin: bottom left; }
  .helper-bubble { right: -142px; width: 158px; }
}

@media (max-width: 580px) {
  .menu-tools { top: 55px; right: 9px; gap: 4px; }
  .menu-tool-button { width: 40px; height: 40px; border-width: 2px; border-bottom-width: 5px; font-size: 1.05rem; }
  .menu-helper { display: none; }
  .mini-shelf { padding-left: 0; }
}

@media (min-width: 821px) and (max-height: 820px) {
  .menu-tools { top: 55px; }
  .menu-helper { scale: .85; transform-origin: bottom left; }
  .helper-bubble { bottom: 65px; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-cloud, .helper-bubble { animation: none !important; }
}

@media (max-width: 820px) {
  .stats-panel { padding: 22px; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .stats-card { min-height: 105px; }
  .skill-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .practice-screen { padding: 16px; }
  .practice-grid { gap: 10px; }
  .practice-card { min-height: 108px; padding: 10px; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .shop-header-logo { width: 43px; height: 43px; }
  .customer-avatar.shop-dialog-badge { padding: 7px; border-width: 4px; box-shadow: inset 0 0 0 3px #f2c744, 0 4px 0 rgba(40,34,82,.18), 0 7px 12px rgba(40,34,82,.14); }
  .customer-avatar.shop-dialog-badge::after { top: 6px; left: 10px; }
  .category-screen, .time-level-screen, .measurement-level-screen { min-height: calc(100vh - 12px); padding: 7px 10px; }
  .category-grid { width: min(720px, 90%); margin-top: 2vh; gap: 12px; }
  .category-card { min-height: 150px; padding: 8px; border-width: 4px; border-bottom-width: 7px; }
  .category-card > span { font-size: 2.8rem; }
  .category-card strong { font-size: 1.25rem; }
  .category-card small { font-size: .7rem; }
  .time-level-grid, .measurement-level-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
  .items-and-question.time-question { grid-template-columns: minmax(190px, .75fr) 1.25fr; }
  .items-and-question.measurement-question { grid-template-columns: minmax(190px, .75fr) 1.25fr; }
  .measurement-display { min-height: 132px; padding: 6px; border-width: 3px; border-bottom-width: 6px; }
  .measurement-item-visual { width: 58px; }
  .measurement-item-emoji { font-size: 3.1rem; }
  .measurement-copy { gap: 4px; }
  .measurement-copy strong { font-size: .85rem; }
  .measurement-copy b { padding: 4px 9px; border-width: 2px; font-size: 1.15rem; }
  .clock-stage { padding: 4px; border-width: 3px; border-bottom-width: 6px; }
  .analog-clock { width: min(190px, 100%); max-height: 190px; }
  html.text-large .analog-clock { width: min(175px, 100%); max-height: 175px; }
  .dual-clock .analog-clock { width: min(135px, 100%); max-height: 135px; }
  html.text-large .dual-clock .analog-clock { width: min(120px, 100%); max-height: 120px; }
  .clock-label { padding: 2px 7px; font-size: .6rem; }
  .clock-arrow { font-size: 1.35rem; }
  .duration-chip { padding: 3px 8px; border-width: 2px; border-bottom-width: 4px; font-size: .72rem; }
  .clock-legend { font-size: .6rem; gap: 6px; }
  .game-shell { width: min(100% - 16px, 1180px); padding-block: 6px; }
  .menu-screen { min-height: calc(100vh - 12px); }
  .menu-card { padding: 50px 18px 10px; }
  .menu-shop-icon { width: 52px; height: 52px; margin-bottom: 1px; border-width: 3px; font-size: 2.5rem; }
  .menu-card .eyebrow { font-size: .7rem; }
  .menu-card h2 { margin: 0 0 5px; font-size: clamp(2rem, 6vw, 2.75rem); }
  .menu-tagline { margin-bottom: 8px; font-size: .9rem; line-height: 1.25; }
  .primary-menu-button { min-width: 230px; padding: 9px 28px; border-bottom-width: 7px; font-size: 1.25rem; }
  .menu-status { max-width: 440px; margin-block: 9px 6px; }
  .menu-status-chip { padding-block: 5px; border-bottom-width: 4px; }
  .how-to-button { padding-block: 4px; font-size: .85rem; }
  .how-to-card { position: absolute; z-index: 8; right: 90px; bottom: 10px; left: 90px; margin: 0; font-size: .8rem; }
  .mini-shelf, .menu-helper, .menu-decor { display: none; }
  .menu-tools { top: 51px; }
  .app-version { bottom: 5px; }

  .stats-screen { min-height: calc(100vh - 12px); }
  .stats-panel { width: min(850px, 100%); padding: 10px 16px; border-width: 4px; }
  .stats-panel h2 { margin-bottom: 8px; font-size: 2rem; }
  .stats-panel > .eyebrow { display: none; }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .stats-card { min-height: 82px; padding: 6px; border-width: 2px; border-bottom-width: 5px; }
  .stats-card > span { font-size: 1.4rem; }
  .stats-card small { font-size: .68rem; }
  .stats-card strong { font-size: 1.05rem; }
  .stats-back-button { margin-top: 8px; padding: 7px 18px; }
  .skill-performance { margin-top: 8px; padding-top: 7px; }
  .skill-performance h3 { margin-bottom: 6px; font-size: .82rem; }
  .skill-stats-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .skill-stat-card { padding: 5px; border-width: 2px; border-bottom-width: 4px; border-radius: 12px; }
  .skill-stat-heading { gap: 3px; font-size: .7rem; }
  .skill-stat-score { margin: 2px 0; font-size: 1rem; }
  .skill-progress { height: 6px; }
  .skill-stat-card small, .skill-stat-card em { margin-top: 2px; font-size: .55rem; }
  .skill-recommendation { margin-top: 6px; font-size: .7rem; }
  .skill-recommendation-button { padding: 4px 8px; font-size: .65rem; }

  .practice-screen { min-height: calc(100vh - 12px); padding: 7px 10px; }
  .practice-screen .screen-heading { margin-bottom: 1px; }
  .practice-note { margin: 0 0 5px; font-size: .72rem; }
  .practice-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
  .practice-card { min-height: 102px; padding: 6px 4px; border-width: 3px; border-bottom-width: 6px; border-radius: 15px; }
  .practice-card .practice-number { font-size: .62rem; }
  .practice-card strong { margin: 5px 0; font-size: .75rem; }
  .practice-card > span:last-child { font-size: .62rem; }
  .practice-badge { top: 45px; right: 10px; padding: 3px 7px; border-width: 2px; font-size: .62rem; }

  .level-screen { min-height: calc(100vh - 12px); padding: 7px 10px; }
  .screen-heading { display: grid; grid-template-columns: 125px 1fr 125px; margin-bottom: 2px; }
  .screen-heading h2 { padding-block: 1px 3px; font-size: 1.7rem; }
  .screen-heading .eyebrow { display: none; }
  .back-button { padding: 7px 10px; border-bottom-width: 4px; }
  .level-notice { min-height: 18px; margin-bottom: 3px; font-size: .8rem; }
  .level-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
  .level-card { min-height: 112px; padding: 7px 4px; border-width: 3px; border-bottom-width: 6px; border-radius: 16px; }
  .level-number { padding: 3px 7px; border-width: 2px; font-size: .8rem; }
  .level-name { min-height: 29px; margin: 5px 0 3px; font-size: .72rem; }
  .level-best { padding: 3px 5px; font-size: .65rem; }
  .level-stars { margin-bottom: 4px; font-size: .85rem; }
  .level-lock { margin: -2px 0 1px; font-size: 1rem; }
  .coming-label { font-size: .58rem; }

  .top-bar { padding: 7px 12px; border-width: 3px; border-bottom-width: 5px; }
  .brand-icon { font-size: 2rem; }
  h1 { font-size: 1.45rem; }
  .stat-card { padding: 5px 9px; }
  .stat-card > span { font-size: 1.4rem; }
  .stat-card strong { font-size: 1rem; }
  .shop-scene { margin-top: 8px; padding: 0 12px 12px; }
  .shop-decoration { margin: 0 -12px 7px; padding-block: 4px; border-bottom-width: 4px; font-size: 1.25rem; }
  .customer-panel { gap: 10px; margin-bottom: 7px; }
  .customer-avatar { width: 65px; height: 65px; flex-basis: 65px; border-width: 4px; }
  .speech-bubble { min-width: 290px; padding: 7px 14px; border-width: 3px; }
  .speech-bubble::before { top: 20px; width: 18px; height: 18px; }
  .customer-label { font-size: .75rem; }
  .speech-bubble h2 { font-size: 1.15rem; }
  .items-and-question { grid-template-columns: 1fr 1.12fr; gap: 10px; padding: 7px; border-width: 4px; }
  .items-list { gap: 7px; }
  .item-card, .items-list.three-items .item-card { min-height: 132px; padding: 6px; border-width: 3px; border-bottom-width: 6px; }
  .item-visual, .items-list.three-items .item-visual { width: 58px; height: 58px; }
  .item-emoji, .items-list.three-items .item-emoji { font-size: 2.5rem; }
  .item-name, .items-list.three-items .item-name { min-height: 1.8em; margin-top: 3px; font-size: .82rem; }
  .item-price, .item-price.money-cents { padding: 3px 7px; font-size: .83rem; }
  .question-card { padding: 8px; border-width: 4px; border-bottom-width: 6px; }
  .question-timer { margin-bottom: 5px; }
  .timer-label { margin-bottom: 2px; font-size: .8rem; }
  .timer-track { height: 9px; border-width: 2px; }
  #question-text { margin-bottom: 7px; font-size: 1.05rem; }
  .transaction-summary { margin-bottom: 6px; }
  .transaction-summary span { padding: 4px 7px; border-width: 2px; border-bottom-width: 4px; font-size: .75rem; }
  .transaction-summary strong { font-size: 1rem; }
  .answers { gap: 7px; }
  .answer-button { min-height: 48px; padding: 5px; border-width: 3px; border-bottom-width: 6px; font-size: 1.1rem; }
  .feedback { min-height: 24px; margin-top: 5px; font-size: 1rem; }
}

/* Title Screen dan Main Menu berasaskan aset produksi. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.title-screen,
.main-hub-screen {
  position: relative;
  min-height: calc(100vh - 48px);
  overflow: hidden;
  border: 5px solid rgba(255,255,255,.92);
  border-radius: 34px;
  background: #9ddff5;
  box-shadow: 0 14px 0 rgba(44,35,85,.14), 0 22px 45px rgba(50,68,120,.16);
}
.title-screen.hidden, .main-hub-screen.hidden { display: none; }

.main-hub-screen::before {
  position: absolute;
  inset: auto -4% -52px;
  height: 150px;
  border-radius: 50% 50% 0 0;
  background: #61b85d;
  content: "";
}

.title-hero,
.title-hero-shade {
  position: absolute;
  inset: 0;
}

.title-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.title-hero-shade {
  z-index: 1;
  background:
    radial-gradient(circle at 49% 32%, rgba(255,255,255,.22), transparent 38%),
    linear-gradient(180deg, rgba(35,57,130,.03) 0 55%, rgba(23,42,82,.2) 100%);
  pointer-events: none;
}

.title-tools {
  position: absolute;
  z-index: 5;
  top: 18px;
  right: 20px;
  display: flex;
  gap: 10px;
}

.asset-icon-button,
.asset-back-button {
  border: 3px solid #fff;
  border-bottom: 6px solid rgba(53,40,111,.26);
  background: rgba(101,70,199,.94);
  box-shadow: 0 5px 12px rgba(43,35,91,.18);
  color: #fff;
  cursor: pointer;
}

.asset-icon-button {
  display: grid;
  width: 54px;
  height: 54px;
  padding: 8px;
  place-items: center;
  border-radius: 18px;
}

.asset-icon-button img,
.asset-back-button img,
.home-game-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-icon-button:hover:not(:disabled),
.asset-icon-button:focus-visible,
.asset-back-button:hover,
.asset-back-button:focus-visible { filter: brightness(1.1); transform: translateY(-2px); }
.asset-icon-button:active:not(:disabled), .asset-back-button:active { border-bottom-width: 3px; transform: translateY(3px); }
.asset-icon-button.is-fullscreen img { transform: rotate(180deg); }
.asset-icon-button:disabled { opacity: .45; cursor: not-allowed; }

.title-stage {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: calc(100vh - 58px);
  padding: 26px 110px 36px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.title-branding {
  display: grid;
  width: min(760px, 72vw);
  padding: 8px 30px 11px;
  place-items: center;
  border: 2px solid rgba(255,255,255,.68);
  border-radius: 34px;
  background: rgba(255,250,232,.72);
  box-shadow: 0 12px 34px rgba(42,42,105,.14), inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(5px);
}

.title-logo {
  display: block;
  width: min(680px, 68vw);
  max-height: 35vh;
  object-fit: contain;
  filter: drop-shadow(0 10px 9px rgba(48,35,93,.2));
}

.title-tagline {
  margin: 2px 0 0;
  color: #49319d;
  font-size: clamp(1rem, 2.1vw, 1.35rem);
  font-weight: 900;
}

.title-actions {
  display: grid;
  margin-top: 16px;
  place-items: center;
  gap: 11px;
}

.enter-shop-button {
  display: inline-flex;
  min-width: 310px;
  min-height: 72px;
  padding: 10px 28px 10px 16px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 4px solid #fff4a9;
  border-bottom: 9px solid #bd7800;
  border-radius: 24px;
  background: #ffd84d;
  box-shadow: 0 10px 0 rgba(135,73,8,.18), 0 16px 24px rgba(91,59,0,.25);
  color: #563800;
  cursor: pointer;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 1000;
  letter-spacing: .025em;
}
.enter-shop-button img { width: 54px; height: 54px; object-fit: contain; }
.enter-shop-button:hover, .enter-shop-button:focus-visible { filter: brightness(1.05); transform: translateY(-3px) scale(1.015); }
.enter-shop-button:active { border-bottom-width: 5px; transform: translateY(5px); }

.title-highlights {
  display: flex;
  margin: 0;
  padding: 0;
  justify-content: center;
  gap: 8px;
  list-style: none;
}

.title-highlights li {
  display: inline-flex;
  min-height: 34px;
  padding: 5px 11px;
  align-items: center;
  gap: 5px;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 999px;
  background: rgba(255,249,229,.9);
  box-shadow: 0 4px 10px rgba(43,35,91,.16);
  color: #49319d;
  font-size: .78rem;
  white-space: nowrap;
}

.title-version {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: rgba(45,54,83,.82);
  font-size: .72rem;
  font-weight: 800;
}

.title-decor { position: absolute; z-index: 2; width: 76px; height: 76px; object-fit: contain; opacity: .76; pointer-events: none; }
.title-star { top: 14%; left: 5%; animation: titleFloat 3.4s ease-in-out infinite; }
.title-sparkle { top: 19%; right: 7%; width: 60px; height: 60px; animation: titleTwinkle 2.2s ease-in-out infinite alternate; }
.title-mascot { position: absolute; z-index: 3; bottom: -8px; left: 22px; width: clamp(155px, 15vw, 220px); pointer-events: none; filter: drop-shadow(0 12px 9px rgba(34,37,80,.22)); }
.title-mascot img { display: block; width: 100%; height: auto; object-fit: contain; }
.title-mascot-bubble { position: absolute; left: 74%; bottom: 72%; width: max-content; padding: 8px 12px; border: 3px solid #6546c7; border-radius: 17px 17px 17px 4px; background: #fff9e9; color: #49319d; font-size: .82rem; font-weight: 900; box-shadow: 0 5px 0 rgba(73,49,157,.14); }

@keyframes titleFloat { 50% { transform: translateY(-9px) rotate(5deg); } }
@keyframes titleTwinkle { to { opacity: .42; transform: scale(.82) rotate(10deg); } }

.main-hub-screen { display: grid; padding: 24px; place-items: center; }
.main-hub-panel {
  position: relative;
  z-index: 2;
  width: min(940px, 100%);
  padding: 22px 26px 18px;
  border: 5px solid #fff;
  border-radius: 30px;
  background: rgba(255,249,233,.96);
  box-shadow: 0 10px 0 rgba(73,49,157,.16);
}
.main-hub-header { display: grid; grid-template-columns: 180px 1fr 220px; align-items: center; gap: 14px; }
.main-hub-header > div:nth-child(2) { text-align: center; }
.main-hub-header h2 { margin: 0; color: var(--purple-dark); font-size: clamp(2rem,4vw,3.1rem); line-height: 1; }
.asset-back-button { display: inline-flex; width: max-content; min-height: 48px; padding: 5px 13px 7px 8px; align-items: center; gap: 7px; border-radius: 16px; font-weight: 900; }
.asset-back-button img { width: 32px; height: 32px; }
.hub-player { display: flex; min-width: 0; padding: 7px 10px; align-items: center; gap: 8px; border: 3px solid var(--player-accent); border-radius: 17px; background: var(--player-accent-soft); color: var(--ink); cursor: pointer; font: inherit; text-align: left; }
.hub-player > span:first-child { font-size: 1.7rem; }
.hub-player strong, .hub-player small { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hub-progress { display: flex; max-width: 440px; margin: 10px auto 12px; justify-content: center; gap: 8px; }
.hub-progress > span { display: flex; min-width: 0; padding: 5px 13px; align-items: center; gap: 7px; border: 2px solid #e4d9ff; border-radius: 999px; background: #fff; }
.hub-progress small { color: #6d7390; font-size: .69rem; font-weight: 900; text-transform: uppercase; }
.hub-progress strong { color: var(--purple-dark); font-size: .9rem; }
.menu-recommendation { display: grid; width: min(680px, 100%); margin: 0 auto 12px; padding: 9px 14px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 3px solid var(--player-accent, #6546c7); border-radius: 18px; background: var(--player-accent-soft, #eee8ff); color: var(--purple-dark); text-align: left; box-shadow: 0 4px 0 rgba(73,49,157,.14); cursor: pointer; }
.menu-recommendation > span:first-child { font-size: 1.4rem; }
.menu-recommendation small, .menu-recommendation strong { display: block; line-height: 1.2; }
.menu-recommendation small { margin-bottom: 2px; font-size: .68rem; font-weight: 1000; letter-spacing: .04em; text-transform: uppercase; }
.menu-recommendation strong { font-size: .92rem; }
.menu-recommendation-arrow { font-size: 1.55rem; font-weight: 1000; }
.menu-recommendation:hover { transform: translateY(-1px); box-shadow: 0 6px 0 rgba(73,49,157,.14); }
.menu-recommendation:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(73,49,157,.14); }

.smart-tip { width: min(460px, 100%); margin: 10px auto 16px; padding: 10px 13px; border: 3px solid #f2cf68; border-radius: 16px; background: #fff9dc; color: #684f25; text-align: left; }
.smart-tip strong, .smart-tip span { display: block; }
.smart-tip strong { margin-bottom: 3px; color: var(--purple-dark); }
.smart-tip span { font-size: .88rem; font-weight: 750; line-height: 1.3; }

.hub-categories { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.hub-category-card, .hub-menu-card, .hub-how-to-button { cursor: pointer; }
.hub-help-actions { display: flex; margin-top: 12px; justify-content: center; gap: 8px; }
.hub-tutorial-button,
.hub-how-to-button { min-height: 42px; padding: 7px 14px; border: 3px solid #c9bdf0; border-radius: 14px; background: #fff; color: var(--purple-dark); cursor: pointer; font: inherit; font-size: .9rem; font-weight: 900; }
.hub-tutorial-button:hover,
.hub-tutorial-button:focus-visible,
.hub-how-to-button:hover,
.hub-how-to-button:focus-visible { border-color: var(--player-accent); background: var(--player-accent-soft); transform: translateY(-1px); }

.tutorial-modal { position: fixed; z-index: 220; inset: 0; display: grid; padding: 16px; place-items: center; background: rgba(31,20,77,.78); }
.tutorial-modal.hidden { display: none; }
.tutorial-card { position: relative; width: min(520px, 100%); padding: 30px 24px 24px; border: 5px solid #fff; border-radius: 28px; background: #fff9e9; box-shadow: 0 12px 0 rgba(35,25,83,.28), 0 24px 50px rgba(20,16,55,.32); text-align: center; }
.tutorial-skip { position: absolute; top: 12px; right: 14px; padding: 7px 10px; border: 0; border-radius: 999px; background: #eee8ff; color: #584598; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 900; }
.tutorial-kicker { margin: 0 54px 5px; color: #7a64c2; font-size: .75rem; font-weight: 1000; letter-spacing: .06em; text-transform: uppercase; }
.tutorial-icon { margin: 4px 0 7px; font-size: 4rem; line-height: 1; }
.tutorial-card h2 { margin: 0 0 8px; color: var(--purple-dark); font-size: clamp(1.8rem, 7vw, 2.6rem); }
.tutorial-card > p:not(.tutorial-kicker) { max-width: 390px; min-height: 3em; margin: 0 auto 16px; color: #4e536b; font-size: 1.05rem; font-weight: 800; line-height: 1.45; }
.tutorial-dots { display: flex; margin-bottom: 18px; justify-content: center; gap: 8px; }
.tutorial-dots span { width: 12px; height: 12px; border-radius: 50%; background: #d8cff5; }
.tutorial-dots span.active { width: 30px; border-radius: 999px; background: var(--player-accent); }
.tutorial-actions { display: flex; justify-content: center; gap: 10px; }
.tutorial-actions .hidden { display: none; }

@media (max-width: 480px) {
  .hub-help-actions { flex-wrap: wrap; }
  .tutorial-card { padding: 28px 16px 18px; border-width: 4px; border-radius: 23px; }
  .tutorial-icon { font-size: 3.4rem; }
  .tutorial-actions .play-again-button, .tutorial-actions .secondary-button { min-height: 48px; padding: 9px 16px; }
}
.hub-category-card {
  display: flex;
  min-height: 118px;
  padding: 12px 20px;
  align-items: center;
  gap: 17px;
  border: 4px solid #fff;
  border-bottom: 8px solid rgba(59,51,108,.2);
  border-radius: 24px;
  box-shadow: 0 6px 14px rgba(52,47,105,.14);
  color: var(--ink);
  text-align: left;
}
.money-hub-card { background: #ffe16f; }
.time-hub-card { background: #9ee6f8; }
.measurement-hub-card { background: #bdeba9; }
.fraction-hub-card { background: #ffe0ea; }
.geometry-hub-card { width: calc(50% - 7px); grid-column: 1 / -1; justify-self: center; background: #eef8ff; border-color: #8dc7eb; }
.hub-category-card img { width: 90px; height: 90px; flex: 0 0 90px; object-fit: contain; }
.hub-category-emoji { display: grid; width: 90px; height: 90px; flex: 0 0 90px; place-items: center; font-size: 4.1rem; line-height: 1; }
.hub-category-card span { display: grid; gap: 4px; }
.hub-category-card strong { color: var(--purple-dark); font-size: 1.45rem; }
.hub-category-card small { font-size: .83rem; font-weight: 800; }

.hub-support-grid { display: grid; margin-top: 14px; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.hub-menu-card {
  display: flex;
  min-height: 68px;
  padding: 7px 12px;
  align-items: center;
  gap: 9px;
  border: 3px solid #d9cef9;
  border-bottom: 6px solid #b9a8ea;
  border-radius: 18px;
  background: #fff;
  color: var(--purple-dark);
  font-size: .9rem;
  font-weight: 900;
  text-align: left;
}
.hub-menu-card img { width: 48px; height: 48px; flex: 0 0 48px; object-fit: contain; }
.hub-menu-card > span { display: grid; gap: 4px; line-height: 1.15; }
.hub-menu-card > span > small { display: block; margin-top: 2px; color: #514174; font-size: .78em; font-weight: 800; line-height: 1.2; }
.hub-category-card:hover, .hub-category-card:focus-visible, .hub-menu-card:hover, .hub-menu-card:focus-visible { filter: brightness(1.035); transform: translateY(-2px); }
.hub-category-card:active, .hub-menu-card:active { transform: translateY(3px); }
.hub-how-to-button { display: block; margin: 10px auto 0; padding: 6px 14px; border: 2px solid #d8cff5; border-radius: 999px; background: transparent; color: var(--purple-dark); font-size: .78rem; font-weight: 900; }
.main-hub-panel .how-to-card { width: min(760px, 100%); max-width: 760px; max-height: min(58vh, 520px); margin: 8px auto 0; overflow-y: auto; padding: 13px 15px; border: 3px solid #e2bd3f; border-radius: 18px; background: #fffaf0; color: var(--ink); font-size: .82rem; text-align: left; box-shadow: 0 8px 20px rgba(49,34,105,.18); scrollbar-color: var(--player-accent) transparent; }
.main-hub-panel .how-to-card h3 { margin: 0 0 5px; color: var(--purple-dark); font-size: 1rem; text-align: center; }
.how-to-intro { margin: 0 0 9px; color: #4d4567; font-weight: 850; text-align: center; }
.how-to-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.how-to-grid p { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 1px 6px; margin: 0; padding: 6px 8px; border: 2px solid #e7def8; border-radius: 11px; background: #fff; }
.how-to-grid p > span { grid-row: 1 / 3; align-self: center; font-size: 1.15rem; }
.how-to-grid strong { color: var(--purple-dark); }
.how-to-grid small { color: #5c6077; font-size: .72rem; font-weight: 750; line-height: 1.25; }
.how-to-stars { margin: 8px 0 0; padding: 6px 8px; border-radius: 10px; background: #fff2b7; color: #59451d; font-size: .73rem; text-align: center; }

.home-game-button { display: grid; padding: 5px; place-items: center; }
.home-game-button img { width: 34px; height: 34px; }

html.reduce-motion .title-decor,
html.reduce-motion .enter-shop-button { animation: none !important; transition: none !important; }

@media (max-width: 1050px) {
  .main-hub-panel { width: min(820px,100%); }
  .main-hub-header { grid-template-columns: 145px 1fr 190px; }
  .hub-category-card { min-height: 105px; }
  .hub-category-card img { width: 76px; height: 76px; flex-basis: 76px; }
  .hub-category-emoji { width: 76px; height: 76px; flex-basis: 76px; font-size: 3.5rem; }
}

@media (max-width: 820px) {
  .title-stage { padding-inline: 64px; }
  .title-branding { width: min(650px, 82vw); padding-inline: 20px; }
  .title-logo { width: min(590px,76vw); }
  .title-mascot { width: 135px; left: 8px; }
  .title-mascot-bubble { left: 65%; bottom: 73%; font-size: .69rem; }
  .main-hub-screen { padding: 12px; }
  .main-hub-panel { padding: 15px; }
  .main-hub-header { grid-template-columns: 120px 1fr 160px; gap: 7px; }
  .asset-back-button span { font-size: .78rem; }
  .hub-player { padding: 5px 7px; font-size: .78rem; }
  .hub-category-card { min-height: 92px; padding: 8px 13px; gap: 10px; }
  .hub-category-card img { width: 65px; height: 65px; flex-basis: 65px; }
  .hub-category-emoji { width: 65px; height: 65px; flex-basis: 65px; font-size: 3rem; }
  .hub-category-card strong { font-size: 1.15rem; }
  .hub-support-grid { margin-top: 9px; gap: 7px; }
  .hub-menu-card { min-height: 56px; padding: 5px 8px; font-size: .75rem; }
  .hub-menu-card img { width: 40px; height: 40px; flex-basis: 40px; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .title-screen, .main-hub-screen { min-height: calc(100vh - 12px); border-width: 4px; border-radius: 25px; }
  .title-stage { min-height: calc(100vh - 20px); padding: 8px 90px 18px; }
  .title-branding { width: min(520px, 68vw); padding: 4px 18px 6px; border-radius: 23px; }
  .title-logo { width: min(470px,62vw); max-height: 31vh; }
  .title-tagline { margin: 0; font-size: .82rem; }
  .title-actions { margin-top: 7px; gap: 5px; }
  .enter-shop-button { min-width: 250px; min-height: 55px; padding: 5px 20px 5px 10px; border-width: 3px; border-bottom-width: 7px; border-radius: 19px; font-size: 1.15rem; }
  .enter-shop-button img { width: 42px; height: 42px; }
  .title-tools { top: 9px; right: 10px; gap: 6px; }
  .asset-icon-button { width: 43px; height: 43px; padding: 6px; border-width: 2px; border-bottom-width: 5px; border-radius: 14px; }
  .title-decor { width: 54px; height: 54px; }
  .title-star { top: 15%; left: 5%; }
  .title-sparkle { top: 24%; right: 7%; }
  .title-highlights li { min-height: 25px; padding: 2px 7px; font-size: .61rem; }
  .title-mascot { width: 102px; }
  .title-mascot-bubble { left: 62%; bottom: 72%; padding: 5px 7px; border-width: 2px; font-size: .56rem; }
  .title-version { bottom: 4px; font-size: .59rem; }

  .main-hub-screen { padding: 5px 10px; }
  .main-hub-panel { width: min(780px,100%); padding: 7px 13px 8px; border-width: 4px; border-radius: 23px; }
  .main-hub-header { grid-template-columns: 125px 1fr 180px; }
  .main-hub-header .eyebrow { display: none; }
  .main-hub-header h2 { font-size: 1.75rem; }
  .asset-back-button { min-height: 38px; padding-block: 3px 5px; border-width: 2px; border-bottom-width: 4px; }
  .asset-back-button img { width: 27px; height: 27px; }
  .hub-player { padding-block: 3px; }
  .hub-player > span:first-child { font-size: 1.3rem; }
  .hub-progress { margin: 4px auto 5px; }
  .hub-progress > span { padding: 2px 9px; }
  .hub-progress small { font-size: .56rem; }
  .hub-progress strong { font-size: .72rem; }
  .menu-recommendation { margin-bottom: 5px; padding: 4px 9px; gap: 7px; border-width: 2px; border-radius: 13px; box-shadow: 0 3px 0 rgba(73,49,157,.12); }
  .menu-recommendation > span:first-child, .menu-recommendation-arrow { font-size: .95rem; }
  .menu-recommendation small { font-size: .5rem; }
  .menu-recommendation strong { font-size: .66rem; }
  .hub-categories { gap: 8px; }
  .hub-category-card { min-height: 72px; padding: 4px 11px; border-width: 3px; border-bottom-width: 6px; border-radius: 17px; }
  .hub-category-card img { width: 54px; height: 54px; flex-basis: 54px; }
  .hub-category-emoji { width: 54px; height: 54px; flex-basis: 54px; font-size: 2.5rem; }
  .hub-category-card strong { font-size: 1rem; }
  .hub-category-card small { font-size: .64rem; }
  .hub-support-grid { margin-top: 6px; gap: 5px; }
  .hub-menu-card { min-height: 47px; padding: 3px 7px; border-width: 2px; border-bottom-width: 4px; border-radius: 13px; font-size: .67rem; }
  .hub-menu-card img { width: 34px; height: 34px; flex-basis: 34px; }
  .hub-how-to-button { margin-top: 5px; padding-block: 3px; font-size: .64rem; }
  .main-hub-panel .how-to-card { position: absolute; right: 10px; bottom: 7px; left: 10px; width: auto; max-width: 680px; max-height: 72vh; margin: 0 auto; font-size: .72rem; }
}

@media (max-width: 700px) and (orientation: landscape) {
  .title-mascot-bubble { display: none; }
  .title-decor { opacity: .5; }
}

@media (max-width: 640px) and (orientation: portrait) {
  .title-screen { min-height: calc(100dvh - 20px); border-width: 4px; border-radius: 26px; }
  .title-hero img { object-position: center 48%; }
  .title-hero-shade { background: linear-gradient(180deg, rgba(37,70,150,.04), rgba(29,48,93,.14)); }
  .title-stage { min-height: calc(100dvh - 28px); padding: 74px 14px 128px; justify-content: flex-start; }
  .title-branding { width: min(94vw, 500px); padding: 5px 10px 8px; border-radius: 24px; background: rgba(255,250,232,.78); }
  .title-logo { width: min(88vw, 470px); max-height: 26vh; }
  .title-tagline { font-size: clamp(.88rem, 4vw, 1.08rem); }
  .title-actions { margin-top: 12px; gap: 8px; }
  .enter-shop-button { min-width: min(280px, 82vw); min-height: 62px; padding: 7px 22px 7px 12px; border-width: 3px; border-bottom-width: 8px; border-radius: 21px; font-size: 1.25rem; }
  .enter-shop-button img { width: 46px; height: 46px; }
  .title-highlights { max-width: 94vw; flex-wrap: wrap; gap: 5px; }
  .title-highlights li { min-height: 29px; padding: 3px 8px; font-size: .68rem; }
  .title-tools { top: 10px; right: 10px; gap: 6px; }
  .asset-icon-button { width: 46px; height: 46px; padding: 7px; border-width: 2px; border-bottom-width: 5px; border-radius: 15px; }
  .title-mascot { width: min(34vw, 155px); left: 5px; bottom: -5px; }
  .title-mascot-bubble { left: 66%; bottom: 72%; padding: 6px 8px; font-size: .65rem; }
  .title-version { right: 9px; bottom: 7px; font-size: .62rem; }
  .title-decor { width: 48px; height: 48px; opacity: .58; }
  .title-star { top: 23%; left: 2%; }
  .title-sparkle { top: 32%; right: 3%; }
}

@media (max-width: 390px) and (orientation: portrait) {
  .title-stage { padding-top: 70px; padding-bottom: 112px; }
  .title-logo { max-height: 23vh; }
  .title-highlights li { font-size: .62rem; }
  .title-mascot { width: 122px; }
  .title-mascot-bubble { left: 58%; bottom: 73%; padding: 4px 6px; border-width: 2px; font-size: .56rem; }
}

html.text-large .main-hub-panel { overflow: auto; }
@media (max-height: 600px) and (orientation: landscape) {
  html.text-large .hub-menu-card { font-size: .62rem; }
  html.text-large .hub-category-card strong { font-size: .9rem; }
}

/* v1.1: Home, pencapaian dan notifikasi */
.menu-secondary-actions .how-to-button { padding: 6px 10px; font-size: .86rem; }
.menu-secondary-actions { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); }
.daily-menu-button { border-color: #ffe28a; background: rgba(255,200,61,.2); }

.daily-screen { display: grid; place-items: center; min-height: calc(100vh - 48px); }
.daily-panel { width: min(900px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 24px; border: 6px solid #fff; border-radius: 32px; background: #fff8d8; box-shadow: var(--shadow); text-align: center; scrollbar-color: #e5b838 transparent; }
.daily-sun { font-size: 4.5rem; line-height: 1; animation: dailySun 3s ease-in-out infinite; }
.daily-panel h2 { margin: 4px 0 8px; color: var(--purple); font-size: clamp(2.3rem, 5vw, 3.7rem); }
.daily-date { margin: 0 0 12px; color: #8b5a00; font-size: 1.3rem; font-weight: 900; text-transform: capitalize; }
.daily-calendar-section h3, .daily-week-summary h3 { margin: 0 0 8px; color: var(--purple-dark); font-size: 1rem; }
.daily-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.daily-day { display: grid; place-items: center; min-width: 0; padding: 7px 3px; border: 2px solid #e5d59e; border-bottom-width: 5px; border-radius: 14px; background: #fffdf5; color: #6d7390; }
.daily-day.completed { border-color: #8ed09a; background: #efffeb; color: #276c3b; }
.daily-day.today { outline: 3px solid var(--yellow); outline-offset: 1px; }
.daily-day strong { font-size: .75rem; }
.daily-day small { font-weight: 900; }
.daily-day span { min-height: 22px; font-size: 1.05rem; }
.daily-day em { min-height: 24px; font-size: .57rem; font-weight: 900; font-style: normal; line-height: 1.05; }
.daily-day b { margin-top: 2px; font-size: .7rem; }
.daily-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 11px; }
.daily-summary > div { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 10px; padding: 14px; border: 3px solid #f2cf68; border-bottom-width: 7px; border-radius: 19px; background: #fff; text-align: left; }
.daily-summary span { grid-row: 1 / 3; align-self: center; font-size: 2.1rem; }
.daily-summary small { color: #6d7390; font-weight: 900; }
.daily-summary strong { color: var(--purple-dark); font-size: 1.2rem; }
.daily-week-summary { display: grid; grid-template-columns: auto 1fr 1fr; align-items: center; gap: 7px 12px; margin-top: 10px; padding: 9px 12px; border: 3px dashed #e5c65f; border-radius: 15px; background: rgba(255,255,255,.55); text-align: left; }
.daily-week-summary h3 { grid-column: 1 / -1; margin: 0; }
.daily-week-summary > div { display: flex; justify-content: space-between; gap: 8px; color: #6d7390; font-size: .78rem; font-weight: 900; }
.daily-week-summary > div strong { color: var(--purple-dark); }
.daily-week-summary p { grid-column: 2 / -1; margin: 0; color: #397540; font-size: .75rem; font-weight: 900; }
.daily-status { margin: 10px 0; color: #397540; font-weight: 900; }
.daily-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 11px; }
@keyframes dailySun { 0%,100% { transform: rotate(-3deg) scale(1); } 50% { transform: rotate(3deg) scale(1.04); } }
.home-game-button { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 3px solid #fff; border-bottom: 6px solid #44308e; border-radius: 15px; background: #8066dc; color: #fff; cursor: pointer; box-shadow: 0 4px 0 rgba(42,25,112,.22); font-size: 1.45rem; transition: transform .12s, filter .12s; }
.home-game-button:hover:not(:disabled), .home-game-button:focus-visible { filter: brightness(1.12); outline: 3px solid var(--yellow); outline-offset: 2px; transform: translateY(-2px); }
.home-game-button:disabled { cursor: default; filter: grayscale(.45); opacity: .55; }

.home-modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(31,20,77,.58); backdrop-filter: blur(3px); }
.home-modal.hidden { display: none; }
.home-modal-card { width: min(440px, 100%); padding: 28px; border: 6px solid #fff; border-radius: 28px; background: var(--cream); box-shadow: var(--shadow); text-align: center; }
.home-modal-card > div:first-child { font-size: 3.5rem; }
.home-modal-card h2 { margin: 6px 0; color: var(--purple); font-size: 2rem; }
.home-modal-card p { margin: 0 0 20px; color: #5f6280; font-weight: 800; }
.home-modal-card > div:last-child { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.achievements-screen { min-height: calc(100vh - 48px); }
.achievements-panel { width: 100%; padding: 22px; border: 5px solid #fff; border-radius: 30px; background: linear-gradient(180deg, #fffdf2 0%, var(--cream) 100%); box-shadow: var(--shadow); }
.achievement-collection-summary { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 16px; margin-bottom: 15px; }
.achievement-summary-copy, .achievement-featured { min-width: 0; border: 3px solid #e5d8ff; border-bottom-width: 7px; border-radius: 22px; background: #fff; box-shadow: 0 5px 0 rgba(73,49,157,.1); }
.achievement-summary-copy { padding: 16px 18px; background: radial-gradient(circle at 90% 15%, rgba(255,216,75,.2), transparent 28%), #fff; }
.achievement-summary-kicker, .achievement-featured small { margin: 0 0 3px; color: #8b5a00; font-size: .69rem; font-weight: 1000; letter-spacing: .08em; }
.achievement-summary-copy h3 { margin: 0 0 10px; color: var(--purple-dark); font-size: clamp(1rem, 2vw, 1.35rem); }
.achievement-summary-track, .achievement-detail-progress-track { overflow: hidden; height: 12px; border: 2px solid #d9caf7; border-radius: 999px; background: #eee8ff; }
.achievement-summary-track span, .achievement-detail-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffb520, #ffe354); transition: width .3s ease; }
.achievement-featured { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 12px; padding: 10px 14px; border-color: #efc44d; background: linear-gradient(135deg, #fff8d1, #fff); }
.achievement-featured-art { position: relative; width: 72px; height: 72px; }
.achievement-featured-art .achievement-art-image { width: 100%; height: 100%; object-fit: contain; }
.achievement-featured > div:last-child { display: grid; min-width: 0; }
.achievement-featured strong { overflow: hidden; color: var(--purple-dark); font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.achievement-featured span:not(.achievement-art-fallback) { color: #69697c; font-size: .72rem; font-weight: 800; }
.achievement-featured-empty { display: grid; place-items: center; width: 62px; height: 62px; border: 3px dashed #c7b9e7; border-radius: 50%; color: #9b88c5; font-size: 2rem; }
.achievement-filters { display: flex; gap: 7px; margin-bottom: 15px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.achievement-filter { flex: 0 0 auto; min-height: 38px; padding: 7px 14px; border: 2px solid #d8cdf0; border-radius: 999px; background: #fff; color: var(--purple-dark); font: inherit; font-size: .78rem; font-weight: 950; cursor: pointer; }
.achievement-filter:hover, .achievement-filter:focus-visible { border-color: var(--purple); outline: 3px solid rgba(255,216,75,.72); outline-offset: 1px; }
.achievement-filter.active { border-color: var(--purple-dark); background: var(--purple); color: #fff; box-shadow: 0 3px 0 #3f2a8c; }
.achievements-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.achievement-card { position: relative; display: grid; justify-items: center; align-content: start; min-width: 0; min-height: 260px; padding: 12px 10px 13px; border: 3px solid #d7cdef; border-bottom-width: 7px; border-radius: 22px; background: #fff; color: #525266; font: inherit; text-align: center; cursor: pointer; box-shadow: 0 5px 0 rgba(73,49,157,.12); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.achievement-card:hover, .achievement-card:focus-visible { z-index: 1; outline: 4px solid rgba(255,216,75,.72); outline-offset: 2px; transform: translateY(-3px); box-shadow: 0 9px 0 rgba(73,49,157,.13); }
.achievement-card.unlocked { border-color: #e8b933; background: linear-gradient(180deg, #fffdf2 0%, #fff7c8 100%); }
.achievement-card.in-progress { border-color: #75bce5; background: linear-gradient(180deg, #fff 0%, #edf8ff 100%); }
.achievement-card.locked { border-color: #c7c4d1; background: #f6f4f2; }
.achievement-card-art { position: relative; display: grid; place-items: center; width: min(130px, 78%); aspect-ratio: 1; margin-bottom: 5px; }
.achievement-art-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.achievement-art-image.hidden { display: none; }
.achievement-art-fallback { display: none; place-items: center; width: 100%; height: 100%; font-size: 3.5rem; }
.achievement-art-fallback.is-visible { display: grid; }
.achievement-card.in-progress .achievement-art-image { filter: saturate(.58); opacity: .72; }
.achievement-card.locked .achievement-art-image { filter: grayscale(1) saturate(.05) brightness(.55); opacity: .55; }
.achievement-card-lock, .achievement-detail-lock { position: absolute; right: 2px; bottom: 5px; display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid #fff; border-radius: 50%; background: #625d72; box-shadow: 0 3px 7px rgba(31,20,77,.25); font-size: 1rem; }
.achievement-card-category { margin-top: 1px; color: #8b5a00; font-size: .61rem; font-weight: 1000; letter-spacing: .075em; text-transform: uppercase; }
.achievement-card-name { min-height: 2.3em; margin: 3px 0 5px; color: var(--purple-dark); font-size: .94rem; line-height: 1.12; }
.achievement-card-mini-progress { overflow: hidden; width: 88%; height: 7px; margin: 1px 0 3px; border-radius: 99px; background: #d9eefa; }
.achievement-card-mini-progress i { display: block; height: 100%; border-radius: inherit; background: #2189cf; }
.achievement-card small { min-height: 1.1em; margin-bottom: 4px; color: #376a88; font-size: .61rem; font-weight: 900; line-height: 1.12; }
.achievement-card-status { margin-top: auto; padding: 4px 8px; border-radius: 999px; font-size: .68rem; font-weight: 950; }
.achievement-card-status.unlocked { background: #dcf5d7; color: #2e7134; }
.achievement-card-status.in-progress { background: #dcedfa; color: #276887; }
.achievement-card-status.locked { background: #e7e5e9; color: #686472; }

.achievement-detail-modal { position: fixed; z-index: 130; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(31,20,77,.64); backdrop-filter: blur(5px); }
.achievement-detail-modal.hidden { display: none; }
.achievement-detail-card { position: relative; width: min(470px, 100%); max-height: min(690px, calc(100vh - 28px)); overflow-y: auto; padding: 24px 28px 26px; border: 5px solid #fff; border-radius: 30px; background: radial-gradient(circle at 50% 0, #fff6c6 0, transparent 34%), var(--cream); box-shadow: 0 22px 60px rgba(31,20,77,.4); text-align: center; }
.achievement-detail-close { position: absolute; z-index: 2; top: 12px; right: 12px; display: grid; place-items: center; width: 42px; height: 42px; border: 3px solid #fff; border-radius: 50%; background: var(--purple); color: #fff; box-shadow: 0 4px 0 #3f2a8c; font-size: 1.6rem; font-weight: 900; cursor: pointer; }
.achievement-detail-close:focus-visible { outline: 4px solid var(--yellow); outline-offset: 2px; }
.achievement-detail-artwork { position: relative; width: min(230px, 64vw); aspect-ratio: 1; margin: 0 auto 4px; }
.achievement-detail-artwork .achievement-art-image { width: 100%; height: 100%; }
.achievement-detail-artwork.in-progress .achievement-art-image { filter: saturate(.6); opacity: .75; }
.achievement-detail-artwork.locked .achievement-art-image { filter: grayscale(1) brightness(.55); opacity: .55; }
.achievement-detail-lock { right: 10px; bottom: 12px; width: 44px; height: 44px; font-size: 1.25rem; }
.achievement-detail-category { margin: 0; color: #8b5a00; font-size: .72rem; font-weight: 1000; letter-spacing: .09em; text-transform: uppercase; }
.achievement-detail-card h2 { margin: 3px 0 7px; color: var(--purple-dark); font-size: clamp(1.55rem, 4vw, 2.15rem); }
.achievement-detail-card > p:not(.achievement-detail-category):not(.achievement-detail-date) { margin: 0 auto 12px; color: #58586d; font-weight: 750; line-height: 1.4; }
.achievement-detail-status { display: inline-block; margin: 2px 0 10px; padding: 6px 13px; border-radius: 999px; font-size: .82rem; font-weight: 950; }
.achievement-detail-status.unlocked { background: #dcf5d7; color: #2e7134; }
.achievement-detail-status.in-progress { background: #dcedfa; color: #276887; }
.achievement-detail-status.locked { background: #e7e5e9; color: #686472; }
.achievement-detail-progress { margin: 0 auto 10px; }
.achievement-detail-progress.hidden { display: none; }
.achievement-detail-progress strong { display: block; margin-top: 5px; color: #536274; font-size: .75rem; }
.achievement-detail-date { margin: 8px 0 16px; color: #6b6478; font-size: .78rem; font-weight: 800; }
.achievement-detail-card .play-again-button { margin-inline: auto; }
.achievement-detail-card .play-again-button.hidden { display: none; }

.achievement-toast { position: fixed; z-index: 120; right: 18px; bottom: 18px; display: grid; width: min(330px, calc(100% - 36px)); padding: 14px 16px; border: 4px solid var(--yellow); border-radius: 18px; background: #fffdf2; box-shadow: 0 9px 24px rgba(31,20,77,.28); animation: toastArrive .3s ease both; }
.achievement-toast.hidden { display: none; }
.achievement-toast strong { color: #8b5a00; font-size: .88rem; }
.achievement-toast span { margin: 3px 0; color: var(--purple-dark); font-size: 1.2rem; font-weight: 900; }
.achievement-toast small { color: #5f6280; font-weight: 700; line-height: 1.25; }
@keyframes toastArrive { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
  .achievements-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .home-game-button { width: 43px; height: 43px; }
  .achievements-panel { padding: 14px; }
  .achievement-collection-summary { grid-template-columns: 1fr; gap: 9px; }
  .achievement-summary-copy { padding: 11px 14px; }
  .achievement-featured { min-height: 78px; }
  .achievements-grid { gap: 9px; }
  .achievement-card { min-height: 225px; padding: 9px 7px 11px; }
  .achievement-card-art { width: min(110px, 76%); }
  .daily-panel { padding: 22px; }
  .daily-calendar { gap: 4px; }
  .daily-day { padding-inline: 2px; }
}

@media (max-width: 620px) {
  .achievements-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .achievement-featured { grid-template-columns: 58px 1fr; padding: 8px 10px; }
  .achievement-featured-art { width: 58px; height: 58px; }
  .achievement-card { min-height: 220px; }
  .achievement-detail-card { padding: 18px 16px 21px; border-radius: 24px; }
  .achievement-detail-artwork { width: min(190px, 58vw); }
}

@media (max-width: 390px) {
  .achievements-panel { padding: 10px; border-width: 4px; }
  .achievement-summary-copy h3 { font-size: .93rem; }
  .achievement-filters { margin-bottom: 10px; }
  .achievement-filter { min-height: 36px; padding: 6px 11px; font-size: .7rem; }
  .achievements-grid { gap: 7px; }
  .achievement-card { min-height: 202px; padding: 7px 5px 9px; border-width: 2px; border-bottom-width: 5px; border-radius: 17px; }
  .achievement-card-art { width: min(94px, 72%); }
  .achievement-card-name { font-size: .82rem; }
  .achievement-card-category, .achievement-card small { font-size: .54rem; }
  .achievement-card-status { padding: 3px 6px; font-size: .59rem; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .menu-secondary-actions { gap: 4px; }
  .menu-secondary-actions { grid-template-columns: repeat(4, minmax(0, auto)); }
  .menu-secondary-actions .how-to-button { min-height: 36px; padding: 4px 7px; font-size: .7rem; }
  .home-game-button { width: 38px; height: 38px; border-width: 2px; border-bottom-width: 4px; font-size: 1.1rem; }
  .home-modal-card { padding: 14px; }
  .home-modal-card > div:first-child { font-size: 2.2rem; }
  .home-modal-card h2 { font-size: 1.5rem; }
  .home-modal-card p { margin-bottom: 10px; }
  .achievements-screen { min-height: calc(100vh - 12px); }
  .achievements-panel { padding: 7px 10px; border-width: 4px; }
  .achievements-panel .screen-heading { margin-bottom: 4px; }
  .achievement-collection-summary { grid-template-columns: 1.2fr .8fr; gap: 7px; margin-bottom: 6px; }
  .achievement-summary-copy { padding: 6px 9px; }
  .achievement-summary-copy h3 { margin-bottom: 4px; font-size: .78rem; }
  .achievement-summary-kicker, .achievement-featured small { font-size: .52rem; }
  .achievement-summary-track { height: 8px; }
  .achievement-featured { grid-template-columns: 43px 1fr; min-height: 0; padding: 4px 7px; border-width: 2px; border-bottom-width: 4px; }
  .achievement-featured-art { width: 43px; height: 43px; }
  .achievement-featured strong { font-size: .72rem; }
  .achievement-featured span:not(.achievement-art-fallback) { font-size: .52rem; }
  .achievement-filters { gap: 4px; margin-bottom: 5px; padding-bottom: 3px; }
  .achievement-filter { min-height: 29px; padding: 3px 8px; border-width: 1px; font-size: .56rem; }
  .achievements-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .achievement-card { min-height: 150px; padding: 4px 3px 6px; border-width: 2px; border-bottom-width: 4px; border-radius: 14px; }
  .achievement-card-art { width: min(76px, 70%); margin-bottom: 1px; }
  .achievement-card-lock { width: 23px; height: 23px; font-size: .64rem; }
  .achievement-card-category { font-size: .43rem; }
  .achievement-card-name { min-height: 2.15em; margin: 1px 0 2px; font-size: .61rem; }
  .achievement-card small { margin-bottom: 1px; font-size: .43rem; }
  .achievement-card-status { padding: 2px 4px; font-size: .46rem; }
  .achievement-toast { right: 8px; bottom: 8px; padding: 8px 10px; }
  .daily-screen { min-height: calc(100vh - 12px); }
  .daily-panel { width: min(720px, 100%); padding: 8px 16px; border-width: 4px; }
  .daily-sun { font-size: 2.2rem; }
  .daily-panel > .eyebrow { display: none; }
  .daily-panel h2 { margin: 1px 0 3px; font-size: 2rem; }
  .daily-date { margin-bottom: 7px; font-size: .95rem; }
  .daily-calendar-section h3 { margin-bottom: 3px; font-size: .7rem; }
  .daily-calendar { gap: 4px; }
  .daily-day { padding: 3px 1px; border-width: 1px; border-bottom-width: 3px; border-radius: 9px; }
  .daily-day strong { font-size: .55rem; }
  .daily-day small { font-size: .55rem; }
  .daily-day span { min-height: 16px; font-size: .75rem; }
  .daily-day em { min-height: 0; font-size: .43rem; }
  .daily-day b { font-size: .52rem; }
  .daily-summary { gap: 5px; margin-top: 5px; }
  .daily-summary > div { padding: 6px 9px; border-width: 2px; border-bottom-width: 5px; }
  .daily-summary span { font-size: 1.4rem; }
  .daily-summary small { font-size: .68rem; }
  .daily-summary strong { font-size: .9rem; }
  .daily-week-summary { grid-template-columns: 1fr 1fr; gap: 3px 8px; margin-top: 5px; padding: 4px 7px; border-width: 2px; }
  .daily-week-summary h3 { grid-column: 1 / -1; font-size: .65rem; }
  .daily-week-summary > div { font-size: .58rem; }
  .daily-week-summary p { grid-column: 1 / -1; font-size: .58rem; text-align: center; }
  .daily-status { margin: 5px 0; font-size: .72rem; }
  .daily-actions .play-again-button, .daily-actions .secondary-button { padding: 7px 15px; font-size: 1rem; }
}

/* Footer menu berada dalam document flow supaya bubble tidak menutup butang. */
.menu-player-greeting {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: -9px auto 10px;
  padding: 5px 12px;
  border: 2px solid var(--player-accent-soft);
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  color: #fff;
}
.menu-player-greeting > span:first-child { font-size: 1.45rem; }
.menu-player-copy { display: grid; min-width: 0; text-align: left; line-height: 1.1; }
.menu-player-greeting strong { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-player-copy small { justify-self: start; max-width: 220px; margin-top: 3px; overflow: hidden; padding: 3px 8px; border: 2px solid var(--player-accent); border-radius: 999px; background: #fff8df; color: #2f215f; font-size: .74rem; font-weight: 950; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 2px 0 rgba(47,33,95,.15); }
.menu-footer-zone { display: flex; align-items: flex-end; justify-content: center; gap: 18px; min-height: 82px; margin: 9px auto 0; }
.menu-footer-zone .menu-helper { position: relative; bottom: auto; left: auto; width: 235px; height: 82px; scale: 1; transform: none; transform-origin: initial; }
.menu-footer-zone .helper-mascot { left: 0; }
.menu-footer-zone .helper-bubble { right: auto; bottom: 44px; left: 52px; width: 175px; }
.menu-footer-zone .mini-shelf { width: 300px; margin: 0 0 5px; padding-left: 0; font-size: 1.45rem; }

.profile-screen { display: grid; place-items: center; min-height: calc(100vh - 48px); }
.profile-panel { width: min(800px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 24px; border: 6px solid var(--player-accent-soft); border-radius: 32px; background: var(--cream); box-shadow: var(--shadow); text-align: center; scrollbar-color: var(--player-accent) transparent; }
.profile-panel h2 { margin: 3px 0 12px; color: var(--player-accent); font-size: clamp(2.2rem, 5vw, 3.4rem); }
.profile-preview { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 0 auto 16px; }
.profile-preview > span { display: grid; place-items: center; width: 72px; height: 72px; border: 4px solid var(--player-accent); border-radius: 50%; background: var(--player-accent-soft); font-size: 2.8rem; box-shadow: 0 5px 0 var(--player-accent-dark); }
.profile-preview strong { max-width: 300px; overflow-wrap: anywhere; color: var(--player-accent-dark); font-size: 1.6rem; }
.profile-name-label { display: block; margin-bottom: 6px; color: var(--purple-dark); font-weight: 900; }
.profile-name-input { width: min(390px, 100%); padding: 12px 15px; border: 4px solid #d7cdef; border-radius: 15px; background: #fff; color: var(--ink); font: inherit; font-size: 1.15rem; font-weight: 800; text-align: center; }
.profile-name-input:focus { border-color: var(--yellow); outline: 3px solid rgba(255,200,61,.35); }
.avatar-picker { margin: 14px 0; padding: 10px; border: 3px dashed var(--player-accent); border-radius: 18px; }
.avatar-picker legend { padding-inline: 9px; color: var(--purple-dark); font-weight: 900; }
.avatar-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.avatar-option { display: grid; place-items: center; width: 78px; min-height: 74px; padding: 5px; border: 3px solid #d7cdef; border-bottom-width: 6px; border-radius: 17px; background: #fff; cursor: pointer; transition: transform .12s, background .12s; }
.avatar-option span { font-size: 1.8rem; line-height: 1; }
.avatar-option:hover, .avatar-option:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; transform: translateY(-2px); }
.avatar-option.selected, .theme-option.selected { border-color: var(--player-accent); background: var(--player-accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--player-accent) 22%, transparent); }
.profile-customisation-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.theme-picker, .badge-picker { min-width: 0; margin: 0; padding: 10px; border: 3px dashed var(--player-accent); border-radius: 18px; }
.theme-picker legend, .badge-picker legend { padding-inline: 8px; color: var(--player-accent-dark); font-weight: 900; }
.theme-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.theme-option { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px; border: 3px solid #d7cdef; border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; font: inherit; font-size: .8rem; font-weight: 900; }
.theme-option > span { width: 17px; height: 17px; border: 2px solid #fff; border-radius: 50%; background: var(--theme-swatch); box-shadow: 0 0 0 1px #889; }
.badge-picker { display: grid; align-content: center; }
.badge-picker select { width: 100%; padding: 9px; border: 3px solid var(--player-accent); border-radius: 11px; background: #fff; color: var(--ink); font: inherit; font-weight: 800; }
.profile-badge-section { margin-bottom: 12px; }
.profile-badge-section h3 { margin: 0 0 7px; color: var(--player-accent-dark); font-size: 1rem; }
.profile-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 29px; }
.profile-badges p { margin: 3px 0; color: #6d7390; font-size: .85rem; font-weight: 800; }
.profile-badge-chip { padding: 5px 9px; border: 2px solid var(--player-accent); border-radius: 999px; background: var(--player-accent-soft); color: var(--player-accent-dark); font-size: .72rem; font-weight: 900; }
.profile-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 11px; }

@media (max-width: 820px) {
  .menu-footer-zone { gap: 8px; }
  .menu-footer-zone .menu-helper { width: 215px; }
  .menu-footer-zone .helper-bubble { width: 158px; }
  .menu-footer-zone .mini-shelf { width: 255px; gap: 14px; }
  .profile-panel { padding: 22px; }
  .profile-customisation-row { gap: 8px; }
}

@media (max-width: 580px) {
  .menu-footer-zone .menu-helper { display: block; width: 205px; }
  .menu-footer-zone .mini-shelf { display: none; }
  .profile-panel { padding: 18px 14px; }
  .avatar-option { width: 72px; }
  .profile-customisation-row { grid-template-columns: 1fr; }
}

@media (min-width: 821px) and (max-height: 820px) {
  .menu-player-greeting { margin-bottom: 7px; padding-block: 3px; }
  .menu-footer-zone { min-height: 66px; margin-top: 4px; }
  .menu-footer-zone .menu-helper { width: 220px; height: 66px; scale: .86; transform-origin: bottom right; }
  .menu-footer-zone .mini-shelf { margin-bottom: 2px; font-size: 1.25rem; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .menu-player-greeting { margin: -4px auto 5px; padding: 2px 9px; font-size: .78rem; }
  .menu-footer-zone { display: none; }
  .profile-screen { min-height: calc(100vh - 12px); }
  .profile-panel { width: min(720px, 100%); padding: 8px 18px; border-width: 4px; }
  .profile-panel h2 { margin-bottom: 5px; font-size: 2rem; }
  .profile-panel > .eyebrow { display: none; }
  .profile-preview { margin-bottom: 6px; }
  .profile-preview > span { width: 48px; height: 48px; border-width: 3px; font-size: 2rem; }
  .profile-preview strong { font-size: 1.2rem; }
  .profile-name-label { margin-bottom: 3px; font-size: .8rem; }
  .profile-name-input { padding: 7px 10px; border-width: 3px; font-size: .95rem; }
  .avatar-picker { margin: 7px 0; padding: 6px; }
  .avatar-option { width: 68px; min-height: 43px; border-width: 2px; border-bottom-width: 4px; }
  .avatar-option span { font-size: 1.35rem; }
  .avatar-option small { font-size: .48rem; }
  .profile-customisation-row { grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 5px; }
  .theme-picker, .badge-picker { padding: 4px; border-width: 2px; }
  .theme-picker legend, .badge-picker legend { font-size: .68rem; }
  .theme-option { padding: 3px; border-width: 2px; font-size: .6rem; }
  .theme-option > span { width: 12px; height: 12px; }
  .badge-picker select { padding: 4px; border-width: 2px; font-size: .65rem; }
  .profile-badge-section { margin-bottom: 5px; }
  .profile-badge-section h3 { margin-bottom: 3px; font-size: .72rem; }
  .profile-badge-chip { padding: 3px 6px; font-size: .55rem; }
  .profile-badges p { font-size: .65rem; }
  .profile-actions .play-again-button, .profile-actions .secondary-button { padding: 7px 18px; font-size: 1rem; }
}

@media (max-height: 820px) {
  .game-over { min-height: calc(100vh - 24px); }
  .game-over-card { padding: 20px 24px; }
  .game-over-icon { font-size: 4rem; line-height: 1; }
  .game-over h2 { margin: 4px 0 10px; font-size: clamp(2.2rem, 5vw, 3rem); line-height: 1.05; }
  .result-level { margin: 0 0 6px; }
  .final-label { font-size: 1.1rem; }
  .final-score { margin: 3px 0 17px; font-size: 2.8rem; }
  .session-stars { margin-top: -12px; font-size: 1.65rem; }
  .final-accuracy { margin: -10px 0 7px; font-size: 1.3rem; }
  .final-best { margin: 0 0 8px; font-size: 1.15rem; }
  .final-rating { margin: 0 0 13px; font-size: 1.4rem; }
  .level-unlocked { margin: 0 0 12px; font-size: 1.2rem; }
  .play-again-button { padding: 13px 26px; font-size: 1.35rem; }
  .secondary-button, .next-level-button { padding: 12px 18px; font-size: 1.05rem; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .game-over { min-height: calc(100vh - 12px); }
  .game-over-card { width: min(760px, 100%); padding: 9px 16px; border-width: 4px; border-radius: 24px; }
  .game-over-icon { font-size: 2.25rem; }
  .game-over-card > .eyebrow { font-size: .65rem; }
  .game-over h2 { margin: 1px 0 3px; font-size: 2rem; white-space: nowrap; }
  .result-level { margin-bottom: 2px; font-size: 1rem; }
  .final-label { display: none; }
  .final-score { margin: 0 0 9px; font-size: 2rem; line-height: 1; }
  .session-stars { margin: -5px 0 3px; font-size: 1.25rem; }
  .new-star-record { margin-bottom: 3px; font-size: .82rem; }
  .final-accuracy { margin: 0 0 3px; font-size: 1rem; }
  .final-best { margin-bottom: 3px; font-size: .95rem; }
  .final-rating { margin-bottom: 5px; font-size: 1.05rem; }
  .level-unlocked { margin-bottom: 6px; font-size: 1rem; }
  .result-actions { gap: 7px; }
  .play-again-button, .secondary-button, .next-level-button { min-height: 44px; padding: 7px 15px; border-bottom-width: 5px; font-size: 1rem; }
}

@media (max-width: 820px) {
  .settings-panel { padding: 18px; }
  .settings-toggle-list { gap: 6px; }
  .settings-toggle { padding: 9px; }
}

@media (max-height: 600px) and (orientation: landscape) {
  html.text-large { font-size: 108%; }
  .settings-screen { min-height: calc(100vh - 12px); }
  .settings-panel { width: min(780px, 100%); padding: 7px 14px; border-width: 4px; }
  .settings-panel > .eyebrow { display: none; }
  .settings-panel h2 { margin: 1px 0 4px; font-size: 1.85rem; }
  .settings-group { margin-bottom: 5px; padding: 4px; border-width: 2px; }
  .settings-group legend { font-size: .7rem; }
  .settings-choice-row { gap: 5px; }
  .settings-choice-row span { padding: 4px; border-width: 2px; border-bottom-width: 4px; font-size: .7rem; }
  .settings-toggle-list { gap: 5px; }
  .settings-toggle { padding: 6px; border-width: 2px; border-radius: 11px; }
  .settings-toggle strong { font-size: .68rem; }
  .settings-toggle small { font-size: .53rem; }
  .settings-toggle i { width: 40px; height: 23px; border-width: 2px; }
  .settings-toggle i::after { width: 20px; height: 17px; font-size: .36rem; }
  .settings-toggle input:checked + i::after { left: 15px; }
  .system-motion-note { margin: 3px 0; font-size: .58rem; }
  .parent-info { margin: 5px 0; padding: 5px 9px; border-width: 2px; }
  .parent-info h3 { margin-bottom: 2px; font-size: .68rem; }
  .parent-info ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-left: 13px; font-size: .52rem; line-height: 1.2; }
  .settings-actions .play-again-button, .settings-actions .secondary-button { padding: 6px 16px; font-size: .85rem; }
}
/* Telefon portrait: kandungan mengecil mengikut viewport tanpa scroll mendatar. */
@media (max-width: 600px) and (orientation: portrait) {
  html, body { min-width: 0; max-width: 100%; overflow-x: hidden; }
  .game-shell { width: calc(100% - 12px); max-width: 100%; padding: 6px 0 12px; }
  .top-bar, .shop-scene { width: 100%; min-width: 0; }
  .game-stats { min-width: 0; }
  .stat-card, .progress-card { min-width: 0; }

  .main-hub-screen {
    min-height: calc(100vh - 12px);
    padding: 8px;
    place-items: start stretch;
    overflow-x: hidden;
    overflow-y: auto;
    border-width: 4px;
    border-radius: 24px;
  }
  .main-hub-panel {
    width: 100%;
    min-width: 0;
    padding: 12px;
    border-width: 4px;
    border-radius: 22px;
  }
  .main-hub-panel *, .daily-panel * { min-width: 0; }
  .main-hub-header {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    grid-template-areas: "back player" "title title";
    gap: 8px;
  }
  .main-hub-header > .asset-back-button { grid-area: back; }
  .main-hub-header > div:nth-child(2) { grid-area: title; }
  .main-hub-header > .hub-player { grid-area: player; }
  .main-hub-header .eyebrow { margin: 2px 0; font-size: .64rem; }
  .main-hub-header h2 { font-size: clamp(1.7rem, 9vw, 2.25rem); }
  .asset-back-button { max-width: 100%; min-height: 42px; padding: 4px 8px 6px 5px; }
  .asset-back-button img { width: 27px; height: 27px; flex: 0 0 27px; }
  .asset-back-button span { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
  .hub-player { width: 100%; padding: 5px 7px; }
  .hub-player > span:first-child { flex: 0 0 auto; font-size: 1.35rem; }
  .hub-player strong, .hub-player small { max-width: 100%; }
  .hub-progress { display: grid; width: 100%; max-width: none; margin: 8px 0 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .hub-progress > span { padding: 5px 7px; justify-content: center; flex-wrap: wrap; text-align: center; }
  .hub-progress small { font-size: .58rem; }
  .hub-progress strong { font-size: .78rem; }

  .hub-categories { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hub-category-card { width: 100%; min-height: 78px; padding: 7px 11px; gap: 10px; border-width: 3px; border-bottom-width: 6px; border-radius: 18px; }
  .hub-category-card img, .hub-category-emoji { width: 56px; height: 56px; flex-basis: 56px; }
  .hub-category-emoji { font-size: 2.55rem; }
  .hub-category-card > span:last-child { min-width: 0; }
  .hub-category-card strong { font-size: 1.08rem; }
  .hub-category-card small { font-size: .7rem; }
  .hub-support-grid { margin-top: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .hub-menu-card { width: 100%; min-height: 55px; padding: 5px 7px; gap: 6px; border-width: 2px; border-bottom-width: 5px; border-radius: 14px; font-size: .72rem; }
  .hub-menu-card img { width: 36px; height: 36px; flex-basis: 36px; }
  .hub-menu-card span { overflow-wrap: anywhere; }
  .hub-how-to-button { margin-top: 8px; }
  .main-hub-panel .how-to-card { position: static; max-width: 100%; }
  .how-to-grid { grid-template-columns: minmax(0, 1fr); }
  .how-to-grid p { padding: 5px 7px; }

  .daily-screen { min-height: calc(100vh - 12px); width: 100%; place-items: start stretch; }
  .daily-panel { width: 100%; max-width: 100%; max-height: calc(100vh - 12px); padding: 13px 10px; overflow-x: hidden; overflow-y: auto; border-width: 4px; border-radius: 23px; }
  .daily-sun { font-size: 2.8rem; }
  .daily-panel > .eyebrow { margin: 2px 0; font-size: .7rem; }
  .daily-panel h2 { margin: 2px 0 4px; font-size: clamp(1.8rem, 9vw, 2.45rem); }
  .daily-date { margin-bottom: 8px; font-size: .95rem; }
  .daily-calendar-section h3, .daily-week-summary h3 { margin-bottom: 5px; font-size: .8rem; }
  .daily-calendar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .daily-day { padding: 5px 2px; border-width: 2px; border-bottom-width: 4px; border-radius: 11px; }
  .daily-day strong, .daily-day small { font-size: .62rem; }
  .daily-day span { min-height: 18px; font-size: .88rem; }
  .daily-day em { min-height: 2.1em; font-size: .49rem; overflow-wrap: anywhere; }
  .daily-day b { font-size: .6rem; }
  .daily-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
  .daily-summary > div { padding: 8px; gap: 1px 6px; border-width: 2px; border-bottom-width: 5px; border-radius: 14px; }
  .daily-summary > div:last-child { grid-column: 1 / -1; }
  .daily-summary span { font-size: 1.45rem; }
  .daily-summary small { font-size: .65rem; }
  .daily-summary strong { font-size: .88rem; }
  .daily-week-summary { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 8px; margin-top: 8px; padding: 7px; }
  .daily-week-summary h3, .daily-week-summary p { grid-column: 1 / -1; }
  .daily-week-summary > div { display: grid; gap: 2px; font-size: .68rem; text-align: center; }
  .daily-week-summary p { font-size: .66rem; text-align: center; }
  .daily-status { margin: 7px 0; font-size: .78rem; }
  .daily-actions { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .daily-actions .play-again-button, .daily-actions .secondary-button { width: min(100%, 310px); margin: 0 auto; padding: 10px 12px; font-size: 1rem; }
}

@media (max-width: 400px) and (orientation: portrait) {
  .shop-header-logo { width: 46px; height: 46px; }
  h1 { font-size: 1.25rem; }
  .game-stats { gap: 6px; }
  .stat-card { gap: 4px; padding-inline: 6px; }
  .stat-card > span { font-size: 1.25rem; }
  .stat-card strong { max-width: 100%; font-size: .78rem; line-height: 1.05; overflow-wrap: anywhere; }
  .main-hub-screen { padding: 6px; }
  .main-hub-panel { padding: 9px; }
  .main-hub-header { grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); }
  .hub-progress small { width: 100%; }
  .daily-calendar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html.text-large .hub-support-grid, html.text-large .hub-progress, html.text-large .daily-summary { grid-template-columns: minmax(0, 1fr); }
  html.text-large .daily-summary > div:last-child { grid-column: auto; }
}

/* v1.5.1: 30 latihan dibahagikan mengikut kategori. */
.category-star-total { color: #49319d; font-weight: 1000; }
.practice-screen { max-height: calc(100vh - 48px); overflow-x: hidden; overflow-y: auto; }
.practice-grid { display: block; }
.practice-group { margin: 0 0 20px; padding: 13px; border: 3px solid #c9bdf0; border-radius: 22px; background: rgba(255,255,255,.58); }
.practice-group:last-child { margin-bottom: 0; }
.practice-group > h3 { display: flex; align-items: center; gap: .4em; margin: 0 0 10px; color: var(--purple-dark); font-size: 1.05rem; text-align: left; }
.practice-group > h3 .practice-category-icon { width: 1.8em; height: 1.8em; }
.practice-group-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.practice-group-grid .practice-card { min-width: 0; min-height: 112px; }

@media (max-width: 820px) {
  .practice-group-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-height: 600px) and (orientation: landscape) {
  .practice-screen { max-height: calc(100vh - 12px); }
  .practice-group { margin-bottom: 9px; padding: 6px; border-width: 2px; border-radius: 15px; }
  .practice-group > h3 { margin-bottom: 5px; font-size: .7rem; }
  .practice-group-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .practice-group-grid .practice-card { min-height: 93px; }
}

@media (max-width: 600px) and (orientation: portrait) {
  .practice-screen { min-height: calc(100vh - 12px); max-height: calc(100vh - 12px); padding: 10px 8px; }
  .practice-group { margin-bottom: 11px; padding: 8px; border-radius: 16px; }
  .practice-group > h3 { margin-bottom: 7px; font-size: .82rem; }
  .practice-group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .practice-group-grid .practice-card { min-height: 98px; padding: 7px 5px; }
}

@media (max-width: 400px) and (orientation: portrait) {
  html.text-large .practice-group-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Mobile portrait: gameplay Ukuran dan latihan Ukuran menggunakan susunan bertingkat. */
@media (max-width: 640px) and (orientation: portrait) {
  .shop-scene {
    max-width: 100%;
    margin-top: 8px;
    padding: 0 8px 12px;
    overflow-x: clip;
  }

  .shop-decoration {
    margin: 0 -8px 8px;
    padding-block: 5px;
    border-bottom-width: 4px;
    font-size: 1.25rem;
  }

  .practice-badge {
    top: 6px;
    right: 8px;
    max-width: calc(100% - 16px);
    padding: 3px 7px;
    border-width: 2px;
    font-size: .62rem;
    white-space: nowrap;
  }

  .customer-panel {
    width: 100%;
    min-width: 0;
    gap: 8px;
    margin-bottom: 9px;
    padding-inline: 1px;
  }

  .customer-avatar,
  .customer-avatar.shop-dialog-badge {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    padding: 6px;
    border-width: 4px;
  }

  .customer-avatar.shop-dialog-badge {
    box-shadow: inset 0 0 0 3px #f2c744, 0 4px 0 rgba(40,34,82,.18), 0 7px 12px rgba(40,34,82,.14);
  }

  .customer-avatar.shop-dialog-badge::after {
    top: 6px;
    left: 10px;
  }

  .speech-bubble {
    width: auto;
    min-width: 0;
    max-width: calc(100% - 72px);
    padding: 9px 11px;
    border-width: 3px;
    border-radius: 16px;
  }

  .speech-bubble::before {
    left: -10px;
    top: 22px;
    width: 17px;
    height: 17px;
    border-width: 0 0 3px 3px;
  }

  .customer-label {
    margin-bottom: 2px;
    font-size: .72rem;
  }

  .speech-bubble h2 {
    max-width: 100%;
    font-size: clamp(.98rem, 4.5vw, 1.18rem);
    line-height: 1.22;
    overflow-wrap: anywhere;
  }

  .items-and-question.measurement-question {
    display: grid;
    width: 100%;
    min-width: 0;
    padding: 7px;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
  }

  .items-and-question.measurement-question > * {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .items-and-question.measurement-question .items-list {
    display: block;
    min-width: 0;
  }

  .measurement-display {
    min-height: 0;
    padding: 9px 10px;
    grid-template-columns: minmax(90px, auto) minmax(0, 1fr);
    place-items: center;
    align-content: center;
    gap: 9px;
    border-width: 3px;
    border-bottom-width: 6px;
    border-radius: 18px;
    text-align: left;
  }

  .measurement-visuals { gap: 5px; }
  .measurement-item-visual { width: 44px; }
  .measurement-item-emoji { font-size: clamp(2.65rem, 13vw, 3.45rem); }

  .measurement-copy {
    width: 100%;
    min-width: 0;
    gap: 4px;
  }

  .measurement-copy strong {
    font-size: clamp(.92rem, 4.2vw, 1.08rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .measurement-copy b {
    width: 100%;
    min-width: 0;
    padding: 5px 7px;
    border-width: 2px;
    border-radius: 11px;
    font-size: clamp(1.05rem, 5vw, 1.3rem);
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .items-and-question.measurement-question .question-card {
    min-width: 0;
    padding: 10px 8px;
    border-width: 3px;
    border-bottom-width: 6px;
    border-radius: 18px;
  }

  .items-and-question.measurement-question #question-text {
    max-width: 100%;
    margin-bottom: 9px;
    font-size: clamp(1.05rem, 5vw, 1.28rem);
    line-height: 1.18;
    overflow-wrap: anywhere;
  }

  .items-and-question.measurement-question .answers {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .items-and-question.measurement-question .answer-button {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    height: auto;
    padding: 7px 4px;
    border-width: 3px;
    border-bottom-width: 6px;
    border-radius: 14px;
    font-size: clamp(1rem, 4.6vw, 1.2rem);
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .items-and-question.measurement-question .feedback {
    min-height: 24px;
    margin-top: 5px;
    font-size: 1rem;
  }

  html.text-large .items-and-question.measurement-question {
    gap: 8px;
    padding: 7px;
  }

html.text-large .measurement-copy b,
  html.text-large .items-and-question.measurement-question .answer-button {
    font-size: 1.08rem;
  }
}

/* v1.6 — visual Pecahan yang ringan, boleh diguna semula dan responsif. */
.fraction-level-grid { grid-template-columns: repeat(5, minmax(145px, 1fr)); }
.fraction-level-card { border-color: #f0b7c9; }

/* Bentuk & Ruang — asas geometri menggunakan rajah SVG ringan. */
.geometry-hub-card { background: #eef8ff; border-color: #8dc7eb; }
.geometry-level-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); max-width: 930px; margin-inline: auto; }
.geometry-level-card { border-color: #8dc7eb; background: #f4fbff; }
.geometry-level-card .level-character { color: #27506f; font-size: .82rem; font-weight: 850; }
.items-and-question.geometry-question { grid-template-columns: minmax(300px, .9fr) 1.1fr; }
.items-and-question.geometry-question .items-list { display: block; min-width: 0; }
.geometry-display { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 270px; padding: 14px; border: 4px solid #82c3e9; border-radius: 24px; background: linear-gradient(#f8fdff,#e9f7ff); color: var(--purple-dark); text-align: center; }
.geometry-display > strong { font-size: 1.1rem; }
.geometry-svg { width: min(190px, 72%); max-height: 190px; overflow: visible; }
.geometry-object-illustration, .geometry-solid-object { display: grid; place-items: center; gap: 3px; min-width: 0; }
.geometry-product-image, .geometry-product-fallback { grid-area: 1 / 1; }
.geometry-product-image { display: block; width: 112px; height: 112px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(48,35,96,.18)); }
.geometry-product-image.hidden, .geometry-product-fallback.hidden { display: none; }
.geometry-product-fallback { display: grid; place-items: center; margin: 0; }
.geometry-object-illustration .geometry-svg { width: 112px; height: 112px; }
.geometry-object-illustration > span { margin-top: -36px; z-index: 1; color: #382073; font-weight: 950; }
.geometry-solid-object .geometry-svg { width: 130px; height: 110px; }
.geometry-shelf, .geometry-compare { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; }
.geometry-shelf span { display: grid; place-items: center; width: 60px; height: 60px; border: 3px solid #6045ae; border-radius: 14px; background: #fff; color: #ff9d2e; font-size: 2rem; font-weight: 900; }
.geometry-compare .geometry-svg { width: 135px; }
.geometry-feature-card { display: grid; place-items: center; gap: 7px; min-height: 135px; padding: 12px; border: 3px dashed #7358bd; border-radius: 18px; background: #fff9d7; }
.geometry-feature-card span { font-size: 2.5rem; }
.geometry-visual-note { max-width: 30ch; color: #375268; font-weight: 750; }
.geometry-answer-button { font-size: 1.22rem; }
.geometry-answer-visual { display: grid; place-items: center; gap: 2px; line-height: 1.05; }
.geometry-answer-visual .geometry-svg { width: 72px; height: 62px; max-height: 62px; }
.geometry-answer-visual .geometry-object-illustration .geometry-svg { width: 72px; height: 62px; }
.geometry-answer-visual .geometry-product-image { width: 72px; height: 62px; }
.geometry-answer-visual .geometry-object-illustration > span { margin-top: -23px; font-size: .75rem; }
.geometry-answer-visual .geometry-solid-object .geometry-svg { width: 76px; height: 58px; }
.geometry-answer-visual strong, .geometry-solid-object strong { font-size: .82rem; }
.geometry-product-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; width: 100%; }
.geometry-product-choice, .geometry-choice { min-width: 0; border: 3px solid #826bc5; border-radius: 17px; background: #fff; color: var(--purple-dark); cursor: pointer; font: inherit; font-weight: 850; box-shadow: 0 4px 0 rgba(73,49,157,.14); }
.geometry-product-choice { display: grid; place-items: center; gap: 2px; min-height: 122px; padding: 5px; }
.geometry-product-choice .geometry-object-illustration .geometry-svg { width: 78px; height: 72px; }
.geometry-product-choice .geometry-product-image { width: 88px; height: 76px; }
.geometry-product-choice strong { font-size: .78rem; line-height: 1.1; }
.geometry-choice:hover:not(:disabled), .geometry-rack-cell:hover:not(:disabled), .geometry-symmetry-cell:hover:not(:disabled) { transform: translateY(-2px); border-color: #ff9f2d; }
.geometry-choice:focus-visible, .geometry-rack-cell:focus-visible, .geometry-symmetry-cell:focus-visible, .geometry-grid-actions button:focus-visible { outline: 4px solid #ffca28; outline-offset: 2px; }
.geometry-choice.is-selected, .geometry-rack-cell.is-selected, .geometry-symmetry-cell.is-selected { border-color: #ff9f2d; background: #fff2ae; box-shadow: 0 0 0 4px rgba(255,159,45,.28); }
.geometry-solid-focus { display: grid; place-items: center; gap: 2px; }
.geometry-solid-focus .geometry-svg { width: 175px; max-height: 165px; }
.geometry-visual-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; width: min(360px,100%); }
.geometry-visual-options .geometry-choice { min-height: 48px; padding: 7px; }
.geometry-rack { display: grid; grid-template-columns: repeat(var(--rack-cols),1fr); gap: 5px; width: min(350px,100%); padding: 12px; border: 8px solid #a96331; border-radius: 16px; background: #d98b48; box-shadow: inset 0 0 0 3px #6c341b; }
.geometry-rack-cell { display: grid; place-items: center; aspect-ratio: 1.22; min-width: 0; border: 3px solid #74401f; border-radius: 8px; background: #fff4d2; cursor: pointer; font-size: 2rem; }
.geometry-pattern { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; width: 100%; }
.geometry-pattern span { display: grid; place-items: center; width: 52px; height: 52px; border: 3px solid #49319d; border-radius: 10px; background: #fff; color: #f45b69; font-size: 1.8rem; font-weight: 950; }
.geometry-pattern span:nth-child(3n+2) { color: #168bd2; }
.geometry-pattern .is-missing { border-style: dashed; background: #fff6bd; color: #49319d; }
.geometry-pattern-answer { font-size: 2rem; color: #f45b69; }
.geometry-symmetry-wrap { display: grid; gap: 8px; place-items: center; width: 100%; }
.geometry-symmetry-grid { position: relative; display: grid; grid-template-columns: repeat(var(--grid-size),1fr); width: min(320px,72vw); aspect-ratio: 1; border: 4px solid #49319d; background: #fff; }
.geometry-symmetry-grid.axis-vertical::after, .geometry-symmetry-grid.axis-horizontal::after { content: ""; position: absolute; z-index: 2; pointer-events: none; background: #ef3340; }
.geometry-symmetry-grid.axis-vertical::after { inset: 0 auto 0 50%; width: 4px; transform: translateX(-2px); }
.geometry-symmetry-grid.axis-horizontal::after { inset: 50% 0 auto; height: 4px; transform: translateY(-2px); }
.geometry-symmetry-cell { min-width: 0; padding: 0; border: 1px solid #a9b5d0; background: #f8fbff; cursor: pointer; }
.geometry-symmetry-cell.is-source { background: #6045ae; box-shadow: inset 0 0 0 4px #ffd84f; cursor: default; }
.geometry-symmetry-cell.is-selected { background: #ffd84f; }
.geometry-grid-actions { display: flex; gap: 9px; }
.geometry-grid-actions button { min-height: 44px; padding: 7px 13px; border: 3px solid #49319d; border-radius: 13px; background: #fff; color: #49319d; font: inherit; font-weight: 900; cursor: pointer; }
.geometry-grid-actions .geometry-check-button { background: #65d36e; }
.geometry-math-svg { width: min(420px, 96%); max-height: 245px; overflow: visible; }
.geometry-math-svg text { fill: #49319d; font-family: inherit; font-size: 19px; font-weight: 900; }
.geometry-dimension line { stroke: #ef4e62; stroke-width: 3; marker-start: none; marker-end: none; }
.geometry-boundary-ticks path { fill: none; stroke: #ff9d2e; stroke-width: 4; stroke-linecap: round; }
.perimeter-svg { filter: drop-shadow(0 5px 0 rgba(73,49,157,.12)); }
.area-svg { max-width: 360px; }
.geometry-finale { display: grid; place-items: center; gap: 5px; margin: 10px auto; padding: 12px; border: 4px solid #ffd84f; border-radius: 22px; background: linear-gradient(145deg,#e8fbff,#fff7c7); box-shadow: 0 6px 0 rgba(73,49,157,.16); }
.geometry-finale.hidden { display: none; }
.geometry-finale-art { display: flex; align-items: end; justify-content: center; gap: 4px; min-height: 82px; }
.geometry-finale-art img:first-child { width: 82px; height: 82px; object-fit: contain; }
.geometry-finale-art img:last-child { width: 94px; height: 94px; object-fit: contain; margin-left: -18px; }
.geometry-finale h3 { margin: 0; color: #49319d; font-size: 1.3rem; }
.geometry-finale p { margin: 0; color: #365268; font-weight: 800; }
.practice-badge.hidden { display: none; }

@media (max-width: 900px) {
  .items-and-question.geometry-question { grid-template-columns: minmax(240px, .8fr) 1.2fr; }
  .geometry-display { min-height: 220px; }
}

@media (max-width: 900px) and (max-height: 520px) {
  .practice-badge { right: 14px; max-width: 118px; padding: 2px 5px; font-size: .52rem; }
}

@media (max-width: 640px) {
  .geometry-level-screen { min-height: calc(100vh - 12px); padding: 10px; }
  .geometry-level-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .geometry-level-card { min-height: 112px; }
  .items-and-question.geometry-question { grid-template-columns: minmax(0, 1fr); width: 100%; min-width: 0; padding: 8px; gap: 9px; overflow: hidden; }
  .items-and-question.geometry-question > * { width: 100%; min-width: 0; max-width: 100%; }
  .geometry-display { min-height: 150px; padding: 7px; border-width: 3px; border-radius: 17px; }
  .geometry-display > strong { font-size: .92rem; }
  .geometry-display > .geometry-svg { width: 112px; max-height: 112px; }
  .geometry-shelf span { width: 44px; height: 44px; font-size: 1.45rem; }
  .geometry-compare .geometry-svg { width: 92px; max-height: 96px; }
  .items-and-question.geometry-question .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .items-and-question.geometry-question .answer-button { width: 100%; min-width: 0; min-height: 58px; padding: 5px 3px; font-size: 1rem; }
  .geometry-answer-visual .geometry-svg, .geometry-answer-visual .geometry-object-illustration .geometry-svg { width: 54px; height: 46px; }
  .geometry-answer-visual .geometry-product-image { width: 58px; height: 48px; }
  .geometry-answer-visual .geometry-solid-object .geometry-svg { width: 58px; height: 44px; }
  .geometry-answer-visual strong, .geometry-solid-object strong { font-size: .68rem; }
  .geometry-product-choice { min-height: 88px; }
  .geometry-product-choice .geometry-object-illustration .geometry-svg { width: 58px; height: 52px; }
  .geometry-product-choice .geometry-product-image { width: 66px; height: 54px; }
  .geometry-solid-focus .geometry-svg { width: 115px; max-height: 108px; }
  .geometry-rack { width: min(285px,100%); padding: 7px; border-width: 6px; }
  .geometry-rack-cell { font-size: 1.5rem; }
  .geometry-pattern span { width: 40px; height: 40px; font-size: 1.35rem; }
  .geometry-symmetry-grid { width: min(235px,70vw); }
  .geometry-grid-actions button { min-height: 40px; padding: 5px 9px; font-size: .82rem; }
  .geometry-math-svg { width: min(330px, 96%); max-height: 205px; }
  .geometry-math-svg text { font-size: 17px; }
  .geometry-finale { padding: 8px; }
  .geometry-finale-art { min-height: 64px; }
  .geometry-finale-art img:first-child { width: 64px; height: 64px; }
  .geometry-finale-art img:last-child { width: 72px; height: 72px; }
  html.text-large .items-and-question.geometry-question .answer-button { font-size: .96rem; }
}
.items-and-question.fraction-question { grid-template-columns: minmax(300px, .9fr) 1.1fr; }
.items-and-question.fraction-question .items-list { display: block; min-width: 0; }
.fraction-display {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 230px;
  padding: 18px;
  place-content: center;
  gap: 14px;
  overflow: hidden;
  border: 4px solid #693daa;
  border-bottom-width: 8px;
  border-radius: 24px;
  background: #fff8dc;
  box-shadow: 0 7px 0 rgba(73,49,157,.12);
  text-align: center;
}
.fraction-object-label { color: var(--purple-dark); font-size: 1.05rem; font-weight: 1000; text-transform: capitalize; }
.fraction-bar {
  display: grid;
  grid-template-columns: repeat(var(--parts), minmax(16px, 1fr));
  width: min(280px, 100%);
  min-height: 92px;
  margin-inline: auto;
  overflow: hidden;
  border: 4px solid #35206f;
  border-radius: 16px;
  background: #fff;
}
.fraction-part { border-right: 3px solid #35206f; background: #fffdf5; }
.fraction-part:last-child { border-right: 0; }
.fraction-part.filled { background: #ffca43; }
.fraction-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(22px, 1fr));
  width: min(280px, 100%);
  aspect-ratio: 1.45;
  overflow: hidden;
  border: 4px solid #35206f;
  border-radius: 14px;
  background: #35206f;
  gap: 3px;
}
.fraction-grid-part { min-width: 0; min-height: 0; background: #fffdf5; }
.fraction-grid-part.filled { background: #ffca43; }
.fraction-circle {
  width: min(190px, 48vw);
  aspect-ratio: 1;
  margin-inline: auto;
  border: 5px solid #35206f;
  border-radius: 50%;
  background:
    repeating-conic-gradient(transparent 0 calc(var(--step) - 2deg), #35206f calc(var(--step) - 2deg) var(--step)),
    conic-gradient(#ffca43 0 var(--fill), #fffdf5 var(--fill) 100%);
  box-shadow: inset 0 0 0 3px #fff;
}
.fraction-group { display: grid; grid-template-columns: repeat(var(--count), minmax(34px, 1fr)); gap: 8px; width: min(330px, 100%); margin-inline: auto; }
.fraction-group span { display: grid; min-width: 34px; min-height: 42px; place-items: center; border: 3px solid transparent; border-radius: 12px; filter: grayscale(.85); font-size: 2rem; opacity: .42; }
.fraction-group span.filled { border-color: #693daa; background: #fff0a8; filter: none; opacity: 1; }
.fraction-collection span { filter: none; opacity: 1; }
.fraction-choice-prompt { display: grid; place-items: center; gap: 6px; color: var(--purple-dark); text-align: center; }
.fraction-choice-prompt strong { font-size: clamp(2.3rem, 6vw, 4.2rem); line-height: 1; }
.fraction-choice-prompt span { font-weight: 850; }
.fraction-mini-choice { display: grid; width: min(150px, 100%); margin-inline: auto; place-items: center; }
.fraction-mini-bar { display: grid; grid-template-columns: repeat(var(--parts), minmax(8px, 1fr)); width: 100%; min-height: 42px; overflow: hidden; border: 3px solid #35206f; border-radius: 10px; background: #fffdf5; }
.fraction-mini-part { border-right: 2px solid #35206f; background: #fffdf5; }
.fraction-mini-part:last-child { border-right: 0; }
.fraction-mini-part.filled { background: #ffca43; }
.fraction-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.fraction-pair .fraction-bar { min-height: 72px; }
.fraction-pair b { color: var(--purple-dark); font-size: 1.2rem; }
.fraction-mystery { display: grid; width: min(160px, 100%); min-height: 84px; place-items: center; border: 4px dashed #693daa; border-radius: 18px; color: #693daa; font-size: 3rem; font-weight: 1000; }
.fraction-equation { color: var(--purple-dark); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 1000; }
.fraction-help { display: block; max-width: 360px; color: #684f25; font-weight: 850; line-height: 1.25; }

@media (max-width: 1180px) {
  .fraction-level-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .items-and-question.fraction-question { grid-template-columns: minmax(250px, .8fr) 1.2fr; }
}

@media (max-width: 820px) and (orientation: portrait) {
  .fraction-level-screen { min-height: calc(100vh - 12px); padding: 10px; }
  .fraction-level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .items-and-question.fraction-question { grid-template-columns: minmax(0, 1fr); width: 100%; min-width: 0; padding: 8px; gap: 9px; overflow: hidden; }
  .items-and-question.fraction-question > * { width: 100%; min-width: 0; max-width: 100%; }
  .fraction-display { min-height: 150px; padding: 10px; gap: 7px; border-width: 3px; border-bottom-width: 6px; border-radius: 18px; }
  .fraction-circle { width: min(142px, 39vw); }
  .fraction-bar { min-height: 68px; }
  .fraction-group { gap: 5px; }
  .fraction-group span { min-width: 27px; min-height: 34px; font-size: 1.55rem; }
  .fraction-pair { gap: 6px; }
  .fraction-pair .fraction-bar { min-height: 55px; }
  .items-and-question.fraction-question .question-card { padding: 11px; }
  .items-and-question.fraction-question .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .items-and-question.fraction-question .answer-button { width: 100%; min-width: 0; min-height: 54px; padding: 8px 4px; }
}

@media (max-width: 640px) and (orientation: portrait) {
  .fraction-display { min-height: 128px; padding: 8px; }
  .fraction-object-label { font-size: .88rem; }
  .fraction-circle { width: min(112px, 34vw); border-width: 4px; }
  .fraction-bar { min-height: 58px; border-width: 3px; }
  .fraction-part { border-right-width: 2px; }
  .fraction-grid { width: min(220px, 100%); border-width: 3px; border-radius: 11px; gap: 2px; }
  .fraction-group { grid-template-columns: repeat(var(--count), minmax(24px, 1fr)); }
  .fraction-group span { min-width: 24px; min-height: 30px; font-size: 1.3rem; }
  .fraction-mini-bar { min-height: 34px; border-width: 2px; }
  .fraction-mystery { min-height: 58px; font-size: 2rem; }
  .fraction-equation { font-size: 1.25rem; }
  .fraction-help { font-size: .72rem; }
  html.text-large .fraction-object-label { font-size: 1rem; }
  html.text-large .items-and-question.fraction-question .answer-button { font-size: 1.05rem; }
}

/* v1.7 — visual wang Malaysia bergaya pendidikan, bukan replika wang sebenar. */
.money-visual-stage { min-width: 0; margin: 0 0 10px; }
.money-visual-stage.hidden { display: none; }
.money-visual {
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: 9px;
  border: 3px solid #efd36a;
  border-radius: 17px;
  background: #fffbea;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.9);
}
.money-visual-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; color: var(--purple-dark); font-size: .78rem; }
.money-visual-heading strong { min-width: 0; overflow-wrap: anywhere; }
.money-visual-heading span { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; background: #fff; font-weight: 950; }
.money-pieces { display: flex; min-width: 0; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; }
.money-piece { position: relative; display: grid; flex: 0 0 auto; place-items: center; overflow: hidden; color: #24134f; font-weight: 1000; line-height: 1; isolation: isolate; }
.money-piece-pattern { position: absolute; z-index: -1; inset: 5px; border: 1px dashed currentColor; border-radius: inherit; opacity: .28; }
.money-note { width: 82px; min-height: 42px; padding: 6px; border: 3px solid #35206f; border-radius: 9px; box-shadow: 0 3px 0 rgba(53,32,111,.24); }
.money-note strong { font-size: 1.05rem; }
.money-note small { margin-top: 4px; font-size: .42rem; letter-spacing: .04em; }
.money-coin { width: 52px; height: 52px; padding: 5px; border: 4px solid #8b6513; border-radius: 50%; background: #ffd75e; box-shadow: inset 0 0 0 3px #fff1a3, 0 3px 0 rgba(90,62,8,.25); text-align: center; }
.money-coin strong { max-width: 38px; font-size: .7rem; line-height: .9; }
.money-plus { color: #6a4d19; font-size: .85rem; font-weight: 1000; }
.money-value-100 { background: #bce7ff; }
.money-value-500 { background: #c9f0bd; }
.money-value-1000 { background: #ffd0df; }
.money-value-2000 { background: #f3cfb1; }
.money-value-5000 { background: #b7e5dc; }
.money-value-10000 { background: #e6cfef; }
.money-value-5 { background: #d9b46d; }
.money-value-10 { background: #d7d9dc; }
.money-value-20 { background: #e1c27e; }
.money-value-50 { background: #d6d8dc; }

@media (max-width: 640px) and (orientation: portrait) {
  .money-visual { padding: 7px; gap: 5px; border-width: 2px; border-radius: 14px; }
  .money-visual-heading { font-size: .7rem; }
  .money-pieces { gap: 4px; }
  .money-note { width: 70px; min-height: 37px; padding: 5px; border-width: 2px; }
  .money-note strong { font-size: .92rem; }
  .money-coin { width: 45px; height: 45px; border-width: 3px; }
  .money-coin strong { font-size: .62rem; }
  html.text-large .money-visual-heading { font-size: .78rem; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .money-visual-stage { margin-bottom: 5px; }
  .money-visual { grid-template-columns: minmax(105px, auto) 1fr; align-items: center; gap: 5px; padding: 4px 6px; border-width: 2px; border-radius: 12px; }
  .money-visual-heading { display: grid; gap: 2px; font-size: .58rem; }
  .money-visual-heading span { justify-self: start; padding: 1px 5px; }
  .money-pieces { gap: 3px; }
  .money-note { width: 54px; min-height: 29px; padding: 3px; border-width: 2px; border-radius: 6px; box-shadow: 0 2px 0 rgba(53,32,111,.2); }
  .money-note strong { font-size: .72rem; }
  .money-note small { margin-top: 2px; font-size: .3rem; }
  .money-coin { width: 33px; height: 33px; padding: 3px; border-width: 2px; box-shadow: inset 0 0 0 2px #fff1a3, 0 2px 0 rgba(90,62,8,.2); }
  .money-coin strong { font-size: .46rem; }
  .money-plus { font-size: .62rem; }
}

/* v1.8: tujuh mode sokongan kekal dua baris pada landscape rendah. */
@media (max-width: 820px) and (orientation: landscape) {
  .main-hub-panel .hub-support-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .main-hub-panel .shop-challenge-menu-card small { font-size: .54rem; }
}

/* v1.9 — profil lokal dan laporan ibu bapa/guru */
.profile-picker-screen, .parent-screen { min-height: calc(100vh - 48px); padding: 22px; }
.profile-picker-panel, .parent-dashboard { width: min(1040px, 100%); max-height: calc(100vh - 48px); margin: auto; overflow: auto; padding: 22px; border: 5px solid #fff; border-radius: 30px; background: var(--cream); box-shadow: var(--shadow); }
.profile-picker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.profile-picker-card { display: grid; place-items: center; min-height: 145px; padding: 12px; border: 3px solid #c9bdf0; border-bottom-width: 7px; border-radius: 20px; background: #fff; color: var(--ink); cursor: pointer; font: inherit; }
.profile-picker-card.active { border-color: var(--player-accent); background: var(--player-accent-soft); }
.profile-picker-card > span { font-size: 2.6rem; }
.profile-picker-card strong { margin: 5px 0; color: var(--purple-dark); font-size: 1.1rem; }
.profile-picker-card small { color: #686b80; font-weight: 800; }
.profile-picker-card:focus-visible, .hub-player:focus-visible { outline: 4px solid var(--yellow); outline-offset: 2px; }
.profile-picker-card:disabled { cursor: not-allowed; filter: grayscale(.6); opacity: .55; }
.profile-limit-message { color: #885916; font-weight: 900; text-align: center; }
.profile-create-modal { position: fixed; z-index: 170; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(31,20,77,.72); }
.profile-create-modal.hidden { display: none; }
.profile-create-form { display: grid; width: min(680px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; gap: 10px; padding: 20px; border: 5px solid #fff; border-radius: 24px; background: var(--cream); box-shadow: var(--shadow); }
.profile-create-form h2 { margin: 0; color: var(--purple-dark); text-align: center; }
.profile-create-form label { display: grid; gap: 5px; color: var(--purple-dark); font-weight: 900; }
.profile-create-name { text-align: center; }
.profile-create-form > input, .parent-profile-select select, .parent-gate-card input { min-height: 48px; padding: 8px 11px; border: 3px solid #c9bdf0; border-radius: 12px; background: #fff; color: var(--ink); font: inherit; }
.profile-create-form > input { width: min(390px, 100%); margin-inline: auto; font-weight: 800; text-align: center; }
.profile-create-form > div, .parent-management > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.profile-create-form .avatar-picker, .profile-create-form .theme-picker { margin: 0; background: #fff; }
.profile-create-form .avatar-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.profile-create-actions { position: sticky; bottom: -20px; margin: 0 -8px -8px; padding: 10px 8px 8px; background: linear-gradient(transparent, var(--cream) 24%); }
.player-avatar-image, .profile-preview-image, .menu-player-avatar-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.player-avatar-fallback { display: none; }
.player-avatar-fallback.is-visible { display: block; }
.profile-picker-avatar { display: grid; width: 70px; height: 70px; place-items: center; overflow: hidden; border-radius: 50%; background: var(--player-accent-soft); }
.avatar-option-visual { position: relative; display: grid; width: 60px; height: 60px; place-items: center; overflow: hidden; border-radius: 50%; background: #f5f2ff; }
.avatar-option .player-avatar-image { width: 58px; height: 58px; object-fit: cover; object-position: center top; }
.avatar-option .player-avatar-fallback, .profile-picker-avatar .player-avatar-fallback, .parent-profile-avatar .player-avatar-fallback, #profile-preview-avatar .player-avatar-fallback, #menu-player-avatar .player-avatar-fallback { font-size: 1.8rem; }
#menu-player-avatar { display: grid; width: 42px; height: 42px; place-items: center; overflow: hidden; border-radius: 50%; }
#profile-preview-avatar { overflow: hidden; }
.parent-profile-avatar { display: grid; width: 66px; height: 66px; place-items: center; overflow: hidden; border-radius: 50%; background: var(--player-accent-soft); }
.parent-dashboard { display: grid; gap: 14px; }
.parent-profile-select { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--purple-dark); font-weight: 900; }
.parent-overview { display: grid; grid-template-columns: minmax(180px, .7fr) 2fr; gap: 12px; }
.parent-profile-hero, .parent-overview-grid, .parent-module-grid article, .parent-insights, .parent-detail-grid article, .parent-management { border: 3px solid #d8cff5; border-radius: 18px; background: #fff; padding: 13px; }
.parent-profile-hero { display: flex; align-items: center; justify-content: center; gap: 12px; }
.parent-profile-hero > span { font-size: 3rem; }
.parent-profile-hero h3, .parent-profile-hero p { margin: 2px 0; }
.parent-overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.parent-overview-grid span { display: grid; text-align: center; }
.parent-overview-grid small { color: #6d7390; font-weight: 800; }
.parent-overview-grid strong { color: var(--purple-dark); font-size: 1.15rem; }
.parent-dashboard section > h3 { margin: 0 0 8px; color: var(--purple-dark); text-align: center; }
.parent-module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.parent-module-grid h4, .parent-module-grid p { margin: 3px 0; }
.parent-progress { height: 10px; overflow: hidden; border-radius: 999px; background: #e8e3f5; }
.parent-progress span { display: block; height: 100%; background: var(--player-accent); }
.parent-insights p { margin: 5px 0; }
.parent-recommendation { color: #397540; font-weight: 900; }
.parent-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.parent-detail-grid h3, .parent-detail-grid p { margin: 4px 0; }
.danger-button { border-color: #d75d5d; color: #9a2929; }
.parent-gate { position: fixed; z-index: 160; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(31,20,77,.68); }
.parent-gate.hidden { display: none; }
.parent-gate-card { width: min(430px, 100%); padding: 22px; border: 5px solid #fff; border-radius: 24px; background: var(--cream); box-shadow: var(--shadow); text-align: center; }
.parent-gate-card h2 { color: var(--purple-dark); }
.parent-gate-card input { width: 150px; text-align: center; }
.parent-gate-card > div { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }

@media (max-width: 640px) {
  .menu-recommendation { margin-bottom: 8px; padding: 7px 10px; gap: 7px; border-width: 2px; border-radius: 14px; }
  .menu-recommendation > span:first-child { font-size: 1.1rem; }
  .menu-recommendation small { font-size: .58rem; }
  .menu-recommendation strong { font-size: .76rem; }
  .smart-tip { margin: 6px auto 9px; padding: 7px 10px; border-width: 2px; }
  .smart-tip span { font-size: .74rem; }
  .profile-picker-screen, .parent-screen { min-height: calc(100vh - 12px); padding: 6px; }
  .profile-picker-panel, .parent-dashboard { max-height: calc(100vh - 12px); padding: 10px; border-width: 4px; border-radius: 22px; }
  .profile-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .profile-picker-card { min-height: 108px; padding: 7px; border-width: 2px; border-bottom-width: 5px; }
  .profile-picker-card > span { font-size: 2rem; }
  .profile-picker-avatar { width: 58px; height: 58px; }
  .profile-create-modal { padding: 8px; }
  .profile-create-form { max-height: calc(100vh - 16px); padding: 12px; border-width: 4px; border-radius: 20px; }
  .profile-create-form .avatar-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .profile-create-form .avatar-option { width: 100%; min-height: 64px; }
  .profile-create-actions { bottom: -12px; margin-bottom: -4px; }
  .parent-overview { grid-template-columns: 1fr; }
  .parent-module-grid, .parent-detail-grid { grid-template-columns: 1fr; }
  .geometry-hub-card { width: 100%; grid-column: auto; }
  .parent-profile-select { align-items: stretch; flex-direction: column; }
}

.p00-modal { position: fixed; z-index: 180; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(31,20,77,.72); backdrop-filter: blur(3px); }
.p00-modal.hidden { display: none; }
.p00-modal-card { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; border: 5px solid #fff; border-radius: 26px; background: var(--cream); box-shadow: var(--shadow); text-align: center; }
.p00-modal-card h2 { margin: 0 0 10px; color: var(--purple-dark); font-size: clamp(1.35rem, 3vw, 2rem); }
.p00-modal-card > p { margin: 7px auto; color: #555a78; font-weight: 700; line-height: 1.42; }

@media (max-width: 640px) {
  .p00-modal { padding: 7px; }
  .p00-modal-card { max-height: calc(100vh - 14px); padding: 14px 11px; border-width: 4px; border-radius: 20px; }
  .p00-modal-card > p { font-size: .82rem; }
}

/* P2 premium learning dashboards */
.stats-panel, .parent-dashboard { background: radial-gradient(circle at 8% 3%, rgba(255,220,92,.22), transparent 18%), linear-gradient(180deg, #fffaf0 0%, #fffdf7 100%); }
.stats-hero { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 20px; padding: 16px 20px; border: 3px solid #d8cff5; border-radius: 24px; background: linear-gradient(135deg, #fff 0%, #f3eeff 100%); text-align: left; box-shadow: 0 6px 0 rgba(73,49,157,.1); }
.stats-hero-icon { display: grid; width: 66px; height: 66px; flex: 0 0 auto; place-items: center; border: 4px solid #fff; border-radius: 20px; background: linear-gradient(145deg, #7655d5, #49319d); box-shadow: 0 5px 0 rgba(52,32,125,.25); font-size: 2rem; }
.stats-panel .stats-hero h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1; }
.stats-hero .eyebrow, .stats-hero p { margin: 0; }
.stats-hero > div:last-child > p:last-child { margin-top: 6px; color: #666b85; font-weight: 800; }
.stats-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.stats-card { min-height: 136px; align-content: center; border-color: #d8cff5; background: linear-gradient(180deg, #fff, #fbf9ff); }
.stats-card:nth-child(2), .stats-card:nth-child(6) { border-color: #b7dff0; background: #f4fbff; }
.stats-card:nth-child(4), .stats-card:nth-child(7) { border-color: #bfe2b6; background: #f7fff3; }
.stats-card > span { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px; background: rgba(101,70,199,.1); }
.stats-card strong { font-size: clamp(1.22rem, 2vw, 1.65rem); }
.dashboard-section-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; text-align: left; }
.dashboard-section-heading > span { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 14px; background: #eee8ff; font-size: 1.45rem; }
.dashboard-section-heading h3, .dashboard-section-heading p { margin: 0; }
.dashboard-section-heading p { margin-top: 2px; color: #6d7390; font-size: .78rem; font-weight: 800; }
.dashboard-section-heading.compact { margin-bottom: 9px; }
.skill-performance { margin-top: 20px; padding: 18px; border: 3px solid #d8cff5; border-radius: 24px; background: rgba(255,255,255,.8); }
.skill-performance h3 { margin: 0; }
.skill-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.skill-stat-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 12px; padding: 13px; box-shadow: 0 4px 0 rgba(49,95,120,.1); }
.skill-stat-heading { grid-column: 1; }
.skill-stat-score { grid-column: 2; grid-row: 1; margin: 0; }
.skill-progress, .skill-stat-card small, .skill-stat-card em { grid-column: 1 / -1; }
.skill-progress { height: 11px; }
.skill-stat-card em { justify-self: start; padding: 3px 8px; border-radius: 999px; background: #e9f7e4; }
.skill-recommendation-panel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 16px; padding: 14px 16px; border: 3px solid #efcf72; border-radius: 19px; background: linear-gradient(135deg, #fff8d8, #fffdf3); text-align: left; }
.skill-recommendation-icon { font-size: 1.8rem; }
.skill-recommendation-panel h4, .skill-recommendation { margin: 0; }
.skill-recommendation-panel h4 { color: #76531a; font-size: .78rem; letter-spacing: .06em; }
.skill-recommendation { display: block; margin-top: 3px; }
.skill-recommendation-button { margin: 0; white-space: nowrap; }
.shop-challenge-stats { padding: 16px; background: linear-gradient(135deg, #fff8d8, #fffdf2); }
.shop-challenge-stats h3 { margin: 0; text-align: left; }
.shop-challenge-stats-grid span { min-height: 72px; align-content: center; }
.parent-dashboard { gap: 17px; }
.parent-dashboard > .screen-heading { padding: 12px 16px; border: 3px solid #d8cff5; border-radius: 22px; background: linear-gradient(135deg, #fff, #f3eeff); box-shadow: 0 5px 0 rgba(73,49,157,.1); }
.parent-profile-select { justify-self: center; padding: 7px 12px; border-radius: 14px; background: #eee8ff; }
.parent-overview { grid-template-columns: minmax(260px, .8fr) 2fr; }
.parent-profile-hero, .parent-overview-grid, .parent-module-grid article, .parent-insights, .parent-detail-grid article, .parent-management { border-bottom-width: 6px; box-shadow: 0 4px 0 rgba(73,49,157,.08); }
.parent-profile-hero { justify-content: flex-start; padding: 17px; background: linear-gradient(145deg, #fff8d8, #fff); border-color: #efd071; }
.parent-profile-avatar { width: 82px; height: 82px; border: 4px solid #fff; box-shadow: 0 4px 0 rgba(73,49,157,.14); }
.parent-profile-hero h3 { color: var(--purple-dark); font-size: 1.45rem; }
.parent-profile-hero p strong { color: #a36a00; }
.parent-report-label { color: #805f18; font-size: .68rem; font-weight: 1000; letter-spacing: .08em; }
.parent-overview-grid { padding: 10px; background: #fbf9ff; }
.parent-overview-grid span { min-height: 66px; align-content: center; padding: 7px; border: 2px solid #e4ddf7; border-radius: 13px; background: #fff; }
.parent-overview-grid strong { font-size: 1.28rem; }
.parent-module-section { padding: 16px; border: 3px solid #d8cff5; border-radius: 22px; background: rgba(255,255,255,.75); }
.parent-dashboard .parent-module-section > .dashboard-section-heading h3 { margin: 0; text-align: left; }
.parent-module-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.parent-module-card { min-width: 0; border-color: #c9e7f2 !important; background: linear-gradient(180deg, #fff, #f5fbff) !important; }
.parent-module-card:nth-child(2n) { border-color: #cce6b8 !important; background: linear-gradient(180deg, #fff, #f8fff3) !important; }
.parent-module-card header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.parent-module-card header img { width: 52px; height: 52px; flex: 0 0 auto; object-fit: contain; }
.parent-module-card h4 { color: var(--purple-dark); font-size: .92rem; line-height: 1.12; }
.parent-module-card header strong { color: #9a6500; font-size: .8rem; }
.parent-module-metric { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 7px; color: #666b85; font-size: .69rem; font-weight: 800; }
.parent-module-metric b { color: var(--purple-dark); font-size: .72rem; text-align: right; }
.parent-progress { height: 9px; margin-top: 5px; }
.parent-insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.parent-insight-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 13px; border: 3px solid #bee2b6; border-radius: 18px; background: #f7fff3; box-shadow: 0 4px 0 rgba(68,129,70,.12); text-align: left; }
.parent-insight-card.practice { border-color: #b9dce8; background: #effaff; }
.parent-insight-card.next { border-color: #efcf72; background: #fff8d8; }
.parent-insight-card > span { font-size: 1.55rem; }
.parent-insight-card small, .parent-insight-card strong { display: block; }
.parent-insight-card small { color: #6d7390; font-size: .64rem; font-weight: 1000; letter-spacing: .06em; }
.parent-insight-card strong { margin-top: 2px; color: var(--purple-dark); }
.parent-insight-card p { margin: 4px 0 0; color: #5f6280; font-size: .75rem; font-weight: 750; line-height: 1.3; }
.parent-detail-grid article { padding: 15px; }
.parent-detail-grid article:nth-child(1) { border-color: #efcf72; background: #fff8d8; }
.parent-detail-grid article:nth-child(2) { border-color: #b9dce8; background: #effaff; }
.parent-detail-grid article:nth-child(3) { border-color: #c9bdf0; background: #f7f3ff; }
.parent-detail-grid h3 { color: var(--purple-dark); }
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .parent-module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .stats-hero { padding: 12px 14px; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .skill-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parent-overview { grid-template-columns: 1fr; }
  .parent-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parent-insights { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stats-panel { padding: 11px; border-width: 4px; border-radius: 22px; }
  .stats-hero { align-items: flex-start; gap: 10px; margin-bottom: 12px; padding: 10px; border-width: 2px; border-radius: 17px; }
  .stats-hero-icon { width: 48px; height: 48px; border-radius: 14px; font-size: 1.45rem; }
  .stats-panel .stats-hero h2 { font-size: 1.55rem; }
  .stats-hero > div:last-child > p:last-child { font-size: .72rem; line-height: 1.25; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .stats-card { min-height: 105px; padding: 8px 5px; border-width: 2px; border-bottom-width: 5px; border-radius: 15px; }
  .stats-card:first-child { grid-column: 1 / -1; }
  .stats-card > span { width: 34px; height: 34px; border-radius: 10px; font-size: 1.45rem; }
  .stats-card small { font-size: .68rem; }
  .skill-performance { padding: 10px; border-width: 2px; border-radius: 18px; }
  .dashboard-section-heading > span { width: 36px; height: 36px; font-size: 1.15rem; }
  .dashboard-section-heading h3 { font-size: .86rem; }
  .dashboard-section-heading p { font-size: .65rem; }
  .skill-stats-grid { grid-template-columns: 1fr; gap: 7px; }
  .skill-stat-card { padding: 9px; border-width: 2px; border-bottom-width: 5px; }
  .skill-recommendation-panel { grid-template-columns: auto minmax(0, 1fr); padding: 10px; border-width: 2px; }
  .skill-recommendation-button { grid-column: 1 / -1; width: 100%; }
  .parent-module-section { padding: 10px; border-width: 2px; }
  .parent-module-grid { grid-template-columns: 1fr; }
  .parent-module-card header img { width: 46px; height: 46px; }
  .parent-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) and (orientation: landscape) {
  .stats-panel { padding: 9px 13px; }
  .stats-hero { margin-bottom: 8px; padding: 7px 11px; }
  .stats-hero-icon { width: 44px; height: 44px; font-size: 1.35rem; }
  .stats-panel .stats-hero h2 { font-size: 1.5rem; }
  .stats-hero > div:last-child > p:last-child { font-size: .65rem; }
  .stats-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
  .stats-card { min-height: 82px; padding: 5px 3px; border-width: 2px; border-bottom-width: 4px; }
  .stats-card > span { width: 27px; height: 27px; font-size: 1.1rem; }
  .stats-card small { font-size: .52rem; }
  .stats-card strong { font-size: .85rem; }
  .skill-performance { margin-top: 8px; padding: 8px; }
  .skill-stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .skill-stat-card { display: block; padding: 6px; }
  .skill-stat-score { font-size: .9rem; }
  .skill-stat-card small, .skill-stat-card em { font-size: .5rem; }
  .skill-recommendation-panel { margin-top: 7px; padding: 6px 8px; }
  .parent-dashboard { gap: 8px; padding: 9px; }
  .parent-overview { grid-template-columns: minmax(230px, .8fr) 2fr; gap: 7px; }
  .parent-module-section { padding: 8px; }
  .parent-module-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .parent-module-card { padding: 6px !important; }
  .parent-module-card header img { width: 34px; height: 34px; }
  .parent-module-card h4 { font-size: .68rem; }
  .parent-module-metric { font-size: .52rem; }
  .parent-insights { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .parent-insight-card { padding: 7px; }
}

/* P3 global premium consistency polish */
.top-bar,
.shop-scene,
.menu-panel,
.level-panel,
.practice-panel {
  box-shadow: var(--card-shadow);
}

.top-bar {
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
}

.shop-scene {
  border-radius: calc(var(--radius-card) + 6px);
  background:
    radial-gradient(circle at 94% 8%, rgba(255, 216, 77, .18), transparent 19%),
    var(--cream);
}

.speech-bubble {
  border-color: var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 0 rgba(73, 49, 157, .1), 0 10px 22px rgba(44, 35, 85, .07);
}

.speech-bubble::before { border-color: var(--border-soft); }

.items-and-question { gap: var(--space-lg); }

.item-card {
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #fff 0%, #fffdf7 100%);
  box-shadow: 0 7px 0 #eadcae, 0 12px 24px rgba(91, 68, 18, .08);
}

.item-image { filter: drop-shadow(0 5px 5px rgba(44, 35, 85, .12)); }

.question-card {
  border: 3px solid var(--border-soft);
  border-bottom-width: 7px;
  border-radius: var(--radius-card);
  background:
    radial-gradient(circle at 92% 7%, rgba(255, 216, 77, .22), transparent 20%),
    linear-gradient(145deg, #f8f5ff 0%, #eee8ff 100%);
  box-shadow: 0 8px 22px rgba(73, 49, 157, .1);
}

.transaction-summary span {
  border-color: var(--border-soft);
  border-radius: var(--radius-control);
  box-shadow: 0 3px 0 rgba(73, 49, 157, .08);
}

.answer-button,
.next-question-button,
.play-again-button,
.primary-menu-button,
.secondary-button,
.back-button,
.next-level-button,
.home-game-button {
  min-height: 44px;
  border-radius: var(--radius-control);
  box-shadow: var(--button-shadow);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.answer-button:hover:not(:disabled),
.next-question-button:hover:not(:disabled),
.play-again-button:hover:not(:disabled),
.primary-menu-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.back-button:hover:not(:disabled),
.next-level-button:hover:not(:disabled),
.home-game-button:hover:not(:disabled) {
  filter: brightness(1.06) saturate(1.04);
  transform: translateY(-2px);
}

.answer-button:active:not(:disabled),
.next-question-button:active:not(:disabled),
.play-again-button:active:not(:disabled),
.primary-menu-button:active:not(:disabled),
.secondary-button:active:not(:disabled),
.back-button:active:not(:disabled),
.next-level-button:active:not(:disabled),
.home-game-button:active:not(:disabled) {
  box-shadow: 0 2px 0 rgba(49, 31, 116, .28);
  transform: translateY(4px);
}

button:disabled,
.answer-button:disabled,
.next-question-button:disabled {
  cursor: not-allowed;
  filter: grayscale(.16) saturate(.72);
  opacity: .62;
  box-shadow: 0 3px 0 rgba(44, 35, 85, .12);
}

.answer-button.correct {
  background: linear-gradient(180deg, #42c47f, var(--green));
  filter: none;
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(255,255,255,.9), 0 0 0 8px rgba(41,169,107,.34), 0 6px 0 #147743;
}

.answer-button.wrong {
  background: linear-gradient(180deg, #ef7770, var(--red));
  filter: none;
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(255,255,255,.9), 0 0 0 8px rgba(228,87,87,.24), 0 6px 0 #a33131;
}

.answer-button.correct-answer-review { filter: none; opacity: 1; }

.feedback-review {
  margin-top: var(--space-md);
  padding: 15px 17px;
  border: 3px solid #efb2a8;
  border-left-width: 8px;
  border-radius: var(--radius-control);
  background: linear-gradient(135deg, var(--state-error-soft), #fffaf7);
  box-shadow: 0 5px 0 rgba(190, 92, 77, .1);
  font-size: clamp(1rem, 2vw, 1.3rem);
  line-height: 1.45;
  text-align: left;
}

.next-question-button {
  min-height: 58px;
  background: linear-gradient(180deg, #42c47f, var(--green));
}

.hub-category-card,
.hub-menu-card,
.level-card,
.practice-card {
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  transition: transform 170ms ease, filter 170ms ease, box-shadow 170ms ease;
}

.hub-category-card {
  min-height: 128px;
  align-items: center;
}

.hub-category-card img { filter: drop-shadow(0 5px 5px rgba(44,35,85,.14)); }

.hub-menu-card {
  min-height: 82px;
  align-items: center;
}

.hub-category-card:hover,
.hub-category-card:focus-visible,
.hub-menu-card:hover,
.hub-menu-card:focus-visible,
.level-card:hover:not(:disabled),
.level-card:focus-visible:not(:disabled),
.practice-card:hover,
.practice-card:focus-visible {
  box-shadow: 0 9px 0 rgba(44, 35, 85, .13), 0 16px 30px rgba(44, 35, 85, .11);
}

.level-card {
  display: flex;
  min-height: 174px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.level-card strong,
.practice-card strong {
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.level-card.played { box-shadow: 0 0 0 4px #75cb70, var(--card-shadow); }

.level-card.locked {
  border-style: dashed;
  opacity: .82;
  box-shadow: 0 5px 0 rgba(80, 80, 96, .12);
}

.practice-card {
  display: flex;
  min-height: 138px;
  flex-direction: column;
  justify-content: center;
}

.home-modal-card,
.game-over-card,
.tutorial-card {
  border-color: #fff;
  border-radius: calc(var(--radius-card) + 6px);
  background:
    radial-gradient(circle at 92% 8%, rgba(255,216,77,.2), transparent 20%),
    var(--cream);
  box-shadow: 0 12px 0 rgba(35,25,83,.24), 0 24px 50px rgba(20,16,55,.24);
}

@media (max-width: 640px) {
  .items-and-question { gap: 13px; }
  .speech-bubble { border-radius: 18px; }
  .item-card, .question-card { border-radius: 19px; }
  .question-card { padding: 15px; border-width: 2px; border-bottom-width: 6px; }
  .feedback-review { padding: 12px; border-width: 2px; border-left-width: 6px; font-size: .95rem; }
  .next-question-button { width: 100%; min-height: 54px; font-size: 1.1rem; }
  .hub-category-card, .level-card, .practice-card { border-radius: 19px; }
  .hub-category-card { min-height: 112px; }
  .hub-menu-card { min-height: 68px; border-radius: 17px; }
  .level-card { min-height: 150px; }
  .practice-card { min-height: 122px; }
}

@media (prefers-reduced-motion: reduce) {
  .answer-button,
  .next-question-button,
  .play-again-button,
  .primary-menu-button,
  .secondary-button,
  .back-button,
  .next-level-button,
  .home-game-button,
  .hub-category-card,
  .hub-menu-card,
  .level-card,
  .practice-card { transition-duration: .01ms !important; }
  .answer-button.correct-answer, .feedback.wrong, .session-stars { animation: none !important; }
}

html.reduce-motion .answer-button,
html.reduce-motion .next-question-button,
html.reduce-motion .play-again-button,
html.reduce-motion .primary-menu-button,
html.reduce-motion .secondary-button,
html.reduce-motion .back-button,
html.reduce-motion .next-level-button,
html.reduce-motion .home-game-button,
html.reduce-motion .hub-category-card,
html.reduce-motion .hub-menu-card,
html.reduce-motion .level-card,
html.reduce-motion .practice-card { transition-duration: .01ms !important; }
html.reduce-motion .answer-button.correct-answer,
html.reduce-motion .feedback.wrong,
html.reduce-motion .session-stars { animation: none !important; }

@page { size: A4 portrait; margin: 12mm; }

@media print {
  body { background: #fff !important; }
  body > main > section, #game-header, .parent-management, .parent-profile-select, .parent-dashboard > .screen-heading, .parent-gate, .p00-modal { display: none !important; }
  #parent-screen { display: block !important; padding: 0; }
  #parent-report { display: grid !important; width: 100%; max-height: none; overflow: visible; border: 0; box-shadow: none; }
  #parent-report::before { content: "Kedai Adik — Laporan Kemajuan"; color: #35206f; font-size: 24pt; font-weight: 900; text-align: center; }
  .parent-overview, .parent-module-grid article, .parent-insights, .parent-detail-grid article, .parent-achievement-summary { break-inside: avoid; page-break-inside: avoid; }
  .parent-module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .parent-module-grid article { padding: 8px; font-size: 9pt; }
}

/* ZilTeroka brand integration — informational, parent-gated and offline. */
.brand-intro {
  position: fixed;
  z-index: 400;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 226, 91, .28), transparent 34%),
    linear-gradient(145deg, #251766, #5f3fc2 58%, #1b73d8);
  transition: opacity .22s ease, visibility .22s ease;
}
.brand-intro.hidden { display: none; }
.brand-intro.is-leaving { visibility: hidden; opacity: 0; }
.brand-intro::before, .brand-intro::after {
  position: absolute;
  width: 28vmin;
  height: 28vmin;
  border: 3px solid rgba(255,255,255,.13);
  border-radius: 50%;
  content: "";
}
.brand-intro::before { top: -12vmin; left: -8vmin; }
.brand-intro::after { right: -10vmin; bottom: -13vmin; }
.brand-intro-stage {
  display: grid;
  width: min(330px, 70vw);
  justify-items: center;
  gap: 14px;
  color: #fff;
  text-align: center;
  animation: zilteroka-intro-arrive .7s cubic-bezier(.2,.8,.25,1) both;
}
.brand-intro-stage img {
  width: min(250px, 58vw);
  height: min(250px, 58vw);
  aspect-ratio: 1;
  object-fit: cover;
  border: 5px solid rgba(255,255,255,.9);
  border-radius: 30px;
  box-shadow: 0 20px 55px rgba(11, 17, 71, .42);
}
.brand-intro-stage p {
  margin: 0;
  color: #fff6c9;
  font-size: clamp(.78rem, 2vw, 1rem);
  font-weight: 1000;
  letter-spacing: .2em;
}
.brand-intro-skip {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 1;
  min-height: 42px;
  padding: 7px 16px;
  border: 2px solid rgba(255,255,255,.58);
  border-radius: 999px;
  background: rgba(26,16,76,.46);
  color: #fff;
  font-weight: 900;
}
.brand-intro-skip:hover, .brand-intro-skip:focus-visible { background: rgba(255,255,255,.2); }
@keyframes zilteroka-intro-arrive {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.title-family-brand {
  position: absolute;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(12px, 2vw, 24px);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 230px;
  padding: 7px 11px 7px 7px;
  border: 2px solid rgba(255,255,255,.78);
  border-radius: 999px;
  background: rgba(255,250,231,.92);
  color: #372477;
  box-shadow: 0 7px 18px rgba(36,21,91,.2);
  font-size: clamp(.62rem, 1vw, .78rem);
  font-weight: 800;
}
.title-family-brand img { width: 30px; height: 30px; border-radius: 9px; object-fit: contain; }
.title-family-brand strong { color: #125bd5; }

.zilteroka-family {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border: 3px solid #cbbdf6;
  border-radius: 22px;
  background: linear-gradient(145deg, #fffdf4, #f4f0ff);
  box-shadow: 0 9px 22px rgba(59,41,128,.1);
  text-align: left;
}
.zilteroka-family-header { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 16px; }
.zilteroka-family-header > img {
  width: 88px;
  height: 88px;
  aspect-ratio: 1;
  object-fit: contain;
  border: 4px solid #fff;
  border-radius: 22px;
  box-shadow: 0 8px 18px rgba(28,82,175,.2);
}
.zilteroka-family-header h3 { margin: 1px 0 5px; color: var(--purple-dark); font-size: 1.4rem; }
.zilteroka-family-header p { margin: 3px 0; color: #4e5670; font-size: .88rem; font-weight: 700; line-height: 1.48; }
.zilteroka-game-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.zilteroka-game-card {
  min-width: 0;
  overflow: hidden;
  border: 2px solid #ded6f6;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 5px 13px rgba(57,38,117,.1);
}
.zilteroka-game-card > img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #eae5fa; }
.zilteroka-game-card > div { display: grid; align-content: start; gap: 5px; padding: 11px; }
.zilteroka-game-card h4 { margin: 0; color: var(--purple-dark); font-size: .96rem; line-height: 1.2; }
.zilteroka-game-card p { margin: 0; color: #62677b; font-size: .75rem; font-weight: 700; line-height: 1.42; }
.zilteroka-status {
  width: max-content;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  color: #273052;
  font-size: .64rem;
  font-weight: 1000;
  line-height: 1.2;
}
.zilteroka-status.available { background: #c9f5d1; color: #14652a; }
.zilteroka-status.beta { background: #ffe892; color: #745500; }
.zilteroka-status.development { background: #dce8ff; color: #214f9d; }
.zilteroka-discover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 3px solid #ffe074;
  border-radius: 18px;
  background: #fff9df;
  align-self: start;
  height: auto;
  min-height: 0;
}
.zilteroka-discover h4 { margin: 0 0 4px; color: #4a317f; font-size: 1rem; }
.zilteroka-discover p { margin: 5px 0 0; color: #596079; font-size: .75rem; font-weight: 700; }
.zilteroka-address { display: inline-block; color: #135acb; overflow-wrap: anywhere; }
.zilteroka-qr-preview {
  justify-self: end;
  width: 126px;
  padding: 8px;
  border: 3px solid #40277f;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 15px rgba(56,37,118,.16);
}
.zilteroka-qr-preview img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; image-rendering: pixelated; }
.zilteroka-qr-preview:hover, .zilteroka-qr-preview:focus-visible { transform: translateY(-2px); box-shadow: 0 9px 18px rgba(56,37,118,.23); }

.zilteroka-qr-lightbox {
  position: fixed;
  z-index: 180;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(31,20,77,.76);
  backdrop-filter: blur(5px);
}
.zilteroka-qr-lightbox.hidden { display: none; }
.zilteroka-qr-lightbox-card {
  position: relative;
  display: grid;
  width: min(480px, 100%);
  max-height: calc(100dvh - 28px);
  justify-items: center;
  gap: 8px;
  overflow-y: auto;
  padding: 24px;
  border: 5px solid #fff;
  border-radius: 28px;
  background: var(--cream);
  box-shadow: 0 24px 62px rgba(14,10,52,.5);
  text-align: center;
}
.zilteroka-qr-lightbox-card h2 { margin: 0; color: var(--purple-dark); }
.zilteroka-qr-lightbox-card p { margin: 0; color: #5b6076; font-weight: 700; }
.zilteroka-qr-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #e8e2fa;
  color: var(--purple-dark);
  font-size: 1.65rem;
  font-weight: 1000;
}
.zilteroka-lightbox-brand { width: 48px; height: 48px; border-radius: 13px; }
.zilteroka-qr-large {
  width: min(310px, 74vw);
  height: auto;
  aspect-ratio: 1;
  padding: 8px;
  border: 3px solid #40277f;
  border-radius: 16px;
  background: #fff;
  object-fit: contain;
  image-rendering: pixelated;
}

html.reduce-motion .brand-intro-stage,
html.reduce-motion .zilteroka-qr-preview { animation: none; transition: none; }

@media (max-width: 900px) {
  .zilteroka-game-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .title-family-brand { right: 8px; bottom: 7px; padding: 5px 8px 5px 5px; }
  .title-family-brand img { width: 24px; height: 24px; border-radius: 7px; }
  .zilteroka-family { padding: 12px; }
  .zilteroka-family-header { grid-template-columns: 80px minmax(0, 1fr); gap: 11px; }
  .zilteroka-family-header > img { width: 80px; height: 80px; border-radius: 19px; }
  .zilteroka-game-gallery { grid-template-columns: minmax(0, 1fr); }
  .zilteroka-game-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); }
  .zilteroka-game-card > img { height: 100%; min-height: 88px; aspect-ratio: auto; }
  .zilteroka-discover { grid-template-columns: minmax(0, 1fr) 104px; padding: 11px; }
  .zilteroka-qr-preview { width: 100px; padding: 6px; }
  .zilteroka-qr-lightbox-card { padding: 18px 14px; }
}

@media (max-width: 380px) {
  .brand-intro-stage { width: 74vw; }
  .brand-intro-stage img { width: min(210px, 60vw); height: min(210px, 60vw); border-radius: 24px; }
  .title-family-brand span { max-width: 118px; line-height: 1.05; }
  .zilteroka-family-header { grid-template-columns: 72px minmax(0, 1fr); }
  .zilteroka-family-header > img { width: 72px; height: 72px; border-radius: 17px; }
  .zilteroka-game-card { grid-template-columns: 92px minmax(0, 1fr); }
  .zilteroka-discover { grid-template-columns: 1fr; text-align: center; }
  .zilteroka-qr-preview { justify-self: center; }
}

html.text-large .zilteroka-game-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 640px) {
  html.text-large .zilteroka-game-gallery { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .brand-intro, .title-family-brand, .zilteroka-discover, .zilteroka-qr-lightbox { display: none !important; }
}
.patterns-stage { display:flex; align-items:center; justify-content:center; min-height:190px; padding:16px; }
.pattern-row { display:flex; align-items:center; justify-content:center; gap:clamp(5px,1.4vw,14px); flex-wrap:wrap; width:100%; }
.pattern-separator { color:var(--text-muted,#665977); font-size:1.35rem; font-weight:900; }
.pattern-color,.pattern-missing { width:clamp(42px,8vw,70px); aspect-ratio:1; border-radius:18px; background:var(--pattern-color); border:3px solid rgba(45,31,57,.28); box-shadow:0 4px 0 rgba(45,31,57,.12); }
.pattern-color.is-white { border-color:#4b4053; }
.pattern-missing { display:grid; place-items:center; background:repeating-linear-gradient(135deg,#fff 0 8px,#eee8f5 8px 16px); color:#5d3b78; font-size:2rem; font-weight:900; border-style:dashed; }
.pattern-product { width:clamp(48px,9vw,76px); height:clamp(48px,9vw,76px); object-fit:contain; }
.patterns-answers { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.patterns-choice { min-height:88px; display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; padding:10px; }
.patterns-choice .pattern-color { width:54px; }
.pattern-number { font-size:clamp(1.8rem,6vw,3rem); color:var(--text-color,#31243a); }
.pattern-size { display:inline-grid; place-items:center; width:58px; height:58px; color:#9556c7; font-size:calc(2.3rem * var(--pattern-scale)); line-height:1; }
.pattern-quantity { display:inline-block; max-width:82px; color:#e55e48; font-size:1.05rem; letter-spacing:3px; line-height:1.2; overflow-wrap:anywhere; }
.pattern-direction { font-size:clamp(1.3rem,4vw,2rem); font-weight:900; color:var(--text-color,#31243a); }
@media (max-width:560px) { .patterns-stage{min-height:150px;padding:10px 4px}.patterns-answers{grid-template-columns:1fr}.patterns-choice{min-height:64px}.pattern-color,.pattern-missing{width:38px;border-radius:12px}.pattern-product{width:44px;height:44px}.pattern-separator{font-size:1rem} }

/* P07 feedback states follow the final component layer. */
.answer-button.correct-answer:disabled { border-color:#147743; background:linear-gradient(180deg,#42c47f,#218e59); color:#fff; filter:none; opacity:1; box-shadow:inset 0 0 0 3px #fff,0 0 0 5px #147743,0 7px 0 #11643a; }
