:root {
  --ink: #24324a;
  --muted: #718096;
  --cream: #fff7e9;
  --paper: #fffdf8;
  --orange: #ff8b42;
  --orange-dark: #e86d2d;
  --yellow: #ffd45a;
  --green: #69c98c;
  --blue: #65b9e8;
  --shadow: 0 12px 30px rgba(69, 79, 102, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #f1f5fb; color: var(--ink); font-family: 'Nunito', 'Trebuchet MS', system-ui, sans-serif; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #4b83d1; outline-offset: 3px; }

.app-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(100%, 760px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 18px max(12px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 86% 12%, #fff0bf 0 9%, transparent 9.5%), linear-gradient(155deg, #fff5df 0%, #eff9ff 52%, #f1ffef 100%);
}
.sky-deco { position: absolute; z-index: -1; pointer-events: none; opacity: .45; border-radius: 50%; background: #fff; filter: blur(1px); }
.sky-one { width: 180px; height: 75px; top: 145px; left: -85px; }
.sky-two { width: 210px; height: 80px; top: 430px; right: -125px; }

.brandbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 680px; margin: 0 auto; min-height: 48px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; background: #fff; box-shadow: 0 4px 0 #f0d9b7; font-size: 23px; transform: rotate(-5deg); }
.brand-name { font-weight: 1000; letter-spacing: .045em; font-size: 15px; }
.brand-name b { color: var(--orange-dark); }
.brand-actions { display: flex; align-items: center; gap: 8px; }
.best-chip { display: flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid rgba(210, 177, 111, .35); border-radius: 999px; background: rgba(255,255,255,.75); font-weight: 900; font-size: 13px; box-shadow: 0 3px 0 rgba(231, 212, 174, .45); }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 13px; background: #fff; color: var(--ink); box-shadow: 0 4px 0 #dce4ee; cursor: pointer; font-weight: 1000; font-size: 17px; }
.icon-button:active { transform: translateY(2px); box-shadow: 0 2px 0 #dce4ee; }

.screen { width: 100%; max-width: 620px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; }
.hidden { display: none !important; }
.home-screen { align-items: center; justify-content: center; padding: 12px 0 4px; text-align: center; }
.home-copy { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: rgba(255,255,255,.8); color: #b36b35; font-size: 10px; font-weight: 1000; letter-spacing: .13em; box-shadow: 0 3px 0 rgba(228, 204, 163, .45); }
.sparkle { color: #ffb82e; font-size: 13px; }
h1 { margin: 15px 0 8px; font-size: clamp(42px, 10vw, 64px); line-height: .94; letter-spacing: -.055em; font-weight: 1000; color: #27344b; }
h1 span { color: #ed7b3d; text-shadow: 0 3px 0 rgba(255,255,255,.8); }
.home-subtitle { max-width: 370px; margin: 12px auto 0; color: #66758b; font-size: 14px; line-height: 1.45; font-weight: 700; }
.hero-scene { position: relative; width: min(100%, 410px); height: 220px; margin: 3px auto 5px; }
.sun-bubble { position: absolute; width: 150px; height: 150px; top: 30px; left: 50%; transform: translateX(-50%); border-radius: 50%; background: #ffe7a0; }
.cloud { position: absolute; height: 28px; width: 85px; background: rgba(255,255,255,.9); border-radius: 25px; }
.cloud:before, .cloud:after { content: ''; position: absolute; bottom: 6px; width: 36px; height: 36px; border-radius: 50%; background: inherit; }
.cloud:before { left: 12px; }.cloud:after { right: 12px; width: 28px; height: 28px; }
.cloud-a { top: 46px; left: 27px; transform: scale(.75); }.cloud-b { top: 80px; right: 13px; transform: scale(.9); }
.parcel-hero { position: absolute; display: grid; place-items: center; border: 5px solid #fff; border-radius: 17px; box-shadow: 0 10px 0 rgba(95, 105, 125, .12), 0 16px 24px rgba(78, 97, 127, .14); font-size: 31px; }
.parcel-main { z-index: 2; width: 130px; height: 124px; left: 50%; top: 60px; transform: translateX(-50%) rotate(-4deg); background: linear-gradient(145deg, #f6be75, #e9a65e); }
.parcel-back { z-index: 1; width: 95px; height: 91px; left: calc(50% - 112px); top: 103px; transform: rotate(-13deg); background: #8ed7a6; }
.parcel-front { z-index: 3; width: 94px; height: 88px; right: calc(50% - 151px); top: 112px; transform: rotate(12deg); background: #8dcdf2; }
.parcel-tape { position: absolute; top: 0; bottom: 0; left: 48px; width: 24px; background: rgba(255, 234, 177, .75); border-left: 2px dashed rgba(182, 127, 64, .45); border-right: 2px dashed rgba(182, 127, 64, .45); }
.parcel-emoji { z-index: 1; font-size: 39px; filter: drop-shadow(0 2px 0 rgba(255,255,255,.8)); }
.parcel-stamp { position: absolute; right: 8px; bottom: 7px; padding: 2px 4px; border: 2px solid rgba(151,91,39,.35); border-radius: 4px; color: rgba(151,91,39,.6); font-size: 8px; font-weight: 1000; transform: rotate(8deg); }
.mini-spark { position: absolute; color: #ffb82e; font-size: 25px; }.spark-a { top: 44px; right: 87px; }.spark-b { top: 133px; left: 69px; color: #6eb9e5; }
.home-actions { width: min(100%, 380px); }
.how-card { display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin-bottom: 13px; border: 1px solid rgba(216, 197, 163, .45); border-radius: 17px; background: rgba(255,255,255,.76); text-align: left; box-shadow: 0 5px 0 rgba(222, 208, 181, .35); }
.how-icon { display: grid; place-items: center; flex: 0 0 39px; height: 39px; border-radius: 13px; background: #fff0c8; font-size: 21px; }
.how-card strong, .how-card span { display: block; }.how-card strong { font-size: 13px; font-weight: 1000; }.how-card span { margin-top: 1px; color: #778397; font-size: 11px; line-height: 1.25; font-weight: 700; }
.primary-button { min-height: 53px; width: 100%; padding: 12px 18px; border: 0; border-radius: 16px; background: linear-gradient(180deg, #ff9b50, #f27a36); color: #fff; box-shadow: 0 6px 0 #d85f2e, 0 10px 18px rgba(215, 111, 54, .18); cursor: pointer; font-size: 15px; font-weight: 1000; letter-spacing: .08em; transition: transform .12s, box-shadow .12s, filter .12s; }
.primary-button span { margin-left: 8px; font-size: 19px; vertical-align: -1px; }.primary-button:hover { filter: brightness(1.04); }.primary-button:active { transform: translateY(4px); box-shadow: 0 2px 0 #d85f2e; }
.text-button { padding: 10px 16px; border: 0; background: transparent; color: #718096; cursor: pointer; font-size: 12px; font-weight: 900; }.text-button:hover { color: var(--orange-dark); }
.tiny-note { margin: 11px 0 0; color: #9aa4b3; font-size: 10px; font-weight: 800; letter-spacing: .04em; }

.game-screen { padding: 10px 0 5px; gap: 10px; }
.game-topline { display: grid; grid-template-columns: auto minmax(80px,1fr) auto auto; align-items: center; gap: 8px; }
.level-pill, .lives-pill { min-height: 39px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px; border-radius: 13px; background: rgba(255,255,255,.83); box-shadow: 0 4px 0 rgba(218, 218, 210, .55); }
.level-pill span, .progress-label, .score-block span, .combo-block span { color: #8a96a9; font-size: 9px; font-weight: 1000; letter-spacing: .09em; }.level-pill strong, .lives-pill strong { font-size: 16px; font-weight: 1000; }.lives-pill { color: #ef6c70; }.pause-button { width: 39px; height: 39px; font-size: 15px; }
.progress-wrap { min-width: 0; padding: 0 3px; }.progress-label { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 5px; }.progress-label strong { color: var(--ink); font-size: 10px; }.progress-track { height: 9px; overflow: hidden; border-radius: 10px; background: #e7e9eb; box-shadow: inset 0 1px 2px rgba(46, 59, 80, .08); }.progress-fill { width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #81d79a, #4fc28b); transition: width .25s ease; }
.score-row { display: flex; align-items: center; justify-content: space-between; padding: 0 3px; }.score-block strong, .combo-block strong { display: block; margin-top: -2px; font-size: 20px; line-height: 1; font-weight: 1000; }.combo-block { text-align: right; }.combo-block strong { color: #e99539; }
.sorting-area { padding: 12px 12px 10px; border: 1px solid rgba(208, 220, 225, .75); border-radius: 23px; background: rgba(255,255,255,.72); box-shadow: var(--shadow); }
.instruction-line { display: flex; align-items: center; justify-content: center; gap: 7px; color: #69778d; font-size: 12px; font-weight: 900; text-align: center; }.instruction-dot { width: 7px; height: 7px; border-radius: 50%; background: #ffa84d; box-shadow: 0 0 0 4px rgba(255,168,77,.15); }
.parcel-stage { position: relative; min-height: 213px; margin: 10px 0 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; border-radius: 18px; background: linear-gradient(180deg, #e2f3fc 0%, #eaf8ff 55%, #dbf0f8 56%, #d0e8f2 100%); }
.parcel-stage:before { content: ''; position: absolute; top: 13px; left: 8%; width: 48px; height: 16px; border-radius: 30px; background: rgba(255,255,255,.7); box-shadow: 8px -6px 0 -1px rgba(255,255,255,.7), 19px 1px 0 -4px rgba(255,255,255,.7); }
.parcel-stage:after { content: ''; position: absolute; top: 27px; right: 10%; width: 36px; height: 12px; border-radius: 30px; background: rgba(255,255,255,.7); box-shadow: 7px -5px 0 -2px rgba(255,255,255,.7), 17px 1px 0 -4px rgba(255,255,255,.7); }
.conveyor { position: absolute; z-index: 0; left: -3%; width: 106%; height: 24px; border-top: 4px solid #a4bdca; border-bottom: 4px solid #a4bdca; background: repeating-linear-gradient(90deg, #c6d7df 0 20px, #b1c8d2 20px 27px); transform: rotate(-2deg); opacity: .8; }.conveyor-back { top: 62px; }.conveyor-front { bottom: 31px; transform: rotate(2deg); }
.parcel-card { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 150px; height: 145px; padding: 9px 10px 8px; overflow: hidden; border: 5px solid #fff; border-radius: 17px; background: linear-gradient(145deg, #f3c17d, #e9a65e); box-shadow: 0 7px 0 #bc8548, 0 13px 19px rgba(60, 94, 113, .2); transform: rotate(-2deg); animation: parcel-in .28s cubic-bezier(.2,.8,.2,1); }
.parcel-card.special { background: linear-gradient(145deg, #ffe58b, #f6be4e); box-shadow: 0 7px 0 #c18c2e, 0 13px 19px rgba(60, 94, 113, .2); }
.parcel-ribbon { position: absolute; top: -5px; bottom: -5px; left: calc(50% - 11px); width: 22px; background: rgba(255, 235, 177, .65); border-left: 2px dashed rgba(174, 121, 58, .4); border-right: 2px dashed rgba(174, 121, 58, .4); pointer-events: none; }
.parcel-top-label, .parcel-bottom-label { z-index: 1; display: flex; width: 100%; justify-content: space-between; align-items: center; color: rgba(117, 74, 35, .76); font-size: 6px; line-height: 1; font-weight: 1000; letter-spacing: .05em; }.parcel-bottom-label { margin-top: auto; }
.parcel-code { padding: 2px 3px; border-radius: 3px; background: rgba(255,255,255,.42); }
.parcel-face { z-index: 1; display: grid; place-items: center; flex: 1; font-size: 47px; line-height: 1; filter: drop-shadow(0 3px 0 rgba(255,255,255,.55)); }.parcel-destination { z-index: 1; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.75); color: #536075; font-size: 8px; font-weight: 1000; letter-spacing: .13em; }
.timer-track { position: absolute; z-index: 3; bottom: 10px; left: 18%; width: 64%; height: 7px; overflow: hidden; border-radius: 8px; background: rgba(255,255,255,.75); }.timer-fill { width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #61c994, #ffd05a); transition: width .1s linear, background .15s; }.timer-fill.urgent { background: #ef7777; }
.timer-caption { position: absolute; bottom: 0; z-index: 2; color: #7da2b2; font-size: 7px; font-weight: 1000; letter-spacing: .13em; transform: translateY(-1px); }
.hub-heading { display: flex; align-items: center; gap: 8px; margin: 4px 0 9px; color: #8290a2; font-size: 9px; font-weight: 1000; letter-spacing: .11em; }.hub-heading-line { flex: 1; height: 1px; background: #e4e9ed; }
.hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }.hub-button { min-width: 0; min-height: 103px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; border: 2px solid transparent; border-radius: 15px; color: var(--ink); cursor: pointer; box-shadow: 0 5px 0 rgba(51, 75, 94, .12); transition: transform .1s, box-shadow .1s, filter .1s; }.hub-button:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(51, 75, 94, .12); }.hub-button:disabled { cursor: default; filter: saturate(.7); }.hub-sun { background: #fff0c6; border-color: #f3d88d; }.hub-leaf { background: #ddf5e4; border-color: #b5e4c3; }.hub-wave { background: #dff2ff; border-color: #b8ddf2; }.hub-icon { font-size: 26px; line-height: 1.15; }.hub-name { font-size: 9px; line-height: 1.15; font-weight: 1000; letter-spacing: .035em; }.hub-sub { color: #78869a; font-size: 8px; font-weight: 800; }.hub-button.correct { border-color: #40b978; box-shadow: 0 0 0 3px rgba(64,185,120,.18), 0 5px 0 rgba(51,75,94,.12); }.hub-button.wrong { border-color: #e87979; animation: shake .25s; }
.feedback-message { min-height: 18px; margin-top: 9px; color: #7b899d; text-align: center; font-size: 10px; font-weight: 900; }.feedback-message.good { color: #32a86f; }.feedback-message.bad { color: #d96767; }
.game-footer { margin-top: auto; padding: 2px 3px 4px; }.belt-history-label { margin-bottom: 6px; color: #94a0b0; font-size: 8px; font-weight: 1000; letter-spacing: .12em; }.belt-history { display: flex; align-items: center; gap: 7px; min-height: 30px; overflow: hidden; }.history-empty { color: #a1aaba; font-size: 10px; font-weight: 700; }.history-token { display: grid; place-items: center; flex: 0 0 29px; width: 29px; height: 27px; border-radius: 8px; background: rgba(255,255,255,.8); box-shadow: 0 2px 0 rgba(208,218,224,.8); font-size: 15px; }.history-token.bad { opacity: .4; filter: grayscale(1); }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(37, 52, 75, .38); backdrop-filter: blur(5px); }.modal-card { position: relative; width: min(100%, 350px); padding: 23px 22px 20px; border: 5px solid #fff; border-radius: 25px; background: #fffaf0; box-shadow: 0 15px 0 rgba(37, 52, 75, .12), 0 25px 50px rgba(34, 49, 74, .25); text-align: center; animation: modal-in .2s ease-out; }.modal-confetti { color: #f5b849; font-size: 19px; letter-spacing: .5em; }.modal-icon { margin: 5px 0; font-size: 48px; }.modal-card h2 { margin: 5px 0; color: #27344b; font-size: 26px; font-weight: 1000; letter-spacing: -.04em; }.modal-card p { margin: 7px auto 16px; max-width: 265px; color: #758298; font-size: 13px; line-height: 1.45; font-weight: 800; }.modal-actions { display: grid; gap: 5px; }.modal-stats { display: flex; justify-content: center; gap: 18px; margin: 0 0 17px; }.modal-stat strong, .modal-stat span { display: block; }.modal-stat strong { color: #2e405d; font-size: 19px; font-weight: 1000; }.modal-stat span { color: #93a0ae; font-size: 8px; font-weight: 1000; letter-spacing: .1em; }
.app-footer { display: flex; justify-content: space-between; gap: 10px; max-width: 680px; width: 100%; margin: 9px auto 0; color: #a1aab5; font-size: 7px; font-weight: 1000; letter-spacing: .09em; }.app-footer i { padding: 0 3px; color: #f1a353; font-style: normal; }

@keyframes parcel-in { from { opacity: 0; transform: translateY(-15px) rotate(4deg) scale(.86); } to { opacity: 1; transform: translateY(0) rotate(-2deg) scale(1); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

@media (min-width: 620px) {
  .app-shell { min-height: 100vh; padding-left: 26px; padding-right: 26px; }
  .home-screen { padding-top: 20px; }.hero-scene { height: 245px; }.sorting-area { padding: 15px 18px 12px; }.parcel-stage { min-height: 230px; }.hub-button { min-height: 110px; }.game-screen { padding-top: 14px; }
}
@media (max-height: 740px) and (max-width: 619px) {
  .home-screen { justify-content: flex-start; padding-top: 8px; }.hero-scene { height: 175px; transform: scale(.85); transform-origin: center top; margin-bottom: -18px; }.home-subtitle { margin-top: 8px; }.sorting-area { padding-top: 9px; }.parcel-stage { min-height: 190px; margin-top: 7px; margin-bottom: 8px; }.hub-button { min-height: 88px; }.game-screen { gap: 7px; }
}
@media (max-width: 360px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }.game-topline { gap: 5px; }.level-pill, .lives-pill { padding: 5px 7px; }.hub-grid { gap: 5px; }.hub-name { font-size: 8px; }.hub-sub { font-size: 7px; }.parcel-stage { min-height: 190px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
