/* MiniCat World (phase 2) - playable hub map. Candy theme; self-contained; no third-party. */
@font-face { font-family: 'Fredoka'; src: url('/assets/fonts/fredoka.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Baloo 2'; src: url('/assets/fonts/baloo2-deva.woff2') format('woff2'); font-weight: 400 800; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }
:root {
  --coral: #FF7A8A; --orange: #FFA552; --mint: #5FD8A9; --sky: #5CC0F5; --lilac: #AE8CFF; --pink: #FF9EC4;
  --ink: #4A2E3E; --ink-soft: #6E4F61;
  --shadow: 0 10px 30px rgba(170,100,160,.20), 0 2px 6px rgba(170,100,160,.14);
  --font: 'Fredoka', 'Baloo 2', 'Nunito', 'Comic Sans MS', system-ui, sans-serif;
  --px: 0; --py: 0;
}
html[lang="zh"] { --font: 'Fredoka', 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Noto Sans CJK SC', 'Source Han Sans SC', 'Microsoft YaHei', system-ui, sans-serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; background: #E3E2FF; }
body { margin: 0; min-height: 100vh; min-height: 100svh; overflow-x: hidden; font-family: var(--font); color: var(--ink); font-size: 20px; line-height: 1.35;
  background: linear-gradient(180deg, #FFE3D3 0%, #FFD9E8 38%, #EBDDFF 72%, #D7ECFF 100%) fixed; }
html[lang="hi"] body { line-height: 1.5; }
a { color: inherit; font-family: inherit; }
button { font-family: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
img { -webkit-user-drag: none; user-select: none; }

/* ---------- opening curtain ---------- */
.w-curtain { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; display: grid; place-items: center; animation: gone 0s linear 1.9s forwards; }
.w-curtain::before, .w-curtain::after { content: ''; position: absolute; top: 0; bottom: 0; width: 50.5%;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.55) 0 2px, transparent 3px) 0 0 / 46px 46px,
              radial-gradient(circle at 70% 60%, rgba(255,233,140,.8) 0 2px, transparent 3px) 0 0 / 64px 64px,
              linear-gradient(180deg, #FF9EC4, #C9A6FF); }
.w-curtain::before { left: 0; border-right: 6px solid #fff; animation: open-l 1.15s cubic-bezier(.7,0,.2,1) .55s forwards; }
.w-curtain::after { right: 0; border-left: 6px solid #fff; animation: open-r 1.15s cubic-bezier(.7,0,.2,1) .55s forwards; }
.w-spark { position: relative; z-index: 1; font-size: 72px; filter: drop-shadow(0 0 18px #fff); animation: spark 1.2s ease-out forwards; }
@keyframes open-l { to { transform: translateX(-102%); } }
@keyframes open-r { to { transform: translateX(102%); } }
@keyframes spark { 0% { transform: scale(.4); opacity: 0; } 35% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(2.4) rotate(40deg); opacity: 0; } }
@keyframes gone { to { visibility: hidden; } }
.w-main { animation: arrive 1.6s cubic-bezier(.2,.8,.2,1) .45s both; }
@keyframes arrive { from { transform: scale(1.06); opacity: .0; } 30% { opacity: 1; } to { transform: none; opacity: 1; } }
html.no-intro .w-curtain { display: none; }
html.no-intro .w-main { animation: none; }

/* ---------- sky ---------- */
.w-sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.tw { position: absolute; left: var(--x); top: var(--y); font-size: 20px; color: #fff; text-shadow: 0 0 10px rgba(255,255,255,.9), 0 0 2px #FFC4DA; opacity: .2; animation: twinkle 3.2s ease-in-out var(--d) infinite; }
.tw:nth-child(3n) { color: #FFE27A; } .tw:nth-child(3n+1) { color: #FFB3CF; }
@keyframes twinkle { 0%,100% { opacity: .15; transform: scale(.8); } 50% { opacity: .95; transform: scale(1.15); } }
.cloud { position: absolute; width: 180px; height: 60px; border-radius: 60px; background: rgba(255,255,255,.75); filter: blur(2px); box-shadow: 40px -22px 0 6px rgba(255,255,255,.75), 90px -6px 0 0 rgba(255,255,255,.7); }
.cloud.c1 { top: 15%; left: -200px; animation: drift 70s linear infinite; }
.cloud.c2 { top: 38%; left: -200px; transform: scale(.7); opacity: .8; animation: drift 95s linear -40s infinite; }
.cloud.c3 { top: 70%; left: -200px; transform: scale(.55); opacity: .7; animation: drift 120s linear -80s infinite; }
@keyframes drift { to { left: 110%; } }

/* ---------- top ---------- */
.w-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 0; padding-top: calc(10px + env(safe-area-inset-top)); max-width: 980px; margin: 0 auto; }
.w-home { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; min-height: 48px; border-radius: 999px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); text-decoration: none; font-weight: 700; font-size: 18px; }
.w-badge { padding: 7px 14px; border-radius: 999px; background: linear-gradient(135deg, #8E5BE8, #D9468F); color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .3px; box-shadow: var(--shadow); white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.w-home:focus-visible, .portal:focus-visible, .w-cat:focus-visible, .w-foot a:focus-visible, .zone:focus-visible, .w-me-cta:focus-visible, .w-me-switch:focus-visible { outline: 4px solid #8E5BE8; outline-offset: 3px; }

.w-main { max-width: 980px; margin: 0 auto; overflow-x: hidden; overflow-x: clip; padding: 6px 16px calc(28px + env(safe-area-inset-bottom)); text-align: center; }

/* ---------- candy title ---------- */
.candy { font-weight: 700; letter-spacing: .5px; margin: 0; line-height: 1.08; }
.candy b { display: inline-block; text-shadow: 0 3px 0 #fff, 0 -2px 0 #fff, 2px 0 0 #fff, -2px 0 0 #fff, 0 6px 14px rgba(170,100,160,.3); }
.candy .cw { white-space: nowrap; }
.candy b:nth-of-type(6n+1), .candy b.k1 { color: var(--coral); } .candy b:nth-of-type(6n+2), .candy b.k2 { color: var(--orange); } .candy b:nth-of-type(6n+3), .candy b.k3 { color: #F5B800; }
.candy b:nth-of-type(6n+4), .candy b.k4 { color: #3CC995; } .candy b:nth-of-type(6n+5), .candy b.k5 { color: var(--sky); } .candy b:nth-of-type(6n), .candy b.k6 { color: var(--lilac); }
.candy b { animation: hop 2.6s ease-in-out infinite; } .candy b:nth-of-type(2n) { animation-delay: .2s; } .candy b:nth-of-type(3n) { animation-delay: .4s; }
.candy .candy-solid { background: linear-gradient(90deg, #FF6F86, #FF9A3D, #F5B800, #3CC995, #3AAFF0, #9B74FF); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 #fff) drop-shadow(0 -1px 0 #fff) drop-shadow(0 4px 8px rgba(170,100,160,.3)); }
.candy:not(:has(.candy-solid)) { direction: ltr; unicode-bidi: isolate; }
@keyframes hop { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.w-title { font-size: clamp(32px, 9vw, 72px); margin: 8px auto 0; max-width: 16ch; }
html[lang="hi"] .w-title { line-height: 1.32; letter-spacing: 0; }
html[lang="ru"] .w-title, html[lang="uz"] .w-title, html[lang="es"] .w-title { font-size: clamp(28px, 8vw, 64px); }

.w-lead { position: relative; max-width: 560px; margin: 14px auto 12px; padding: 12px 18px; border-radius: 24px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); font-weight: 600; font-size: 18px; }
.w-lead::before { content: ''; position: absolute; top: -10px; left: 50%; margin-left: -10px; border: 10px solid transparent; border-top: 0; border-bottom-color: rgba(255,255,255,.92); }

/* ---------- saved cat / make CTA ---------- */
.w-me { max-width: 560px; margin: 0 auto 14px; }
.w-me-has { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 28px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); text-align: start; }
.w-me-has[hidden], .w-me-cta[hidden], .w-me-switch[hidden], .w-avatar[hidden] { display: none !important; }
.w-me-art { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(180deg, #FFF6E8, #FFE3F0); display: grid; place-items: center; overflow: hidden; box-shadow: inset 0 -4px 0 rgba(0,0,0,.06); }
.w-me-art svg { width: 64px; height: 64px; }
.w-me-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.w-me-hi { font-size: 20px; line-height: 1.15; }
.w-me-txt small { font-size: 14px; color: var(--ink-soft); font-weight: 600; line-height: 1.25; }
.w-me-switch { padding: 8px 12px; min-height: 44px; border-radius: 999px; background: linear-gradient(135deg, #AE8CFF, #FF9EC4); color: #fff; font-weight: 700; font-size: 14px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); white-space: nowrap; }
.w-me-cta { display: grid; grid-template-columns: 58px 1fr 22px; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; min-height: 78px; border-radius: 999px;
  color: #fff; text-decoration: none; text-align: start; border: 4px solid rgba(255,255,255,.9);
  background: linear-gradient(135deg, #D63B67, #E2621F); box-shadow: var(--shadow), inset 0 -6px 0 rgba(0,0,0,.12); }
.w-me-cta-ic { width: 58px; height: 58px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 30px; box-shadow: 0 3px 8px rgba(0,0,0,.15); }
.w-me-cta-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.w-me-cta-txt b { font-size: 22px; line-height: 1.15; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.w-me-cta-txt small { font-size: 15px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
[dir="rtl"] .w-me-cta { padding: 10px 10px 10px 18px; }
[dir="rtl"] .w-me-has { text-align: start; }

/* ---------- hub map ---------- */
.w-hub { width: min(100%, 680px); margin: 0 auto 16px; }
.w-hub-board { position: relative; overflow: hidden; overflow: clip; aspect-ratio: 360 / 300; border-radius: 36px;
  box-shadow: var(--shadow), 0 0 0 5px rgba(255,255,255,.85); background: #9EE8C0;
  transform: translate3d(calc(var(--px) * 4px), calc(var(--py) * 3px), 0); }
.w-hub-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Fuzz / Cola on the board (existing cut-outs) */
.w-cat { position: absolute; display: block; z-index: 3; }
.w-cat.fuzz { left: 18%; top: 30%; width: 18%; }
.w-cat.cola { right: 16%; top: 32%; width: 18%; }
.w-cat .bob { display: block; animation: bob 4.2s ease-in-out infinite; transform-origin: 50% 100%; }
.w-cat.cola .bob { animation-delay: -2.1s; }
.w-cat img { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 8px rgba(120,60,110,.18)); }
.w-cat .shadow { position: absolute; left: 18%; right: 18%; bottom: -2%; height: 10%; border-radius: 50%; background: radial-gradient(closest-side, rgba(120,60,110,.28), transparent); z-index: -1; animation: shade 4.2s ease-in-out infinite; }
.w-cat.cola .shadow { animation-delay: -2.1s; }
.w-cat .tag { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); padding: 1px 10px; border-radius: 999px; background: #fff; border: 3px solid transparent;
  background-image: linear-gradient(#fff, #fff), linear-gradient(90deg, #FF8FA8, #FFC36B, #7FE0B5, #8FD3FF); background-origin: border-box; background-clip: padding-box, border-box;
  font-weight: 700; font-size: 13px; color: var(--ink); white-space: nowrap; box-shadow: 0 3px 8px rgba(170,100,160,.2); }
.w-cat.hop .bob { animation: jump .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-.6deg); } }
@keyframes shade { 0%,100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.86); opacity: .75; } }
@keyframes jump { 0% { transform: translateY(0) scale(1, 1); } 25% { transform: translateY(0) scale(1.05, .93); } 55% { transform: translateY(-22px) scale(.97, 1.04); } 100% { transform: translateY(0) scale(1); } }
.burst { position: absolute; pointer-events: none; font-size: 20px; z-index: 8; animation: burst .9s ease-out forwards; }
@keyframes burst { from { transform: translate(0, 0) scale(.6); opacity: 1; } to { transform: translate(var(--bx), var(--by)) scale(1.1); opacity: 0; } }

/* player avatar in garden */
.w-avatar { position: absolute; left: 41%; top: 42%; width: 18%; z-index: 4; text-align: center; pointer-events: none; }
.w-avatar-art { width: 100%; aspect-ratio: 1; display: grid; place-items: end center; filter: drop-shadow(0 6px 8px rgba(120,60,110,.2)); animation: bob 3.6s ease-in-out infinite; }
.w-avatar-art svg { width: 100%; height: auto; display: block; }
.w-avatar-tag { display: inline-block; margin-top: -4px; padding: 1px 10px; border-radius: 999px; background: #fff; border: 3px solid #FFE27A; font-weight: 700; font-size: 12px; box-shadow: 0 2px 6px rgba(170,100,160,.2); max-width: 110%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tap zones */
.zone { position: absolute; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px; min-width: 72px; min-height: 64px;
  border-radius: 18px; text-decoration: none; color: var(--ink); background: rgba(255,255,255,.92); border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(120,60,110,.18); transition: transform .15s; }
.zone:hover { transform: translateY(-2px) scale(1.03); }
.zone:active { transform: scale(.96); }
.zone .zi { font-size: 22px; line-height: 1; }
.zone .zt { font-weight: 700; font-size: 13px; line-height: 1.15; text-align: center; }
.zone .zt b { display: block; font-size: 14px; }
.zone .zt small { display: none; font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.z-garden { left: 6%; top: 8%; background: linear-gradient(180deg, #FFF8E8, #FFE6F2); }
.z-forest { right: 4%; top: 6%; max-width: 42%; background: linear-gradient(180deg, #E8FFF4, #D4F5E4); border-color: #5FD8A9; }
.z-desert { left: 38%; top: 2%; max-width: 40%; background: linear-gradient(180deg, #FFF6D6, #FFE7A8); border-color: #F2C14E; }
.z-home { left: 8%; bottom: 5%; background: linear-gradient(180deg, #FFE8F0, #FFD3E4); border-color: #FF9EC4; }
.z-chat { right: 5%; bottom: 5%; max-width: 42%; background: linear-gradient(180deg, #F0E8FF, #E0D4FF); border-color: #AE8CFF; }
.zone.here { box-shadow: 0 0 0 4px #FFE27A, 0 6px 16px rgba(120,60,110,.18); }

/* list portals under the map */
.w-portals { display: grid; gap: 10px; max-width: 560px; margin: 0 auto; }
.portal { position: relative; display: grid; grid-template-columns: 58px 1fr 22px; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; min-height: 72px; border-radius: 999px;
  color: #fff; text-decoration: none; text-align: start; border: 4px solid rgba(255,255,255,.9); box-shadow: var(--shadow), inset 0 -6px 0 rgba(0,0,0,.12); transition: transform .15s; overflow: hidden; }
.portal::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.35) 45%, transparent 60%) no-repeat; background-size: 250% 100%; background-position: 150% 0; animation: shine 5s ease-in-out infinite; pointer-events: none; }
.p-adv::after { animation-delay: 1.4s; } .p-chat::after { animation-delay: 2.8s; }
@keyframes shine { 0%, 60% { background-position: 150% 0; } 100% { background-position: -60% 0; } }
.portal:hover { transform: translateY(-2px); } .portal:active { transform: scale(.96); }
.p-make { background: linear-gradient(135deg, #D63B67, #E2621F); }
.p-adv { background: linear-gradient(135deg, #12855E, #15789A); }
.p-chat { background: linear-gradient(135deg, #B8357E, #7448D8); }
/* map zones that also carry .portal keep zone look, not pill look */
.w-hub-board > .zone.portal { position: absolute; display: flex; flex-direction: column; grid-template-columns: none; width: auto; max-width: 44%; color: var(--ink); border-radius: 18px; padding: 6px 8px; min-height: 64px; min-width: 72px; border-width: 3px; box-shadow: 0 6px 16px rgba(120,60,110,.18); overflow: visible; }
.w-hub-board > .portal::after { display: none; }
.w-hub-board > .portal .pi, .w-hub-board > .portal .pa, .w-hub-board > .portal .pt { display: none; }
/* re-assert corner anchors after .portal's position:relative */
.w-hub-board > .z-garden { left: 5%; top: 6%; right: auto; bottom: auto; }
.w-hub-board > .z-forest { right: 4%; top: 5%; left: auto; bottom: auto; max-width: 40%; }
.w-hub-board > .z-desert { left: 36%; top: 2%; right: auto; bottom: auto; max-width: 38%; }
.w-hub-board > .z-home { left: 5%; bottom: 5%; right: auto; top: auto; }
.w-hub-board > .z-chat { right: 4%; bottom: 5%; left: auto; top: auto; max-width: 40%; }
.pi { width: 58px; height: 58px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 32px; box-shadow: 0 3px 8px rgba(0,0,0,.15); }
.pt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pt b { font-size: 22px; line-height: 1.15; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.pt small { font-size: 16px; font-weight: 600; line-height: 1.2; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.pa { font-size: 34px; font-weight: 700; line-height: 1; }
[dir="rtl"] .pa { transform: scaleX(-1); }
[dir="rtl"] .w-portals .portal { padding: 8px 8px 8px 18px; }
.w-afra { max-width: 520px; margin: 20px auto 6px; font-size: 16px; color: var(--ink-soft); font-weight: 500; }
.w-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0 0; }
.w-foot a { display: inline-flex; gap: 6px; align-items: center; padding: 8px 14px; min-height: 44px; border-radius: 999px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); font-size: 16px; font-weight: 700; text-decoration: none; }

@media (min-width: 760px) {
  .w-portals { grid-template-columns: repeat(3, 1fr); max-width: 940px; gap: 16px; }
  .w-portals .portal { grid-template-columns: 1fr; justify-items: center; text-align: center; border-radius: 34px; padding: 18px 14px 16px; min-height: 0; }
  .w-portals .portal .pi { width: 76px; height: 76px; font-size: 42px; }
  .w-portals .portal .pt { align-items: center; }
  .w-portals .portal .pa { display: none; }
  .w-title { max-width: none; }
  .w-lead { font-size: 20px; }
  .w-hub { width: min(100%, 720px); }
  .zone .zt small { display: block; }
  .zone { min-width: 96px; padding: 8px 10px; }
  .zone .zt b { font-size: 15px; }
  .w-cat .tag { font-size: 14px; bottom: -18px; }
  .w-me { max-width: 640px; }
}
@media (max-width: 360px) {
  .w-portals .portal { grid-template-columns: 50px 1fr 18px; }
  .pi { width: 50px; height: 50px; font-size: 27px; }
  .pt b { font-size: 19px; } .pt small { font-size: 14px; }
  .w-badge { font-size: 13px; padding: 6px 10px; }
  .zone .zt { font-size: 11px; } .zone .zt b { font-size: 12px; }
  .w-me-cta-txt b { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .w-curtain { display: none; }
  .w-main, .candy b, .tw, .cloud, .w-cat .bob, .w-cat .shadow, .portal::after, .w-avatar-art { animation: none !important; }
  .w-hub-board { transform: none !important; }
}

.portal.p-desert { background: linear-gradient(180deg, #FFF6D6, #FFE7A8); border-color: #F2C14E; }
.portal.p-desert .pi { background: #F2C14E; }
