:root {
  --ink: #29211b;
  --paper: #fffaf0;
  --cream: #f7ead1;
  --yellow: #f3b63f;
  --orange: #df6c2f;
  --red: #b63d2d;
  --green: #315f4a;
  --muted: #75675b;
  --line: rgba(60, 43, 31, 0.16);
  --shadow: 0 18px 50px rgba(74, 46, 22, 0.13);
  --recipe-icon-sheet: url("./assets/icons/recipe-icons.webp");
  --achievement-icon-sheet: url("./assets/icons/achievement-icons-v2.webp");
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Gowun Dodum", sans-serif;
  background: #efe5d2;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; }
.grain {
  position: fixed; inset: 0; pointer-events: none; opacity: .2; z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}
.topbar {
  height: 94px; padding: 0 clamp(20px, 4vw, 64px); display: flex; align-items: center;
  justify-content: space-between; background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { min-width: 0; display: flex; flex: 0 1 auto; align-items: center; gap: 14px; }
.brand-copy { min-width: 0; }
.brand-mark {
  width: 52px; height: 52px; flex: 0 0 auto; object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(117,43,29,.2));
}
.brand h1 { margin: 0; font: 26px "Black Han Sans"; letter-spacing: -.5px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; letter-spacing: .12em; }
.brand .bakery-modifier {
  margin: 0 0 1px; color: var(--red); font-size: 11px; font-weight: 800;
  letter-spacing: .08em; line-height: 1.1;
}
.bakery-name-button {
  display: flex; max-width: 100%; align-items: center; gap: 6px; margin: 0; padding: 0;
  border: 0; color: inherit; background: none; font: inherit; letter-spacing: inherit;
  line-height: inherit; text-align: left; cursor: text;
}
.bakery-name-button #bakeryName {
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.bakery-name-edit {
  flex: none; color: var(--red); font: 700 14px/1 sans-serif; opacity: .35;
  transform: translateY(-1px); transition: opacity .15s, transform .15s;
}
.bakery-name-button:hover .bakery-name-edit,
.bakery-name-button:focus-visible .bakery-name-edit { opacity: 1; transform: translateY(-1px) rotate(-8deg); }
.bakery-name-button:focus-visible { outline: 2px solid rgba(181, 56, 39, .35); outline-offset: 4px; border-radius: 3px; }
.bakery-name-input {
  width: min(230px, 25vw); min-width: 130px; height: 34px; padding: 3px 8px;
  border: 1px solid var(--red); border-radius: 6px; color: var(--ink);
  background: #fffaf0; font: 20px "Black Han Sans"; box-shadow: 0 0 0 3px rgba(181, 56, 39, .1);
}
.bakery-name-button[hidden], .bakery-name-input[hidden] { display: none; }
:lang(en) .brand h1 {
  max-width: 205px; font-size: 22px; line-height: 1.02; white-space: normal;
}
:lang(en) .brand p {
  max-width: 210px; overflow: hidden; font-size: 10px; letter-spacing: .04em;
  text-overflow: ellipsis; white-space: nowrap;
}
.header-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.header-more { position: relative; }
.header-more summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 8px 13px;
  border: 1px solid var(--line); border-radius: 99px; background: transparent;
  font-size: 12px; font-weight: 800; cursor: pointer; list-style: none;
}
.header-more summary::-webkit-details-marker { display: none; }
.header-more[open] summary { border-color: #d9a65c; background: #fff7e7; }
.header-more-menu {
  position: absolute; z-index: 85; top: calc(100% + 8px); right: 0; display: grid; gap: 3px;
  width: 166px; padding: 7px; border: 1px solid var(--line); border-radius: 12px;
  background: #fffaf0; box-shadow: 0 14px 34px rgba(58,39,24,.22);
}
.header-actions .header-more-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px;
  border: 0; border-radius: 8px; padding: 8px 10px; text-align: left;
}
.header-actions .header-more-menu button:hover { background: #f4e5cc; }
.tick-indicator {
  position: fixed; z-index: 90; top: 5px; right: 7px; padding: 3px 6px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 5px; color: rgba(255,255,255,.82);
  background: rgba(41,33,27,.78); box-shadow: 0 2px 7px rgba(41,33,27,.16);
  font: 700 9px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .02em; pointer-events: none;
}
.tick-indicator.developer { color: #3b240d; background: #ffd66b; border-color: #e7a62b; }
.language-picker {
  position: relative; display: inline-grid; width: 36px; height: 40px; place-items: center;
  border: 0; border-radius: 0; background: transparent;
}
.language-flag {
  position: relative; z-index: 1; font-size: 22px; line-height: 1;
  pointer-events: none;
}
.language-picker select {
  position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; padding: 0;
  border: 0; border-radius: inherit; opacity: 0; cursor: pointer;
}
.language-picker:focus-within { outline: 2px solid rgba(181,56,39,.35); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.header-ticker {
  flex: 1 1 420px; max-width: 620px; min-width: 300px; margin: 0 clamp(18px,3vw,48px) !important;
  box-shadow: 0 5px 16px rgba(45,33,25,.12);
}
.header-ticker { font-size: 13px !important; }
.header-ticker > span { font-size: 12px; }
.header-ticker p { animation-duration: 11s !important; font-size: 13px; }
.header-actions button {
  border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 9px 14px;
  cursor: pointer; font-size: 12px; font-weight: 700;
}
.header-actions > .bread-collection-btn {
  width: 36px; min-width: 36px; padding: 0 !important; border: 0; border-radius: 0;
  background: transparent; font-size: 23px; line-height: 1;
}
.bread-collection-btn b,.header-more > summary b { display: none; }
.header-more > summary {
  width: 36px; min-height: 40px; justify-content: center; padding: 0;
  border: 0; border-radius: 0; background: transparent; font-size: 22px;
}
.header-more[open] > summary { border-color: transparent; background: transparent; }
.reset-btn { color: var(--red) !important; }
.game-grid {
  display: grid; grid-template-columns: minmax(440px, 1.03fr) minmax(470px, .97fr);
  min-height: calc(100vh - 94px); max-width: 1500px; margin: auto;
}
.panel { min-width: 0; }
.bakery-panel {
  padding: clamp(24px, 3vw, 46px) clamp(26px, 5vw, 76px); position: relative;
  border-right: 1px solid var(--line); background: var(--paper);
}
.shop-panel {
  height: calc(100vh - 94px); overflow-y: auto; overscroll-behavior: contain;
  background: #f4ead7; padding: clamp(20px, 2.4vw, 38px);
  scrollbar-width: thin; scrollbar-color: #c6ad87 transparent;
}
.scene-game-hud {
  position: absolute; z-index: 13; top: 9px; left: 12px; right: 12px; pointer-events: none;
}
.status-line {
  display: flex; justify-content: flex-start; align-items: center; gap: 7px;
  color: #fff8e9; font-size: 11px; text-shadow: 0 1px 3px rgba(45,26,14,.6);
}
/* the HUD wrapper is pointer-events:none so clicks fall through to the
   bread, so the badge that carries the tech tooltip has to opt back in. */
.day-badge {
  display: inline-flex; align-items: baseline; gap: 5px; background: var(--green); color: white;
  padding: 7px 11px; border-radius: 4px; font-weight: 700; pointer-events: auto;
}
.day-badge[data-tooltip] { cursor: help; }
.day-badge:focus-visible { outline: 2px solid #fff8e9; outline-offset: 2px; }
.prestige-count { color: #d9f4dc; font-size: 10px; font-weight: 800; white-space: nowrap; }
.prestige-count[hidden] { display: none; }
.score-wrap { text-align: center; padding: 5px 0 0; }
.item-dock {
  position: absolute; z-index: 24; inset: 0; pointer-events: none;
}
.item-dock[hidden] { display: none; }
.item-consumable-hud {
  position: absolute; z-index: 25; top: 47px; left: 10px;
  display: grid; justify-items: start; gap: 5px; pointer-events: none;
}
.item-service-hud {
  position: absolute; z-index: 25; top: 3px; right: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: auto;
}
.item-hub-button,.roulette-ready-button {
  position: relative; width: 68px; min-width: 68px; height: 68px; min-height: 68px;
  display: inline-grid; place-items: center; overflow: visible; padding: 0;
  border: 0; border-radius: 0; color: #fff8e9; background: transparent;
  box-shadow: none; cursor: pointer; font-size: 39px; font-weight: 800;
  filter: drop-shadow(0 7px 7px rgba(45,27,14,.35));
}
.item-hub-button b { display: none; }
.roulette-ready-button img {
  position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; pointer-events: none;
}
.item-hub-button em {
  position: absolute; z-index: 3; top: 8px; right: 5px; min-width: 22px; padding: 2px 5px;
  border: 2px solid #fff7e7; border-radius: 99px; color: white;
  background: #b54531; font-size: 9px; font-style: normal;
}
.item-hub-button em[hidden] { display: none; }
.item-quick-list {
  max-height: min(52vh,320px); display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto; padding: 4px; border-radius: 0; background: transparent;
  box-shadow: none; pointer-events: auto; scrollbar-width: none;
}
.item-quick-list:empty { display: none; }
.item-quick-list::-webkit-scrollbar { display: none; }
.item-quick-button {
  --cooldown-angle: 0deg;
  position: relative; flex: 0 0 42px; width: 42px; height: 42px; padding: 2px;
  overflow: visible; border: 0; border-radius: 0; background: transparent;
  box-shadow: none; cursor: pointer; filter: drop-shadow(0 4px 5px rgba(45,27,14,.3));
}
.item-quick-button::after {
  content: ""; position: absolute; z-index: 2; inset: 2px; border-radius: 10px;
  background: conic-gradient(rgba(35,30,25,.62) 0 var(--cooldown-angle),transparent 0);
  pointer-events: none;
}
.item-quick-button img {
  position: relative; z-index: 1; width: 100%; height: 100%; border: 0;
  border-radius: 10px; object-fit: cover; box-sizing: border-box;
}
.item-quick-button.ready {
  background: transparent; animation: item-ready-glint 1.15s ease-in-out infinite alternate;
}
.item-quick-button.active { cursor: wait; }
.item-quick-button.active::after { display: none; }
.item-quick-button[aria-disabled="true"] { opacity: .9; }
.item-quick-button b {
  position: absolute; z-index: 2; right: -4px; bottom: -4px; min-width: 17px; padding: 1px 4px;
  border: 2px solid #fff8ec; border-radius: 99px; color: white; background: #a63e2d;
  font: 800 8px/1.25 sans-serif;
}
.item-active-effects {
  display: none;
}
.item-effect-chip {
  max-width: 118px; padding: 5px 7px; border-radius: 8px; color: #6c3d16;
  background: #ffe6a0; font-size: 9px; font-weight: 800; white-space: nowrap;
}
.roulette-ready-button {
  color: #4f280d; background: transparent;
}
.roulette-cooldown-overlay {
  position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%;
  overflow: visible; pointer-events: none;
}
.roulette-ready-button.ready {
  background: transparent; animation: none;
}
.roulette-ready-button.ready .roulette-cooldown-overlay { display: none; }
.roulette-ready-button.ready img { animation: item-ready-pulse 1.1s ease-in-out infinite alternate; }
@keyframes item-ready-pulse { to { transform: translateY(-1px); box-shadow: 0 0 13px rgba(242,173,56,.7); } }
@keyframes item-ready-glint {
  to { transform: scale(1.04); box-shadow: 0 0 0 3px rgba(255,224,112,.24),0 0 15px rgba(242,173,56,.8); }
}
.item-use-effect {
  position: absolute; z-index: 28; inset: 0; display: none; overflow: hidden;
  place-items: center; pointer-events: none;
}
.item-use-effect.show { display: grid; }
.item-use-effect > img {
  position: relative; z-index: 3; width: clamp(90px,24%,132px); aspect-ratio: 1;
  border-radius: 22px; object-fit: cover; filter: drop-shadow(0 14px 18px rgba(46,25,13,.4));
}
.item-use-effect > strong {
  position: absolute; z-index: 5; left: 50%; bottom: 16%; padding: 6px 12px;
  border: 1px solid rgba(255,255,255,.72); border-radius: 99px; color: #fff;
  background: rgba(52,31,20,.86); font-size: 12px; transform: translateX(-50%);
  animation: item-effect-label 1.25s ease-out both;
}
.item-use-effect-aura {
  position: absolute; z-index: 1; left: 50%; top: 60%; width: 120px; height: 120px;
  border: 5px solid #ffe17a; border-radius: 50%; transform: translate(-50%,-50%);
}
.item-use-effect-particles { position: absolute; z-index: 2; inset: 0; }
.item-use-effect-particles i {
  --particle-x: 80px; --particle-y: -90px;
  position: absolute; left: 50%; top: 60%; width: 9px; height: 9px;
  border-radius: 50%; background: #ffe16d;
  animation: item-effect-particle 1s ease-out both;
}
.item-use-effect-particles i:nth-child(2) { --particle-x:-85px;--particle-y:-65px;animation-delay:.05s; }
.item-use-effect-particles i:nth-child(3) { --particle-x:110px;--particle-y:15px;animation-delay:.1s; }
.item-use-effect-particles i:nth-child(4) { --particle-x:-105px;--particle-y:22px;animation-delay:.14s; }
.item-use-effect-particles i:nth-child(5) { --particle-x:54px;--particle-y:95px;animation-delay:.08s; }
.item-use-effect-particles i:nth-child(6) { --particle-x:-48px;--particle-y:90px;animation-delay:.12s; }
.item-use-effect.effect-clickBoost > img { animation: use-click-tonic 1.25s cubic-bezier(.18,.85,.25,1) both; }
.item-use-effect.effect-clickBoost .item-use-effect-aura {
  border-color: #ff9d4d; box-shadow: 0 0 35px #ff693d; animation: use-tonic-aura 1.2s ease-out both;
}
.item-use-effect.effect-timeSkip > img { animation: use-time-ticket 1.3s ease-in-out both; }
.item-use-effect.effect-timeSkip .item-use-effect-aura {
  border: 10px dotted #8ee9ff; box-shadow: 0 0 35px #4fc7e5; animation: use-time-ring 1.2s ease-in-out both;
}
.item-use-effect.effect-buildingCoupon > img { animation: use-building-coupon 1.25s cubic-bezier(.18,.8,.22,1) both; }
.item-use-effect.effect-buildingCoupon .item-use-effect-aura {
  border-color: #7ed9a5; animation: use-coupon-stamp 1.1s ease-out both;
}
.item-use-effect.effect-laborShield > img { animation: use-labor-shield 1.25s ease-out both; }
.item-use-effect.effect-laborShield .item-use-effect-aura {
  border-color: #70c7ff; background: rgba(90,190,255,.14); box-shadow: inset 0 0 35px #8edcff,0 0 35px #6bc8ff;
  animation: use-shield-dome 1.25s ease-out both;
}
.item-use-effect.effect-tempBaker > img { animation: use-temp-baker 1.3s cubic-bezier(.18,.85,.26,1) both; }
.item-use-effect.effect-tempBaker .item-use-effect-aura {
  border-color: #ffd162; animation: use-baker-burst 1.15s ease-out both;
}
.item-effect-progress {
  position: absolute; z-index: 29; left: 50%; bottom: 62px;
  width: min(230px,56%); padding: 7px 9px 8px; box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.72); border-radius: 11px;
  color: #fff; background: rgba(45,30,21,.88); box-shadow: 0 7px 18px rgba(39,23,14,.28);
  transform: translateX(-50%); pointer-events: none;
}
.item-effect-progress[hidden] { display: none; }
.item-effect-progress > div { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; }
.item-effect-progress strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-effect-progress span { flex: 0 0 auto; color: #ffe18b; font-weight: 900; }
.item-effect-progress > i {
  height: 6px; display: block; overflow: hidden; margin-top: 5px;
  border-radius: 99px; background: rgba(255,255,255,.2);
}
.item-effect-progress > i > b {
  width: 100%; height: 100%; display: block; border-radius: inherit;
  background: linear-gradient(90deg,#ff814d,#ffe06d); transition: width .24s linear;
}
.temp-baker-helper {
  position: absolute; z-index: 8; right: 86px; bottom: 66px; width: 72px; height: 72px;
  pointer-events: none; transform-origin: bottom center;
  animation: temp-baker-arrive .55s cubic-bezier(.2,.9,.3,1.3),temp-baker-click .2s ease-in-out .55s infinite alternate;
}
.temp-baker-helper[hidden] { display: none; }
.temp-baker-helper img {
  width: 100%; height: 100%; border: 2px solid rgba(255,235,181,.9); border-radius: 22px;
  object-fit: cover; box-shadow: 0 6px 15px rgba(50,29,15,.35);
}
.temp-baker-helper span {
  position: absolute; left: -9px; top: 2px; padding: 2px 5px; border-radius: 99px;
  color: #fff; background: #b64a2e; font: 900 8px sans-serif;
  animation: temp-baker-pop .4s ease-out infinite;
}
@keyframes temp-baker-arrive { from { opacity: 0; transform: translateX(90px) scale(.3); } }
@keyframes temp-baker-click {
  from { transform: translate(0,0) rotate(1deg); }
  to { transform: translate(-9px,3px) rotate(-5deg); }
}
@keyframes temp-baker-pop {
  from { opacity: 0; transform: translateY(8px) scale(.7); }
  45% { opacity: 1; }
  to { opacity: 0; transform: translateY(-9px) scale(1.05); }
}
@keyframes use-click-tonic {
  0% { opacity: 0; transform: translateY(80px) rotate(-20deg) scale(.35); }
  35%,70% { opacity: 1; transform: translateY(0) rotate(8deg) scale(1.1); }
  100% { opacity: 0; transform: translateY(-45px) rotate(-8deg) scale(.75); }
}
@keyframes use-tonic-aura { from { opacity: .9; scale: .25; } to { opacity: 0; scale: 3.2; } }
@keyframes use-time-ticket {
  0% { opacity: 0; transform: rotate(-140deg) scale(.25); }
  45%,70% { opacity: 1; transform: rotate(12deg) scale(1.08); }
  100% { opacity: 0; transform: rotate(360deg) scale(.35); }
}
@keyframes use-time-ring { 0% { opacity: 0; rotate: -120deg; scale: .4; } 45% { opacity: 1; } 100% { opacity: 0; rotate: 240deg; scale: 2.6; } }
@keyframes use-building-coupon {
  0% { opacity: 0; transform: translate(-130px,90px) rotate(-22deg) scale(.4); }
  42% { opacity: 1; transform: translate(0,0) rotate(5deg) scale(1.15); }
  100% { opacity: 0; transform: translate(125px,78px) rotate(18deg) scale(.3); }
}
@keyframes use-coupon-stamp { 0% { opacity: 0; scale: 2.4; } 45% { opacity: 1; scale: .85; } 100% { opacity: 0; scale: 1.2; } }
@keyframes use-labor-shield { 0% { opacity: 0; scale: .25; } 42%,78% { opacity: 1; scale: 1.05; } 100% { opacity: 0; scale: 1.25; } }
@keyframes use-shield-dome { 0% { opacity: 0; scale: .2; } 45% { opacity: .9; scale: 2.2; } 100% { opacity: 0; scale: 3.8; } }
@keyframes use-temp-baker {
  0% { opacity: 0; transform: translateX(-180px) rotate(-12deg) scale(.45); }
  45%,72% { opacity: 1; transform: translateX(0) rotate(4deg) scale(1.12); }
  100% { opacity: 0; transform: translateX(145px) rotate(9deg) scale(.65); }
}
@keyframes use-baker-burst { 0% { opacity: 0; scale: .3; } 40% { opacity: 1; scale: 1.15; } 100% { opacity: 0; scale: 2.5; } }
@keyframes item-effect-particle {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.2); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--particle-x),var(--particle-y)) scale(.1); }
}
@keyframes item-effect-label {
  0% { opacity: 0; transform: translate(-50%,15px) scale(.8); }
  25%,72% { opacity: 1; transform: translate(-50%,0) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-12px) scale(.9); }
}
.score-label, .eyebrow {
  margin: 0 0 4px; color: var(--orange); font-size: 11px; letter-spacing: .14em; font-weight: 800; text-transform: uppercase;
}
.scene-game-hud .score-label { margin-bottom: 0; color: #8b391f; text-shadow: 0 1px rgba(255,255,255,.65); }
.score { font: clamp(40px, 5vw, 62px) "Black Han Sans"; line-height: .95; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.score small { font: 16px "Gowun Dodum"; margin-left: 6px; }
.rate {
  width: max-content; max-width: 100%; margin: 4px auto 0; padding: 4px 9px; border-radius: 99px;
  color: #fff8e9; background: rgba(45,31,22,.7); font-size: 11px; backdrop-filter: blur(4px);
}
.rate strong { color: #ffe28a; pointer-events: auto; }
.click-stage {
  height: min(58vh,600px); min-height: 410px; position: relative; overflow: hidden; margin: 0 0 24px;
  border: 7px solid #71462d; border-radius: 22px; background: linear-gradient(#f7d986 0 61%, #d2ad67 61%);
  outline: 2px solid #d7a85e; outline-offset: -4px;
  box-shadow: inset 0 0 0 3px rgba(255,224,165,.62),inset 0 -55px 0 rgba(98,66,33,.09),0 9px 24px rgba(74,43,22,.2);
}
.world-item-event {
  position: absolute; z-index: 26; left: -96px; top: 34%; width: 84px; padding: 0;
  border: 0; background: transparent; cursor: pointer;
  filter: drop-shadow(0 8px 11px rgba(41,25,15,.32));
}
.world-item-event[hidden] { display: none; }
.world-item-event img { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; }
.world-item-event span {
  display: block; margin-top: -5px; padding: 3px 5px; border-radius: 99px;
  color: white; background: rgba(54,34,24,.88); font-size: 8px; font-weight: 900;
}
.world-item-event.customer {
  top: auto; bottom: 23%; animation: world-customer-cross 16s linear forwards;
}
.world-item-event.flyingBox {
  left: auto; right: -96px; top: 29%; animation: world-box-cross 13s linear forwards;
}
.world-item-event.customer img { border-radius: 50%; }
@keyframes world-customer-cross {
  0% { left: -96px; transform: translateY(0) rotate(-3deg); }
  22% { transform: translateY(-12px) rotate(3deg); }
  48% { transform: translateY(5px) rotate(-2deg); }
  76% { transform: translateY(-9px) rotate(3deg); }
  100% { left: calc(100% + 12px); transform: translateY(0) rotate(-2deg); }
}
@keyframes world-box-cross {
  0% { right: -96px; transform: translateY(0) rotate(8deg); }
  30% { transform: translateY(35px) rotate(-12deg); }
  58% { transform: translateY(-24px) rotate(11deg); }
  100% { right: calc(100% + 12px); transform: translateY(8px) rotate(-9deg); }
}
.click-stage { transition: background 1s ease, box-shadow 1s ease; }
.click-combo {
  position: absolute; z-index: 10; left: 50%; bottom: 37px; padding: 5px 10px;
  transform: translateX(-50%); border: 1px solid rgba(255,255,255,.58); border-radius: 99px;
  color: white; background: rgba(182,61,45,.9); font-size: 12px; font-weight: 800;
  box-shadow: 0 5px 15px rgba(117,43,29,.22); pointer-events: none;
}
.click-combo[hidden] { display: none; }
.click-combo.guarded {
  border-color: rgba(255,255,255,.72);
  background: rgba(45,70,83,.94);
  box-shadow: 0 5px 18px rgba(25,47,61,.28);
}
.bread-button.critical-bake .bread-photo,
.bread-button.critical-bake .bread-generated-photo,
.bread-button.critical-bake .bread {
  animation: criticalBake .42s ease-out;
}
@keyframes criticalBake {
  0% { filter: brightness(1); }
  35% { transform: scale(1.14) rotate(-3deg); filter: brightness(1.45) saturate(1.25); }
  100% { filter: brightness(1); }
}
.click-stage.scene-change .shop-scene { animation: sceneUpgrade .85s cubic-bezier(.2,.8,.2,1); }
@keyframes sceneUpgrade {
  0% { opacity: .25; filter: brightness(1.8) saturate(.6); }
  55% { opacity: 1; filter: brightness(1.3) saturate(1.25); }
  100% { filter: brightness(1) saturate(1); }
}
.shop-scene { position: absolute; inset: 0; pointer-events: none; }
.scene-building {
  position: absolute; left: 50%; bottom: 47px; width: 245px; height: 82px; transform: translateX(-50%);
  border: 4px solid #694a32; border-radius: 3px; background: #9b6b40;
  box-shadow: inset 0 -17px rgba(59,36,22,.14), 0 10px 16px rgba(55,35,22,.2);
  transition: width .8s, height .8s, background .8s, border-color .8s, border-radius .8s;
}
.scene-roof {
  position: absolute; z-index: 2; left: 50%; bottom: 121px; width: 280px; height: 38px;
  transform: translateX(-50%) rotate(-2deg); clip-path: polygon(4% 12%,96% 0,100% 75%,0 100%);
  border-radius: 5px; background: repeating-linear-gradient(90deg,#765039 0 35px,#b98b5b 35px 70px);
  filter: drop-shadow(0 5px 3px rgba(55,35,22,.2)); transition: .8s;
}
.scene-sign {
  position: absolute; z-index: 3; left: 50%; top: -18px; min-width: 85px; padding: 4px 8px;
  transform: translateX(-50%) rotate(-2deg); border: 2px solid #5e402d; border-radius: 3px;
  color: #efe0c4; background: #704d35; text-align: center; font: 10px "Black Han Sans"; transition: .8s;
}
.scene-window {
  position: absolute; top: 25px; width: 54px; height: 32px; border: 3px solid #64452f;
  background: linear-gradient(135deg,#f8d97d,#d88d43); opacity: .6; transition: .8s;
}
.scene-window.left { left: 16px; }.scene-window.right { right: 16px; }
.scene-door { position: absolute; left: calc(50% - 24px); bottom: 0; width: 48px; height: 55px; background: #654630; border: 3px solid #573b29; transition: .8s; }
.scene-counter { position: absolute; left: 13px; right: 13px; bottom: -9px; height: 14px; border-radius: 2px; background: #583c29; transition: .8s; }
.scene-crates { position: absolute; z-index: 2; left: calc(50% - 155px); bottom: 42px; color: #66462f; font-size: 19px; transform: rotate(-4deg); }
.scene-lights { display: none; position: absolute; z-index: 4; left: 24%; right: 24%; bottom: 188px; justify-content: space-around; }
.scene-lights i { width: 9px; height: 9px; border-radius: 50%; background: #ffe16d; box-shadow: 0 0 8px #ffe16d; }
.click-stage.prestiged .scene-sign { box-shadow: 0 0 12px rgba(255,218,87,.65); }
.click-stage.prestiged[data-stage="0"] .scene-building {
  border-color: #9d702d; box-shadow: inset 0 -17px rgba(59,36,22,.14),0 10px 16px rgba(55,35,22,.2),0 0 22px rgba(255,211,74,.55);
}
.click-stage.prestiged[data-stage="0"] .scene-roof {
  background: repeating-linear-gradient(90deg,#765039 0 31px,#d2a54b 31px 37px,#b98b5b 37px 68px);
}
.click-stage[data-stage="0"] .scene-window.right { display: none; }
.click-stage[data-stage="0"] .scene-door { display: none; }
.click-stage[data-stage="0"] .scene-window.left { left: 85px; width: 75px; }
.click-stage[data-stage="1"] .scene-roof { width: 310px; background: repeating-linear-gradient(90deg,#d66c35 0 38px,#f0b54d 38px 76px); }
.click-stage[data-stage="1"] .scene-building { width: 275px; height: 96px; background: #b77a46; }
.click-stage[data-stage="2"] .scene-building { width: 310px; height: 118px; background: #d5a562; border-color: #8b452f; }
.click-stage[data-stage="2"] .scene-roof { width: 345px; bottom: 157px; transform: translateX(-50%); background: repeating-linear-gradient(90deg,#b84131 0 42px,#f7e2ae 42px 84px); }
.click-stage[data-stage="2"] .scene-sign { color: white; background: var(--red); border-color: #7b2921; }
.click-stage[data-stage="3"] .scene-building { width: 350px; height: 145px; background: #f2d39b; border-color: #91452e; }
.click-stage[data-stage="3"] .scene-roof { width: 385px; bottom: 184px; clip-path: polygon(3% 0,97% 0,100% 100%,0 100%); transform: translateX(-50%); background: #a33d2d; }
.click-stage[data-stage="3"] .scene-sign { top: -29px; font-size: 13px; background: #fff3d5; color: #8d3226; }
.click-stage[data-stage="4"] { background: linear-gradient(#bde1df 0 61%,#c5aa73 61%); }
.click-stage[data-stage="4"] .scene-building { width: 370px; height: 158px; border-radius: 10px 10px 0 0; background: #e8cfad; border-color: #315f4a; }
.click-stage[data-stage="4"] .scene-roof { width: 405px; bottom: 197px; background: repeating-linear-gradient(90deg,#315f4a 0 46px,#f5e7c9 46px 92px); }
.click-stage[data-stage="4"] .scene-window { background: linear-gradient(135deg,#bde6e4,#72aead); border-color: #315f4a; opacity: .9; }
.click-stage[data-stage="5"] { background: linear-gradient(#afd3dd 0 61%,#a79f8d 61%); }
.click-stage[data-stage="5"] .scene-building { width: 410px; height: 170px; border-radius: 2px; background: #b5b4aa; border-color: #575d5d; }
.click-stage[data-stage="5"] .scene-roof { width: 430px; bottom: 209px; height: 23px; background: #535d60; clip-path: none; }
.click-stage[data-stage="5"] .scene-building::before { content:""; position:absolute; right:25px; top:-78px; width:32px; height:78px; background:#697172; border:4px solid #505859; }
.click-stage[data-stage="6"] { background: linear-gradient(#95cfd0 0 61%,#8ca59c 61%); }
.click-stage[data-stage="6"] .scene-building { width: 420px; height: 178px; background: rgba(170,225,218,.82); border-color: #2f6864; border-radius: 35px 35px 3px 3px; }
.click-stage[data-stage="6"] .scene-roof { width: 390px; bottom: 217px; background: #316e69; clip-path: polygon(8% 100%,20% 0,80% 0,92% 100%); }
.click-stage[data-stage="6"] .scene-window { background: #d7ffff; box-shadow: inset 0 0 12px #57c6bb; }
.click-stage[data-stage="7"] { background: linear-gradient(#88b9dc 0 61%,#8b939a 61%); }
.click-stage[data-stage="7"] .scene-building { width: 455px; height: 185px; background: #d8e1e3; border-color: #345d78; }
.click-stage[data-stage="7"] .scene-roof { width: 470px; bottom: 224px; background: #316b91; clip-path: none; }
.click-stage[data-stage="7"] .scene-sign { background: #214b69; color: white; }
.click-stage[data-stage="8"] { background: linear-gradient(#65578e 0 61%,#63546e 61%); }
.click-stage[data-stage="8"] .scene-building { width: 455px; height: 185px; background: #d8824d; border-color: #7f3454; }
.click-stage[data-stage="8"] .scene-roof { width: 475px; bottom: 224px; background: repeating-linear-gradient(90deg,#e34d58 0 42px,#f8d152 42px 84px); }
.click-stage[data-stage="8"] .scene-lights { display: flex; bottom: 213px; }
.click-stage[data-stage="8"] .sun { background: #fae49a; opacity: .6; }
.click-stage[data-stage="9"] { background: radial-gradient(circle at 80% 15%,#8c72bd 0 4%,transparent 5%),linear-gradient(#171f4b 0 61%,#31365b 61%); }
.click-stage[data-stage="9"] .scene-building { width: 440px; height: 190px; border-radius: 80px 80px 5px 5px; background: linear-gradient(135deg,#777fa4,#353d70); border-color: #85e0e2; box-shadow: inset 0 0 25px #252d5c,0 0 18px rgba(89,226,224,.5); }
.click-stage[data-stage="9"] .scene-roof { width: 300px; bottom: 229px; border-radius: 50% 50% 0 0; background: #85e0e2; clip-path: polygon(10% 100%,30% 0,70% 0,90% 100%); }
.click-stage[data-stage="9"] .scene-sign { color: #171f4b; background: #85e0e2; border-color: #b8ffff; }
.click-stage[data-stage="9"] .scene-window { background: #b9ffff; border-color: #85e0e2; box-shadow: 0 0 12px #85e0e2; }
.click-stage[data-stage="9"] .scene-lights { display: flex; }
.sun { position: absolute; width: 75px; height: 75px; border-radius: 50%; top: 30px; right: 50px; background: #fff3a8; box-shadow: 0 0 40px #fff0a2; }
.skyline { position: absolute; left: 0; right: 0; bottom: 38%; display: flex; align-items: flex-end; opacity: .28; }
.skyline span { flex: 1; height: 55px; background: var(--green); border: 2px solid #244636; }
.skyline span:nth-child(2) { height: 95px; border-radius: 40px 40px 0 0; }
.skyline span:nth-child(3) { height: 68px; }
.skyline span:nth-child(4) { height: 118px; clip-path: polygon(0 30%, 40% 30%, 50% 0, 60% 30%, 100% 30%, 100% 100%, 0 100%); }
.skyline span:nth-child(5) { height: 72px; }
.bread-button {
  position: absolute; left: 50%; top: 61%; width: min(62%,340px); height: auto; aspect-ratio: 23 / 18;
  transform: translate(-50%, -50%);
  z-index: 5; background: none; border: 0; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.bread-button:hover .bread { transform: rotate(-2deg) scale(1.04); }
.bread-button:active .bread { transform: rotate(2deg) scale(.94); }
/* Auto-click active: a soft pulsing ring around the button itself (not a
   custom cursor icon - a bread/arm-shaped pointer read as out of place)
   so hovering during auto-click still reads as visually distinct from a
   plain manual hover. */
.bread-button.auto-clicking::after {
  content: ""; position: absolute; inset: -14px; border-radius: 50%;
  border: 2px solid rgba(223,108,47,.55); pointer-events: none;
  animation: auto-click-pulse 1.1s ease-in-out infinite;
}
@keyframes auto-click-pulse {
  0%, 100% { transform: scale(.94); opacity: .75; }
  50% { transform: scale(1.04); opacity: .35; }
}
/* Super part-timer (superAlba prestige tech) - an AI-generated chibi
   character sprite (assets/alba/super-alba-N.webp, one per level: green
   apron -> baker cap -> golden apron -> glowing legend; sparkles/glow are
   baked into the level 3-4 art). Stands on the RIGHT side of the stage
   because the sprite's tapping arm reaches left, toward the bread. The
   whole sprite rocks toward the bread at a level-scaled tempo, and .enter
   replays a bounce-in whenever a new node is hired. */
.super-alba {
  position: absolute; right: 16px; bottom: 30px; width: 64px; height: 96px;
  z-index: 4; cursor: help; --tap-duration: .9s;
}
.super-alba[hidden] { display: none !important; }
.super-alba.enter { animation: super-alba-enter .8s cubic-bezier(.2,.9,.3,1.35); }
.super-alba-figure {
  position: absolute; inset: 0; display: block;
  animation: super-alba-bob 2.4s ease-in-out infinite;
}
.super-alba-image {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; object-position: bottom center;
  filter: drop-shadow(0 4px 4px rgba(65,41,23,.25));
  transform-origin: bottom center;
  animation: super-alba-tap var(--tap-duration) ease-in-out infinite;
}
.super-alba[data-level="2"] { --tap-duration: .62s; }
.super-alba[data-level="3"] { --tap-duration: .45s; }
.super-alba[data-level="4"] { --tap-duration: .32s; }
.super-alba[data-level="4"] .super-alba-image {
  filter: drop-shadow(0 4px 4px rgba(65,41,23,.25)) drop-shadow(0 0 10px rgba(255,218,87,.6));
}
@keyframes super-alba-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes super-alba-tap {
  0%, 100% { transform: rotate(2deg); }
  45% { transform: rotate(-6deg); }
}
@keyframes super-alba-enter {
  0% { transform: translateY(46px) scale(.2); opacity: 0; }
  55% { transform: translateY(-10px) scale(1.15); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}
.bread-photo {
  position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; opacity: 0;
  pointer-events: none; filter: drop-shadow(0 12px 10px rgba(65,41,23,.28));
  transition: opacity .25s, transform .12s cubic-bezier(.2,.8,.3,1.4);
}
.bread-generated-photo {
  position: absolute; z-index: 3; inset: 0; width: 100%; height: 100%; opacity: 0;
  object-fit: contain; pointer-events: none; filter: drop-shadow(0 12px 10px rgba(65,41,23,.28));
  transition: opacity .25s, transform .12s cubic-bezier(.2,.8,.3,1.4);
}
.bread-button.generated-bread-ready .bread-photo { opacity: 0 !important; }
.bread-button.generated-bread-ready .bread-generated-photo { opacity: 1; }
.bread-button.generated-bread-ready .bread { opacity: 0; pointer-events: none; }
.bread-button.generated-bread-ready:hover .bread-generated-photo { transform: rotate(-2deg) scale(1.04); }
.bread-button.generated-bread-ready:active .bread-generated-photo { transform: rotate(2deg) scale(.94); }
.photo-bread-ready .bread-photo { opacity: 1; }
.photo-bread-ready .bread { opacity: 0; pointer-events: none; }
.photo-bread-ready:hover .bread-photo { transform: rotate(-2deg) scale(1.04); }
.photo-bread-ready:active .bread-photo { transform: rotate(2deg) scale(.94); }
.bread-shadow { position: absolute; width: 190px; height: 35px; bottom: 1px; left: 20px; background: rgba(65,41,23,.25); filter: blur(10px); border-radius: 50%; }
.bread {
  position: absolute; inset: 8px 10px 21px; display: flex; justify-content: center; align-items: center;
  border-radius: 52% 52% 38% 38% / 62% 62% 35% 35%; background: linear-gradient(145deg,#f7c55a 18%,#cf682c 78%);
  border: 7px solid #a94725; box-shadow: inset 0 8px 10px rgba(255,242,163,.55), inset 0 -12px 15px rgba(128,45,20,.2);
  transition: transform .12s cubic-bezier(.2,.8,.3,1.4), opacity .2s;
}
.bread i { position: absolute; width: 17px; height: 56px; top: 23px; background: #fff0ad; border-radius: 50%; transform: rotate(-31deg); opacity: .78; }
.bread i:nth-child(1) { left: 55px; }.bread i:nth-child(2) { left: 96px; }.bread i:nth-child(3) { left: 137px; }
.bread em { margin-top: 60px; font: normal 19px "Black Han Sans"; color: #79351f; letter-spacing: .25em; }
.bread-button[data-bread-type="soboro"] .bread {
  inset: 4px 28px 15px; border-radius: 50%;
  background:
    radial-gradient(circle at 25% 25%,#8e4828 0 3px,transparent 4px),
    radial-gradient(circle at 68% 35%,#9f512c 0 4px,transparent 5px),
    radial-gradient(circle at 42% 67%,#a6552e 0 3px,transparent 4px),
    radial-gradient(circle at 76% 73%,#854322 0 3px,transparent 4px),
    linear-gradient(145deg,#efbd56,#bd5b2d);
}
.bread-button[data-bread-type="soboro"] .bread i { display: none; }
.bread-button[data-bread-type="soboro"] .bread em { margin-top: 72px; letter-spacing: .05em; }
.bread-button[data-bread-type="croissant"] .bread {
  inset: 30px 4px 35px; border-radius: 52% 52% 45% 45% / 68% 68% 34% 34%;
  background: linear-gradient(#f8ce65 0 35%,#c9682f 78%);
  border-width: 6px;
}
.bread-button[data-bread-type="croissant"] .bread i {
  top: 7px; width: 20px; height: 70px; border-radius: 50%; transform: rotate(-12deg);
  background: rgba(255,235,151,.55);
}
.bread-button[data-bread-type="croissant"] .bread em { margin-top: 45px; letter-spacing: .02em; font-size: 15px; }
.bread-button[data-bread-type="baguette"] .bread {
  inset: 45px 0 38px; border-radius: 60px; background: linear-gradient(160deg,#f3ba50,#bd5429);
  border-width: 6px;
}
.bread-button[data-bread-type="baguette"] .bread i { top: 7px; height: 45px; transform: rotate(-45deg); }
.bread-button[data-bread-type="baguette"] .bread i:nth-child(1) { left: 47px; }
.bread-button[data-bread-type="baguette"] .bread i:nth-child(2) { left: 97px; }
.bread-button[data-bread-type="baguette"] .bread i:nth-child(3) { left: 147px; }
.bread-button[data-bread-type="baguette"] .bread em { margin-top: 42px; font-size: 14px; letter-spacing: .02em; }
.bread-button[data-bread-type="ring"] .bread {
  inset: 5px 28px 16px; border-radius: 50%;
  background: radial-gradient(circle,transparent 0 31px,#f0ad43 33px 58px,#a94828 61px 100%);
  box-shadow: inset 0 0 17px rgba(255,239,153,.6),0 7px 12px rgba(87,47,24,.2);
}
.bread-button[data-bread-type="ring"] .bread i { display: none; }
.bread-button[data-bread-type="ring"] .bread em { margin-top: 102px; font-size: 13px; letter-spacing: .02em; }
.bread-button[data-bread-type="golden"] .bread {
  background: linear-gradient(145deg,#fff2a0 10%,#efa82f 62%,#b9661d);
  border-color: #a56e18; box-shadow: inset 0 8px 13px rgba(255,255,218,.75),0 0 26px rgba(255,211,67,.85);
}
.bread-button[data-bread-type="golden"] .bread em { color: #735012; letter-spacing: .05em; }
.bread-button[data-bread-type="cosmic"] .bread {
  inset: 3px 25px 15px; border-radius: 50%;
  background:
    radial-gradient(circle at 28% 30%,#fff6a1 0 2px,transparent 3px),
    radial-gradient(circle at 70% 22%,#8ee7e8 0 3px,transparent 4px),
    radial-gradient(circle at 63% 72%,#fff 0 2px,transparent 3px),
    radial-gradient(circle at 50% 48%,#9b6ac5,#3b376f 58%,#151d47);
  border-color: #70d8d9; box-shadow: inset 0 0 20px #252b65,0 0 25px rgba(99,220,220,.7);
}
.bread-button[data-bread-type="cosmic"] .bread i { display: none; }
.bread-button[data-bread-type="cosmic"] .bread em { margin-top: 72px; color: #c8ffff; letter-spacing: .03em; }
.bread-button[data-bread-type="royal"] .bread {
  background: linear-gradient(145deg,#fff1a3,#d99825 66%,#8d491d);
  border-color: #74431d; clip-path: polygon(0 28%,14% 28%,22% 3%,39% 25%,50% 0,62% 25%,80% 3%,87% 28%,100% 28%,94% 100%,6% 100%);
  border-radius: 22% 22% 35% 35%; box-shadow: inset 0 8px rgba(255,255,211,.6),0 0 28px rgba(255,205,62,.8);
}
.bread-button[data-bread-type="royal"] .bread i { display: none; }
.bread-button[data-bread-type="royal"] .bread em { margin-top: 65px; color: #6d3d16; letter-spacing: .03em; }
.float-layer { position: absolute; z-index: 9; inset: 0; pointer-events: none; overflow: hidden; }
.float-number {
  --float-rise: -85px; --float-scale: 1.1;
  position: absolute; white-space: nowrap; font: 21px "Black Han Sans"; color: var(--red);
  animation: floatUp .8s ease-out forwards; text-shadow: 0 2px white;
}
/* The super part-timer's own output reads as calmer background work than
   the player's own taps - dimmer and smaller so a maxed alba never looks
   like it is out-producing the whole bakery. Jackpots drop this class and
   keep their full treatment. */
.float-number.from-auto:not(.critical) {
  opacity: .62; transform-origin: center;
  font-size: .78em; text-shadow: 0 1px rgba(255,255,255,.85);
}
.float-number.combo-warm {
  color: #df6728; text-shadow: 0 2px #fff,0 0 7px rgba(255,169,59,.72);
}
.float-number.combo-hot {
  color: #d74625; text-shadow: 0 2px #fff0ba,0 0 10px rgba(255,100,35,.82);
}
.float-number.combo-blaze {
  color: #bd3127; text-shadow: 0 2px #ffe3a0,0 0 13px #ff7b24,0 0 22px rgba(255,203,57,.65);
}
.float-number.combo-inferno {
  color: #9e2352; text-shadow: 0 2px #fff0ae,0 0 14px #ff5a28,0 0 25px rgba(255,221,68,.82);
  filter: saturate(1.25);
}
.float-number.combo-max {
  color: #fff2a1;
  text-shadow: 0 2px #8e2921,0 0 8px #fff,0 0 17px #ffb11f,0 0 28px #e33e25;
  filter: saturate(1.35) brightness(1.08);
}
.float-number.combo-blaze::after,
.float-number.combo-inferno::after,
.float-number.combo-max::after {
  content: "✦"; position: absolute; top: -12px; right: -11px;
  color: #ffe36a; font: 14px "Black Han Sans"; text-shadow: 0 0 8px #fff;
  animation: comboSpark .45s ease-out infinite alternate;
}
.float-number.combo-max::before {
  content: "🔥"; position: absolute; top: -14px; left: -18px;
  font-size: 16px; filter: drop-shadow(0 0 6px #ffbf25);
}
.float-number.critical {
  color: #8a4f00; font-size: 25px;
  text-shadow: 0 2px #fff2a2,0 0 10px #ffe066,0 0 22px rgba(255,152,22,.85);
}
.float-number.jackpot-5 { color: #bc5617; filter: saturate(1.2); }
.float-number.jackpot-10 {
  color: #b32754; text-shadow: 0 2px #fff2a2,0 0 12px #ffbc40,0 0 28px rgba(225,48,75,.82);
}
.float-number.jackpot-100 {
  color: #fff5a5;
  text-shadow: 0 2px #8b2540,0 0 10px #fff,0 0 22px #ffc627,0 0 38px #e52858;
  filter: saturate(1.45) brightness(1.08);
}
.bread-button.jackpot-bake-10 .bread-photo,
.bread-button.jackpot-bake-10 .bread-generated-photo,
.bread-button.jackpot-bake-10 .bread { filter: drop-shadow(0 0 16px #ffb52e); }
.bread-button.jackpot-bake-100 .bread-photo,
.bread-button.jackpot-bake-100 .bread-generated-photo,
.bread-button.jackpot-bake-100 .bread { filter: drop-shadow(0 0 25px #fff176) saturate(1.5); }
@keyframes floatUp {
  from { transform: translate(-50%,0) scale(.7); opacity: 0; }
  18% { opacity: 1; }
  62% { opacity: 1; }
  to { transform: translate(-50%,var(--float-rise)) scale(var(--float-scale)); opacity: 0; }
}
@keyframes comboSpark {
  from { transform: rotate(-12deg) scale(.7); opacity: .45; }
  to { transform: rotate(12deg) scale(1.2); opacity: 1; }
}
.status-dock {
  position: static; z-index: 25;
  display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr));
  align-items: start; gap: 8px; margin: -10px 0 0; pointer-events: none;
}
.compact-status {
  min-width: 0; overflow: hidden;
  border: 1px solid rgba(255,255,255,.78); border-radius: 12px;
  background: rgba(255,250,240,.96); box-shadow: 0 7px 20px rgba(61,39,22,.18);
  pointer-events: auto;
}
.compact-status[hidden] { display: none; }
.compact-status summary {
  position: relative; min-height: 48px; display: grid;
  grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 8px;
  padding: 7px 10px; cursor: pointer; list-style: none;
}
.compact-status summary::-webkit-details-marker { display: none; }
.compact-status summary::after {
  content: "⌄"; position: absolute; right: 8px; bottom: -1px;
  color: var(--muted); font-size: 10px;
}
.compact-status[open] summary { border-bottom: 1px solid var(--line); }
.summary-icon {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px;
  background: #f7ecd8; font-size: 19px; box-shadow: inset 0 -2px rgba(0,0,0,.05);
}
.summary-copy small { display: block; color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.summary-copy strong {
  display: block; overflow: hidden; margin-top: 1px; font-size: 12px;
  text-overflow: ellipsis; white-space: nowrap;
}
.summary-value {
  display: block; max-width: 112px; overflow: hidden; padding-right: 8px;
  color: var(--ink); font-size: 12px; font-weight: 800;
  text-overflow: ellipsis; white-space: nowrap;
}
.compact-status-body {
  position: static; max-height: 150px; overflow-y: auto; box-sizing: border-box;
  padding: 10px 12px 12px; background: rgba(255,252,245,.72);
}
.status-popover-close { display: none; }
.delivery { background: #fff; }
.delivery.ready {
  border-color: #e3a52f; box-shadow: 0 0 0 3px rgba(243,182,63,.16),0 10px 28px rgba(168,96,30,.14);
  animation: deliveryReady 1.4s ease-in-out infinite alternate;
}
@keyframes deliveryReady { to { box-shadow: 0 0 0 5px rgba(243,182,63,.1),0 12px 32px rgba(168,96,30,.2); } }
.section-heading h2 { font: 18px "Black Han Sans"; margin: 0; }
.progress-track { height: 7px; border-radius: 9px; background: #eee2cf; margin: 0 0 9px; overflow: hidden; }
.progress-track div { height: 100%; width: 0; background: linear-gradient(90deg,var(--orange),var(--yellow)); transition: width .3s; }
.delivery-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.delivery-footer p { margin: 0; color: var(--ink); font-size: 12px; font-weight: 800; }
.delivery-footer small { display: block; margin-top: 2px; color: var(--green); font-size: 11px; font-weight: 700; }
.delivery-footer button {
  flex: 0 0 auto; border: 0; border-radius: 7px; padding: 9px 11px;
  color: white; background: var(--red); font-size: 11px; font-weight: 800; cursor: pointer;
}
.delivery-footer button:disabled { color: var(--muted); background: #e6dcc9; cursor: not-allowed; }
.worker-panel {
  border-color: rgba(49,95,74,.28); background: #eef4e9;
}
.worker-panel[hidden] { display: none; }
.worker-panel.issue { border-color: rgba(182,61,45,.42); background: #fff1df; animation: workerAlert 1.2s ease-in-out infinite alternate; }
@keyframes workerAlert { to { box-shadow: 0 0 0 4px rgba(182,61,45,.08),0 8px 22px rgba(102,53,29,.12); } }
.worker-body { display: grid; grid-template-columns: 1fr minmax(130px,auto); gap: 14px; align-items: center; }
.worker-copy > p { margin: 0; color: #55493f; font-size: 11px; line-height: 1.35; }

/* Small hand-drawn backdrop for the worker panel, same flat-shape style as
   the click-stage shop scene. Backdrop/landmark theme by current map tier,
   crew size by building-progression stage (see renderWorkerStatus). */
.worker-illustration {
  position: relative; height: 52px; margin-bottom: 7px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px;
  background: linear-gradient(#f6dfb0 0 64%,#d9b878 64%);
}
.worker-illustration-landmark {
  position: absolute; left: 8px; bottom: 0; width: 40px; height: 28px;
  background: #c98a4c; border: 2px solid #7a4a26; border-radius: 3px 3px 0 0;
}
.worker-illustration-landmark::before {
  content: ""; position: absolute; left: -3px; right: -3px; bottom: 100%; height: 7px;
  background: repeating-linear-gradient(90deg,#a4482f 0 7px,#e0a24f 7px 14px);
}
.worker-crew { position: absolute; right: 8px; bottom: 0; display: flex; align-items: flex-end; gap: 5px; }
.worker-figure { position: relative; width: 8px; height: 18px; border-radius: 4px 4px 1px 1px; background: #4a6b52; }
.worker-figure::before {
  content: ""; position: absolute; left: 50%; bottom: 100%; width: 8px; height: 8px;
  border-radius: 50%; background: #f1c79a; transform: translateX(-50%);
}
.worker-illustration[data-map-tier="korea"] { background: linear-gradient(#bfe0e8 0 64%,#9fae94 64%); }
.worker-illustration[data-map-tier="korea"] .worker-illustration-landmark {
  width: 52px; height: 34px; background: #b9c2c4; border-color: #4c5c5e; border-radius: 2px;
}
.worker-illustration[data-map-tier="korea"] .worker-illustration-landmark::before { background: #4c5c5e; }
.worker-illustration[data-map-tier="world"] { background: linear-gradient(#8fd0e0 0 64%,#6fa08c 64%); }
.worker-illustration[data-map-tier="world"] .worker-illustration-landmark {
  width: 34px; height: 34px; border-radius: 50%; border-color: #205a66;
  background: radial-gradient(circle at 35% 30%,#bdeaf0,#3f8f9e);
}
.worker-illustration[data-map-tier="world"] .worker-illustration-landmark::before { content: none; }
.worker-illustration[data-map-tier="galaxy"] {
  background:
    radial-gradient(circle at 20% 25%,rgba(255,255,255,.6) 0 1.5px,transparent 2px) 0 0/22px 22px,
    radial-gradient(circle at 65% 55%,rgba(255,255,255,.45) 0 1.5px,transparent 2px) 0 0/30px 30px,
    linear-gradient(#171f4b 0 64%,#2b3160 64%);
}
.worker-illustration[data-map-tier="galaxy"] .worker-illustration-landmark {
  width: 44px; height: 16px; bottom: 5px; border-radius: 50%; border-color: #85e0e2;
  background: linear-gradient(135deg,#7f89c9,#3c4380); box-shadow: 0 0 8px rgba(133,224,226,.6);
}
.worker-illustration[data-map-tier="galaxy"] .worker-illustration-landmark::before { content: none; }
.worker-illustration[data-map-tier="galaxy"] .worker-figure { background: #4b5aa0; }
.worker-illustration[data-map-tier="galaxy"] .worker-figure::before { background: #d8e6ff; }
/* Real AI-generated key art for tiers we've illustrated (see laborIllustrations
   in app.js); tiers without one yet keep the flat CSS scene above. */
.worker-illustration.has-photo { background-size: cover; background-position: center 32%; }
.worker-illustration.has-photo .worker-illustration-landmark,
.worker-illustration.has-photo .worker-crew { display: none; }
.labor-modal .worker-illustration { height: 92px; margin: 0 0 16px; border-radius: 12px; }
/* The key art is 3:2, but the modal slot was a 3.5:1 letterbox, so `cover`
   cropped away well over half the picture and only the top band showed.
   Matching the art's own aspect ratio makes the whole scene visible with
   no cropping; the vh cap keeps a short window from pushing the buttons
   off screen. Only photo tiers get this - the CSS-drawn fallback scene is
   authored for the short strip. */
.labor-modal .worker-illustration.has-photo {
  height: auto; aspect-ratio: 3 / 2; max-height: 46vh;
  background-position: center;
}
.labor-modal .worker-illustration-landmark { transform: scale(1.6); transform-origin: bottom left; }
.labor-modal .worker-crew { transform: scale(1.6); transform-origin: bottom right; }
.labor-modal-resolve { margin: -6px 0 16px; color: var(--ink); font-size: 12px; font-weight: 700; }
.worker-meter { height: 5px; margin-top: 7px; overflow: hidden; border-radius: 5px; background: #d5dacd; }
.worker-meter i { display: block; width: 100%; height: 100%; background: var(--green); transition: width .3s; }
.worker-panel.issue .worker-meter i { background: var(--red); }
.effect-timer { margin-top: 8px; }
.effect-timer[hidden] { display: none; }
.effect-timer > span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.effect-timer > div {
  height: 6px; margin-top: 5px; overflow: hidden; border-radius: 6px; background: rgba(80,60,40,.14);
}
.effect-timer > div i {
  display: block; width: 100%; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg,var(--orange),var(--yellow)); transition: width .1s linear;
}
.worker-panel.issue .effect-timer > div i { background: linear-gradient(90deg,var(--red),var(--orange)); }
.worker-task {
  margin-top: 8px; padding: 7px 8px; border: 1px solid rgba(182,61,45,.26);
  border-radius: 7px; color: #7f3025; background: rgba(255,255,255,.65);
}
.worker-task[hidden] { display: none; }
.worker-task strong { display: block; font-size: 11px; }
.worker-task > div { height: 5px; margin-top: 5px; overflow: hidden; border-radius: 5px; background: #ead6c4; }
.worker-task > div i { display: block; width: 0; height: 100%; background: linear-gradient(90deg,var(--red),var(--yellow)); transition: width .2s; }
.worker-panel dl { min-width: 135px; margin: 0; padding-left: 12px; border-left: 1px solid var(--line); }
.worker-panel dl div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: 11px; }
.worker-panel dt { color: var(--muted); }
.worker-panel dd { margin: 0; color: var(--ink); font-weight: 800; }
.pace-panel {
  border-color: rgba(90,78,59,.2); background: rgba(255,250,235,.88); transition: .3s;
}
.pace-panel[hidden] { display: none; }
.pace-panel.inflation { border-color: rgba(182,61,45,.38); background: #fff0e5; }
.pace-panel.support { border-color: rgba(49,95,74,.34); background: #edf6e9; }
.pace-detail { margin: 0; color: #5e5145; font-size: 11px; line-height: 1.4; }
.pace-panel.inflation .summary-value { color: var(--red); }
.pace-panel.support .summary-value { color: var(--green); }
.tabs {
  position: sticky; z-index: 15; top: -20px; display: flex; margin: -4px 0 20px;
  border-bottom: 1px solid var(--line); background: rgba(244,234,215,.95); backdrop-filter: blur(8px);
}
.tab {
  flex: 1; padding: 12px 3px 14px; border: 0; border-bottom: 3px solid transparent; background: none; cursor: pointer;
  font-size: 13px; color: var(--muted); font-weight: 700;
}
.tab[hidden] { display: none; }
.tab.active { color: var(--red); border-color: var(--red); }
.tab[data-tab="map"] { position: relative; }
.tab[data-tab="supply"] { position: relative; }
.tab[data-tab="map"].map-new::after, .tab[data-tab="supply"].supply-new::after,
.tab[data-tab="upgrades"].prestige-new::after {
  content: ""; position: absolute; top: 6px; right: 13%; width: 8px; height: 8px;
  border: 2px solid #f4ead7; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 3px rgba(182,61,45,.15); animation: mapNotice .7s ease-in-out infinite alternate;
}
@keyframes mapNotice { to { transform: scale(1.25); } }
.tab-content { display: none; min-height: 565px; }
.tab-content.active { display: block; animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; }
.buy-mode { background: var(--ink); color: white; border-radius: 99px; padding: 7px 12px; font-size: 11px; cursor: pointer; user-select: none; }
.shop-list, .upgrade-list { display: grid; gap: 9px; }
.shop-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
.front-achievements {
  margin-bottom: 12px; padding: 12px 14px; border-radius: 12px; color: #fff8e8;
  background: linear-gradient(135deg,#315f4a,#254638); box-shadow: 0 7px 20px rgba(39,73,57,.15);
}
.front-achievements-head {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 8px; align-items: start;
}
.front-achievements-head h2 { margin: 0; font: 17px "Black Han Sans"; }
.front-achievements-head .eyebrow { color: #f4c862; }
.front-achievements-head > .achievement-collection { grid-column: 2; }
.front-achievements-head > .completed-collection[open] { display: contents; }
.front-achievements-head > .completed-collection[open]::details-content { display: contents; }
.front-achievements-head > .completed-collection[open] > summary {
  grid-column: 2; grid-row: 1; align-self: start; margin-top: 6px;
}
.front-achievements-head > .completed-collection[open] .completed-achievements { grid-column: 1 / -1; grid-row: 2; }
.front-achievements-head > button { grid-column: 3; }
.front-achievements-head > button {
  border: 1px solid rgba(255,255,255,.18); border-radius: 99px; padding: 6px 9px;
  color: #fff8e8; background: rgba(255,255,255,.08); cursor: pointer; font-size: 9px;
}
.completed-achievements {
  --completed-achievement-size: clamp(38px,4.2vw,46px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-height: 190px;
  margin-top: 9px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d8b863 transparent;
}
.completed-achievement {
  position: relative; flex: 0 0 var(--completed-achievement-size);
  width: var(--completed-achievement-size); height: var(--completed-achievement-size);
  display: grid; place-items: center; appearance: none;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  color: var(--ink); font-size: 15px; cursor: help; padding: 0;
}
.completed-achievement::after {
  content: attr(data-tooltip); position: absolute; z-index: 35; left: 50%; bottom: calc(100% + 8px);
  width: max-content; max-width: 210px; padding: 7px 9px; border-radius: 6px; color: white;
  background: var(--ink); font-size: 9px; line-height: 1.45; opacity: 0; pointer-events: none;
  transform: translate(-50%,4px); transition: .16s;
}
.completed-achievement:hover::after, .completed-achievement:focus::after { opacity: 1; transform: translate(-50%,0); }
.next-achievements {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(min(145px,100%),1fr));
  gap: 6px; margin-top: 9px;
}
.next-achievement { padding: 7px; border-radius: 7px; background: rgba(255,255,255,.08); }
.next-achievement strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.next-achievement strong .art-icon { width: 18px; height: 18px; margin-right: 3px; vertical-align: middle; }
.next-achievement p { margin: 4px 0 0; color: rgba(255,255,255,.6); font-size: 8px; }
.next-achievement .mini-progress { height: 3px; margin-top: 6px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.14); }
.next-achievement .mini-progress i { display: block; height: 100%; background: #f4c862; }
.completed-collection { min-width: 0; margin-top: 9px; }
.front-achievements-head > .completed-collection,
.recipe-shelf-head > .completed-collection { align-self: start; margin-top: 6px; }
.completed-collection.empty { display: none; }
.completed-collection summary {
  display: flex; align-items: center; justify-content: space-between; padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 7px; list-style: none;
  background: rgba(255,255,255,.07); cursor: pointer; font-size: 11px; font-weight: 800;
}
.completed-collection summary::-webkit-details-marker { display: none; }
.completed-collection summary::before { content: "▸"; margin-right: 6px; transition: transform .18s; }
.completed-collection[open] summary::before { transform: rotate(90deg); }
.collection-title { flex: 0 0 auto; }
.collection-preview {
  display: flex; flex: 1; justify-content: flex-end; gap: 3px; min-width: 0; margin-left: 8px; overflow: hidden;
}
.collection-preview:empty { display: none; }
.collection-preview .preview-icon {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 6px;
  opacity: .95; cursor: help;
}
.collection-preview .preview-icon .art-icon {
  display: block; width: 24px; height: 24px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45),0 1px 3px rgba(43,28,18,.18);
}
.recipe-collection summary { border-color: var(--line); color: var(--ink); background: #f4e8d3; }
.front-achievements-head > .completed-collection summary,
.recipe-shelf-head > .completed-collection summary {
  width: max-content; max-width: 100%; min-height: 36px; box-sizing: border-box; margin-left: auto; padding: 4px 8px;
  border: 0; border-radius: 7px; background: transparent; font-size: 13px;
}
.front-achievements-head > .completed-collection summary::before,
.recipe-shelf-head > .completed-collection summary::before { margin-right: 7px; font-size: 13px; }
.front-achievements-head > .completed-collection .collection-preview,
.recipe-shelf-head > .completed-collection .collection-preview {
  flex: 0 1 auto; justify-content: flex-start; margin-left: 0;
}
.front-achievements-head > .completed-collection summary:hover,
.recipe-shelf-head > .completed-collection summary:hover {
  background: rgba(255,255,255,.1);
}
.front-achievements-head > button {
  align-self: start; min-height: 28px; margin-top: 6px; padding: 2px 4px 2px 10px;
  border: 0; border-left: 1px solid rgba(255,255,255,.22); border-radius: 0;
  background: transparent;
}
.recipe-shelf-head > #recipeCount {
  align-self: start; min-height: 28px; box-sizing: border-box; margin-top: 6px; padding: 6px 2px 0 10px;
  border-left: 1px solid var(--line);
}
.recipe-shelf {
  box-sizing: border-box; height: 190px; display: flex; flex-direction: column; overflow: hidden;
  margin-bottom: 15px; padding: 9px 10px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,253,246,.72); box-shadow: 0 7px 20px rgba(75,47,24,.05);
}
.recipe-shelf[hidden] { display: none !important; }
.recipe-shelf:has(.recipe-collection[open]) { height: 315px; }
.recipe-shelf .recipe-collection { flex: 0 0 auto; }
.recipe-shelf:has(.recipe-collection[open]) .recipe-available-slot { min-height: 96px; }
.recipe-shelf-head {
  flex: 0 0 auto; display: grid; grid-template-columns: auto minmax(0,1fr) auto auto;
  gap: 8px; align-items: start; margin-bottom: 5px;
}
.recipe-shelf-head > .recipe-collection { grid-column: 2; }
.recipe-shelf-head > .completed-collection[open] { display: contents; }
.recipe-shelf-head > .completed-collection[open]::details-content { display: contents; }
.recipe-shelf-head > .completed-collection[open] > summary {
  grid-column: 2; grid-row: 1; align-self: start; margin-top: 6px;
}
.recipe-shelf-head > .completed-collection[open] .completed-recipes { grid-column: 1 / -1; grid-row: 2; }
.recipe-shelf-head > #recipeCount { grid-column: 3; }
.recipe-shelf-head > #recipeBulkBtn { grid-column: 4; }
.recipe-shelf-head h2 { margin: 0; font: 15px "Black Han Sans"; }
.recipe-shelf-head > span { font-size: 10px; font-weight: 800; color: var(--muted); }
.recipe-bulk-btn {
  align-self: start; margin-top: 3px; border: 0; border-radius: 99px; background: var(--ink);
  color: white; padding: 6px 10px; font-size: 10px; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.recipe-bulk-btn[hidden] { display: none; }
.recipe-bulk-btn:disabled { opacity: .45; cursor: not-allowed; }
.completed-recipes {
  --completed-recipe-size: clamp(36px,3.8vw,42px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px; max-height: 105px; overflow-y: auto;
  padding: 6px 0 3px; scrollbar-width: thin; scrollbar-color: #ccb998 transparent;
}
.completed-recipes:empty { display: none; }
.completed-recipe {
  position: relative; flex: 0 0 var(--completed-recipe-size);
  width: var(--completed-recipe-size); height: var(--completed-recipe-size);
  display: grid; place-items: center; appearance: none;
  border: 0; border-radius: 0; background: transparent;
  font-size: 18px; cursor: help; box-shadow: none; padding: 0;
}
.completed-recipe::after {
  content: attr(data-tooltip); position: absolute; z-index: 35; left: 50%; bottom: calc(100% + 8px);
  width: max-content; max-width: 220px; padding: 7px 9px; border-radius: 6px; background: var(--ink);
  color: white; font-size: 9px; line-height: 1.45; opacity: 0; pointer-events: none;
  transform: translate(-50%,4px); transition: .16s;
}
.completed-recipe:hover::after, .completed-recipe:focus::after { opacity: 1; transform: translate(-50%,0); }
.recipe-available-slot {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
.recipe-shelf .upgrade-list {
  flex: 1 1 auto; min-height: 0; grid-template-columns: repeat(2,minmax(0,1fr));
  grid-auto-rows: max-content; align-content: start; margin-top: 6px; gap: 6px;
  overflow-y: auto; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #ccb998 transparent;
}
.recipe-shelf .upgrade-item {
  grid-template-columns: 32px minmax(0,1fr) 72px; min-width: 0; min-height: 43px; gap: 7px;
  padding: 5px 6px; border-radius: 7px; background: white;
}
.recipe-shelf .item-icon { width: 32px; height: 32px; font-size: 18px; border-radius: 7px; }
.recipe-shelf .item-info h3 {
  overflow: hidden; margin: 0; font-size: 11px; text-overflow: ellipsis; white-space: nowrap;
}
.recipe-shelf .item-info p { display: none; }
.recipe-shelf .upgrade-item.special-recipe { border-color: rgba(176,112,19,.34); background: linear-gradient(135deg,#fffdf8,#fff2c8); }
.recipe-special-badge {
  display: inline-block; margin-left: 4px; padding: 1px 4px; border-radius: 8px;
  color: #fff; background: #a96116; font-size: 7px; vertical-align: 2px;
}
.achievement-item.special-achievement { border-color: rgba(194,135,31,.48); background: linear-gradient(135deg,#fffdf7,#fff4cf); }
.achievement-item.special-achievement .achievement-medal,
.completed-achievement.special-achievement {
  background: radial-gradient(circle,rgba(255,216,92,.58) 0,rgba(235,163,38,.24) 48%,transparent 72%);
  box-shadow: none;
}
.achievement-special-badge {
  display: inline-block; margin-left: 5px; color: #b06b10; font-size: 12px;
  text-shadow: 0 0 8px rgba(237,181,58,.5); vertical-align: 1px;
}
.recipe-shelf .buy-btn {
  box-sizing: border-box; width: 72px; min-width: 0; max-width: 100%; overflow: hidden;
  padding: 4px 5px; font-size: 10px;
}
.recipe-shelf .buy-btn strong {
  overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap;
}
.recipe-shelf .upgrade-item.bought, .recipe-shelf .upgrade-item.locked { display: none; }
.recipe-empty { display: none; margin: 9px 2px 0; color: var(--muted); font-size: 9px; }
.recipe-empty.show { display: block; }
.shop-item.hidden-building { display: none; }
.building-unlock-hint {
  margin: 12px 2px 0; padding: 9px 11px; border: 1px dashed var(--line); border-radius: 7px;
  color: var(--muted); background: rgba(255,255,255,.35); font-size: 9px; text-align: center;
}
.building-unlock-hint:empty { display: none; }
.shop-item, .upgrade-item {
  display: grid; grid-template-columns: 50px 1fr auto; gap: 13px; align-items: center; padding: 13px;
  border: 1px solid var(--line); background: rgba(255,253,246,.7); border-radius: 10px; transition: transform .16s, background .16s;
}
.shop-list .shop-item {
  grid-template-columns: 40px minmax(0,1fr); gap: 8px; padding: 9px; align-content: center;
}
.shop-list .item-icon { width: 40px; height: 40px; font-size: 22px; }
.shop-list .item-info h3 {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 12px;
}
.shop-list .item-info p {
  min-height: 16px; color: #55493f; line-height: 1.45;
  font-size: 10px; font-weight: 600;
}
.shop-list .buy-btn {
  grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 6px 8px;
}
.shop-list .buy-btn strong { display: inline; }
/* While a half-price coupon is pending the list price stays visible with a
   strike through it, so the player can see what the coupon is worth instead
   of the number just quietly halving. It wraps to a second line on the
   narrow mobile buy button rather than squeezing both prices side by side. */
.buy-btn.discounted strong {
  display: inline-flex; flex-wrap: wrap; gap: 1px 5px; align-items: baseline; justify-content: flex-end;
}
.buy-btn .price-list { display: none; }
.buy-btn.discounted .price-list {
  display: inline; color: var(--red); text-decoration: line-through;
  opacity: .7; font-size: .86em; font-weight: 700;
}
.buy-btn.discounted .price-now { color: var(--green); }
.buy-mode.pinned { background: var(--green); cursor: default; }
.shop-item.affordable:hover, .upgrade-item.affordable:hover { transform: translateX(-3px); background: white; }
.item-icon {
  width: 50px; height: 50px; display: grid; place-items: center; border-radius: 9px; font-size: 27px;
  background: #ecdbc1; box-shadow: inset 0 -3px rgba(0,0,0,.07);
}
.item-info h3 { margin: 0 0 2px; font-size: 14px; }
.item-info p { margin: 0; color: var(--muted); font-size: 10px; }
.buy-btn {
  min-width: 82px; border: 1px solid var(--line); background: white; padding: 8px 8px; border-radius: 7px;
  cursor: pointer; font-size: 11px; font-weight: 800;
}
.buy-btn strong { display: block; color: var(--red); font-size: 12px; }
.shop-item:not(.affordable), .upgrade-item:not(.affordable) { opacity: .56; }
.shop-list .shop-item:not(.affordable) { opacity: 1; }
.shop-list .shop-item:not(.affordable) .buy-btn { opacity: .52; }
.shop-item:not(.affordable) .buy-btn, .upgrade-item:not(.affordable) .buy-btn { cursor: not-allowed; }
.owned { display: inline-block; min-width: 22px; color: var(--red); }
.upgrade-item.bought { opacity: .55; filter: grayscale(.5); }
.upgrade-item.bought .buy-btn { background: var(--green); color: white; }
.upgrade-item.locked { opacity: .4; }
.prestige-card {
  display: grid; grid-template-columns: 58px 1fr auto; gap: 14px; align-items: center;
  padding: 18px; color: #fff8e8; background: linear-gradient(135deg,#38271f,#704229);
  border-radius: 13px; box-shadow: 0 12px 25px rgba(55,34,22,.2);
}
.prestige-card[hidden], .prestige-note[hidden], .prestige-stat[hidden] { display: none !important; }
.prestige-symbol {
  width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%;
  font-size: 30px; color: #ffe18a; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
}
.prestige-copy h3 { margin: 1px 0 4px; font: 18px "Black Han Sans"; }
.prestige-copy h3 span { color: #ffe18a; }
.prestige-copy > p:not(.eyebrow) { margin: 0; opacity: .7; font-size: 10px; }
.prestige-preview { margin-top: 9px; font-size: 10px; }
.prestige-preview strong { color: #ffe18a; }
.prestige-copy .prestige-detail { margin: 7px 0 0; color: rgba(255,255,255,.76); opacity: 1; font-size: 11px; line-height: 1.45; }
.prestige-copy .prestige-detail.emphasis { color: #ffe18a; font-weight: 800; }
.prestige-card button {
  min-width: 104px; padding: 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px;
  background: #f2b842; color: #32251e; font-size: 11px; font-weight: 800; cursor: pointer;
}
.prestige-card button:disabled { opacity: .42; cursor: not-allowed; }
.prestige-note { margin: 9px 2px 22px; color: var(--muted); font-size: 10px; }
/* Lives in the rebirth tab, which is already the scroll container - the
   list itself must NOT scroll (a nested scroller here is what produced
   the stacked-scrollbar mess back when this sat in a height-capped
   modal). Node rows wrap instead of scrolling sideways. */
.tech-tree-list { display: grid; gap: 10px; }
.tech-branch {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream);
}
.tech-branch-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.tech-branch-icon { font-size: 20px; }
.tech-branch-copy h4 { margin: 0 0 2px; font-size: 12px; font-weight: 800; }
.tech-branch-copy p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
/* Never a horizontal scrollbar: nodes are sized so the longest chain (6
   nodes) fits the narrowest modal, and wrap as a last resort. */
.tech-node-row { display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px; padding: 2px 1px 2px; }
.tech-node {
  flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; border: 2px solid var(--line); background: #fff8ea;
  color: var(--ink); font-size: 9px; font-weight: 800; cursor: default;
}
.tech-node.owned { background: linear-gradient(135deg,#f2b842,#df6c2f); border-color: #b6935a; color: white; }
.tech-node.available {
  border-color: var(--red); color: var(--red); background: #fff; cursor: pointer;
  box-shadow: 0 0 0 3px rgba(182,61,45,.15); animation: tech-node-pulse 1.6s ease-in-out infinite;
}
.tech-node.locked { color: var(--muted); opacity: .55; cursor: not-allowed; }
.tech-node-link { flex: 0 0 9px; height: 3px; background: var(--line); }
.tech-node-link.done { background: #df6c2f; }
@keyframes tech-node-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(182,61,45,.15); }
  50% { box-shadow: 0 0 0 6px rgba(182,61,45,.08); }
}
.achievement-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.achievement-filter button {
  border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 800;
}
.achievement-filter button.active { color: white; background: var(--red); border-color: var(--red); }
.achievement-discovery-note {
  margin: -4px 2px 11px; color: var(--muted); font-size: 10px; font-weight: 700;
}
.achievement-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.achievement-item {
  position: relative;
  display: grid; grid-template-columns: 38px 1fr; gap: 9px; align-items: center; min-height: 70px;
  padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,253,246,.6);
  filter: grayscale(1); opacity: .45;
}
.achievement-item.unlocked { filter: none; opacity: 1; background: #fffdf7; box-shadow: 0 5px 14px rgba(75,47,24,.06); }
.achievement-item.unlocked { cursor: help; transition: transform .18s, box-shadow .18s; }
.achievement-item.unlocked::after {
  content: attr(data-effect); position: absolute; z-index: 40; left: 50%; bottom: calc(100% + 7px);
  width: max-content; padding: 7px 10px; border-radius: 6px; color: #fff8e8; background: var(--ink);
  font-size: 9px; font-weight: 800; opacity: 0; pointer-events: none;
  transform: translate(-50%,5px); transition: .18s; box-shadow: 0 7px 18px rgba(40,27,18,.2);
}
.achievement-item.unlocked:hover, .achievement-item.unlocked:focus {
  z-index: 3; outline: none; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(223,108,47,.18);
}
.achievement-item.unlocked:hover::after, .achievement-item.unlocked:focus::after { opacity: 1; transform: translate(-50%,0); }
.achievement-item.unlocked:hover .achievement-medal, .achievement-item.unlocked:focus .achievement-medal {
  animation: achievementShine .75s ease-in-out infinite alternate;
}
@keyframes achievementShine {
  to { transform: scale(1.08) rotate(4deg); filter: drop-shadow(0 0 8px rgba(243,182,63,.82)); }
}
.achievement-medal {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 0; background: transparent; box-shadow: none; font-size: 19px;
}
.achievement-item.unlocked .achievement-medal { background: transparent; box-shadow: none; }
.achievement-item.mystery {
  min-height: 62px; border-style: dashed; background: rgba(225,211,187,.28);
  filter: none; opacity: .68; cursor: help;
}
.achievement-item.mystery .achievement-medal {
  color: #fffaf0; background: #8f8170; box-shadow: inset 0 -3px rgba(0,0,0,.12);
  font: 22px "Black Han Sans";
}
.achievement-item.mystery h3 { letter-spacing: .12em; }
.achievement-item.mystery .achievement-bonus { color: var(--muted) !important; }
.achievement-item h3 { margin: 0 0 2px; font-size: 11px; }
.achievement-item p { margin: 0; color: var(--muted); font-size: 9px; }
.achievement-bonus { color: var(--red) !important; font-weight: 800; margin-top: 3px !important; }
.art-icon {
  --ring-color: hsl(var(--ring-hue,34) 72% 53%);
  display: inline-block; width: 100%; height: 100%; min-width: 0; aspect-ratio: 1; border-radius: 22%;
  background-repeat: no-repeat; background-position: var(--icon-x) var(--icon-y);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--ring-color) 70%,white),0 1px 3px rgba(52,34,20,.16);
  filter: saturate(1.03); transition: transform .18s,filter .18s;
}
.recipe-art {
  background-image: var(--recipe-icon-sheet,radial-gradient(circle,#f3b63f 0 45%,#8e492d 47% 58%,transparent 60%));
  background-size: 500% 400%;
}
.achievement-art {
  border-radius: 0; box-shadow: none;
  background-image: var(--achievement-icon-sheet,radial-gradient(circle,#ffe286 0 42%,#c77827 45% 60%,transparent 62%));
  background-size: 400% 300%;
}
.item-icon .art-icon { transform: scale(.92); }
.item-icon:hover .art-icon {
  transform: scale(1.05); filter: saturate(1.15) drop-shadow(0 2px 3px rgba(70,42,20,.2));
}
.completed-recipe:hover .art-icon,
.completed-recipe:focus-visible .art-icon,
.completed-achievement:hover .art-icon,
.completed-achievement:focus-visible .art-icon {
  transform: none; filter: saturate(1.18) brightness(1.06) drop-shadow(0 2px 3px rgba(70,42,20,.24));
}
.completed-recipe .art-icon, .completed-achievement .art-icon { display: block; }
.ticker { margin-top: 22px; background: var(--ink); color: #f7ead1; display: flex; align-items: center; overflow: hidden; font-size: 11px; border-radius: 5px; }
.ticker > span { background: var(--red); padding: 9px 12px; font-weight: 800; white-space: nowrap; }
.ticker div { overflow: hidden; flex: 1; }
.ticker p { display: inline-block; white-space: nowrap; margin: 0; padding-left: 100%; animation: ticker 15s linear infinite; }
@keyframes ticker { to { transform: translateX(-100%); } }
.supply-panel {
  margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,253,246,.65); overflow: hidden;
}
.supply-intro {
  margin: -5px 2px 13px; color: var(--muted); font-size: 12px; line-height: 1.55;
}
.supply-panel[hidden] { display: none; }
.supply-panel summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; list-style: none; cursor: pointer;
}
.supply-panel summary::-webkit-details-marker { display: none; }
.supply-panel summary span { display: flex; flex-direction: column; }
.supply-panel summary b { font-size: 12px; }
.supply-panel summary small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.supply-panel summary > strong { color: var(--green); font-size: 12px; }
.supply-list { display: grid; gap: 6px; padding: 0 10px 10px; }
.supply-line {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center;
  padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px;
  background: rgba(255,255,255,.65); opacity: .62;
}
.supply-line.secured { opacity: 1; border-color: rgba(49,95,74,.35); background: #eef5e8; }
.supply-line.active { opacity: 1; border-color: rgba(223,108,47,.4); background: #fff8e9; }
.supply-line > span { font-size: 20px; text-align: center; }
.supply-line h3 { margin: 0; font-size: 12px; }
.supply-line p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.supply-line .mini-progress { height: 3px; margin-top: 5px; overflow: hidden; border-radius: 3px; background: #ded2bd; }
.supply-line .mini-progress i { display: block; height: 100%; background: linear-gradient(90deg,var(--orange),var(--yellow)); }
.supply-line > strong { color: var(--red); font-size: 11px; white-space: nowrap; }
.supply-line.secured > strong { color: var(--green); }
.supply-deliver {
  max-width: 130px; padding: 6px 8px; border: 0; border-radius: 6px;
  color: white; background: var(--red); font-size: 11px; font-weight: 800; cursor: pointer;
}
.supply-deliver:hover { background: #8f2f24; }
.map-card {
  position: relative; height: 420px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px;
  background: radial-gradient(circle at 45% 45%, #f5ead0 0, #eadbbe 72%); transition: background .8s,border-color .8s;
}
.map-card[data-map-tier="korea"] {
  background:
    radial-gradient(circle at 50% 45%,rgba(255,255,255,.72) 0 16%,transparent 55%),
    linear-gradient(145deg,#d8eef0 0,#b9dde0 62%,#9fcbd0 100%);
  border-color: #86b7bc;
}
.map-card[data-map-tier="world"] { background: radial-gradient(circle at 50% 46%,#dff3ef 0,#aed6d8 62%,#82b8c5 100%); border-color: #7ca9ae; }
.map-card[data-map-tier="galaxy"] { background: radial-gradient(circle at 50% 48%,#352957 0,#17162e 56%,#090b1a 100%); border-color: #68598d; }
.map-card::before {
  content:""; position:absolute; z-index: 0; inset: 10px; pointer-events:none;
  border: 1px dashed rgba(70,50,30,.14); border-radius: 13px;
}
.map-card::after {
  content: ""; position: absolute; z-index: 1; left: var(--unlock-x,50%); top: var(--unlock-y,50%);
  width: 42px; height: 42px; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle,rgba(255,255,225,.98) 0 12%,rgba(255,205,67,.8) 20%,rgba(243,182,63,.25) 48%,transparent 72%);
  transform: translate(-50%,-50%) scale(.1); mix-blend-mode: screen;
}
.map-card.unlock-celebration::after { animation: mapUnlockWave 2.25s cubic-bezier(.12,.72,.2,1) both; }
@keyframes mapUnlockWave {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.1); }
  12% { opacity: 1; }
  72% { opacity: .74; }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(18); }
}
.daejeon-map { position: absolute; inset: 18px 22px 24px; width: calc(100% - 44px); height: calc(100% - 42px); overflow: visible; }
.map-visual { display: none; }
.map-card[data-map-tier="daejeon"] .map-visual[data-map-tier="daejeon"],
.map-card[data-map-tier="korea"] .map-visual[data-map-tier="korea"],
.map-card[data-map-tier="world"] .map-visual[data-map-tier="world"],
.map-card[data-map-tier="galaxy"] .map-visual[data-map-tier="galaxy"] { display: block; }
.map-spots { position: absolute; inset: 18px 22px 24px; }
.map-card[data-map-tier="korea"] .korea-map,
.map-card[data-map-tier="korea"] .map-spots {
  top: 18px; bottom: auto; left: 50%; right: auto;
  width: auto; height: calc(100% - 42px); aspect-ratio: 761 / 1243;
  transform: translateX(-50%);
}
.daejeon-map .districts path { fill: #e5cfa4; stroke: #9e7953; stroke-width: 5; vector-effect: non-scaling-stroke; }
.daejeon-map .districts path:nth-child(2n) { fill: #edd9b2; }
.korea-reference-map {
  opacity: .96;
  filter: drop-shadow(0 7px 5px rgba(46,80,78,.2));
}
.korea-border-line {
  fill: none; stroke: rgba(181,56,39,.58); stroke-width: 3; stroke-dasharray: 9 8;
  vector-effect: non-scaling-stroke;
}
.world-map .districts path { fill: #e8d29d; stroke: #5f8e8b; stroke-width: 3; }
.map-grid-lines { fill: none; stroke: rgba(75,99,78,.2); stroke-width: 2; stroke-dasharray: 7 8; }
.world-map .map-grid-lines { stroke: rgba(255,255,255,.34); }
.daejeon-map .rivers { fill: none; stroke: #78b8c7; stroke-width: 9; opacity: .72; }
.daejeon-map .rivers path { vector-effect: non-scaling-stroke; }
.river-labels { fill: rgba(36,117,139,.72); font: 800 21px "Gowun Dodum"; text-anchor: middle; }
.daejeon-map .delivery-route {
  fill: none; stroke: var(--red); stroke-width: 5; stroke-dasharray: 12 12;
  stroke-linecap: round; stroke-linejoin: round; opacity: .48; vector-effect: non-scaling-stroke;
}
.map-card.unlock-celebration .districts path {
  animation: districtAwaken 1.8s ease-out both;
}
.map-card.unlock-celebration .districts path:nth-child(2) { animation-delay: .06s; }
.map-card.unlock-celebration .districts path:nth-child(3) { animation-delay: .12s; }
.map-card.unlock-celebration .districts path:nth-child(4) { animation-delay: .18s; }
.map-card.unlock-celebration .districts path:nth-child(5) { animation-delay: .24s; }
.map-card.unlock-celebration .delivery-route { animation: routeIgnition 2.2s ease-out both; }
@keyframes districtAwaken {
  0% { fill: #fff7bc; filter: drop-shadow(0 0 20px rgba(255,199,55,.95)); }
  42% { fill: #f7c85a; }
  100% { filter: drop-shadow(0 0 0 transparent); }
}
@keyframes routeIgnition {
  0% { stroke: #fff9bd; stroke-width: 12; stroke-dashoffset: 180; opacity: 1; filter: drop-shadow(0 0 10px #ffb62f); }
  100% { stroke: var(--red); stroke-width: 5; stroke-dashoffset: 0; opacity: .48; filter: none; }
}
.district-labels { fill: rgba(87,62,42,.42); font: 800 27px "Gowun Dodum"; text-anchor: middle; }
.world-map .district-labels { fill: rgba(25,73,80,.58); }
.galaxy-map .district-labels { fill: rgba(237,224,255,.62); }
.galaxy-arms { fill: none; stroke: rgba(190,159,246,.42); stroke-width: 42; stroke-linecap: round; filter: blur(5px); }
.galaxy-arms path:nth-child(2n) { stroke: rgba(101,177,234,.34); stroke-width: 30; }
.galaxy-stars { fill: #fff7ca; filter: drop-shadow(0 0 6px #fff); }
.galaxy-map .delivery-route { stroke: #f6d573; opacity: .7; }
.map-card[data-map-tier="galaxy"] .map-source-note { color: rgba(245,235,255,.68); background: rgba(24,18,46,.68); }
.map-card.tier-transition .map-visual { animation: mapTierArrival 2.4s cubic-bezier(.16,.8,.22,1) both; }
@keyframes mapTierArrival {
  0% { opacity: 0; transform: scale(.25) rotate(-9deg); filter: brightness(2.2) blur(10px); }
  42% { opacity: 1; transform: scale(1.07) rotate(1deg); filter: brightness(1.45) blur(0); }
  72% { transform: scale(.98); }
  100% { opacity: 1; transform: scale(1); filter: brightness(1); }
}
.map-source-note {
  position: absolute; z-index: 1; right: 12px; bottom: 7px; padding: 2px 5px; border-radius: 4px;
  color: rgba(74,54,38,.58); background: rgba(255,250,240,.7); font-size: 9px; font-weight: 700;
}
.map-spot {
  position: absolute; z-index: 2; width: 38px; transform: translate(-50%,-50%);
  text-align: center; filter: grayscale(1); opacity: .42; transition: .4s;
  cursor: help; border-radius: 12px; outline: none;
}
.map-spot.unlocked { filter: none; opacity: 1; }
.map-spot.current-target { z-index: 5; filter: none; opacity: 1; }
.map-spot.current-target .pin {
  color: #fff; border-color: #fff3a8; background: #d84e32;
  animation: currentMapTarget 1.25s ease-in-out infinite;
}
@keyframes currentMapTarget {
  0%,100% {
    transform: rotate(-45deg) scale(.97); filter: brightness(.88);
    box-shadow: 0 5px 12px rgba(0,0,0,.18),0 0 0 1px rgba(243,182,63,.2);
  }
  50% {
    transform: rotate(-45deg) scale(1.09); filter: brightness(1.15);
    box-shadow: 0 6px 15px rgba(93,35,20,.24),0 0 0 6px rgba(243,182,63,.38),0 0 16px 7px rgba(255,200,54,.18);
  }
}
.map-spot.just-unlocked { z-index: 6; }
.map-spot.just-unlocked .pin { animation: pinArrival 1.25s cubic-bezier(.18,.9,.25,1.25) both; }
@keyframes pinArrival {
  0% { opacity: 0; transform: rotate(-45deg) translate(85px,-85px) scale(2.4); }
  48% { opacity: 1; transform: rotate(-45deg) translate(0,0) scale(1.35); box-shadow: 0 0 0 20px rgba(255,205,61,.25),0 10px 30px rgba(110,54,20,.34); }
  68% { transform: rotate(-45deg) scale(.88); }
  84% { transform: rotate(-45deg) scale(1.12); }
  100% { transform: rotate(-45deg) scale(1); box-shadow: 0 5px 12px rgba(0,0,0,.15); }
}
.map-spot:hover, .map-spot:focus-visible { opacity: .82; }
.map-spot.unlocked:hover, .map-spot.unlocked:focus-visible { opacity: 1; }
.map-spot:focus-visible { box-shadow: 0 0 0 3px rgba(181,56,39,.3); }
.map-spot .pin { width: 36px; height: 36px; display: grid; place-items: center; margin: auto; border-radius: 50% 50% 50% 8%; transform: rotate(-45deg); background: var(--paper); border: 3px solid var(--red); box-shadow: 0 5px 12px rgba(0,0,0,.15); }
.map-spot .pin span { transform: rotate(45deg); font-size: 17px; }
.map-route-table-wrap {
  max-height: 326px; margin-top: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 13px;
  background: rgba(255,250,240,.72);
}
.map-route-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.map-route-table th {
  position: sticky; z-index: 2; top: 0; padding: 8px 7px; color: var(--muted); background: #eee2cd;
  font-size: 10px; text-align: left; white-space: nowrap;
}
.map-route-table td { padding: 7px; border-top: 1px solid rgba(126,94,61,.12); vertical-align: middle; }
.map-route-table td:first-child,.map-route-table th:first-child { width: 42px; text-align: center; }
.map-route-table td:nth-child(4),.map-route-table th:nth-child(4) { text-align: right; white-space: nowrap; }
.map-route-table td:last-child,.map-route-table th:last-child { width: 70px; text-align: center; }
.map-route-table tr { transition: background .25s,opacity .25s; }
.map-route-table tr.completed { color: #315f4a; background: rgba(84,139,92,.08); }
.map-route-table tr.active {
  background: #ffe7a0; box-shadow: inset 5px 0 #d94d2e;
  animation: currentRouteRow 1.25s ease-in-out infinite;
}
.map-route-table tr.locked { opacity: .58; }
.map-route-table strong { color: var(--ink); cursor: help; white-space: nowrap; }
.route-order {
  display: inline-grid; width: 23px; height: 23px; place-items: center; border-radius: 50%;
  color: white; background: #876b50; font-size: 10px; font-weight: 900;
}
.completed .route-order { background: var(--green); }
.active .route-order { background: var(--orange); }
.route-status { display: inline-block; padding: 3px 7px; border-radius: 99px; background: rgba(105,85,65,.1); font-size: 10px; font-weight: 900; white-space: nowrap; }
.completed .route-status { color: var(--green); background: rgba(49,95,74,.12); }
.active .route-status { color: #9d3e23; background: rgba(223,108,47,.15); }
.map-route-table tr.active .route-status { animation: currentRouteStatus 1.25s ease-in-out infinite; }
@keyframes currentRouteStatus {
  0%,100% { color: #96351f; background: rgba(223,108,47,.17); transform: scale(.98); }
  50% { color: #fff; background: #c94a2f; transform: scale(1.03); box-shadow: 0 0 0 3px rgba(243,182,63,.2); }
}
@keyframes currentRouteRow {
  0%,100% { background: #fff1c7; }
  50% { background: #ffe08a; }
}
.map-route-table tr.just-completed { animation: routeRowComplete 1.8s ease-out both; }
@keyframes routeRowComplete {
  0% { background: #fff4a6; box-shadow: inset 0 0 0 2px #f3b63f,0 0 20px rgba(243,182,63,.6); }
  100% { background: rgba(84,139,92,.08); box-shadow: none; }
}
.map-celebration {
  position: absolute; z-index: 8; top: 22px; left: 50%; min-width: 190px; padding: 11px 22px 12px;
  border: 2px solid rgba(255,232,135,.85); border-radius: 14px; pointer-events: none; text-align: center;
  color: #fff9df; background: linear-gradient(135deg,rgba(132,40,27,.96),rgba(190,67,34,.96));
  box-shadow: 0 12px 35px rgba(109,45,21,.35),0 0 0 6px rgba(255,211,72,.12);
  transform: translateX(-50%);
}
.map-celebration[hidden] { display: none; }
.unlock-celebration .map-celebration { animation: deliveryBanner 3.35s ease both; }
.map-celebration span,.map-celebration small { display: block; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.map-celebration strong { display: block; margin: 2px 0; font: 22px "Black Han Sans"; }
@keyframes deliveryBanner {
  0% { opacity: 0; transform: translate(-50%,-22px) scale(.72); }
  12%,78% { opacity: 1; transform: translate(-50%,0) scale(1); }
  88% { transform: translate(-50%,0) scale(1.04); }
  100% { opacity: 0; transform: translate(-50%,-8px) scale(.96); }
}
.map-sparkles { position: absolute; z-index: 7; inset: 0; overflow: hidden; pointer-events: none; }
.map-sparkles i {
  --spark-x: 50%; --spark-color: #f3b63f;
  position: absolute; left: var(--unlock-x,50%); top: var(--unlock-y,50%); width: 8px; height: 14px;
  border-radius: 2px; opacity: 0; background: var(--spark-color);
}
.map-sparkles i:nth-child(2n) { --spark-color: #b63d2d; }
.map-sparkles i:nth-child(3n) { --spark-color: #315f4a; width: 11px; height: 7px; }
.map-sparkles i:nth-child(4n) { --spark-color: #fff1a8; }
.unlock-celebration .map-sparkles i { animation: mapConfetti 1.8s calc(var(--spark-i,0) * .055s) ease-out both; }
.map-sparkles i:nth-child(1) { --spark-i: 1; --spark-x: -125px; }
.map-sparkles i:nth-child(2) { --spark-i: 2; --spark-x: -98px; }
.map-sparkles i:nth-child(3) { --spark-i: 3; --spark-x: -72px; }
.map-sparkles i:nth-child(4) { --spark-i: 4; --spark-x: -44px; }
.map-sparkles i:nth-child(5) { --spark-i: 5; --spark-x: -18px; }
.map-sparkles i:nth-child(6) { --spark-i: 6; --spark-x: 12px; }
.map-sparkles i:nth-child(7) { --spark-i: 7; --spark-x: 38px; }
.map-sparkles i:nth-child(8) { --spark-i: 8; --spark-x: 65px; }
.map-sparkles i:nth-child(9) { --spark-i: 9; --spark-x: 92px; }
.map-sparkles i:nth-child(10) { --spark-i: 10; --spark-x: 118px; }
.map-sparkles i:nth-child(11) { --spark-i: 11; --spark-x: -145px; }
.map-sparkles i:nth-child(12) { --spark-i: 12; --spark-x: 145px; }
@keyframes mapConfetti {
  0% { opacity: 0; transform: translate(-50%,-50%) rotate(0) scale(.3); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--spark-x),180px) rotate(620deg) scale(1); }
}
.reward-reveal, .ending-modal {
  position: fixed; z-index: 100; inset: 0; display: none; place-items: center;
  overflow: hidden; padding: 20px; background: rgba(31,18,12,.78); backdrop-filter: blur(7px);
}
.reward-reveal.show, .ending-modal.show { display: grid; }
.reward-reveal-card {
  position: relative; z-index: 2; width: min(88vw,460px); padding: 34px 34px 28px;
  border: 2px solid rgba(255,235,175,.75); border-radius: 20px; text-align: center;
  background: linear-gradient(155deg,#fffdf5,#f5dfb3);
  box-shadow: 0 24px 80px rgba(0,0,0,.42),0 0 45px rgba(255,191,55,.24);
  animation: reward-card-in .48s cubic-bezier(.18,.89,.3,1.24) both;
}
.reward-reveal-icon {
  display: grid; place-items: center; width: 88px; height: 88px; margin: -76px auto 15px;
  border: 4px solid #fff3bf; border-radius: 50%; background: radial-gradient(circle,#ffd96b,#c77921);
  box-shadow: 0 0 0 7px rgba(255,210,94,.18),0 8px 25px rgba(96,48,15,.3);
  font-size: 46px; animation: reward-icon-pulse 1.1s ease-in-out infinite alternate;
}
.reward-reveal-card h2 { margin: 5px 0 9px; color: #482815; font: 28px "Black Han Sans"; }
.reward-reveal-story { min-height: 38px; margin: 0 auto 13px; color: #6b5544; font-size: 13px; line-height: 1.6; }
.reward-reveal-detail {
  margin: -7px auto 13px; padding: 6px 10px; border-radius: 7px;
  color: #6b5544; background: rgba(107,85,68,.09); font-size: 12px; font-weight: 700;
}
.reward-reveal-card > strong {
  display: block; margin: 0 0 17px; padding: 9px 12px; border-radius: 9px;
  color: #8f2e1d; background: rgba(255,255,255,.62); font-size: 14px;
}
.reward-reveal-card button, .ending-actions button {
  min-height: 44px; border: 0; border-radius: 9px; padding: 11px 20px;
  color: white; background: var(--red); font-weight: 800; cursor: pointer;
}
.reward-reveal.special { background: radial-gradient(circle at 50% 45%,rgba(103,72,16,.3),rgba(12,8,25,.94)); }
.reward-reveal.special .reward-reveal-card {
  border-color: #ffe276; color: #fff6d3; background: linear-gradient(145deg,#3f2915,#171328);
  box-shadow: 0 0 75px rgba(255,201,72,.48),0 24px 90px rgba(0,0,0,.62);
}
.reward-reveal.special .reward-reveal-card h2 { color: #ffe78c; }
.reward-reveal.special .reward-reveal-story { color: #eadfca; }
.reward-reveal.special .reward-reveal-detail { color: #eadfca; background: rgba(255,255,255,.09); }
.reward-reveal.special .reward-reveal-card > strong { color: #fff0a8; background: rgba(255,255,255,.09); }
.reward-reveal.kind-recipe .reward-reveal-icon { background: radial-gradient(circle,#fff2a8,#d76b32); }
.reward-reveal.kind-map .reward-reveal-card { width: min(92vw,680px); padding-top: 17px; }
.reward-reveal-art {
  display: block; width: 100%; height: clamp(180px,32vh,285px); margin: 0 0 9px;
  border: 1px solid rgba(255,226,118,.58); border-radius: 14px; object-fit: cover;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
.reward-reveal-art[hidden] { display: none; }
.reward-reveal.kind-map .reward-reveal-icon {
  position: relative; z-index: 1; width: 72px; height: 72px; margin: -49px auto 9px;
  font-size: 38px;
}
.reveal-rays {
  position: absolute; width: 780px; height: 780px; opacity: .32;
  background: repeating-conic-gradient(from 0deg,transparent 0 11deg,#ffd86a 12deg 17deg,transparent 18deg 30deg);
  mask-image: radial-gradient(circle,#000 0 42%,transparent 72%); animation: reward-rays 12s linear infinite;
}
.reveal-particles { position: absolute; inset: 0; pointer-events: none; }
.reveal-particles i {
  position: absolute; left: calc(8% + var(--i,0) * 7.2%); top: -8%; width: 9px; height: 18px;
  border-radius: 2px; background: #ffd358; animation: reward-confetti 2.4s ease-in infinite;
}
.reveal-particles i:nth-child(2n) { background: #e8563f; animation-delay: -.8s; }
.reveal-particles i:nth-child(3n) { background: #68ae87; animation-delay: -1.6s; }
.reveal-particles i:nth-child(1) { --i: 0; }.reveal-particles i:nth-child(2) { --i: 1; }
.reveal-particles i:nth-child(3) { --i: 2; }.reveal-particles i:nth-child(4) { --i: 3; }
.reveal-particles i:nth-child(5) { --i: 4; }.reveal-particles i:nth-child(6) { --i: 5; }
.reveal-particles i:nth-child(7) { --i: 6; }.reveal-particles i:nth-child(8) { --i: 7; }
.reveal-particles i:nth-child(9) { --i: 8; }.reveal-particles i:nth-child(10) { --i: 9; }
.reveal-particles i:nth-child(11) { --i: 10; }.reveal-particles i:nth-child(12) { --i: 11; }
@keyframes reward-card-in { from { opacity: 0; transform: translateY(25px) scale(.7) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes reward-icon-pulse { to { transform: scale(1.08) rotate(3deg); box-shadow: 0 0 0 10px rgba(255,210,94,.1),0 8px 32px rgba(96,48,15,.4); } }
@keyframes reward-rays { to { transform: rotate(1turn); } }
@keyframes reward-confetti { to { top: 108%; transform: rotate(520deg) translateX(45px); } }

.ending-modal { z-index: 110; background: radial-gradient(circle at 50% 38%,#343164 0,#111226 52%,#070812 100%); }
.ending-stars { position: absolute; inset: 0; background-image: radial-gradient(#fff 0 1px,transparent 1.5px); background-size: 37px 37px; opacity: .45; animation: ending-stars 10s linear infinite; }
.ending-card {
  position: relative; z-index: 2; width: min(90vw,620px); padding: 38px;
  border: 1px solid rgba(255,226,124,.46); border-radius: 24px; color: #f8f0dc;
  text-align: center; background: rgba(18,18,38,.88); box-shadow: 0 0 90px rgba(115,99,255,.32);
  animation: reward-card-in .7s ease-out both;
}
.ending-emblem { display: block; color: #ffe27c; font-size: 70px; text-shadow: 0 0 32px #e8ac42; animation: reward-icon-pulse 1.4s ease-in-out infinite alternate; }
.ending-card h2 { margin: 6px 0 16px; color: #ffe896; font: 32px "Black Han Sans"; }
.ending-story { margin: 0 auto 14px; max-width: 510px; font-size: 14px; line-height: 1.8; }
.ending-choice { margin: 0 auto 22px; color: #beb9d4; font-size: 12px; line-height: 1.6; }
.ending-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ending-actions button:first-child { color: #38210d; background: linear-gradient(#ffe38a,#e8a83f); }
.ending-actions button:last-child { background: #4d477c; }
@keyframes ending-stars { to { background-position: 37px 74px; } }

.click-stage { min-height: 340px; }
.click-combo { bottom: 62px; }
.bread-evolution {
  position: absolute; z-index: 10; right: 8px; bottom: 7px; width: min(56%,268px); min-height: 42px;
  display: block; box-sizing: border-box; padding: 6px 9px 8px;
  border: 1px solid rgba(255,255,255,.45); border-radius: 10px; color: #fff9e9;
  background: linear-gradient(135deg,rgba(48,34,25,.88),rgba(35,47,42,.9));
  box-shadow: 0 5px 18px rgba(42,27,18,.2); backdrop-filter: blur(6px); cursor: help;
}
.bread-evolution-copy { min-width: 0; display: block; padding-bottom: 3px; }
.bread-evolution-copy strong, .bread-evolution-copy small {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bread-evolution-copy strong { color: #ffe9a6; font-size: 10px; }
.bread-evolution-copy small { margin-top: 2px; color: rgba(255,255,255,.73); font-size: 9px; }
.bread-evolution-progress {
  position: absolute; left: 9px; right: 9px; bottom: 4px; height: 3px;
  overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.13);
}
.bread-evolution-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg,#f0a93d,#ffe987); transition: width .4s; }
.bread-button[data-bread-visual="steam"] .bread-photo { filter: sepia(.15) brightness(1.08) drop-shadow(0 0 13px rgba(255,255,255,.65)); }
.bread-button[data-bread-visual="forest"] .bread-photo { filter: saturate(1.12) hue-rotate(18deg) drop-shadow(0 10px 10px rgba(50,105,58,.38)); }
.bread-button[data-bread-visual="star"] .bread-photo,
.bread-button[data-bread-visual="gold"] .bread-photo { filter: saturate(1.25) brightness(1.08) drop-shadow(0 0 16px rgba(255,213,67,.75)); }
.bread-button[data-bread-visual="dawn"] .bread-photo,
.bread-button[data-bread-visual="ember"] .bread-photo { filter: sepia(.18) saturate(1.25) drop-shadow(0 0 13px rgba(232,103,52,.58)); }
.bread-button[data-bread-visual="earth"] .bread-photo { filter: saturate(1.22) hue-rotate(145deg) drop-shadow(0 0 15px rgba(71,190,210,.7)); }
.bread-button[data-bread-visual="citrus"] .bread-photo { filter: saturate(1.35) hue-rotate(-17deg) drop-shadow(0 0 14px rgba(255,163,48,.68)); }
.bread-button[data-bread-visual="taegeuk"] .bread-photo,
.bread-button[data-bread-visual="neon"] .bread-photo { filter: saturate(1.45) hue-rotate(305deg) drop-shadow(0 0 17px rgba(238,72,165,.68)); }
.bread-button[data-bread-visual="moon"] .bread-photo,
.bread-button[data-bread-visual="lunar"] .bread-photo { filter: grayscale(.35) brightness(1.14) drop-shadow(0 0 17px rgba(218,229,255,.78)); }
.bread-button[data-bread-visual="aurora"] .bread-photo,
.bread-button[data-bread-visual="nebula"] .bread-photo { filter: saturate(1.4) hue-rotate(220deg) drop-shadow(0 0 18px rgba(134,104,255,.78)); }
.bread-button[data-bread-visual="city"] .bread-photo { filter: contrast(1.13) saturate(.9) drop-shadow(0 0 15px rgba(255,232,154,.7)); }
.bread-button[data-bread-visual="mars"] .bread-photo { filter: sepia(.35) saturate(1.65) hue-rotate(330deg) drop-shadow(0 0 17px rgba(224,72,46,.75)); }
.bread-button[data-bread-visual="saturn"] .bread-photo { filter: sepia(.2) saturate(1.3) hue-rotate(25deg) drop-shadow(0 0 18px rgba(240,175,80,.78)); }
.bread-button[data-bread-visual="core"] .bread-photo { filter: saturate(1.7) hue-rotate(245deg) brightness(1.12) drop-shadow(0 0 22px rgba(162,102,255,.95)); }
.bread-button.bread-evolved { animation: bread-evolution-arrival .82s cubic-bezier(.16,.85,.24,1); }
@keyframes bread-evolution-arrival {
  0% { opacity: .2; transform: translate(-50%,-50%) scale(.45) rotate(-12deg); filter: brightness(2.2); }
  65% { transform: translate(-50%,-50%) scale(1.12) rotate(3deg); }
  100% { opacity: 1; transform: translate(-50%,-50%); filter: none; }
}

@media (max-width: 900px) {
  .item-service-hud { right: 10px; }
  .stats-mini { right: 10px; }
}

@media (max-width: 620px) {
  .reward-reveal-card { padding: 29px 20px 22px; }
  .reward-reveal-icon { width: 72px; height: 72px; margin-top: -62px; font-size: 37px; }
  .reward-reveal.kind-map .reward-reveal-card { padding: 10px 12px 18px; }
  .reward-reveal.kind-map .reward-reveal-icon { margin-top: -42px; }
  .reward-reveal-art { height: min(29vh,210px); }
  .reward-reveal-card h2 { font-size: 23px; }
  .ending-card { padding: 28px 19px; }
  .ending-card h2 { font-size: 25px; }
  .ending-actions { grid-template-columns: 1fr; }
  .click-stage { height: min(52dvh,350px); min-height: 320px; }
  .click-combo { bottom: 60px; }
  .bread-evolution { right: 7px; bottom: 7px; width: min(60%,212px); }
  .bread-evolution-copy strong { font-size: 9px; }
  .bread-evolution-copy small { font-size: 8px; }
  .item-dock { position: absolute; z-index: 24; inset: 0; width: auto; }
  .item-consumable-hud { position: absolute; top: 43px; left: 5px; }
  .item-service-hud { position: absolute; top: 0; right: 3px; align-items: center; }
  .item-hub-button,.roulette-ready-button {
    width: 58px; min-width: 58px; height: 58px; min-height: 58px; padding: 0;
    border-radius: 0; font-size: 34px;
  }
  .roulette-ready-button { width: 78px; min-width: 78px; height: 78px; min-height: 78px; }
  .item-quick-list {
    position: static; width: 46px; max-width: 46px; max-height: min(48dvh,290px);
    flex-direction: column; padding: 3px;
  }
  .item-quick-button { flex-basis: 40px; width: 40px; height: 40px; }
  .item-hub-modal { align-items: end; padding: 0; }
  .item-hub-card {
    width: 100vw; max-height: 86dvh; padding: 16px 12px 20px;
    border-radius: 22px 22px 0 0;
  }
  .roulette-modal { align-items: stretch; }
  .roulette-card {
    width: 100vw; min-height: 100dvh; padding: max(58px,calc(env(safe-area-inset-top) + 48px)) 16px
      max(24px,env(safe-area-inset-bottom)); border: 0; border-radius: 0;
  }
  .roulette-stage { width: min(88vw,430px); height: min(88vw,430px); }
  .item-inventory-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .world-item-event { right: 2%; width: 68px; }
  .world-item-event img { width: 60px; height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .map-card.unlock-celebration::after,
  .map-card.unlock-celebration .districts path,
  .map-card.unlock-celebration .delivery-route,
  .map-card.tier-transition .map-visual,
  .map-spot.current-target .pin,
  .map-spot.just-unlocked .pin,
  .map-route-table tr.active,
  .map-route-table tr.active .route-status,
  .map-route-table tr.just-completed,
  .unlock-celebration .map-celebration,
  .unlock-celebration .map-sparkles i { animation: none; }
  .unlock-celebration .map-celebration { opacity: 1; transform: translate(-50%,0); }
}
.toast-stack {
  position: fixed; z-index: 40; left: 50%; bottom: 24px; width: min(560px,calc(100vw - 28px));
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  transform: translateX(-50%); pointer-events: none;
}
.toast-item {
  box-sizing: border-box; max-width: 100%; padding: 11px 18px; border-radius: 12px;
  color: white; background: rgba(41,33,27,.96); box-shadow: 0 7px 18px rgba(36,25,17,.2);
  font-size: 12px; font-weight: 700; line-height: 1.45; text-align: center;
  opacity: 0; transform: translateY(12px) scale(.97); transition: opacity .22s,transform .22s;
}
.toast-item.show { opacity: 1; transform: translateY(0) scale(1); }
.toast-item.leaving { opacity: 0; transform: translateY(-7px) scale(.98); }
.hover-tooltip {
  --tooltip-accent: #e8b441;
  position: fixed; z-index: 80; width: max-content; max-width: min(330px,calc(100vw - 20px));
  display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 9px; align-items: start;
  padding: 10px 12px 11px 10px; border: 1px solid color-mix(in srgb,var(--tooltip-accent) 48%,#fff 8%);
  border-left: 4px solid var(--tooltip-accent); border-radius: 10px;
  color: #fff8e8; background: linear-gradient(145deg,rgba(49,39,31,.985),rgba(29,25,30,.985));
  box-shadow: 0 12px 34px rgba(30,20,14,.38),inset 0 1px rgba(255,255,255,.07);
  font-size: 10px; font-weight: 700; line-height: 1.45; text-align: left;
  opacity: 0; pointer-events: none; transform: translate(-50%,-100%) translateY(5px);
  transition: opacity .14s,transform .14s; backdrop-filter: blur(7px);
}
.hover-tooltip.tooltip-building { --tooltip-accent: #e08b3c; }
.hover-tooltip.tooltip-building {
  grid-template-columns: 26px minmax(0,1fr); gap: 7px; padding: 7px 9px 7px 7px;
}
.hover-tooltip.tooltip-building .tooltip-badge { width: 24px; height: 24px; border-radius: 6px; font-size: 13px; }
.hover-tooltip.tooltip-building .tooltip-copy { align-self: center; }
.hover-tooltip.tooltip-building .tooltip-copy > strong:first-child { font-size: 11px; white-space: nowrap; }
.hover-tooltip.tooltip-recipe { --tooltip-accent: #d7b14e; }
.hover-tooltip.tooltip-achievement { --tooltip-accent: #f4d461; }
.hover-tooltip.tooltip-item { --tooltip-accent: #7ed9c1; }
.hover-tooltip.tooltip-bread { --tooltip-accent: #75c9b0; }
.tooltip-badge {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
  color: #261d18; background: var(--tooltip-accent); box-shadow: inset 0 -2px rgba(0,0,0,.14);
  font-size: 17px;
}
.tooltip-badge.has-art-icon { padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
.tooltip-badge.has-art-icon .art-icon { width: 32px; height: 32px; }
.tooltip-copy { min-width: 0; display: grid; gap: 3px; }
/* One divider per emphasized block, not per line: an emphasized line opens a
   group and the muted detail lines under it belong to that group, so only a
   new heading draws a rule. */
.tooltip-copy > * { display: block; }
.tooltip-copy > * + strong { margin-top: 2px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.08); }
.tooltip-copy strong { color: #fff4c9; font-size: 11px; font-weight: 800; line-height: 1.35; }
.tooltip-copy > strong:first-child { font-size: 12px; line-height: 1.25; }
.tooltip-copy small {
  color: rgba(255,248,232,.72); font-size: 10px; font-weight: 600; line-height: 1.4;
}
.hover-tooltip.show { opacity: 1; transform: translate(-50%,-100%) translateY(0); }
.hover-tooltip.below { transform: translate(-50%,0) translateY(-5px); }
.hover-tooltip.below.show { transform: translate(-50%,0) translateY(0); }
[data-tooltip]::after, .achievement-item.unlocked::after { display: none !important; }
@media (pointer: coarse) {
  body {
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  }
  input, textarea, [contenteditable="true"] {
    user-select: text; -webkit-user-select: text; -webkit-touch-callout: default;
  }
}
.stats-mini {
  position: fixed; z-index: 56; left: auto; right: calc(50% + 12px); bottom: 10px; width: 48px;
  overflow: visible; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; color: #fff8e8;
  background: rgba(41,33,27,.94); box-shadow: 0 12px 32px rgba(45,30,20,.24); backdrop-filter: blur(9px);
}
.stats-mini[open] {
  left: 12px; right: auto; bottom: 68px; width: min(390px,calc(100vw - 24px));
  max-height: min(52vh,410px); overflow-y: auto; border-radius: 14px;
}
.stats-mini summary {
  width: 48px; height: 48px; box-sizing: border-box; display: flex; align-items: center;
  justify-content: center; padding: 0;
  list-style: none; cursor: pointer; font-size: 11px; font-weight: 800;
}
.stats-mini[open] summary { width: 100%; height: auto; justify-content: space-between; padding: 10px 12px; }
.stats-mini summary::-webkit-details-marker { display: none; }
.stats-mini summary::before { content: "📊"; margin: 0; color: var(--yellow); font-size: 18px; }
.stats-mini[open] summary::before { margin-right: 7px; }
.stats-mini summary span { flex: 1; }
.stats-mini summary small { color: rgba(255,255,255,.45); font-size: 8px; font-weight: 400; }
.stats-mini:not([open]) summary span,.stats-mini:not([open]) summary small { display: none; }
.stats-mini dl { margin: 0; padding: 3px 12px 11px; border-top: 1px solid rgba(255,255,255,.1); }
.stats-mini dl div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 9px; }
.stats-mini dt { color: rgba(255,255,255,.55); }
.stats-mini dd { margin: 0; color: #ffe18a; font-weight: 800; text-align: right; }
.offline-modal {
  position: fixed; inset: 0; background: rgba(41,33,27,.68);
  display: none; place-items: safe center; z-index: 50;
  box-sizing: border-box; overflow-x: hidden; overflow-y: auto;
  padding: 24px 12px; overscroll-behavior: contain;
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
.offline-modal.show { display: grid; }
.modal-card { text-align: center; background: var(--paper); width: min(90vw,390px); border-radius: 18px; padding: 34px; box-shadow: var(--shadow); }
.modal-icon { font-size: 52px; }
.modal-card h2 { font: 22px "Black Han Sans"; margin: 8px 0 14px; }
.modal-card > strong { display: block; color: var(--red); font: 34px "Black Han Sans"; margin-bottom: 6px; }
.offline-elapsed {
  margin: 0 0 6px; padding: 7px 12px; display: inline-block;
  border-radius: 99px; background: rgba(223,108,47,.12);
  color: var(--ink); font-size: 13px; font-weight: 800;
}
.offline-elapsed b { color: var(--red); font-size: 15px; }
.offline-summary { margin: 0 0 18px; color: var(--muted); font-size: 12px; font-weight: 700; }
.modal-card button { width: 100%; border: 0; border-radius: 8px; background: var(--red); color: white; padding: 12px; cursor: pointer; font-weight: 800; }
.intro-modal { z-index: 60; }
.intro-card { width: min(90vw,460px); padding: 28px 32px 32px; text-align: left; }
.intro-card .modal-icon, .intro-card > .eyebrow, .intro-card h2 { display: block; text-align: center; }
.intro-story {
  margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px;
  color: #59483a; background: rgba(255,255,255,.5); font-size: 13px; line-height: 1.65;
}
.intro-steps { margin: 15px 0 19px; padding-left: 24px; color: #59483a; font-size: 12px; line-height: 1.8; }
.intro-steps b { color: var(--red); }
.tutorial-modal { z-index: 61; }
.tutorial-card { width: min(90vw, 420px); padding: 24px 30px 30px; }
.tutorial-progress { display: flex; justify-content: center; gap: 7px; margin-bottom: 15px; }
.tutorial-progress span { width: 26px; height: 5px; border-radius: 5px; background: #ddcec0; transition: background .2s, transform .2s; }
.tutorial-progress span.active { background: var(--red); transform: scaleX(1.08); }
.bread-collection-modal { z-index: 65; }
.bread-collection-card {
  width: min(94vw,920px); max-height: min(88dvh,780px); padding: 22px;
  overflow: hidden; text-align: left;
}
.bread-collection-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bread-collection-head .eyebrow { margin-bottom: 2px; }
.bread-collection-head h2 { margin: 0; }
.bread-collection-card .bread-collection-close {
  flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border-radius: 50%;
  color: #5a3b2b; background: #eadbc3; font-size: 25px; line-height: 1;
}
.collection-tabs {
  display: flex; gap: 5px; margin-top: 13px; padding: 4px;
  border-radius: 11px; background: #eadcc6;
}
.collection-tab {
  flex: 1; min-height: 38px; border: 0; border-radius: 8px;
  color: #765c47; background: transparent; font-size: 12px; font-weight: 900; cursor: pointer;
}
.collection-tab.active {
  color: #fff9ed; background: var(--green); box-shadow: 0 3px 9px rgba(49,95,74,.22);
}
.bread-collection-summary {
  margin: 12px 0; padding: 8px 11px; border-radius: 8px;
  color: #5c493a; background: rgba(255,255,255,.52); font-size: 12px; font-weight: 800;
}
.bread-collection-list {
  max-height: calc(min(88dvh,780px) - 168px); display: grid;
  grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 9px;
  overflow-y: auto; padding: 2px 5px 8px 2px; scrollbar-gutter: stable;
}
.bread-collection-list[hidden],.bakery-collection-list[hidden] { display: none; }
.bakery-collection-list {
  max-height: calc(min(88dvh,780px) - 168px); display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px;
  overflow-y: auto; padding: 2px 5px 8px 2px; scrollbar-gutter: stable;
}
.bakery-collection-item {
  min-width: 0; display: grid; grid-template-columns: 52px minmax(0,1fr) auto;
  align-items: center; gap: 10px; padding: 11px;
  border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.7);
}
.bakery-collection-item.active {
  border-color: #d4872d; box-shadow: inset 0 0 0 2px rgba(239,176,68,.28);
}
.bakery-collection-icon {
  width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 10px; background: linear-gradient(145deg,#fff7e5,#e3cda9); font-size: 27px;
}
.bakery-collection-item small { color: #9a7555; font-size: 9px; font-weight: 900; }
.bakery-collection-item strong {
  display: block; margin: 2px 0; overflow: hidden; font-size: 12px;
  text-overflow: ellipsis; white-space: nowrap;
}
.bakery-collection-item p { margin: 0; color: #715b49; font-size: 9px; }
.bakery-collection-item em {
  padding: 3px 7px; border-radius: 99px; color: #fff; background: #69855d;
  font-size: 8px; font-style: normal; font-weight: 900; white-space: nowrap;
}
.bread-collection-item {
  position: relative; min-width: 0; padding: 9px; border: 1px solid var(--line);
  border-radius: 11px; background: rgba(255,255,255,.7);
}
.bread-collection-item.active {
  border-color: #d4872d; box-shadow: inset 0 0 0 2px rgba(239,176,68,.28);
}
.bread-collection-image {
  height: 100px; display: grid; place-items: center; margin-bottom: 7px;
  overflow: hidden; border-radius: 8px; background: radial-gradient(circle,#fffaf0,#ecdec8);
}
.bread-collection-image img { width: 100%; height: 100%; object-fit: contain; }
.bread-collection-starter {
  width: 100%; height: 100%; background: url("./assets/breads/photoreal-breads-sheet.webp") 0 0 / 400% 200% no-repeat;
}
.bread-collection-item small,.bread-collection-item strong,
.bread-collection-item span,.bread-collection-item em { display: block; min-width: 0; }
.bread-collection-item small { color: #9a7555; font-size: 9px; font-weight: 800; }
.bread-collection-item strong {
  margin: 2px 0 4px; overflow: hidden; color: #3f2c20; font-size: 12px;
  text-overflow: ellipsis; white-space: nowrap;
}
.bread-collection-item span { min-height: 28px; color: #715b49; font-size: 9px; line-height: 1.45; }
.bread-collection-item em {
  width: max-content; margin-top: 5px; padding: 2px 6px; border-radius: 99px;
  color: #fff; background: #69855d; font-size: 8px; font-style: normal; font-weight: 900;
}
.bread-collection-item.locked .bread-collection-image {
  background: #d4d4d4 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 70'%3E%3Cpath d='M8 45C8 24 26 12 50 12C74 12 92 24 92 45C92 58 76 64 50 64C24 64 8 58 8 45Z' fill='%23767676'/%3E%3Cpath d='M30 22L40 42M50 18L58 40M68 22L78 42' stroke='%23d4d4d4' stroke-width='3' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center/62% no-repeat;
}
.bread-mystery {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  color: #fff; background: rgba(58,54,48,.72); font: 800 20px "Black Han Sans";
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.bread-collection-item.locked em { background: #8d8178; }
.bread-collection-item.visible .bread-collection-image { cursor: zoom-in; }
.bread-collection-preview {
  position: fixed; z-index: 110; top: 0; left: 0; width: min(350px,calc(100vw - 20px));
  padding: 10px; border: 1px solid rgba(255,226,158,.92); border-radius: 15px;
  color: #fff8e8; background: rgba(45,29,18,.96);
  box-shadow: 0 20px 55px rgba(0,0,0,.42); pointer-events: none;
}
.bread-collection-preview[hidden] { display: none; }
.bread-collection-preview-image {
  height: 270px; display: grid; place-items: center; overflow: hidden;
  border-radius: 10px; background: radial-gradient(circle,#fffdf6,#e9d6b9);
}
.bread-collection-preview-image img { width: 100%; height: 100%; object-fit: contain; }
.bread-collection-preview-image .bread-collection-starter { width: 100%; height: 100%; }
.bread-collection-preview > strong {
  display: block; padding: 9px 4px 2px; overflow: hidden;
  font-size: 14px; text-align: center; text-overflow: ellipsis; white-space: nowrap;
}
.item-hub-modal { z-index: 67; }
.item-hub-card {
  width: min(92vw,560px); max-height: min(88dvh,720px); padding: 21px;
  overflow-y: auto; text-align: left;
}
.item-hub-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.item-hub-head h2 { margin: 0; }
.item-hub-head .eyebrow { margin-bottom: 2px; }
.item-hub-card .item-modal-close {
  flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 0;
  border-radius: 50%; color: #573826; background: #eadbc3; font-size: 25px;
}
.roulette-modal {
  z-index: 72; padding: 0;
  background:
    radial-gradient(circle at 50% 42%,rgba(255,213,95,.18),transparent 38%),
    linear-gradient(160deg,rgba(35,18,12,.97),rgba(76,39,18,.98));
}
.roulette-card {
  --collect-x: 0px; --collect-y: 0px;
  position: relative; width: min(94vw,560px); min-height: min(90dvh,720px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 54px 24px 28px; overflow: hidden; border: 1px solid rgba(255,224,144,.5);
  border-radius: 28px; color: #fff7dd; text-align: center;
  background:
    radial-gradient(circle at 50% 43%,rgba(255,224,126,.2),transparent 34%),
    linear-gradient(165deg,rgba(99,48,20,.82),rgba(41,24,18,.94));
  box-shadow: 0 28px 90px rgba(0,0,0,.52),inset 0 1px rgba(255,255,255,.1);
}
.roulette-modal.collecting { animation: acquisition-backdrop-out .52s ease-in forwards; }
.roulette-modal.collecting .roulette-card {
  animation: acquisition-to-inventory .52s cubic-bezier(.55,.02,.86,.42) forwards;
  transform-origin: 50% 50%;
}
.roulette-card[hidden] { display: none; }
.roulette-card.spinning {
  box-shadow: 0 0 0 4px rgba(247,198,67,.2),0 14px 32px rgba(112,71,20,.2);
}
.roulette-close {
  position: absolute; z-index: 8; top: 14px; right: 14px; width: 44px; height: 44px;
  border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: #fff;
  background: rgba(24,14,10,.42); font-size: 27px; cursor: pointer;
}
.roulette-close:disabled { opacity: .35; cursor: wait; }
.roulette-copy { min-width: 0; text-align: center; }
.roulette-copy strong,.roulette-copy small { display: block; }
.roulette-copy strong { font: clamp(24px,5vw,34px) "Black Han Sans"; color: #ffe8a5; }
.roulette-copy small { margin-top: 7px; color: rgba(255,247,221,.7); font-size: 12px; }
.roulette-stage {
  position: relative; width: min(72vw,390px); height: min(72vw,390px);
  display: grid; place-items: center; margin: 4px auto;
}
.roulette-pointer {
  position: absolute; z-index: 4; top: -2px; left: 50%; width: 26px; height: 34px;
  border: 3px solid #ffe5a0; border-radius: 50% 50% 55% 55%;
  background: #b73728; transform: translateX(-50%);
  clip-path: polygon(0 0,100% 0,50% 100%); filter: drop-shadow(0 4px 3px rgba(20,10,5,.4));
}
.roulette-wheel {
  position: relative; width: 100%; height: 100%; transform: rotate(0deg); will-change: transform;
  filter: drop-shadow(0 18px 17px rgba(18,8,3,.38));
}
.roulette-wheel > img { width: 100%; height: 100%; object-fit: contain; }
.roulette-prize-slots { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.roulette-prize-slots::before {
  content: ""; position: absolute; inset: 16%; border: 2px solid rgba(255,240,188,.3); border-radius: 50%;
  background: rgba(49,27,17,.24); box-shadow: inset 0 0 30px rgba(31,14,8,.22);
}
.roulette-prize-slots span {
  position: absolute; left: 50%; top: 50%; width: clamp(38px,10vw,52px); height: clamp(38px,10vw,52px);
  transform:
    translate(-50%,-50%) rotate(var(--slot-angle))
    translateY(calc(clamp(86px,24vw,126px) * -1)) rotate(calc(var(--slot-angle) * -1));
}
.roulette-prize-slots img {
  width: 100%; height: 100%; border: 3px solid rgba(255,249,224,.92); border-radius: 13px;
  object-fit: cover; box-shadow: 0 5px 10px rgba(48,20,8,.35);
}
.roulette-prize-slots span.selected img {
  animation: roulette-slot-selected .48s ease-in-out 2 alternate;
  box-shadow: 0 0 0 5px rgba(255,237,112,.5),0 0 28px #fff069;
  filter: brightness(1.25);
}
.roulette-card.spinning .roulette-pointer { animation: roulette-pointer-tick .12s ease-in-out infinite alternate; }
.roulette-result {
  position: absolute; z-index: 6; inset: 16%; display: grid; place-items: center;
  padding: 12px; border: 3px solid white; border-radius: 50%;
  background: rgba(255,249,229,.98); box-shadow: 0 0 55px #ffe57d;
  opacity: 0; transform: scale(.45);
}
.roulette-result[hidden] { display: none; }
.roulette-result.revealed { animation: roulette-prize-in .55s cubic-bezier(.18,.86,.3,1.2) forwards; }
.roulette-result img { width: 46%; aspect-ratio: 1; border-radius: 22px; object-fit: cover; }
.roulette-result strong { color: #67351c; font-size: 12px; text-align: center; }
@keyframes roulette-prize-in {
  0% { opacity: 0; transform: scale(.4) rotate(-12deg); }
  70% { opacity: 1; transform: scale(1.08) rotate(3deg); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes roulette-slot-selected { to { filter: brightness(1.45); scale: 1.16; } }
@keyframes roulette-pointer-tick { to { transform: translateX(-50%) rotate(8deg); } }
.roulette-odds,.roulette-claim {
  min-height: 44px; border: 1px solid #d3aa5f; border-radius: 11px; padding: 9px 13px;
  background: rgba(255,255,255,.6); font-size: 10px; font-weight: 800; cursor: pointer;
}
.roulette-claim { min-width: 110px; border-color: #a5422e; color: white; background: #a5422e; }
.roulette-claim:disabled { opacity: .46; cursor: not-allowed; }
.roulette-actions { display: flex; gap: 9px; }
.item-inventory-panel {
  min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px;
  background: rgba(255,255,255,.45);
}
.item-section-title { display: flex; justify-content: flex-end; gap: 9px; align-items: baseline; margin-bottom: 9px; }
.item-section-title h3 { margin: 0; font: 16px "Black Han Sans"; }
.item-section-title small { color: var(--muted); font-size: 9px; }
.item-inventory-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.item-inventory-card {
  position: relative; min-width: 0; padding: 7px; border: 1px solid #ddc9ac;
  border-radius: 10px; background: #fffaf0; cursor: pointer;
}
.item-inventory-card[aria-disabled="true"] { opacity: .62; cursor: default; }
.item-inventory-card img { width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: cover; }
.item-inventory-card strong {
  display: block; margin-top: 5px; overflow: hidden; font-size: 10px;
  text-overflow: ellipsis; white-space: nowrap;
}
.item-inventory-card span {
  position: absolute; top: 3px; right: 3px; min-width: 28px; padding: 3px 6px;
  border: 2px solid #fff7e8; border-radius: 99px; color: #fff; background: #a33c2d;
  box-shadow: 0 3px 8px rgba(62,34,19,.22); font-size: 11px; font-weight: 900;
}
.inventory-total { color: #9b3929; font-size: 12px; }
.item-inventory-empty {
  margin: 18px 0 8px; color: var(--muted); font-size: 12px; text-align: center;
}
.item-use-modal { z-index: 115; }
.item-use-card { width: min(90vw,390px); text-align: center; }
.item-use-image {
  width: 132px; height: 132px; margin: -75px auto 10px; border: 5px solid #fff4d2;
  border-radius: 27px; object-fit: cover; box-shadow: 0 14px 34px rgba(50,30,18,.3);
}
.item-use-card h2 { margin: 5px 0 8px; }
.item-use-card > p:not(.eyebrow) { color: #665043; font-size: 12px; line-height: 1.55; }
.item-confirm-skip {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: 13px 0; color: #685244; font-size: 10px; cursor: pointer;
}
.item-confirm-skip input { width: 17px; height: 17px; accent-color: var(--red); }
.item-use-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.item-use-actions button {
  min-height: 43px; border: 0; border-radius: 9px; background: #e5d7c4;
  font-weight: 800; cursor: pointer;
}
.item-use-actions #itemUseConfirm { color: white; background: var(--red); }
.box-reveal-modal {
  position: fixed; z-index: 122; inset: 0; display: none; place-items: center;
  padding: 14px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  background: rgba(27,17,11,.82);
  -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
}
.box-reveal-modal.show { display: grid; }
.box-reveal-stage[hidden] { display: none; }
.box-reveal-burst {
  position: absolute; width: min(86vw,520px); aspect-ratio: 1; border-radius: 50%;
  background: repeating-conic-gradient(from 8deg,rgba(255,225,116,.24) 0 7deg,transparent 7deg 18deg);
  opacity: 0; transform: scale(.3);
}
.box-reveal-modal.opened .box-reveal-burst { animation: box-burst 1s ease-out forwards; }
.box-reveal-card {
  --collect-x: 0px; --collect-y: 0px;
  position: relative; z-index: 2; width: min(94vw,480px);
  overflow: visible; padding: 24px 20px 18px; border: 2px solid #b77a42; border-radius: 22px;
  background: linear-gradient(#fffaf0,#f2dfbd); box-shadow: 0 22px 70px rgba(0,0,0,.45);
  text-align: center;
}
.box-reveal-modal.source-customer .box-reveal-card,
.box-reveal-modal.source-flyingBox .box-reveal-card {
  border-color: #e3b249; background: linear-gradient(155deg,#fffdf4,#f5e2b7);
}
.box-reveal-modal.source-customer .box-reward-list,
.box-reveal-modal.source-flyingBox .box-reward-list { margin-top: 20px; }
.box-reveal-modal.source-customer.opened .box-reveal-burst,
.box-reveal-modal.source-flyingBox.opened .box-reveal-burst { animation: box-burst 1s ease-out forwards; }
.box-reveal-modal.collecting { animation: acquisition-backdrop-out .52s ease-in forwards; }
.box-reveal-modal.collecting .box-reveal-card {
  animation: acquisition-to-inventory .52s cubic-bezier(.55,.02,.86,.42) forwards;
  transform-origin: 50% 50%;
}
.box-reveal-card h2 { margin: 2px 0 0; font: 24px "Black Han Sans"; }
.box-reveal-stage { position: relative; width: 210px; height: 210px; margin: 4px auto 0; perspective: 700px; }
.box-reveal-half {
  position: absolute; z-index: 3; left: 20px; top: 18px; width: 170px; height: 170px;
  object-fit: cover; filter: drop-shadow(0 12px 13px rgba(54,29,14,.32));
}
.box-reveal-half.top { clip-path: inset(0 0 50% 0); transform-origin: 50% 48%; }
.box-reveal-half.bottom { clip-path: inset(50% 0 0 0); transform-origin: 50% 52%; }
.box-reveal-modal.show:not(.opened) .box-reveal-half { animation: box-shake .14s ease-in-out 5 alternate; }
.box-reveal-modal.opened .box-reveal-half.top { animation: box-lid-open .75s cubic-bezier(.2,.8,.2,1) forwards; }
.box-reveal-modal.opened .box-reveal-half.bottom { animation: box-base-open .72s ease-out forwards; }
.box-reveal-light {
  position: absolute; z-index: 1; left: 50%; top: 51%; width: 55px; height: 55px;
  border-radius: 50%; transform: translate(-50%,-50%) scale(.2); opacity: 0;
  background: white; box-shadow: 0 0 22px 16px var(--box-glow,#f6bd49),0 0 75px 38px var(--box-glow,#f6bd49);
}
.box-reveal-modal.opened .box-reveal-light { animation: box-light 1.1s ease-out forwards; }
.box-reveal-particles { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.box-reveal-particles i {
  position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 50%;
  background: var(--box-glow,#f6bd49); opacity: 0;
}
.box-reveal-modal.opened .box-reveal-particles i { animation: box-particle .9s ease-out forwards; }
.box-reveal-particles i:nth-child(1) { --x:-78px;--y:-62px; }
.box-reveal-particles i:nth-child(2) { --x:-39px;--y:-91px;animation-delay:.05s!important; }
.box-reveal-particles i:nth-child(3) { --x:22px;--y:-96px;animation-delay:.1s!important; }
.box-reveal-particles i:nth-child(4) { --x:77px;--y:-52px;animation-delay:.08s!important; }
.box-reveal-particles i:nth-child(5) { --x:88px;--y:17px;animation-delay:.14s!important; }
.box-reveal-particles i:nth-child(6) { --x:46px;--y:71px;animation-delay:.03s!important; }
.box-reveal-particles i:nth-child(7) { --x:-35px;--y:82px;animation-delay:.12s!important; }
.box-reveal-particles i:nth-child(8) { --x:-88px;--y:28px;animation-delay:.07s!important; }
.box-reveal-modal.rarity-bronze { --box-glow:#db8a50; }
.box-reveal-modal.rarity-silver { --box-glow:#bde7ff; }
.box-reveal-modal.rarity-gold { --box-glow:#ffd84b; }
.box-reveal-modal.rarity-diamond { --box-glow:#84f2ff; }
.box-reveal-modal.rarity-diamond .box-reveal-card {
  border-color: #78dbe8; background: linear-gradient(145deg,#f5ffff,#d9eaff);
}
.box-reveal-modal.rarity-gold .box-reveal-card { border-color: #e2a825; }
.box-reward-list {
  min-height: 70px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: -20px 0 14px; opacity: 0; transform: translateY(14px);
}
.box-reveal-modal.rewards-visible .box-reward-list { animation: reward-list-in .42s ease-out forwards; }
.box-reward-card {
  width: 92px; padding: 8px 6px; border: 1px solid rgba(120,78,38,.2); border-radius: 12px;
  background: rgba(255,255,255,.88); box-shadow: 0 7px 16px rgba(70,43,22,.12);
  opacity: 0; transform: translateY(-28px) scale(.7);
}
.box-reveal-modal.rewards-visible .box-reward-card {
  animation: reward-card-drop .5s cubic-bezier(.16,.86,.3,1.25) forwards;
  animation-delay: calc(var(--reward-index) * 90ms);
}
.box-reward-card img { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; }
.box-reward-card strong,.box-reward-card span { display: block; }
.box-reward-card strong {
  margin-top: 4px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap;
}
.box-reward-card span { color: var(--red); font-size: 10px; font-weight: 900; }
.box-reveal-card > button {
  min-width: 150px; min-height: 44px; border: 0; border-radius: 12px;
  color: white; background: var(--red); font-weight: 900; cursor: pointer;
}
.box-reveal-card > button:disabled { opacity: .38; cursor: wait; }
@keyframes box-shake { from { transform: translateX(-3px) rotate(-2deg); } to { transform: translateX(3px) rotate(2deg); } }
@keyframes box-lid-open { to { transform: translateY(-68px) rotateX(38deg) rotate(-7deg); opacity: .28; } }
@keyframes box-base-open { to { transform: translateY(23px) scale(.94); filter: brightness(1.35); } }
@keyframes box-light { 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(3.6); } }
@keyframes box-burst { 35% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5) rotate(18deg); } }
@keyframes box-particle { 18% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x),var(--y)) scale(.25); } }
@keyframes reward-list-in { to { opacity: 1; transform: none; } }
@keyframes reward-card-drop { to { opacity: 1; transform: none; } }
@keyframes acquisition-to-inventory {
  0% { opacity: 1; transform: translate(0,0) scale(1); }
  72% { opacity: .86; transform: translate(calc(var(--collect-x) * .72),calc(var(--collect-y) * .72)) scale(.32); }
  100% { opacity: 0; transform: translate(var(--collect-x),var(--collect-y)) scale(.08); }
}
@keyframes acquisition-backdrop-out { to { background: rgba(27,17,11,0); backdrop-filter: blur(0); } }
.feature-tutorial-modal { z-index: 119; }
.feature-tutorial-card { width: min(92vw,410px); text-align: center; }
.feature-tutorial-icon {
  display: grid; width: 76px; height: 76px; place-items: center; margin: -7px auto 10px;
  border-radius: 24px; background: linear-gradient(145deg,#fff3bd,#e8b94d);
  box-shadow: 0 9px 25px rgba(98,59,18,.2); font-size: 39px;
}
.feature-tutorial-card h2 { margin: 5px 0 8px; }
.feature-tutorial-card > p:not(.eyebrow) { color: #665043; font-size: 12px; line-height: 1.55; }
.feature-tutorial-card ol {
  margin: 12px 0 17px; padding: 10px 12px 10px 31px; border-radius: 12px;
  background: #fff8e7; color: #563a28; font-size: 11px; line-height: 1.6; text-align: left;
}
.feature-tutorial-card button {
  min-width: 150px; min-height: 44px; border: 0; border-radius: 11px;
  color: white; background: var(--red); font-weight: 900;
}
.recipe-reveal-skip {
  display: flex; justify-content: center; align-items: center; gap: 7px;
  margin: -4px 0 12px; color: rgba(255,255,255,.72); font-size: 10px; cursor: pointer;
}
.reward-reveal:not(.special) .recipe-reveal-skip { color: #705847; }
.recipe-reveal-skip[hidden] { display: none; }
.recipe-reveal-skip input { accent-color: #e8ad3f; }
.tutorial-step { display: none; }
.tutorial-step.active { display: block; animation: tutorial-in .22s ease-out; }
.tutorial-step > p:not(.eyebrow) { min-height: 42px; margin: 0 0 16px; color: #665448; font-size: 13px; line-height: 1.6; }
.tutorial-name-label { display: block; margin: 0 0 6px; color: #665448; font-size: 12px; font-weight: 800; text-align: left; }
.tutorial-name-input {
  box-sizing: border-box; width: 100%; margin-bottom: 14px; padding: 11px 12px;
  border: 2px solid #ddcec0; border-radius: 8px; background: #fffdf8;
  color: #3e3028; font: 700 16px "Gowun Dodum", sans-serif; outline: none;
}
.tutorial-name-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(181, 56, 39, .12); }
@keyframes tutorial-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 가독성 보정: 보조 정보도 11px 아래로 내려가지 않도록 유지합니다. */
.eyebrow { font-size: 12px; }
.scene-sign { font-size: 11px; }
.delivery > p { font-size: 12px; }
.tab { font-size: 14px; }
.buy-mode { font-size: 12px; }
.front-achievements-head > button { font-size: 11px; }
.next-achievement strong { font-size: 11px; }
.next-achievement p { font-size: 11px; }
.recipe-shelf-head > span { font-size: 11px; }
.recipe-empty, .building-unlock-hint { font-size: 11px; }
.shop-list .item-info h3 { font-size: 13px; }
.shop-list .item-info p { font-size: 11px; }
.item-info p { font-size: 11px; }
.buy-btn { font-size: 12px; }
.buy-btn strong { font-size: 13px; }
.prestige-copy > p:not(.eyebrow), .prestige-preview, .prestige-note { font-size: 11px; }
.prestige-card button, .achievement-filter button { font-size: 12px; }
.achievement-item h3 { font-size: 13px; }
.achievement-item p { font-size: 11px; line-height: 1.4; }
.toast-item { font-size: 13px; }
.hover-tooltip { font-size: 11px; }
.stats-mini summary { font-size: 13px; }
.stats-mini summary small { font-size: 11px; }
.stats-mini dl div { padding: 5px 0; font-size: 11px; }

@media (max-width: 1180px) {
  .topbar { height: 112px; padding: 10px 20px; flex-wrap: wrap; }
  .brand { gap: 10px; }
  .header-ticker {
    order: 3; flex: 1 0 100%; max-width: none; min-width: 0; height: 32px;
    margin: 5px 0 0 !important;
  }
  .header-ticker > span { flex: 0 0 auto; padding: 7px 10px; }
  .header-actions { gap: 5px; }
  .header-actions button { padding-inline: 10px; }
  .game-grid { min-height: calc(100vh - 112px); }
  .shop-panel { height: calc(100vh - 112px); }
}
@media (max-width: 900px) {
  .topbar { height: 112px; padding: 10px 20px; flex-wrap: wrap; }
  .brand p { display: none; }
  .brand .bakery-modifier { display: block; }
  :lang(en) .brand h1 { max-width: 210px; font-size: 20px; }
  .game-grid { display: block; }
  .bakery-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .click-stage { min-height: 320px; }
  .shop-panel { height: auto; overflow: visible; padding-bottom: 70px; }
  .tabs { top: 0; }
  .header-ticker {
    order: 3; flex: 1 0 100%; max-width: none; min-width: 0; height: 32px;
    margin: 5px 0 0 !important;
  }
  .header-ticker > span { padding: 7px 10px; }
  .game-grid { min-height: calc(100vh - 112px); }
}
@media (max-width: 520px) {
  .topbar { height: 112px; padding: 10px 14px; flex-wrap: wrap; }
  .brand h1 { font-size: 20px; }
  .brand { gap: 8px; }
  .brand-mark { width: 39px; height: 39px; }
  :lang(en) .brand h1 { max-width: 125px; font-size: 18px; }
  .bakery-name-input { width: 145px; min-width: 0; font-size: 17px; }
  .sound-btn { display: none; }
  .intro-btn { display: none; }
  .header-more-menu .sound-btn,.header-more-menu .intro-btn { display: flex; }
  .header-more summary b { display: none; }
  .header-more summary { width: 40px; justify-content: center; padding-inline: 0; }
  .language-picker { width: 44px; height: 44px; }
  .shop-scene { transform: scale(.82); transform-origin: 50% 100%; }
  .bakery-panel, .shop-panel { padding: 22px 14px; }
  .score { font-size: 52px; }
  .click-stage { min-height: 290px; }
  .tab { font-size: 12px; }
  .shop-item, .upgrade-item { grid-template-columns: 43px 1fr auto; gap: 9px; padding: 10px; }
  .item-icon { width: 43px; height: 43px; font-size: 23px; }
  .buy-btn { min-width: 72px; }
  .shop-list, .recipe-shelf .upgrade-list { grid-template-columns: 1fr; }
  .shop-list .shop-item { grid-template-columns: 43px 1fr; }
  .recipe-shelf { height: 205px; }
  .recipe-shelf:has(.recipe-collection[open]) { height: 335px; }
  .prestige-card { grid-template-columns: 46px 1fr; }
  .prestige-symbol { width: 44px; height: 44px; }
  .prestige-card button { grid-column: 1 / -1; width: 100%; }
  .achievement-list { grid-template-columns: 1fr; }
  .worker-body { grid-template-columns: 1fr; }
  .worker-panel dl { padding: 8px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .next-achievements { grid-template-columns: repeat(auto-fit,minmax(min(140px,100%),1fr)); }
  .map-card { height: 360px; }
  .map-route-table th:nth-child(3),.map-route-table td:nth-child(3) { display: none; }
  .map-route-table td { padding: 7px 5px; }
  .map-route-table td:last-child,.map-route-table th:last-child { width: 58px; }
  .stats-mini { position: static; width: auto; margin: 12px 14px 70px; }
}

/* Mobile interaction pass: compact vertical rhythm with comfortable touch targets. */
@media (pointer: coarse), (max-width: 900px) {
  button, select, summary { touch-action: manipulation; }
  .grain { display: none; }
  .ticker p {
    display: block; width: 100%; overflow: hidden; padding: 0 12px;
    animation: none; text-overflow: ellipsis;
  }
  .tabs, .hover-tooltip, .stats-mini { backdrop-filter: none; }
  .box-reveal-modal {
    -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
  }
  .bread-collection-preview { display: none !important; }
  .header-actions button,
  .language-picker select,
  .tab,
  .buy-btn,
  .delivery-footer button,
  .prestige-card button,
  .achievement-filter button,
  .modal-card button { min-height: 44px; }

  .tabs {
    top: 0; margin: -4px 0 16px; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar,
  .achievement-filter::-webkit-scrollbar,
  .next-achievements::-webkit-scrollbar { display: none; }
  .tab {
    flex: 1 0 82px; padding: 11px 7px 10px; white-space: nowrap;
  }
  .achievement-filter {
    flex-wrap: nowrap; overflow-x: auto; padding: 2px 1px 7px;
    overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .achievement-filter button { flex: 0 0 auto; padding-inline: 15px; }
  .next-achievements {
    display: grid; overflow: visible; scroll-snap-type: none;
  }
  .modal-card { max-height: none; overflow: visible; }
  .shop-panel { padding-bottom: max(70px, env(safe-area-inset-bottom)); }
  .toast-stack { bottom: max(16px, env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .topbar { min-height: 104px; height: auto; column-gap: 6px; }
  .brand { flex: 1 1 120px; min-width: 0; }
  .brand h1 { max-width: 118px; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
  :lang(en) .brand h1 { max-width: 118px; font-size: 17px; white-space: nowrap; }
  .brand .bakery-modifier { max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .reset-btn {
    width: 44px; padding: 0 !important; overflow: hidden; font-size: 0 !important;
  }
  .reset-btn::before { content: "↺"; font-size: 21px; line-height: 1; }
  .header-actions .header-more-menu .reset-btn {
    width: 100%; padding: 8px 10px !important; overflow: visible; font-size: 12px !important;
  }
  .header-more-menu .reset-btn::before { content: none; }
  .header-ticker { margin-top: 4px !important; }

  .bakery-panel, .shop-panel { padding: 16px 12px; }
  .status-line { gap: 8px; font-size: 11px; }
  .day-badge { padding: 6px 8px; }
  .score-wrap { padding: 12px 0 3px; }
  .score { max-width: 100%; overflow: hidden; font-size: clamp(40px,14vw,52px); text-overflow: ellipsis; white-space: nowrap; }
  .score small { margin-left: 4px; font-size: 15px; }
  .rate { margin: 7px auto; max-width: 330px; font-size: 12px; line-height: 1.55; }
  .click-stage {
    height: min(46dvh,310px); min-height: 276px; margin: 8px 0 16px;
    border-radius: 34% 34% 16px 16px;
  }
  .bread-button { width: 210px; height: 164px; }
  .status-dock { gap: 6px; }
  .summary-value { max-width: 96px; }

  .tabs {
    margin: -2px -2px 14px; border: 1px solid var(--line); border-radius: 11px;
    background: rgba(244,234,215,.98); box-shadow: 0 6px 18px rgba(69,45,25,.08);
  }
  .tab { flex-basis: 78px; border-bottom-width: 3px; font-size: 12px; }
  .tab:first-child { border-radius: 10px 0 0 10px; }
  .tab:last-child { border-radius: 0 10px 10px 0; }
  .section-heading { align-items: center; margin-bottom: 12px; }
  .section-heading h2 { font-size: 17px; }
  .buy-mode { min-height: 40px; display: inline-flex; align-items: center; padding-inline: 13px; }

  .shop-list { gap: 7px; }
  .shop-list .shop-item {
    grid-template-columns: 42px minmax(0,1fr) 98px; min-height: 64px; gap: 8px;
    padding: 8px;
  }
  .shop-list .item-icon { width: 42px; height: 42px; }
  .shop-list .buy-btn {
    grid-column: 3; grid-row: 1; min-width: 0; height: 48px;
    flex-direction: column; justify-content: center; gap: 1px; padding: 4px 6px;
  }
  .shop-list .item-info h3 { font-size: 12px; }
  .shop-list .item-info p { font-size: 10px; line-height: 1.3; }

  .front-achievements { padding: 10px; }
  .front-achievements-head { gap: 5px; }
  .front-achievements-head > button { padding-left: 7px; }
  .next-achievements { margin-top: 7px; }
  .next-achievement { padding: 9px; }
  .recipe-shelf { margin-bottom: 12px; }
  .recipe-shelf .upgrade-item { min-height: 54px; }
  .recipe-shelf .buy-btn { min-height: 44px; }

  .achievement-list { gap: 7px; }
  .achievement-item { min-height: 76px; padding: 10px; }
  .map-route-table-wrap { -webkit-overflow-scrolling: touch; }
  .modal-card { width: calc(100vw - 24px); padding: 24px 18px; }
  .intro-card, .tutorial-card { padding: 22px 18px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Power saver (menu toggle, state.powerSaver). Targets the three things
   that actually keep a phone warm: looping animations that never idle,
   GPU-backed backdrop blur, and the film-grain overlay. Transitions are
   left alone - killing those makes the UI feel broken rather than calm,
   and they only run on interaction. The tick rate itself is slowed in
   nextGameTickDelay(). */
body.power-saver *, body.power-saver *::before, body.power-saver *::after {
  animation: none !important;
}
body.power-saver .tabs,
body.power-saver .hover-tooltip,
body.power-saver .stats-mini,
body.power-saver .offline-modal {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
body.power-saver .grain { display: none; }
body.power-saver .bread-button.auto-clicking::after { display: none; }
body.power-saver .world-item-event {
  left: 50% !important; right: auto !important; transform: translateX(-50%) !important;
}

/* Keep long localized labels and very large idle-game values inside their cards. */
.score-wrap, .score, .rate, .item-info, .summary-copy, .prestige-copy,
.tooltip-copy, .section-heading > div, .delivery-footer > div,
.buy-btn, .summary-value, .stats-mini dd { min-width: 0; }
#breadCount {
  display: inline-block; max-width: calc(100% - 34px); overflow: hidden;
  text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap;
}
#breadCount.live-precision {
  font-size: clamp(24px,5vw,54px); letter-spacing: -1px;
}
.rate strong, .summary-value, .buy-btn strong, .stats-mini dd, .prestige-detail,
.building-unlock-hint {
  max-width: 100%; overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
}
.tooltip-copy strong, .tooltip-copy small {
  max-width: 100%; overflow-wrap: anywhere; word-break: break-word;
}
button { min-width: 0; }

@media (max-width: 620px) {
  .toast-stack { z-index: 60; bottom: 74px; }
  .stats-mini {
    z-index: 56; left: auto; right: 8px; top: auto; bottom: 9px; width: 46px;
    overflow: visible; border-radius: 50%;
  }
  .stats-mini:not([open]) summary { width: 46px; height: 46px; padding: 0; justify-content: center; }
  .stats-mini:not([open]) summary::before { margin: 0; font-size: 18px; }
  .stats-mini:not([open]) summary span,.stats-mini:not([open]) summary small { display: none; }
  .stats-mini[open] {
    left: 8px; right: 8px; bottom: 66px; width: auto; max-height: min(52dvh,410px);
    overflow-y: auto; border-radius: 14px;
  }
  .bread-collection-btn b { display: none; }
  .bread-collection-card { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 16px 12px; }
  .bread-collection-list {
    max-height: calc(100dvh - 178px); grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px;
  }
  .bakery-collection-list {
    max-height: calc(100dvh - 178px); grid-template-columns: 1fr; gap: 7px;
  }
  .bakery-collection-item { grid-template-columns: 46px minmax(0,1fr) auto; padding: 9px; }
  .bakery-collection-icon { width: 46px; height: 46px; font-size: 24px; }
  .bread-collection-image { height: 88px; }
  .status-dock {
    position: absolute; z-index: 27; left: 21px; right: auto; bottom: 15px;
    display: flex; align-items: flex-end; gap: 6px; overflow: visible;
    margin: 0; padding: 0; scrollbar-width: none;
    pointer-events: none;
  }
  .status-dock::-webkit-scrollbar { display: none; }
  .compact-status {
    position: relative;
    flex: 0 0 46px; width: 46px; min-width: 46px; height: 46px; overflow: visible; pointer-events: auto;
    border: 0; background: transparent; box-shadow: none; backdrop-filter: none;
  }
  .compact-status[open] { width: 46px; height: 46px; }
  .compact-status summary, .compact-status[open] summary {
    width: 46px; height: 46px; min-height: 46px; display: grid; place-items: center;
    padding: 0; border-bottom: 0;
  }
  .summary-copy,.summary-value {
    position: absolute !important; width: 1px !important; height: 1px !important;
    overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important;
  }
  .compact-status summary::after { display: none; }
  .summary-icon {
    width: 38px; height: 38px; border-radius: 0; background: transparent;
    box-shadow: none; font-size: 27px; filter: drop-shadow(0 4px 4px rgba(45,27,14,.35));
  }
  .delivery.ready { border: 0; box-shadow: none; animation: none; }
  .delivery.ready .summary-icon {
    animation: mobile-delivery-ready .72s ease-in-out infinite alternate;
  }
  @keyframes mobile-delivery-ready {
    from {
      transform: translateY(0) scale(1);
      filter: brightness(1) drop-shadow(0 4px 4px rgba(45,27,14,.35));
    }
    to {
      transform: translateY(-2px) scale(1.16);
      filter: brightness(1.42) saturate(1.35)
        drop-shadow(0 0 5px #fff2a3) drop-shadow(0 0 11px #f3b63f);
    }
  }
  .compact-status-body {
    position: absolute; z-index: 57; left: 0; bottom: 54px;
    width: min(286px,calc(100vw - 66px)); max-height: none;
    overflow: visible; padding: 10px 11px 12px;
    border: 1px solid var(--line); border-radius: 15px;
    background: rgba(255,252,245,.98); box-shadow: 0 14px 38px rgba(48,29,17,.28);
    backdrop-filter: blur(10px);
  }
  .status-popover-close {
    position: absolute; z-index: 2; top: -11px; right: -9px;
    width: 30px; height: 30px; display: grid; place-items: center;
    padding: 0; border: 2px solid #fff; border-radius: 50%;
    color: #fff; background: #5b3b27; box-shadow: 0 4px 12px rgba(48,29,17,.28);
    font: 800 20px/1 system-ui; cursor: pointer;
  }
  .compact-status-body::after {
    content: ""; position: absolute; left: 16px; top: 100%; border: 7px solid transparent;
    border-top-color: rgba(255,252,245,.98);
  }
  .worker-panel .compact-status-body { left: -52px; }
  .worker-panel .compact-status-body::after { left: 68px; }
  .pace-panel .compact-status-body { left: -104px; }
  .pace-panel .compact-status-body::after { left: 120px; }
  .progress-track { height: 5px; margin-bottom: 6px; }
  .delivery-footer { gap: 7px; }
  .delivery-footer p, .delivery-footer small { font-size: 9px; }
  .delivery-footer button { padding: 7px 8px; font-size: 9px; }
  .worker-body { grid-template-columns: 1fr; gap: 5px; }
  .worker-copy > p, .pace-detail { font-size: 9px; line-height: 1.3; }
  .worker-panel dl {
    min-width: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 5px; padding: 5px 0 0; border: 0; border-top: 1px solid var(--line);
  }
  .worker-panel dl div { display: block; padding: 0; font-size: 8px; }
  .worker-panel dt, .worker-panel dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .effect-timer { margin-top: 5px; }
  .effect-timer > span { font-size: 9px; }
  .box-reveal-card { padding: 24px 20px 18px; }
  .box-reveal-stage { width: 210px; height: 210px; margin: 4px auto 0; }
  .box-reveal-half { left: 20px; top: 18px; width: 170px; height: 170px; }
  .item-effect-progress { bottom: 58px; width: min(210px,58%); }
  .temp-baker-helper { right: 70px; bottom: 66px; width: 62px; height: 62px; }
  .box-reward-card { width: 78px; }
  .box-reward-card img { width: 48px; height: 48px; }
}

@media (max-height: 560px), (max-width: 390px) {
  .box-reveal-modal { place-items: start center; padding-top: 72px; padding-bottom: 28px; }
}

/* Mobile game-board contract: the bakery is one complete viewport scene.
   The management panel remains below it, while HUD controls float over safe
   edge zones and never consume document height. */
@media (max-width: 620px) {
  .bakery-panel {
    height: calc(67dvh - 75px); min-height: 380px; max-height: 560px;
    display: flex; flex-direction: column;
    overflow: hidden; padding: 10px 8px max(8px,env(safe-area-inset-bottom));
  }
  .status-line { flex: 0 0 auto; padding-inline: 4px; }
  .score-wrap { flex: 0 0 auto; padding: 8px 0 2px; }
  .score { font-size: clamp(38px,12vw,50px); }
  .rate { margin: 4px auto 6px; }
  .click-stage {
    flex: 1 1 auto; width: 100%; height: auto; min-height: 0; margin: 4px 0 0;
    border-width: 6px; border-radius: 18px;
  }
  .scene-game-hud { top: 8px; left: 8px; right: 8px; }
  .scene-game-hud .score { font-size: clamp(37px,11vw,48px); }
  .scene-game-hud .rate { font-size: 10px; }
  .bread-button { width: min(72vw,320px); height: auto; }
  .shop-scene { transform: scale(1.04); transform-origin: 50% 100%; }
}

@media (max-width: 620px) and (max-height: 700px) {
  .bread-button { width: min(62vw,260px); }
  .scene-game-hud .score { font-size: 37px; }
}
