/* café scene: one .cf-world per area (only the viewed one is displayed) */
.cf-bg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.cf-world { position: absolute; inset: 0; }
.cf-table { position: absolute; width: 88px; height: auto; transform: translate(-50%, -100%); pointer-events: none; }
.cf-table-front { clip-path: inset(8% 23% 34% 23% round 30%); }
.cf-seated { pointer-events: none; animation: cfSit .25s ease-out both; }
@keyframes cfSit { from { opacity: 0; } to { opacity: 1; } }
.cf-sip > .spr-still { transform-origin: 50% 100%; animation: cfSip 1.1s ease-in-out infinite; }
@keyframes cfSip { 0%, 100% { transform: rotate(0) scale(1, 1); } 35% { transform: rotate(-2deg) scale(1, 1.03); } 60% { transform: rotate(1deg) scale(1, .98); } }
.cf-joy { position: absolute; z-index: 1002; width: 46px; height: 46px; margin-left: -23px; margin-top: -46px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; line-height: 1; pointer-events: none;
  box-shadow: 0 3px 8px rgba(90, 40, 60, .3), inset 0 0 0 2px #ffd2df; animation: cfJoy 1.7s ease-out both; }
.cf-joy::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: #fff; transform: translateX(-50%) rotate(45deg); z-index: -1; }
@keyframes cfJoy { 0% { transform: scale(.2) translateY(10px); opacity: 0; } 15% { transform: scale(1.15); opacity: 1; } 25% { transform: scale(1); }
  80% { transform: translateY(-6px); opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }
.cf-fest { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 900; }
.cf-hit { position: absolute; background: transparent; border: 0; padding: 0; margin: 0; cursor: pointer; outline-offset: -2px; }
.cf-breathe > .spr-still { transform-origin: 50% 100%; animation: cfBreathe 3s ease-in-out infinite; }
.cf-hop > .spr-still { animation: cfHop .36s ease-in-out infinite; }
.cf-hop > .spr-anim { animation: cfHop .5s ease-in-out infinite; }
.cf-bobm > .spr-still, .cf-glow > .spr-still { animation: cfHop .5s ease-in-out infinite; }
.cf-glow > .spr-still { filter: drop-shadow(0 0 7px #ffd45a) drop-shadow(0 0 14px rgba(255, 210, 90, .7)); }
.cf-glow:not(.cf-bobm) > .spr-still { animation: none; }
.cf-squash > .spr-still { animation: cfSquash .3s !important; transform-origin: 50% 100%; }
.cf-squash > .spr-anim { animation: cfSquash .3s; transform-origin: 50% 100%; }
.cf-waddle > .spr-still { transform-origin: 50% 100%; animation: cfWaddle .5s ease-in-out infinite; }
@keyframes cfWaddle { 0%, 100% { transform: rotate(-3deg) translateY(0); } 25% { transform: rotate(0deg) translateY(-2px); } 50% { transform: rotate(3deg) translateY(0); } 75% { transform: rotate(0deg) translateY(-2px); } }
.cf-gidle > .spr-still { transform-origin: 50% 100%; animation: cfGIdle 3.4s ease-in-out infinite; }
@keyframes cfGIdle { 0%, 100% { transform: scale(1, 1) rotate(0deg); } 30% { transform: scale(1.006, 1.014) rotate(.5deg); } 70% { transform: scale(.998, .994) rotate(-.5deg); } }
.cf-tray { position: absolute; left: -22px; top: -74px; width: 44px; height: 30px; z-index: 2; pointer-events: none; animation: cfHop .36s ease-in-out infinite; }
.cf-tray::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; border-radius: 50%; background: linear-gradient(#fff6e8, #e9c9a8); box-shadow: 0 2px 3px rgba(90, 50, 60, .35); }
.cf-tray img { position: absolute; left: 7px; bottom: 3px; width: 30px; height: 30px; object-fit: contain; }
@keyframes cfBreathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .96); } }
@keyframes cfHop { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes cfSquash { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.12, .84); } 70% { transform: scale(.94, 1.1); } }

/* bubbles */
.cf-bub { position: absolute; width: 54px; height: 54px; border-radius: 50%; border: 0; padding: 0; z-index: 1000; cursor: pointer;
  background: conic-gradient(var(--rc, #7bc9a0) calc(var(--p, 100) * 1%), rgba(255, 255, 255, .45) 0); box-shadow: 0 3px 8px rgba(90, 40, 60, .35);
  animation: cfPop .32s cubic-bezier(.2, 1.9, .4, 1) both; }
.cf-bub .in { position: absolute; inset: 4px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; }
.cf-bub img { width: 40px; height: 40px; object-fit: contain; pointer-events: none; }
.cf-bub::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: #fff; transform: translateX(-50%) rotate(45deg); z-index: -1; }
.cf-bub:active { scale: .92; }
@keyframes cfPop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cf-make { position: absolute; width: 44px; z-index: 1000; text-align: center; animation: cfPop .25s both; }
.cf-make img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 50%; padding: 2px; box-shadow: 0 2px 5px rgba(90, 40, 60, .3); }
.cf-mbar { height: 7px; margin-top: 2px; border-radius: 4px; background: rgba(255, 255, 255, .7); border: 1px solid #c98a6a; overflow: hidden; }
.cf-mbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb3c7, #e88aa5); }
.cf-info, .cf-bang { position: absolute; width: 44px; height: 44px; border-radius: 50%; z-index: 1001; cursor: pointer; padding: 0;
  font: 900 20px var(--font); color: #fff; -webkit-text-stroke: 3px var(--outline); paint-order: stroke fill; animation: cfPop .3s cubic-bezier(.2, 1.9, .4, 1) both; }
.cf-info { border: 3px solid #fff; background: radial-gradient(circle at 40% 35%, #8fd0c8, #3f8f94); box-shadow: 0 3px 8px rgba(40, 80, 80, .4); }
.cf-bang { border: 3px solid #fff7c2; background: radial-gradient(circle at 40% 35%, #ffe08a, #e0a43a); box-shadow: 0 0 12px #ffd45a; z-index: 999; animation: cfPop .3s both, cfFloat 1.4s ease-in-out infinite; }
@keyframes cfFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

/* HUD row 1: gold / gems / crystals (top-right 64x64 stays free for the pause button) */
.cf-top { position: absolute; left: 8px; right: 72px; top: 8px; height: 40px; display: flex; gap: 5px; }
.cf-pill { position: relative; flex: none; height: 40px; display: flex; align-items: center; gap: 5px; padding: 0 10px 0 7px; border-radius: 20px;
  background: linear-gradient(180deg, #fffaf3, #fbe9e4); border: 2px solid var(--gold-l); box-shadow: 0 3px 0 #e3b5a0, 0 4px 8px rgba(100, 40, 60, .25); font-family: var(--font); color: var(--ink); }
.cf-gold { flex: 1 1 auto; min-width: 88px; }
.cf-gold img { width: 26px; height: 26px; object-fit: contain; }
.cf-num { font-size: 18px; -webkit-text-stroke: 4px var(--outline); line-height: 1; }
.cf-cur { cursor: pointer; }
.cf-cur:active { transform: scale(.94); }
.cf-cur img { width: 26px; height: 26px; object-fit: contain; }
.cf-fb { font-size: 20px; line-height: 1; }
.cf-cn { font-size: 16px; -webkit-text-stroke: 3.5px var(--outline); line-height: 1; min-width: 14px; }

/* area pill (always visible, ~30px tall, 46px+ tap area) + expandable tab row (overlays the scene) */
.cf-row2 { position: absolute; left: 8px; right: 8px; top: 60px; height: 30px; display: flex; align-items: center; gap: 6px; z-index: 3; pointer-events: none; }
.cf-row2 > * { pointer-events: auto; }
.cf-apill { position: relative; flex: none; min-width: 0; height: 30px; max-width: 150px; box-sizing: border-box; padding: 0 12px; display: flex; align-items: center; gap: 6px; cursor: pointer;
  border-radius: 15px; border: 2px solid var(--gold-l); background: linear-gradient(180deg, #fffaf3, #fbe9e4); box-shadow: 0 3px 0 #e3b5a0, 0 3px 8px rgba(100, 40, 60, .22);
  font: 900 13px var(--font); color: var(--ink); z-index: 3; transition: transform .1s; }
.cf-apill::before { content: ""; position: absolute; left: -4px; right: -4px; top: -8px; bottom: -8px; }
.cf-apill:active { transform: translateY(2px) scale(.96); }
.cf-apill.open { background: linear-gradient(180deg, #ffe3ea, #fbb9cb); }
.cf-apn { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-apa { flex: none; font-size: 12px; color: var(--rose-d); }
.cf-apdot { position: absolute; top: -5px; right: -4px; width: 15px; height: 15px; border-radius: 50%; background: #ff3f5f; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); pointer-events: none; }
.cf-tabs { position: absolute; left: 8px; right: 72px; top: 94px; height: 48px; display: flex; gap: 6px; z-index: 4; transform-origin: 20% 0; animation: cfTabsIn .22s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes cfTabsIn { from { transform: translateY(-14px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.cf-atab { position: relative; flex: 1; min-width: 0; height: 48px; padding: 0 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer;
  border-radius: 16px; border: 2px solid #e3b5a0; background: linear-gradient(180deg, #fffaf3, #fbe9e4); box-shadow: 0 3px 0 #e3b5a0, 0 4px 8px rgba(100, 40, 60, .2);
  font-family: var(--font); color: var(--ink); transition: transform .1s, filter .15s; }
.cf-atab:active { transform: translateY(2px) scale(.96); }
.cf-atab.on { background: linear-gradient(180deg, #ffe3ea, #fbb9cb); border-color: var(--gold-l); box-shadow: 0 3px 0 #b4567a, 0 0 0 2px #fff inset; }
.cf-atab.locked { filter: grayscale(.45) brightness(.97); }
.cf-an { max-width: 100%; font: 900 13px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.cf-as { max-width: 100%; font: 800 11px var(--font); color: var(--teal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.cf-atab.on .cf-as { color: var(--rose-d); }
.cf-adot { position: absolute; top: -5px; right: -3px; width: 15px; height: 15px; border-radius: 50%; background: #ff3f5f; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); pointer-events: none; }
/* HUD row 2: area pill · festival · level, all 30 px tall with a 46 px invisible tap area */
.cf-lvp, .cf-fest-pill { position: relative; height: 30px; box-sizing: border-box; cursor: pointer; border-radius: 15px; background: linear-gradient(180deg, #fffaf3, #fbe9e4);
  box-shadow: 0 3px 0 #e3b5a0, 0 3px 8px rgba(100, 40, 60, .22); font-family: var(--font); color: var(--ink); transition: transform .1s; }
.cf-lvp::before, .cf-fest-pill::before { content: ""; position: absolute; left: -3px; right: -3px; top: -8px; bottom: -8px; }
.cf-lvp { flex: none; margin-left: auto; padding: 0 10px; border: 2px solid var(--gold-l); display: flex; align-items: center; }
.cf-lvp:active { transform: scale(.96); }
.cf-col { display: flex; align-items: baseline; gap: 5px; min-width: 0; line-height: 1; }
.cf-lv { font: 900 13px var(--font); color: var(--ink); white-space: nowrap; }
.cf-inc { font: 800 11px var(--font); color: var(--teal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-x2 { position: absolute; left: 8px; top: 128px; padding: 2px 8px; border-radius: 10px; background: linear-gradient(180deg, #ffd96a, #e8a93a); color: #fff; font: 900 13px var(--font);
  -webkit-text-stroke: 2.5px #8a4a20; paint-order: stroke fill; border: 2px solid #fff; animation: cfPulse 1.2s ease-in-out infinite; }
#hud .cf-speed { top: 98px; }
@keyframes cfPulse { 50% { transform: scale(1.08); } }
.cf-fest-pill { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 4px; padding: 0 9px 0 6px; border: 2px solid var(--fc, #f6b8cf); text-align: left; }
.cf-fest-pill:active { transform: scale(.96); }
.cf-fic { font-size: 16px; flex: none; }
.cf-ftx { display: flex; align-items: baseline; gap: 5px; min-width: 0; line-height: 1; }
.cf-fn { font: 900 12px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-fs { font: 700 11px var(--font); color: var(--teal); white-space: nowrap; }

/* side (starts below the tabs and festival row) */
#side { top: 168px; }
.cf-sb { width: 60px; display: flex; flex-direction: column; align-items: center; gap: 1px; border: 0; background: transparent; padding: 0; cursor: pointer; position: relative; font-family: var(--font); }
.cf-sc { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative;
  background: radial-gradient(circle at 40% 30%, #fffaf3, #f9dfe0); border: 3px solid var(--gold-l); box-shadow: 0 3px 0 #c98a6a, 0 4px 8px rgba(100, 40, 60, .25); transition: transform .1s; }
.cf-sc img { width: 34px; height: 34px; object-fit: contain; }
.cf-sb:active .cf-sc { transform: scale(.9); }
.cf-sl { font: 900 12px var(--font); color: #fff; -webkit-text-stroke: 3px var(--outline); paint-order: stroke fill; white-space: nowrap; }
.cf-sb .cf-dot { top: -2px; right: 2px; }
.cf-dot { min-width: 14px !important; width: 14px; height: 14px !important; padding: 0 !important; pointer-events: none; }
.cf-sp { display: flex; flex-direction: column; gap: 10px; }

/* nav */
.cf-tab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 0; border-radius: 14px;
  background: transparent; cursor: pointer; font-family: var(--font); padding: 0; transition: background .15s, transform .1s; }
.cf-tab img { width: 34px; height: 34px; object-fit: contain; transition: transform .2s; }
.cf-tl { font: 800 12px var(--font); color: var(--cocoa); white-space: nowrap; }
.cf-tab.on { background: linear-gradient(180deg, #ffe3ea, #fbc9d6); box-shadow: inset 0 0 0 2px var(--gold-l); }
.cf-tab.on img { transform: translateY(-3px) scale(1.12); }
.cf-tab.on .cf-tl { color: var(--rose-d); }
.cf-tab:active { transform: scale(.93); }
.cf-tab .cf-dot { top: 4px; right: 14px; }

/* tutorial */
.cf-tut { position: absolute; z-index: 35; width: 0; height: 0; pointer-events: none; }
.cf-tut-t { position: absolute; left: 0; bottom: 44px; transform: translateX(-50%); width: max-content; max-width: 220px; padding: 8px 14px; border-radius: 16px; text-align: center;
  background: var(--cream); border: 2px solid var(--gold); font: 800 14px/1.3 var(--font); color: var(--ink); box-shadow: 0 3px 8px rgba(80, 30, 60, .3); }
.cf-tut-h { position: absolute; left: 0; bottom: 0; transform: translateX(-50%); font-size: 36px; line-height: 1; animation: cfPoint .8s ease-in-out infinite; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
@keyframes cfPoint { 0%, 100% { translate: 0 0; } 50% { translate: 0 8px; } }

/* festival particles */
.cf-p { position: absolute; top: -20px; font-style: normal; display: block; animation: cfFall linear infinite; }
.cf-petals { width: 10px; height: 8px; border-radius: 80% 0 80% 0; background: #f8b9d0; opacity: .9; }
.cf-snow { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px #fff; }
.cf-fireflies { width: 7px; height: 7px; border-radius: 50%; background: #fff6a8; box-shadow: 0 0 8px 3px #ffe55a; animation-name: cfFly; animation-timing-function: ease-in-out; }
.cf-bats { font-size: 16px; animation-name: cfBat; }
@keyframes cfFall { from { transform: translate(0, 0) rotate(0); } 50% { transform: translate(var(--sw), 330px) rotate(180deg); } to { transform: translate(0, 700px) rotate(360deg); } }
@keyframes cfFly { 0%, 100% { transform: translate(0, 0); opacity: .2; } 25% { transform: translate(var(--sw), -30px); opacity: 1; } 50% { transform: translate(calc(var(--sw) * -1), 20px); opacity: .4; } 75% { transform: translate(var(--sw), 40px); opacity: 1; } }
@keyframes cfBat { 0% { transform: translate(-30px, 0); } 25% { transform: translate(110px, -30px); } 50% { transform: translate(230px, 10px); } 75% { transform: translate(340px, -25px); } 100% { transform: translate(460px, 0); } }
