:root {
  --ink: #22344d;
  --berry: #ee5d82;
  --berry-dark: #c73d67;
  --mint: #48cfa8;
  --sky: #70d6ee;
  --cream: #fff9e9;
  --gold: #ffc64b;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #c8f0f4; }
body { user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; color: var(--ink); }
button, a { font: inherit; }
button { touch-action: manipulation; cursor: pointer; }
[hidden] { display: none !important; }

.game-shell { position: relative; width: min(100%, 470px); height: 100%; height: 100dvh; min-height: 560px; margin: auto; overflow: hidden; background: #72d8ec; isolation: isolate; }
.screen { position: absolute; z-index: 1; inset: 0; display: none; overflow: hidden; }
.screen.active { display: flex; animation: screen-in .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes screen-in { from { opacity: 0; transform: scale(1.025); } to { opacity: 1; transform: scale(1); } }

.loading-screen { flex-direction: column; align-items: center; justify-content: center; color: #fff; background: linear-gradient(160deg,#61d3ee 0%,#8ce5d3 58%,#fff1a6 100%); }
.loading-screen::before, .loading-screen::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; opacity: .18; background: #fff; }
.loading-screen::before { top: -90px; right: -80px; }
.loading-screen::after { bottom: -130px; left: -80px; }
.loading-sky { position: absolute; inset: 0; background: radial-gradient(circle at 25% 25%,rgba(255,255,255,.44) 0 4%,transparent 4.5%), radial-gradient(circle at 72% 43%,rgba(255,255,255,.32) 0 2.5%,transparent 3%); }
.loading-mark { position: relative; width: 132px; height: 132px; margin-bottom: 24px; animation: loading-float 1.4s ease-in-out infinite; }
.loading-mark::before { content: ""; position: absolute; inset: 17px; border: 8px solid rgba(255,255,255,.78); border-radius: 50%; box-shadow: inset 0 0 0 6px rgba(61,181,186,.14),0 15px 35px rgba(34,75,106,.14); }
.loading-mark i { position: absolute; top: 53px; left: 46px; width: 42px; height: 27px; border-radius: 55% 45%; transform: rotate(var(--r)); background: var(--c); box-shadow: inset -5px -5px 9px rgba(77,48,96,.14),0 4px 8px rgba(36,75,95,.15); }
.loading-mark i:nth-child(1) { --r: -36deg; --c: #ff6e95; transform: translate(-21px,-26px) rotate(var(--r)); }
.loading-mark i:nth-child(2) { --r: 18deg; --c: #755fe9; transform: translate(32px,-6px) rotate(var(--r)); }
.loading-mark i:nth-child(3) { --r: -5deg; --c: #ffbd3e; transform: translate(5px,38px) rotate(var(--r)); }
.loading-mark b { position: absolute; right: 7px; top: 4px; color: #fff07c; font-size: 28px; text-shadow: 0 3px 0 rgba(180,134,33,.17); }
.loading-screen h1 { position: relative; margin: 0; font-size: clamp(38px,11vw,53px); line-height: .85; letter-spacing: -.06em; text-shadow: 0 5px 0 rgba(28,92,111,.16); }
.loading-screen h1 span { color: #fff179; }
.loading-screen > p { position: relative; margin: 10px 0 34px; font-size: 13px; font-weight: 900; letter-spacing: .22em; }
.loading-track { position: relative; width: min(270px,68vw); height: 11px; overflow: hidden; padding: 2px; border-radius: 99px; background: rgba(255,255,255,.42); box-shadow: inset 0 1px 3px rgba(28,78,98,.13); }
.loading-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#ffdb53,#ff738f); transition: width .2s; }
.loading-screen > strong { position: relative; margin-top: 10px; font-size: 10px; letter-spacing: .1em; }
.creator-credit { position: relative; margin-top: 10px; color: rgba(46,104,118,.68); font-size: 8px; font-weight: 800; letter-spacing: .04em; }
@keyframes loading-float { 50% { transform: translateY(-9px) rotate(2deg); } }

.menu-screen { flex-direction: column; justify-content: flex-end; background: #5fccea; }
.menu-art, .menu-gradient { position: absolute; inset: 0; }
.menu-art { background: url("../../assets/game-art/bean-battle-menu.webp") center/cover no-repeat; transform: scale(1.01); }
.menu-gradient { background: linear-gradient(180deg,rgba(33,133,177,.08) 0%,transparent 32%,rgba(27,43,56,.08) 55%,rgba(27,42,58,.56) 100%); }
.menu-top { position: absolute; z-index: 3; top: 0; right: 0; left: 0; display: flex; justify-content: space-between; padding: max(14px,env(safe-area-inset-top)) 16px 0; }
.round-button { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid rgba(255,255,255,.75); border-radius: 50%; color: #fff; background: rgba(31,66,83,.28); box-shadow: 0 5px 13px rgba(35,60,72,.15), inset 0 1px rgba(255,255,255,.36); text-decoration: none; font-size: 20px; font-weight: 900; backdrop-filter: blur(9px); }
.round-button:active { transform: scale(.9); }
.title-lockup { position: absolute; z-index: 2; top: max(67px,calc(env(safe-area-inset-top) + 53px)); left: 0; width: 100%; color: #fff; text-align: center; text-shadow: 0 3px 0 rgba(29,80,100,.15),0 5px 18px rgba(29,80,100,.18); }
.title-lockup p { margin: 0 0 7px; font-size: 9px; font-weight: 900; letter-spacing: .25em; }
.title-lockup h1 { margin: 0; font-size: clamp(39px,11vw,54px); line-height: .82; letter-spacing: -.075em; }
.title-lockup h1 span { color: #fff069; }
.title-lockup strong { display: block; margin-top: 10px; font-size: 12px; letter-spacing: .18em; }
.title-lockup strong i { padding: 2px 6px; border-radius: 99px; color: #fff; background: var(--berry); font-style: normal; }

.journey-card { position: relative; z-index: 3; margin: 0 10px max(9px,env(safe-area-inset-bottom)); padding: 17px 17px 12px; border: 1px solid rgba(255,255,255,.8); border-radius: 26px; background: rgba(255,251,240,.95); box-shadow: 0 18px 45px rgba(34,51,63,.27), inset 0 1px #fff; backdrop-filter: blur(16px); }
.journey-heading { display: flex; align-items: center; justify-content: space-between; }
.journey-heading small, .save-summary small, .queue-block small, .shots-block small, .hud-pill small { display: block; color: #89939e; font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.journey-heading strong { display: block; margin-top: 2px; font-size: 18px; }
.journey-heading > span { padding: 7px 10px; border-radius: 99px; color: #fff; background: var(--mint); box-shadow: 0 4px 0 #29ab87; font-size: 11px; font-weight: 900; }
.save-summary { display: grid; grid-template-columns: 1.15fr 1fr 1fr; margin: 12px 0; padding: 10px 0; border-top: 1px solid #e7e3d9; border-bottom: 1px solid #e7e3d9; }
.save-summary > div { padding: 0 9px; border-right: 1px solid #e7e3d9; }
.save-summary > div:first-child { padding-left: 0; }
.save-summary > div:last-child { border: 0; }
.save-summary strong { display: flex; align-items: center; gap: 4px; margin-top: 4px; color: #38465b; font-size: 13px; }
.coin-dot { display: inline-block; width: 13px; height: 13px; border: 2px solid #e29a27; border-radius: 50%; background: #ffd958; box-shadow: inset 0 0 0 2px #fff196; }
.level-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 7px; }
.level-button { position: relative; aspect-ratio: 1; border: 0; border-radius: 12px; color: #fff; background: linear-gradient(145deg,#72dec1,#3ec19c); box-shadow: 0 4px 0 #24a786, inset 0 1px rgba(255,255,255,.52); font-size: 13px; font-weight: 900; }
.level-button.current { outline: 3px solid #ffcf48; outline-offset: 2px; animation: level-pulse 1.6s ease-in-out infinite; }
.level-button.completed::after { content: "★"; position: absolute; top: -5px; right: -3px; display: grid; width: 15px; height: 15px; place-items: center; border-radius: 50%; color: #9b6621; background: #ffdc55; font-size: 8px; }
.level-button.locked { color: #a8afb7; background: #e5e5df; box-shadow: 0 4px 0 #cacbc5; }
.level-lock { position: relative; display: block; width: 19px; height: 15px; margin: 5px auto 0; border-radius: 5px; background: linear-gradient(145deg,#ffd966,#e9a93e); box-shadow: inset 0 1px rgba(255,255,255,.72),0 2px 0 #b98334; }
.level-lock::before { content: ""; position: absolute; top: -10px; left: 3px; width: 9px; height: 11px; border: 3px solid #b58a4b; border-bottom: 0; border-radius: 8px 8px 0 0; }
.level-lock::after { content: ""; position: absolute; top: 5px; left: 8px; width: 3px; height: 6px; border-radius: 3px; background: #8d672d; box-shadow: 0 -1px 0 rgba(255,255,255,.35); }
.level-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #24a786; }
@keyframes level-pulse { 50% { outline-color: #ff758f; } }
.primary-button { display: flex; width: 100%; min-height: 51px; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 15px; color: #fff; background: linear-gradient(180deg,#ff718f,#ed4f78); box-shadow: 0 6px 0 #c83a64,0 10px 20px rgba(217,67,105,.22),inset 0 1px rgba(255,255,255,.45); font-size: 14px; font-weight: 900; letter-spacing: .04em; }
.journey-card .primary-button { margin-top: 14px; }
.primary-button b { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; color: var(--berry); background: #fff; font-size: 11px; }
.primary-button:active { transform: translateY(4px); box-shadow: 0 2px 0 #c83a64; }
.menu-tip { margin: 11px 0 6px; color: #6f7884; text-align: center; font-size: 10px; font-weight: 800; }
.timer-rule { margin: 0; color: #9a6c63; text-align: center; font-size: 7.5px; font-weight: 800; letter-spacing: .015em; }
.menu-tip i { font-size: 14px; font-style: normal; }
.signature { margin: 5px 0 0; color: #9a9fa6; text-align: center; font-size: 8px; font-weight: 800; letter-spacing: .04em; }

.play-screen { flex-direction: column; background: #67cfe9; }
.game-header { display: grid; flex: 0 0 auto; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 11px; padding: max(9px,env(safe-area-inset-top)) 12px 8px; color: #fff; background: linear-gradient(180deg,#40b7dc,#57cce7); box-shadow: 0 5px 18px rgba(29,100,128,.22); }
.game-header > div { text-align: center; text-shadow: 0 2px rgba(29,91,112,.15); }
.game-header small { display: block; font-size: 8px; font-weight: 900; letter-spacing: .15em; }
.game-header strong { display: block; margin-top: 2px; font-size: 15px; }
.game-header .round-button { width: 40px; height: 40px; font-size: 17px; }
.hud-row { z-index: 3; display: grid; flex: 0 0 55px; grid-template-columns: 1fr 1.2fr 1fr; gap: 6px; padding: 7px 9px; background: rgba(249,255,251,.94); box-shadow: 0 4px 12px rgba(39,73,83,.12); }
.hud-pill { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 6px; border-radius: 11px; background: #f1f4ee; }
.hud-pill strong, .hud-pill span { color: #34465c; font-size: 14px; font-weight: 900; }
.health-pill span { color: #f25c7d; font-size: 14px; letter-spacing: 1px; }
.coin-pill .coin-dot { width: 12px; height: 12px; }
.arena { position: relative; flex: 1 1 auto; min-height: 285px; overflow: hidden; background: #9adfb9; }
#gameCanvas { display: block; width: 100%; height: 100%; touch-action: none; }
.turn-timer { position: absolute; z-index: 5; top: 10px; left: 50%; display: grid; min-width: 64px; padding: 5px 11px 6px; place-items: center; border: 2px solid rgba(255,255,255,.84); border-radius: 13px; color: #426173; background: rgba(255,251,235,.9); box-shadow: 0 5px 14px rgba(49,81,93,.15); pointer-events: none; transform: translateX(-50%); }
.turn-timer small { font-size: 6px; font-weight: 900; letter-spacing: .13em; }
.turn-timer strong { font-size: 16px; line-height: 1; }
.turn-timer.urgent { color: #fff; background: #f15e77; animation: timer-pulse .48s ease-in-out infinite alternate; }
@keyframes timer-pulse { to { transform: translateX(-50%) scale(1.08); } }
.level-banner, .combo-banner { position: absolute; z-index: 5; left: 50%; pointer-events: none; transform: translate(-50%,-50%) scale(.7); opacity: 0; text-align: center; }
.level-banner { top: 42%; min-width: 230px; padding: 13px 20px; border: 3px solid rgba(255,255,255,.9); border-radius: 18px; color: #fff; background: rgba(46,65,82,.82); box-shadow: 0 8px 25px rgba(35,54,66,.18); font-size: 18px; font-weight: 900; }
.level-banner.show { animation: banner-pop 1.25s ease both; }
.combo-banner { top: 24%; color: #fff; font-size: 28px; font-weight: 900; text-shadow: 0 4px 0 #d94973,0 7px 16px rgba(64,50,80,.2); }
.combo-banner.show { animation: combo-pop .85s ease both; }
@keyframes banner-pop { 15%,70% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-68%) scale(1.04); } }
@keyframes combo-pop { 20%,65% { opacity: 1; transform: translate(-50%,-50%) scale(1.15) rotate(-2deg); } 100% { opacity: 0; transform: translate(-50%,-90%) scale(.95); } }
.tutorial-hand { position: absolute; z-index: 4; bottom: 26px; left: 24%; display: grid; place-items: center; color: #fff; pointer-events: none; text-shadow: 0 2px 5px rgba(36,66,79,.3); animation: hand-hold 1.1s ease-in-out infinite; }
.tutorial-hand i { font-size: 38px; font-style: normal; }
.tutorial-hand b { padding: 3px 8px; border-radius: 99px; background: rgba(39,60,76,.7); font-size: 9px; letter-spacing: .12em; }
@keyframes hand-hold { 50% { transform: translateY(10px) scale(.9); } }
.battle-shop { position: absolute; z-index: 6; right: 9px; bottom: 9px; left: 9px; display: grid; grid-template-columns: .95fr .95fr 1.15fr; gap: 6px; pointer-events: auto; }
.battle-shop button { display: grid; min-height: 39px; grid-template-columns: 24px 1fr auto; align-items: center; gap: 4px; padding: 5px 8px; border: 2px solid rgba(255,255,255,.9); border-radius: 12px; color: #fff; background: linear-gradient(180deg,rgba(72,191,161,.96),rgba(42,154,126,.96)); box-shadow: 0 4px 0 rgba(31,112,95,.8),0 6px 14px rgba(43,72,77,.16); font-size: 8px; font-weight: 900; }
.battle-shop button:first-child { background: linear-gradient(180deg,rgba(255,120,145,.97),rgba(222,74,111,.97)); box-shadow: 0 4px 0 rgba(174,53,87,.86),0 6px 14px rgba(43,72,77,.16); }
.battle-shop button i { color: #fff0f2; font-size: 19px; font-style: normal; }
.battle-shop button b { padding: 3px 5px; border-radius: 7px; color: #664a29; background: #ffe273; font-size: 8px; }
.battle-shop button:disabled { opacity: .42; filter: grayscale(.35); box-shadow: 0 2px 0 rgba(77,92,91,.35); }
.mega-bean-mark { width: 20px; height: 15px; border-radius: 55% 45%; transform: rotate(-13deg); background: linear-gradient(145deg,#b99aff,#6f4bc4); box-shadow: inset -3px -3px 3px rgba(58,36,112,.22),0 0 0 2px rgba(255,255,255,.72); }
.mini-bean-mark { width: 8px; height: 7px; border-radius: 50%; background: #ff9f72; box-shadow: 8px -4px #ffd26a,-6px -4px #7fe1b3; }

.bean-dock { z-index: 3; display: grid; flex: 0 0 auto; grid-template-columns: 82px minmax(0,1fr) 42px; align-items: center; gap: 8px; padding: 9px 10px max(10px,env(safe-area-inset-bottom)); background: rgba(255,250,235,.98); box-shadow: 0 -6px 18px rgba(38,72,84,.13); }
.queue-block { min-width: 0; }
.bean-queue { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.bean-icon { width: 25px; height: 19px; border: 2px solid rgba(255,255,255,.74); border-radius: 55% 45% 56% 44%; transform: rotate(-12deg); background: var(--bean,#6fd45d); box-shadow: inset -4px -4px 5px rgba(64,45,95,.14),0 2px 4px rgba(51,65,78,.14); }
.bean-icon:not(:first-child) { width: 18px; height: 14px; opacity: .66; }
.bean-icon.heavy { --bean: #8b65dc; }
.bean-icon.scatter { --bean: #ff9164; }
.bean-icon.mega { --bean: #a782f3; transform: rotate(-12deg) scale(1.16); }
.bean-icon.mini { --bean: #ffad70; transform: rotate(-12deg) scale(.72); }
.charge-button { display: grid; min-height: 60px; grid-template-columns: 1fr 37px; gap: 4px 8px; align-items: center; padding: 7px 10px; border: 0; border-radius: 14px; color: #fff; background: linear-gradient(180deg,#54d7ad,#32b98f); box-shadow: 0 5px 0 #239b76,inset 0 1px rgba(255,255,255,.48); }
.charge-button.charging { background: linear-gradient(180deg,#ffb84a,#f66b72); box-shadow: 0 5px 0 #d55259; animation: charge-rumble .11s linear infinite alternate; }
.charge-button > span:first-child { grid-column: 1 / -1; font-size: 10px; font-weight: 900; letter-spacing: .06em; }
.power-track { position: relative; height: 9px; overflow: hidden; border-radius: 99px; background: rgba(29,91,80,.22); }
.power-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#fff06b,#ff764e); }
.power-track em { position: absolute; top: 0; left: 72%; width: 2px; height: 100%; background: rgba(255,255,255,.9); }
.charge-button > b { font-size: 12px; }
.shots-block { text-align: center; }
.shots-block strong { display: block; margin-top: 3px; font-size: 23px; }
@keyframes charge-rumble { from { transform: rotate(-.35deg); } to { transform: rotate(.35deg); } }

.result-screen, .fail-screen { flex-direction: column; align-items: center; justify-content: center; padding: max(35px,env(safe-area-inset-top)) 26px max(24px,env(safe-area-inset-bottom)); text-align: center; background: radial-gradient(circle at 50% 34%,#fff9bd 0 18%,#8ee3cf 48%,#63c7e6 100%); }
.result-screen::before, .fail-screen::before { content: ""; position: absolute; inset: -30%; opacity: .18; background: repeating-conic-gradient(from 0deg,#fff 0 8deg,transparent 8deg 18deg); animation: result-spin 22s linear infinite; }
@keyframes result-spin { to { transform: rotate(360deg); } }
.result-screen > *, .fail-screen > * { position: relative; z-index: 1; }
.result-kicker { margin: 0 0 8px; color: #317f86; font-size: 10px; font-weight: 900; letter-spacing: .22em; }
.result-screen h2, .fail-screen h2 { margin: 0; color: #fff; font-size: clamp(36px,10vw,48px); line-height: .92; letter-spacing: -.06em; text-shadow: 0 5px 0 #49acaa,0 10px 25px rgba(47,104,111,.2); }
.result-medal { display: grid; width: 108px; height: 108px; margin: 22px 0 18px; place-items: center; border: 8px solid #fff2a7; border-radius: 50%; background: linear-gradient(145deg,#ffd54e,#ff9c4c); box-shadow: 0 9px 0 #df7e3d,0 16px 30px rgba(76,104,99,.22),inset 0 0 0 6px rgba(255,255,255,.26); animation: medal-bounce 1.2s ease-in-out infinite; }
.result-medal span { color: #fff; font-size: 57px; text-shadow: 0 4px #da7d32; }
@keyframes medal-bounce { 50% { transform: translateY(-7px) rotate(3deg); } }
.result-stats { display: grid; width: 100%; grid-template-columns: repeat(3,1fr); margin-bottom: 23px; padding: 13px 0; border-radius: 17px; background: rgba(255,255,255,.78); box-shadow: 0 9px 26px rgba(48,103,109,.14); }
.result-stats div { border-right: 1px solid rgba(66,103,104,.15); }
.result-stats div:last-child { border: 0; }
.result-stats small { display: block; color: #7c8c8c; font-size: 7px; font-weight: 900; letter-spacing: .1em; }
.result-stats strong { display: block; margin-top: 5px; color: #2e5360; font-size: 19px; }
.result-screen .primary-button, .fail-screen .primary-button, .pause-modal .primary-button { max-width: 330px; }
.secondary-button { width: min(330px,100%); min-height: 45px; margin-top: 13px; border: 2px solid rgba(255,255,255,.8); border-radius: 14px; color: #356c77; background: rgba(255,255,255,.65); font-size: 11px; font-weight: 900; }
.text-button { margin-top: 15px; padding: 7px 12px; border: 0; color: #376d77; background: transparent; font-size: 10px; font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.result-screen .signature { margin-top: 17px; color: rgba(43,99,103,.62); }
.result-confetti i { position: absolute; width: 8px; height: 15px; border-radius: 4px; background: var(--c); animation: confetti-fall 1.8s ease-in infinite; }
@keyframes confetti-fall { from { transform: translateY(-60vh) rotate(0); } to { transform: translateY(60vh) rotate(580deg); } }

.fail-screen { background: radial-gradient(circle at 50% 35%,#fff4c4,#ffc6cc 48%,#91d7e7); }
.fail-screen h2 { text-shadow: 0 5px 0 #e68d9b,0 10px 25px rgba(102,72,83,.16); }
.fail-stars { margin-bottom: 13px; color: #fff3a0; font-size: 26px; letter-spacing: 10px; animation: stars-wobble 1s ease-in-out infinite alternate; }
@keyframes stars-wobble { to { transform: rotate(5deg) scale(1.06); } }
.fail-cat { position: relative; width: 160px; height: 150px; margin: 22px 0 12px; }
.fail-cat .face { position: absolute; z-index: 2; inset: 18px 19px 10px; border: 5px solid #d88c5e; border-radius: 48% 48% 45% 45%; background: #ffd2a6; box-shadow: inset 0 -12px rgba(236,151,98,.18),0 10px 18px rgba(88,70,82,.13); }
.fail-cat .ear { position: absolute; top: 5px; width: 64px; height: 70px; border: 5px solid #d88c5e; background: #ffbb91; transform: rotate(45deg); }
.fail-cat .ear.left { left: 12px; border-radius: 70% 15%; }
.fail-cat .ear.right { right: 12px; border-radius: 15% 70%; }
.fail-cat .eye { position: absolute; z-index: 3; top: 65px; width: 17px; height: 8px; border-bottom: 4px solid #4b3d46; border-radius: 50%; }
.fail-cat .eye.left { left: 52px; transform: rotate(14deg); }
.fail-cat .eye.right { right: 52px; transform: rotate(-14deg); }
.fail-cat .mouth { position: absolute; z-index: 3; top: 91px; left: 70px; width: 20px; height: 12px; border-bottom: 4px solid #9c5860; border-radius: 50%; }
.fail-cat b { position: absolute; z-index: 4; top: 0; right: -3px; color: #fff; font-size: 40px; transform: rotate(12deg); text-shadow: 0 3px #e595a3; }
.fail-screen > p:not(.result-kicker) { margin: 0 0 20px; color: #725a64; font-size: 12px; font-weight: 800; }

.pause-modal { position: absolute; z-index: 30; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(30,47,63,.58); backdrop-filter: blur(7px); }
.pause-modal > div { width: min(340px,100%); padding: 30px 24px 23px; border: 2px solid rgba(255,255,255,.8); border-radius: 25px; background: #fff9e9; box-shadow: 0 24px 60px rgba(26,43,57,.3); text-align: center; }
.pause-modal p { margin: 0; color: #78a4a1; font-size: 9px; font-weight: 900; letter-spacing: .2em; }
.pause-modal h2 { margin: 5px 0 22px; font-size: 36px; }
.pause-modal .text-button { color: #65727d; }

@media (min-width: 471px) {
  body { display: grid; padding: 18px; place-items: center; background: linear-gradient(135deg,#b9f0ea,#e5f7d6); }
  .game-shell {
    width: min(390px,calc((100dvh - 36px) * .4621));
    height: min(844px,calc(100dvh - 36px));
    min-height: 0;
    margin: 0;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 24px;
    box-shadow: 0 20px 70px rgba(35,89,100,.3);
  }
}

@media (max-height: 690px) {
  .title-lockup { top: 52px; transform: scale(.84); transform-origin: top center; }
  .journey-card { padding: 12px 14px 8px; }
  .save-summary { margin: 8px 0; padding: 7px 0; }
  .level-grid { gap: 5px; }
  .primary-button { min-height: 45px; }
  .journey-card .primary-button { margin-top: 9px; }
  .menu-tip { margin: 7px 0 3px; }
  .bean-dock { padding-top: 6px; padding-bottom: max(7px,env(safe-area-inset-bottom)); }
  .charge-button { min-height: 53px; }
  .result-medal { width: 88px; height: 88px; margin: 14px 0; }
  .result-medal span { font-size: 45px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
