:root {
  color-scheme: light;
  --ink: #29382f;
  --muted: #89928a;
  --cream: #f3efe5;
  --paper: #fffdf7;
  --green: #4f8b62;
  --green-dark: #376b49;
  --orange: #f2a65a;
  --shadow: 0 12px 32px rgba(76, 71, 53, .12);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% -10%, #fffdf7 0, var(--cream) 68%);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button { color: inherit; font: inherit; }
.app-shell { width: min(100%, 520px); min-height: min(100dvh - 28px, 940px); margin: 0 auto; }
.home-screen, .game-shell { width: 100%; min-height: min(100dvh - 28px, 940px); display: flex; flex-direction: column; }
.home-screen { gap: 18px; padding-bottom: 8px; }
.home-topbar { min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #ffffffc9; border-radius: 21px; background: rgba(255,253,247,.9); box-shadow: 0 5px 18px #4b473812; }
.brand-lockup { display: flex; align-items: center; gap: 9px; font: 800 13px "Nunito", sans-serif; white-space: nowrap; }
.brand-lockup strong { color: var(--green-dark); }
.home-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin-left: auto; }
.home-actions .coin-pill { margin-left: 0; padding: 8px; }
.home-actions .mute-button { flex: 0 0 38px; }
.home-intro { min-height: 235px; display: grid; grid-template-columns: 1fr .9fr; align-items: center; gap: 8px; overflow: hidden; position: relative; padding: 20px 20px 18px; border-radius: 26px; background: linear-gradient(130deg, #e9f1df, #dce9d4 60%, #d2e1c9); box-shadow: inset 0 1px 1px #fff, 0 8px 25px #4b47380e; }
.home-copy { position: relative; z-index: 1; }
.home-copy h1 { margin: 7px 0 9px; font: 900 clamp(26px, 7vw, 34px)/1 "Nunito", sans-serif; letter-spacing: -1px; }
.home-copy > p:not(.eyebrow) { max-width: 230px; margin: 0 0 14px; color: #748174; font-size: 11px; line-height: 1.5; }
.continue-button { width: auto; min-width: 164px; min-height: 43px; justify-content: space-between; padding: 0 15px; border-radius: 14px; font-size: 12px; }
.home-progress { display: block; margin-top: 8px; color: #7e8c7d; font-size: 9px; font-weight: 700; }
.home-art { position: relative; width: 100%; height: 190px; }
.sun-shape { position: absolute; top: 7px; left: 50%; width: 130px; height: 130px; transform: translateX(-50%); border-radius: 50%; background: #f7d589; opacity: .8; }
.home-shelf { position: absolute; top: 35px; left: 50%; width: 144px; height: 118px; transform: translateX(-50%); padding: 12px 11px; border: 8px solid #9a704b; border-bottom-width: 10px; border-radius: 14px 14px 7px 7px; background: #c99560; box-shadow: 0 9px 0 #74553c, 0 16px 22px #53674630; }
.home-beam { height: 7px; margin: 2px -10px 9px; border-radius: 4px; background: #845b3d; box-shadow: 0 2px #e4bb82; }
.home-product { position: absolute; z-index: 1; width: 23px; height: 28px; }
.product-apple { top: 18px; left: 19px; border-radius: 48% 48% 45% 45%; background: #ed7160; }
.product-apple::before, .product-pear::before { position: absolute; top: -5px; left: 10px; width: 3px; height: 8px; border-radius: 3px; background: #72523c; content: ""; transform: rotate(12deg); }
.product-can { top: 15px; left: 59px; height: 31px; border-radius: 6px 6px 8px 8px; background: linear-gradient(90deg, #5496b1, #82c0d6 35%, #5496b1); }
.product-orange { top: 19px; right: 17px; border-radius: 50%; background: #f4ad4c; }
.product-book { top: 63px; left: 27px; height: 33px; border: 2px solid #594c85; border-radius: 3px 5px 5px 3px; background: #9685c6; }
.product-pear { top: 68px; right: 23px; width: 22px; height: 27px; border-radius: 45% 45% 55% 55%; background: #a9c75d; }
.sparkle { position: absolute; color: #efab4a; font-size: 22px; }
.sparkle-one { top: 14px; right: 3px; }
.sparkle-two { bottom: 9px; left: 2px; color: #f2a4a0; font-size: 24px; }
.map-section { flex: 1; min-height: 250px; display: flex; flex-direction: column; }
.map-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.map-heading h2 { margin: 4px 0 0; font: 900 21px/1 "Nunito", sans-serif; letter-spacing: -.4px; }
.map-count { padding: 7px 10px; border-radius: 12px; background: #fff4d4; color: #896923; font-size: 9px; font-weight: 800; white-space: nowrap; }
.map-instruction { margin: 8px 0 10px; color: #818b80; font-size: 10px; line-height: 1.45; }
.map-scroll { flex: 1; min-height: 160px; max-height: 365px; overflow: auto; overscroll-behavior: contain; border: 1px solid #ffffffc9; border-radius: 23px; background: linear-gradient(155deg, #e5efd9, #dce9d3); box-shadow: inset 0 1px 2px #ffffffa0, 0 6px 20px #4b47380b; scrollbar-color: #b8c9ab transparent; scrollbar-width: thin; }
.map-board { position: relative; min-height: 176px; overflow: hidden; }
.map-trail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map-trail path { fill: none; stroke: #b2c99f; stroke-width: 13px; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 23; }
.map-nodes { position: absolute; inset: 0; }
.map-node { position: absolute; z-index: 1; width: 66px; min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 0; border: 0; background: transparent; transform: translateX(-50%); cursor: pointer; }
.map-node:disabled { cursor: default; }
.map-node-disc { width: 54px; height: 54px; display: block; flex: 0 0 54px; background: transparent; transition: transform .17s ease, filter .17s ease; }
.map-node-disc img { display: block; width: 100%; height: 100%; object-fit: contain; }
.map-node:not(:disabled):hover .map-node-disc { transform: translateY(-3px) scale(1.06); }
.map-node.current .map-node-disc { filter: drop-shadow(0 0 5px #ffe08a); }
.map-node-label { margin-top: 6px; padding: 3px 7px; border-radius: 8px; background: #fffdf1; color: #72816e; font-size: 8px; font-weight: 800; box-shadow: 0 2px 5px #48543b12; }
.map-node.current .map-node-label { background: #fff0bd; color: #8b6423; }
.home-footer { min-height: 30px; display: flex; align-items: center; gap: 12px; color: #899188; font-size: 10px; }
.home-footer .text-button { margin-left: auto; }
.home-screen .brand-mark { flex: 0 0 40px; }
.topbar {
  display: flex; align-items: center; gap: clamp(9px, 3vw, 18px);
  min-height: 64px; padding: 9px 11px;
  background: rgba(255, 253, 247, .88); border: 1px solid rgba(255,255,255,.8);
  border-radius: 22px; box-shadow: 0 5px 18px rgba(75, 71, 56, .07);
}
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px;
  color: white; background: linear-gradient(145deg, #83b77e, #4d8a60);
  font: 900 15px "Nunito", sans-serif; letter-spacing: -1px; box-shadow: inset 0 2px 2px #ffffff50;
}
.level-block, .score-block { display: grid; gap: 1px; }
.level-block strong, .score-block strong { font: 900 17px "Nunito", sans-serif; line-height: 1; }
.eyebrow { margin: 0; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 1.15px; }
.coin-pill {
  margin-left: auto; padding: 8px 11px; border-radius: 15px; display: flex; align-items: center; gap: 6px;
  background: #fff4d4; color: #936b16; font-size: 13px; box-shadow: inset 0 1px 2px #fff;
}
.icon-button, .levels-button, .restart-button, .modal-close {
  border: 0; cursor: pointer; transition: transform .16s ease, background .16s ease;
}
.icon-button:active, .levels-button:active, .restart-button:active, .primary-button:active, .google-button:active { transform: scale(.96); }
.mute-button { width: 38px; height: 38px; border-radius: 13px; background: #eff3e8; color: var(--green-dark); font-size: 20px; }
.levels-button { min-height: 38px; padding: 0 10px; display: flex; align-items: center; gap: 4px; border-radius: 13px; background: #eff3e8; color: var(--green-dark); font-size: 11px; font-weight: 800; white-space: nowrap; }
.levels-button span:first-child { font-size: 17px; }
.game-content { flex: 1; display: flex; flex-direction: column; padding: clamp(16px, 4vw, 24px) 2px 4px; }
.game-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-heading h1 { margin: 4px 0 0; font: 900 clamp(21px, 6vw, 29px)/1.1 "Nunito", sans-serif; letter-spacing: -.7px; }
.restart-button { display: flex; align-items: center; gap: 5px; min-height: 38px; padding: 0 12px; border-radius: 13px; background: #e8e5d9; color: #667267; font-weight: 700; font-size: 12px; }
.restart-button span:first-child { font-size: 19px; line-height: 1; }
.game-hint { min-height: 20px; margin: 12px 2px 10px; color: #7d887d; font-size: 12px; text-align: center; }
.canvas-frame {
  position: relative; flex: 1; min-height: 310px; max-height: 590px; overflow-x: hidden; overflow-y: auto;
  border: 1px solid #ffffffc9; border-radius: 27px;
  background: linear-gradient(160deg, #e8f1df, #d6e3cd 76%, #cddbc4);
  box-shadow: var(--shadow), inset 0 1px 1px #fff;
}
#game-canvas { position: relative; width: 100%; min-height: 100%; display: block; touch-action: manipulation; }
.progress-row { display: grid; gap: 8px; padding: 15px 3px 8px; color: #758075; font-size: 11px; font-weight: 700; }
.progress-track { height: 8px; overflow: hidden; border-radius: 10px; background: #dfded3; box-shadow: inset 0 2px 3px #0000000c; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #78ae71, #4c8b5d); transition: width .35s ease; }
.game-footer { min-height: 38px; display: flex; align-items: center; gap: 12px; color: #8a9288; font-size: 11px; }
.game-footer #player-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { padding: 5px 0; border: 0; background: transparent; color: var(--green-dark); font-size: 11px; font-weight: 800; cursor: pointer; }
.game-footer .text-button { margin-left: auto; white-space: nowrap; }
.hidden { display: none !important; }
.overlay {
  position: fixed; z-index: 5; inset: 0; display: grid; place-items: center;
  padding: 20px; background: rgba(37, 48, 39, .45); backdrop-filter: blur(7px);
  animation: fade-in .18s ease both;
}
.modal-card {
  position: relative; width: min(100%, 370px); padding: 30px 25px 25px; text-align: center;
  background: var(--paper); border: 1px solid #fff; border-radius: 28px; box-shadow: 0 24px 80px #24362940;
  animation: pop-in .24s cubic-bezier(.2,.8,.2,1) both;
}
.modal-close { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 12px; background: #f0efe7; color: #788177; font-size: 24px; }
.modal-emoji { margin-bottom: 8px; font-size: 48px; filter: drop-shadow(0 6px 3px #6e563422); }
.modal-card h2 { margin: 7px 0; font: 900 27px/1.08 "Nunito", sans-serif; }
.modal-copy { margin: 10px auto 21px; max-width: 275px; color: #7f887f; font-size: 13px; line-height: 1.55; }
.google-button, .primary-button {
  width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 16px; background: var(--green); color: white;
  box-shadow: 0 8px 18px #4d8a6033; font-size: 14px; font-weight: 800; cursor: pointer;
  transition: transform .16s ease, background .16s ease;
}
.google-button:hover, .primary-button:hover { background: var(--green-dark); }
.google-g { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: white; color: #4285f4; font: 900 16px Arial, sans-serif; }
.guest-button { margin: 12px auto 0; }
.form-error { min-height: 16px; margin: 8px 0 0; color: #c55742; font-size: 11px; }
.victory-card { overflow: hidden; }
.confetti { position: absolute; inset: 13px 0 auto; color: #f0b84d; font-size: 18px; }
.reward-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; margin: 0 0 16px; border-radius: 15px; background: #fff4d4; color: #856625; font-size: 13px; }
.reward-row strong { font-size: 16px; }
.levels-link { display: block; margin: 12px auto 0; font-size: 12px; }
.toast {
  position: fixed; z-index: 8; left: 50%; bottom: max(25px, env(safe-area-inset-bottom)); transform: translate(-50%, 15px);
  max-width: calc(100vw - 32px); padding: 11px 17px; border-radius: 13px; background: #304537; color: white;
  box-shadow: 0 8px 24px #29382f35; font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s ease;
}
.toast.visible { transform: translate(-50%, 0); opacity: 1; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (min-height: 850px) {
  .game-content { padding-top: 28px; }
  .game-hint { margin: 16px 2px 14px; }
  .progress-row { padding-top: 19px; }
}
@media (max-width: 360px) {
  body { padding-left: 10px; padding-right: 10px; }
  .home-screen { gap: 13px; }
  .home-topbar { gap: 6px; padding: 7px; }
  .brand-lockup { gap: 5px; font-size: 11px; }
  .home-actions { gap: 5px; }
  .account-button { padding: 0 7px; font-size: 9px; }
  .home-intro { min-height: 215px; grid-template-columns: 1.1fr .8fr; padding: 15px 12px; }
  .home-copy h1 { font-size: 25px; }
  .home-copy > p:not(.eyebrow) { max-width: 175px; font-size: 10px; }
  .home-art { transform: scale(.84); transform-origin: center; }
  .topbar { gap: 7px; }
  .levels-button { width: 38px; justify-content: center; padding: 0; }
  .levels-button span:last-child { display: none; }
  .restart-label { display: none; }
  .restart-button { width: 38px; justify-content: center; padding: 0; }
  .brand-mark { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

:root {
  --ink: #f8e9ca;
  --muted: #c2a882;
  --cream: #211722;
  --paper: #432b34;
  --green: #a64d46;
  --green-dark: #773b41;
  --shadow: 0 14px 34px #100b17a8;
}
body {
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 0, #70433a 0, transparent 38%),
    radial-gradient(ellipse at 12% 65%, #352434 0, transparent 35%),
    #211722;
}
.app-shell { width: min(100%, 480px); min-height: calc(100dvh - 28px); }
.home-screen, .map-screen, .secondary-screen, .game-shell {
  min-height: calc(100dvh - 28px);
  gap: 16px;
}
.home-topbar, .topbar, .subpage-header {
  color: #f7e5bf;
  border: 2px solid #956143;
  background: linear-gradient(180deg, #58333a, #38232f 70%, #2e202a);
  box-shadow: inset 0 2px #e9bd8050, 0 5px 0 #281a25, 0 10px 20px #0e091080;
}
.brand-mark {
  background: linear-gradient(145deg, #e5a452, #a85040);
  color: #fff4d8;
  box-shadow: inset 0 2px 2px #ffffff50, 0 3px 0 #70333b;
}
.brand-lockup { color: #ffe8bd; }
.brand-lockup strong { color: #f0c36f; }
.coin-pill, .map-count {
  background: #38222b;
  color: #ffd985;
  border: 1px solid #956143;
  box-shadow: inset 0 1px #f2c47b38;
}
.home-actions .mute-button, .account-button {
  background: #54333b;
  color: #f4d69a;
  border: 1px solid #a56c4b;
}
.home-intro {
  min-height: 255px;
  color: #ffe8bd;
  border: 2px solid #946047;
  background:
    linear-gradient(90deg, #261924eb 0%, #35202cd9 46%, #35202c4a 100%),
    radial-gradient(ellipse at 82% 22%, #ba7a50 0, #654039 48%, #30202b 100%);
  box-shadow: inset 0 2px #ffdc9a45, 0 6px 0 #231620, 0 13px 28px #0b071080;
}
.home-copy h1 {
  color: #f6ca79;
  text-shadow: 0 2px #7b3c46, 0 4px #21141d;
  font-size: clamp(27px, 7vw, 36px);
}
.home-copy > p:not(.eyebrow) { color: #e2c39c; }
.eyebrow { color: #caa879; }
.home-progress { color: #edcf9e; }
.sun-shape {
  background: radial-gradient(circle, #efc66e, #b76858 62%, #6b3a45);
  box-shadow: 0 0 35px #f1bc6c45;
}
.home-shelf {
  border-color: #684037;
  background: linear-gradient(90deg, #8f5037, #bf7848 48%, #8b4936);
  box-shadow: 0 9px 0 #4c2a2e, 0 16px 22px #140d19a8, inset 0 0 0 2px #e0a45c;
}
.home-beam { background: #4c292d; box-shadow: 0 2px #dda25c; }
.product-potion, .product-vial {
  width: 22px; height: 25px; border: 2px solid #f1d7ba; border-radius: 8px 8px 10px 10px;
  background: linear-gradient(90deg, #a82e6e, #e55aa5 48%, #913579);
  box-shadow: inset 3px 1px #ffffff70, 0 0 10px #e942c273;
}
.product-potion { top: 16px; left: 18px; }
.product-potion::before, .product-vial::before {
  position: absolute; top: -8px; left: 6px; width: 7px; height: 8px;
  border: 1px solid #f4d596; border-radius: 2px 2px 0 0; background: #a77a4c; content: "";
}
.product-crystal {
  top: 16px; left: 59px; width: 26px; height: 33px; background: #75dff0;
  clip-path: polygon(50% 0, 100% 28%, 75% 100%, 22% 100%, 0 30%);
  filter: drop-shadow(0 0 8px #69daef);
}
.product-orb {
  top: 17px; right: 16px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #fff3c9, #e6a347 30%, #bc4b68 68%, #613a77);
  box-shadow: 0 0 10px #ffe08994;
}
.product-tome {
  top: 63px; left: 24px; height: 34px; border: 2px solid #e7c17a;
  border-radius: 3px 6px 6px 3px; background: linear-gradient(90deg, #4f314b, #8a4760);
  box-shadow: inset 4px 0 #e9bf6c;
}
.product-vial {
  top: 66px; right: 21px; width: 20px; height: 28px;
  border-color: #f2d6ab; background: linear-gradient(90deg, #668c54, #a7cf70, #52794b);
}
.sparkle { color: #ffdc82; }
.sparkle-two { color: #c08bdf; }
.main-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-card {
  min-height: 78px; display: grid; grid-template-columns: 36px 1fr 15px; align-items: center;
  gap: 9px; padding: 10px; text-align: left; border: 2px solid #81513e; border-radius: 15px;
  background: linear-gradient(160deg, #55333a, #392631 78%, #30212b);
  box-shadow: inset 0 1px #ffdf9b35, 0 4px 0 #251720, 0 8px 14px #120b174d;
  color: #f8e4bf; cursor: pointer; transition: transform .14s ease, filter .14s ease;
}
.menu-card:hover { transform: translateY(-2px); filter: brightness(1.15); }
.menu-card:active { transform: translateY(1px); }
.menu-play { grid-column: 1 / -1; min-height: 62px; border-color: #d39a4f; background: linear-gradient(115deg, #a84648, #76384a 60%, #593044); }
.menu-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #d29c5d; border-radius: 11px; background: #31202a; color: #f4c66f; font-size: 19px; }
.menu-card strong, .menu-card small { display: block; }
.menu-card strong { font: 900 14px "Nunito", sans-serif; }
.menu-card small { margin-top: 3px; color: #c9a983; font-size: 9px; line-height: 1.25; }
.menu-arrow { color: #ebc778; font-size: 17px; }
.home-footer { margin-top: auto; color: #b99d7e; }
.text-button { color: #efc774; }
.map-screen, .secondary-screen { padding: 5px 0 10px; }
.subpage-header { min-height: 72px; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 20px; }
.subpage-header > div { min-width: 0; flex: 1; }
.subpage-header h1 { margin: 3px 0 0; color: #f6d69a; font: 900 21px/1.1 "Nunito", sans-serif; }
.back-button {
  flex: 0 0 40px; width: 40px; height: 40px; border: 1px solid #bc8052; border-radius: 12px;
  background: #36232e; color: #f4d398; font-size: 22px; cursor: pointer;
}
.map-section { min-height: 0; }
.map-heading h2 { color: #f3d7a4; }
.map-instruction, .section-copy { color: #c0a586; }
.map-scroll {
  min-height: 240px; max-height: calc(100dvh - 235px); border: 2px solid #82513d;
  background:
    radial-gradient(ellipse at 50% 20%, #5b3540c9, transparent 70%),
    linear-gradient(155deg, #452c34, #2b202b);
  box-shadow: inset 0 2px #f4cb8a24, 0 5px 0 #1c141d;
}
.map-trail path { stroke: #d5a465; stroke-width: 11px; stroke-dasharray: 3 18; }
.map-node-label { margin-top: 5px; background: #4b3036; color: #f5d69c; }
.map-node-status { margin-top: 2px; color: #c8a77a; font-size: 8px; font-weight: 800; text-shadow: 0 1px #251720; }
.timer-pill {
  display: flex; align-items: center; gap: 4px; padding: 7px 8px; border: 1px solid #bb8650;
  border-radius: 12px; background: #38232e; color: #ffdc8d; font: 900 12px "Nunito", sans-serif;
}
.timer-pill span { font-size: 17px; }
.timer-pill.timer-warning { border-color: #f27670; background: #682d3e; color: #ffd2c2; animation: timer-pulse .65s ease infinite alternate; }
.pause-button { width: 36px; height: 36px; border: 1px solid #bb8650; border-radius: 11px; background: #38232e; color: #f5d79c; font-size: 17px; }
.game-content { padding-top: 15px; }
.game-heading h1 { color: #f6d69a; }
.game-hint { color: #dbc29b; }
.canvas-frame {
  border: 2px solid #96603f; border-radius: 20px;
  background: linear-gradient(155deg, #452a34, #211823);
  box-shadow: inset 0 2px #f1ce8e29, 0 7px 0 #211620, 0 13px 24px #100a14a8;
}
.progress-row { color: #cbb18c; }
.progress-track { background: #392732; }
.progress-track span { background: linear-gradient(90deg, #65c99e, #e2c363); }
.game-footer { color: #baa080; }
.game-footer .text-button { color: #f0c66e; }
.secondary-screen .section-copy { margin: 0; font-size: 12px; }
.collection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.relic-card {
  min-height: 178px; display: flex; flex-direction: column; align-items: center; padding: 15px 11px 12px;
  text-align: center; border: 2px solid #81513e; border-radius: 17px;
  background: linear-gradient(160deg, #55343d, #33232f);
  box-shadow: inset 0 1px #ffe0a22b, 0 4px 0 #211720, 0 8px 15px #110b164d;
}
.relic-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 8px; border: 1px solid #bf8b52; border-radius: 16px; background: radial-gradient(circle, #775047, #30202b); font-size: 29px; }
.relic-card > strong { color: #f7ddaa; font: 900 13px "Nunito", sans-serif; }
.relic-card p { flex: 1; margin: 5px 0 10px; color: #c1a282; font-size: 9px; line-height: 1.4; }
.relic-card button { width: 100%; min-height: 34px; border: 1px solid #d9a958; border-radius: 11px; background: #8a4642; color: #fff0c3; font-size: 9px; font-weight: 900; cursor: pointer; }
.relic-card button:disabled { border-color: #75604b; background: #403039; color: #b49c7e; cursor: default; }
.empty-state { margin: 28px auto; color: #cfb28d; text-align: center; font-size: 12px; line-height: 1.6; }
.settings-list { display: grid; gap: 10px; }
.setting-row { min-height: 74px; display: flex; align-items: center; gap: 12px; padding: 13px; border: 2px solid #80503e; border-radius: 16px; background: linear-gradient(150deg, #53343d, #34242f); box-shadow: inset 0 1px #ffe1a228, 0 4px 0 #221721; }
.setting-row > div { flex: 1; }
.setting-row strong, .setting-row small { display: block; }
.setting-row strong { color: #f7dfaf; font: 800 12px "Nunito", sans-serif; }
.setting-row small { margin-top: 4px; color: #c3a586; font-size: 9px; }
.setting-toggle { min-width: 90px; min-height: 35px; border: 1px solid #bd8652; border-radius: 11px; background: #44303a; color: #ebcf9a; font-size: 10px; font-weight: 800; cursor: pointer; }
.setting-toggle[aria-pressed="true"] { border-color: #73b783; background: #355745; color: #d9f1ce; }
.overlay { background: #120b17c9; }
.modal-card {
  border: 2px solid #a66a45; background: linear-gradient(155deg, #593942, #332330 82%);
  color: #f8e7c7; box-shadow: 0 22px 70px #08050bc9, inset 0 1px #ffe2a436;
}
.modal-close { background: #38232e; color: #f5d291; border: 1px solid #9a6044; }
.modal-card h2 { color: #f6d384; text-shadow: 0 2px #34202d; }
.modal-copy { color: #d1b391; }
.primary-button, .google-button { background: linear-gradient(180deg, #e6a94f, #ba603d); color: #fff4d4; box-shadow: 0 4px 0 #793b35, 0 9px 20px #120a16a3; }
.primary-button:hover, .google-button:hover { background: linear-gradient(180deg, #f0bd64, #ca7046); }
.reward-row { border: 1px solid #a97a49; background: #38252f; color: #f0d59e; }
.result-stats { display: flex; justify-content: center; gap: 26px; margin: 13px 0; color: #c7a883; font-size: 9px; font-weight: 800; letter-spacing: .6px; }
.result-stats span, .result-stats strong { display: grid; gap: 4px; }
.result-stats strong { color: #ffdc8b; font: 900 16px "Nunito", sans-serif; letter-spacing: 0; }
.secondary-action { width: 100%; min-height: 46px; margin-top: 9px; border: 1px solid #b78152; border-radius: 14px; background: #56343b; color: #f6dba5; font-size: 12px; font-weight: 900; cursor: pointer; }
.levels-link { color: #f0c66f; }
.toast { background: #4c3038; border: 1px solid #b27b4d; color: #ffedc5; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@keyframes timer-pulse { from { box-shadow: 0 0 0 #f2767000; } to { box-shadow: 0 0 14px #f2767070; } }
@media (max-width: 480px) {
  .home-screen, .map-screen, .secondary-screen, .game-shell { gap: 12px; }
  .home-topbar { gap: 6px; padding: 7px; }
  .brand-lockup { gap: 5px; font-size: 10px; }
  .home-actions { gap: 5px; }
  .home-actions .coin-pill { padding: 7px 6px; font-size: 11px; }
  .home-intro { min-height: 230px; }
  .main-menu { gap: 8px; }
  .menu-card { min-height: 72px; grid-template-columns: 31px 1fr 12px; gap: 6px; padding: 8px; }
  .menu-icon { width: 30px; height: 30px; }
  .subpage-header { gap: 7px; padding: 8px; }
  .subpage-header h1 { font-size: 17px; }
  .back-button { flex-basis: 36px; width: 36px; height: 36px; }
  .topbar { gap: 6px; padding: 7px; }
  .levels-button { width: 36px; min-height: 36px; justify-content: center; padding: 0; }
  .levels-button span:last-child { display: none; }
  .level-block strong, .score-block strong { font-size: 14px; }
  .timer-pill { gap: 2px; padding: 6px; font-size: 10px; }
  .timer-pill span { font-size: 14px; }
  .pause-button { width: 33px; height: 33px; }
  .topbar { gap: 4px; padding: 7px 6px; justify-content: space-between; }
  .topbar .brand-mark { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
  .topbar .levels-button { flex: 0 0 32px; width: 32px; min-height: 32px; }
  .topbar .level-block, .topbar .score-block { min-width: 20px; }
  .topbar .level-block .eyebrow, .topbar .score-block .eyebrow { font-size: 7px; letter-spacing: 0; }
  .topbar .level-block strong, .topbar .score-block strong { font-size: 12px; }
  .topbar .coin-pill { flex: 0 0 auto; gap: 3px; margin-left: 0; padding: 6px 5px; font-size: 10px; }
  .topbar .timer-pill { flex: 0 0 auto; }
  .topbar .pause-button, .topbar .mute-button { flex: 0 0 31px; width: 31px; height: 31px; }
}
@media (min-width: 700px) {
  .app-shell { width: min(100%, 540px); }
  .home-screen { justify-content: center; }
}

:root {
  --ink: #472b30;
  --muted: #8d745a;
  --paper: #f5e5c5;
}

body {
  background:
    radial-gradient(ellipse at 50% -12%, #fff2ce 0, transparent 47%),
    radial-gradient(ellipse at 50% 105%, #a8784f 0, transparent 54%),
    #5b3c37;
}

.home-screen, .map-screen, .secondary-screen, .game-shell {
  gap: clamp(11px, 2.2vh, 18px);
}

.home-intro {
  min-height: 275px;
  grid-template-columns: .95fr 1fr;
  border-color: #d3a562;
  background:
    radial-gradient(ellipse at 79% 30%, #c68150 0, transparent 47%),
    linear-gradient(135deg, #75463b, #492d37 54%, #342431);
}

.home-copy h1 {
  color: #ffe6a0;
  text-shadow: 0 2px #a04f43, 0 4px #38212b;
}

.home-copy > p:not(.eyebrow) { color: #f1d2a4; }
.home-copy .eyebrow { color: #e2b974; font-size: 8px; }

.home-art { height: 225px; }
.sun-shape { top: 16px; width: 145px; height: 145px; }

.home-shelf {
  top: 48px;
  width: 158px;
  height: 130px;
  border-width: 9px;
  border-bottom-width: 12px;
}

.home-witch {
  position: absolute;
  z-index: 3;
  bottom: 2px;
  left: 50%;
  width: 79px;
  height: 125px;
  transform: translateX(-50%);
  filter: drop-shadow(0 5px 5px #24172288);
}

.witch-hair {
  position: absolute;
  z-index: 1;
  top: 22px;
  left: 12px;
  width: 55px;
  height: 62px;
  border: 2px solid #281a2b;
  border-radius: 48% 48% 40% 40%;
  background: linear-gradient(90deg, #322034, #684064 48%, #302033);
}

.witch-hair::before, .witch-hair::after {
  position: absolute;
  top: 34px;
  width: 14px;
  height: 40px;
  border: 2px solid #291c2c;
  border-radius: 7px 7px 12px 12px;
  background: linear-gradient(90deg, #38233a, #805272, #342035);
  content: "";
}

.witch-hair::before { left: -5px; transform: rotate(7deg); }
.witch-hair::after { right: -5px; transform: rotate(-7deg); }

.witch-face {
  position: absolute;
  z-index: 2;
  top: 34px;
  left: 23px;
  width: 34px;
  height: 39px;
  border: 1px solid #593138;
  border-radius: 45% 45% 50% 50%;
  background: linear-gradient(110deg, #f6ce99, #d99270);
  box-shadow: inset 3px 0 #fff0c25c;
}

.witch-face i {
  position: absolute;
  top: 16px;
  left: 8px;
  width: 4px;
  height: 5px;
  border-radius: 50%;
  background: #392330;
}

.witch-face i + i { left: 22px; }
.witch-face::after {
  position: absolute;
  bottom: 7px;
  left: 14px;
  width: 7px;
  height: 3px;
  border-bottom: 1px solid #8c4546;
  border-radius: 50%;
  content: "";
}

.witch-body {
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: 3px;
  width: 73px;
  height: 57px;
  border: 2px solid #281b2d;
  border-radius: 36px 36px 9px 9px;
  background: linear-gradient(100deg, #392541, #855070 48%, #38233c);
  clip-path: polygon(27% 0, 73% 0, 100% 100%, 0 100%);
}

.witch-body::before {
  position: absolute;
  top: 1px;
  left: 24px;
  width: 20px;
  height: 11px;
  border: 2px solid #f3d28a;
  border-top: 0;
  background: #d99e73;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  content: "";
}

.witch-hat {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 17px;
  width: 49px;
  height: 38px;
  background: linear-gradient(105deg, #302039, #754469 55%, #302039);
  clip-path: polygon(50% 0, 61% 66%, 100% 89%, 4% 100%, 39% 69%);
  filter: drop-shadow(0 2px #e8bb6d);
}

.witch-hat i {
  position: absolute;
  bottom: 0;
  left: -7px;
  width: 66px;
  height: 9px;
  border: 2px solid #3c2435;
  border-radius: 50%;
  background: linear-gradient(#f0c975, #a35e4b);
}

.home-intro .sparkle { z-index: 4; }
.home-intro .sparkle-one { top: 12px; right: 2px; }
.home-intro .sparkle-two { bottom: 13px; left: 5px; }

.menu-card {
  border-color: #e1bc72;
  background: linear-gradient(180deg, #7ac8df, #3b91b9 56%, #27749d);
  box-shadow: inset 0 2px #ffffff80, 0 4px 0 #20546f, 0 8px 14px #190f184d;
  color: #fff3ce;
}

.menu-play {
  border-color: #f1ce79;
  background: linear-gradient(180deg, #8ed5e6, #409dc4 56%, #2b759f);
}

.menu-icon {
  border-color: #f0cc75;
  background: linear-gradient(145deg, #fbdb83, #c68145);
  color: #593b36;
  box-shadow: inset 0 1px #fff7d2;
}

.menu-card small { color: #e8f6e9; }
.menu-arrow { color: #fff0b9; }
.home-footer { color: #f0d3a0; }
.home-footer .text-button { color: #ffe092; }

.map-scroll {
  border-color: #d6ae69;
  background:
    radial-gradient(ellipse at 50% 16%, #f7e1a6 0, transparent 54%),
    linear-gradient(150deg, #d3bd7b, #9b9c5f 53%, #718250);
  box-shadow: inset 0 2px #fff1be, 0 5px 0 #48332b, 0 10px 22px #1a111066;
}

.map-trail path { stroke: #fff0c0; }
.victory-card {
  border: 8px double #9c633b;
  border-radius: 22px;
  background:
    linear-gradient(90deg, #d0a36d 0, #f3dfb6 7%, #f8e9c9 50%, #f3dfb6 93%, #d0a36d 100%);
  color: #563b34;
  box-shadow: 0 22px 70px #100910c9, inset 0 0 0 2px #fff4d3;
}

.victory-card .eyebrow { color: #98603f; }
.victory-card h2 {
  color: #873e43;
  text-shadow: 0 1px #fff0c3;
}

.victory-card .modal-copy { color: #775a45; }
.victory-card .result-stats { color: #8a6948; }
.victory-card .result-stats strong { color: #9a5638; }
.victory-card .reward-row {
  border: 1px solid #d1a65e;
  background: #ecd29b;
  color: #6e4a32;
}

.victory-card .primary-button {
  border: 2px solid #f5d68a;
  background: linear-gradient(180deg, #78c9df, #3295b8);
  box-shadow: 0 4px 0 #28627a, 0 8px 16px #49301d25, inset 0 1px #ffffff88;
}

.victory-card .secondary-action {
  border: 1px solid #b5834e;
  background: linear-gradient(180deg, #a56549, #79413e);
  color: #fff0ce;
}

.victory-card .levels-link { color: #75503a; }

@media (max-width: 480px) {
  .home-intro { min-height: 248px; grid-template-columns: .95fr 1fr; padding: 15px 12px; }
  .home-art { height: 212px; }
  .home-shelf { width: 145px; }
  .home-witch { transform: translateX(-50%) scale(.91); transform-origin: bottom center; }
  .menu-card { min-height: 72px; }
}

@media (max-width: 360px) {
  .home-intro { min-height: 226px; padding: 13px 9px; }
  .home-copy h1 { font-size: 23px; }
  .home-art { transform: scale(.9); transform-origin: center; }
}

.home-screen {
  min-height: 100dvh;
  gap: clamp(6px, 1.6vh, 14px);
  overflow: hidden;
  padding: max(12px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
  border-radius: 0;
  background:
    linear-gradient(180deg, #21172266 0%, #21172220 42%, #21172255 100%),
    url("imagenes/fondos/bg_menu.png") center / cover no-repeat;
}

body { padding: 0; }
.app-shell { width: 100%; min-height: 100dvh; margin: 0; }
.home-topbar {
  width: min(100%, 520px);
  align-self: center;
  background: #38232ee8;
}

.home-intro {
  width: min(100%, 520px);
  align-self: center;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  padding: 12px 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.home-copy { width: 100%; text-align: center; }
.home-copy h1 { width: 100%; margin: 0 auto 8px; }
.home-logo {
  display: block;
  width: min(100%, 520px);
  max-height: min(38dvh, 300px);
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px #160b24b3);
}

.home-progress {
  color: #fff0c5;
  text-shadow: 0 2px 4px #21131bcc;
}

.home-art { display: none; }

.main-menu {
  width: min(100%, 340px);
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "play play"
    "shop shop"
    "inventory settings";
  gap: 8px;
  align-self: center;
  margin: auto auto 0;
}

.menu-play { grid-area: play; }
.menu-shop { grid-area: shop; }
.menu-inventory { grid-area: inventory; }
.menu-settings { grid-area: settings; }

.menu-card {
  position: relative;
  min-height: 0;
  grid-column: auto;
  display: block;
  aspect-ratio: 987 / 358;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: none;
  color: #fff4cf;
  text-shadow: 0 2px 3px #073b5f;
  font-size: clamp(30px, 10vw, 44px);
}

.menu-play, .menu-shop {
  grid-column: 1 / -1;
  width: min(100%, 300px);
  justify-self: center;
  font-size: clamp(30px, 10vw, 44px);
}

.menu-play { background-image: url("imagenes/botones/boton_jugar.png"); }
.menu-shop { background-image: url("imagenes/botones/boton_tienda.png"); }
.menu-card:hover { filter: brightness(1.08); }
.menu-icon, .menu-arrow { display: none; }
.menu-card > span:nth-child(2) {
  position: absolute;
  top: 50%;
  right: 2%;
  left: 28%;
  min-width: 0;
  transform: translateY(-50%);
  text-align: center;
}
.menu-card strong { font-size: 1em; }
.menu-card small { display: none; }
.menu-play strong, .menu-shop strong {
  line-height: 1;
  text-shadow: 0 2px 0 #165279, 0 4px 0 #0a3d61, 0 7px 8px #06182ebf;
}

.menu-round {
  min-height: 0;
  aspect-ratio: 1.35 / 1;
  align-content: end;
  justify-items: center;
  padding: 0;
  background-position: center 0;
  background-size: min(20vw, 80px) auto;
  border-radius: 16px;
  font-size: clamp(16px, 4.8vw, 20px);
}

.menu-inventory { background-image: url("imagenes/botones/boton_inventario.png"); }
.menu-settings { background-image: url("imagenes/botones/boton_ajustes.png"); }
.menu-round > span:nth-child(2) {
  top: auto;
  right: 2%;
  bottom: 16%;
  left: 2%;
  transform: none;
  text-align: center;
}
.menu-round strong { color: #fff0bc; }
.menu-round small { display: none; }

.map-screen {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding: max(16px, env(safe-area-inset-top)) 18px max(14px, env(safe-area-inset-bottom));
  border-radius: 0;
  background: url("imagenes/fondos/bg-mapa.png") center / cover no-repeat;
}

.map-screen .subpage-header,
.map-screen .map-section {
  width: min(100%, 480px);
}

.map-screen .map-section {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.map-screen .map-heading h2 { color: #542e2b; }
.map-screen .map-heading .eyebrow { color: #8e5430; }
.map-screen .map-instruction { color: #684535; }
.map-screen .map-count {
  border-color: #a96c3f;
  background: #fff0c9ed;
  color: #704126;
}

.map-screen .map-scroll {
  min-height: 0;
  max-height: none;
  padding: 6px 10px 14px;
  border: 0;
  border-radius: 0;
  clip-path: inset(0 round 12px);
  background: transparent;
  box-shadow: none;
}

.map-screen .map-board { overflow: hidden; }
.map-screen .map-trail { overflow: hidden; }

.map-screen .map-trail path {
  stroke: #a76a35;
  stroke-dasharray: 3 17;
}

.map-screen .map-node-status {
  color: #633d2c;
  text-shadow: 0 1px #fff0ca;
}

@media (max-width: 360px) {
  .home-screen { padding-right: 10px; padding-left: 10px; }
  .home-intro { min-height: 190px; }
  .home-logo { max-height: min(34dvh, 220px); }
  .map-screen { padding-right: 13px; padding-left: 13px; }
}

@media (max-height: 700px) {
  .home-screen { gap: 6px; }
  .home-topbar { min-height: 54px; }
  .home-intro { min-height: 0; }
  .home-logo { max-height: 18dvh; }
  .home-progress { margin-top: 4px; }
  .main-menu { width: min(100%, 220px); }
  .menu-round { background-size: min(18vw, 66px) auto; }
}
