﻿/* Cozy Cat Café — kid-friendly, touch-first styles */
:root {
  --bg: #fff4e8;
  --card: #ffffff;
  --ink: #4a3428;
  --soft: #8a6f60;
  --line: #f1dccb;
  --orange: #ff8a3d;
  --pink: #ff6f9a;
  --mint: #3cc98a;
  --sky: #5bb8ff;
  --gold: #ffc83d;
  --shadow: 0 6px 0 rgba(150, 90, 50, .12), 0 10px 24px rgba(150, 90, 50, .12);
  font-family: Fredoka, 'Comic Sans MS', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; min-height: 100dvh; color: var(--ink); display: flex; flex-direction: column;
  background:
    radial-gradient(circle at 20px 20px, rgba(255, 138, 61, .09) 6px, transparent 7px) 0 0 / 80px 80px,
    radial-gradient(circle at 60px 60px, rgba(255, 111, 154, .08) 6px, transparent 7px) 0 0 / 80px 80px,
    linear-gradient(#fff7ee, #ffeedd) fixed; }
h1, h2 { margin: 0; font-weight: 700; }
button, input { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: #e0602a; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; max-width: 1180px; width: 100%; margin: 0 auto; }
.title { font-size: clamp(20px, 5vw, 28px); color: var(--orange); text-shadow: 0 2px 0 #fff; white-space: nowrap; }
.back { text-decoration: none; font-weight: 600; color: var(--soft); background: var(--card); border-radius: 999px; padding: 10px 14px; box-shadow: var(--shadow); min-height: 44px; display: inline-flex; align-items: center; }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow); font-size: 22px; }

/* ---------- layout ---------- */
.app { width: 100%; max-width: 1180px; margin: 0 auto; padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 14px; }
.stage { position: relative; overflow: hidden; border-radius: 28px; box-shadow: var(--shadow); min-height: 380px; height: 62dvh; max-height: 680px;
  display: flex; flex-direction: column; align-items: center; padding: 14px 12px 70px;
  background:
    radial-gradient(ellipse at 50% 108%, #ffd9b8 0 34%, transparent 35%),
    linear-gradient(#bfe6ff 0, #e2f4ff 40%, #ffe7cf 40.5%, #ffe7cf 100%); }
/* a little window and shelf in the café wall */
.stage::before { content: ''; position: absolute; left: 6%; top: 9%; width: 70px; height: 56px; border-radius: 12px; border: 6px solid #fff;
  background: linear-gradient(90deg, transparent 47%, #fff 47% 53%, transparent 53%), linear-gradient(#9fdcff, #d8f1ff); opacity: .8; }
.stage::after { content: '☕  🪴'; position: absolute; right: 5%; top: 11%; font-size: 26px; padding: 0 8px 4px; border-bottom: 6px solid #e8b48a; opacity: .9; }

.shop { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

@media (min-width: 820px) and (min-aspect-ratio: 1/1) {
  .app { display: grid; grid-template-columns: minmax(0, 1fr) 430px; align-items: stretch; height: calc(100dvh - 70px); min-height: 520px; }
  .stage { height: auto; max-height: none; min-height: 0; }
  .panel { overflow-y: auto; }
  .stage .big-cat { --cat: min(42vw, calc(100dvh - 300px), 480px); }
}
/* phones held sideways: cat left, shop right */
@media (orientation: landscape) and (max-height: 520px) {
  .app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 46%); height: calc(100dvh - 62px); min-height: 280px; gap: 10px; }
  .stage { height: auto; min-height: 0; padding: 8px 10px 56px; }
  .stage .big-cat { --cat: max(120px, calc(100dvh - 236px)); }
  .counter { padding: 2px 16px 4px; }
  .cat-name { font-size: 16px; }
  .buddy { width: 38px; height: 38px; font-size: 19px; }
  .panel { overflow-y: auto; }
  .fish-count { font-size: 30px !important; }
  .top { padding: 4px 12px; }
  .back, .icon-btn { min-height: 40px; height: 40px; }
  .icon-btn { width: 40px; }
}

/* ---------- counter ---------- */
.counter { position: relative; z-index: 2; text-align: center; background: rgba(255, 255, 255, .85); border-radius: 22px; padding: 6px 20px 8px; box-shadow: 0 4px 0 rgba(150, 90, 50, .1); }
.fish-count { font-size: clamp(30px, 8vw, 46px); font-weight: 700; line-height: 1.1; display: flex; align-items: center; gap: 6px; justify-content: center; color: #2f7fd1; }
.fish-icon { display: inline-block; font-size: 1.45em; line-height: 1; animation: wiggle 2.4s ease-in-out infinite; }
.rate { color: var(--soft); font-size: 15px; font-weight: 500; }
.rate b { color: var(--mint); }

/* ---------- the big cat ---------- */
.cat-spot { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; z-index: 1; }
.big-cat { --cat: min(80vw, calc(62dvh - 196px), 420px); border: 0; background: none; padding: 0; width: var(--cat); height: calc(var(--cat) * 1.05); min-width: 120px; min-height: 126px; display: grid; place-items: center; border-radius: 40px; }
.big-cat svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 0 rgba(120, 70, 40, .12)); animation: breathe 3s ease-in-out infinite; transform-origin: 50% 95%; }
.big-cat:focus-visible { outline: 4px dashed var(--sky); outline-offset: 4px; }
.big-cat.squish svg { animation: squish .3s ease-out; }
.big-cat .tail { transform-origin: 148px 168px; animation: tail 1.6s ease-in-out infinite; }
.big-cat .eyes { transform-origin: 100px 84px; animation: blink 5s infinite; }
.big-cat .happy-eyes { opacity: 0; }
.big-cat.happy .eyes { opacity: 0; }
.big-cat.happy .happy-eyes { opacity: 1; }
.swatch .tail, .swatch .happy-eyes { animation: none; }
.swatch .happy-eyes { opacity: 0; }

.tap-hint { position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); background: var(--pink); color: #fff; font-weight: 600; padding: 6px 14px; border-radius: 999px; animation: bounce 1.2s ease-in-out infinite; pointer-events: none; white-space: nowrap; }
.tap-hint.gone { display: none; }
.cat-name { position: relative; z-index: 2; font-weight: 700; font-size: 20px; background: #fff; padding: 2px 16px 4px; border-radius: 999px; box-shadow: 0 3px 0 rgba(150, 90, 50, .12); }

@keyframes breathe { 50% { transform: scale(1.02, .985); } }
@keyframes squish { 0% { transform: scale(1); } 35% { transform: scale(1.1, .88); } 70% { transform: scale(.96, 1.05); } 100% { transform: scale(1); } }
@keyframes tail { 50% { transform: rotate(14deg); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes bounce { 50% { transform: translate(-50%, -6px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }

/* helper cats hanging out at the bottom of the café */
.crew { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0 10px; z-index: 2; }
.buddy { position: relative; width: 44px; height: 44px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 22px; box-shadow: 0 3px 0 rgba(150, 90, 50, .15); animation: bob 2.2s ease-in-out infinite; }
.buddy i { position: absolute; right: -6px; top: -6px; font-style: normal; font-size: 11px; font-weight: 700; background: var(--orange); color: #fff; border-radius: 999px; padding: 1px 6px; min-width: 20px; text-align: center; }
@keyframes bob { 50% { transform: translateY(-5px); } }

/* "+5 🐟" pop-ups */
.floaters { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.floater { position: absolute; transform: translate(-50%, -50%); font-weight: 700; font-size: 24px; color: #ff7a1a; white-space: nowrap;
  text-shadow: 0 2px 0 #fff, 0 -2px 0 #fff, 2px 0 0 #fff, -2px 0 0 #fff; animation: rise 1.1s ease-out forwards; }
.floater.heart { font-size: 26px; }
.floater.big { font-size: 30px; color: var(--mint); }
.fi { font-style: normal; display: inline-block; line-height: 1; }
.floater .fi { font-size: 1.7em; vertical-align: -.2em; margin-left: 2px; text-shadow: none; filter: drop-shadow(0 2px 0 #fff) drop-shadow(0 -1px 0 #fff); }
.price .pr { display: inline-flex; align-items: center; gap: 3px; }
.price .fi { font-size: 1.45em; }
@keyframes rise { to { transform: translate(calc(-50% + var(--dx, 0px)), -150%); opacity: 0; } }

/* lucky fish swimming across */
.golden { position: absolute; left: -120px; z-index: 6; border: 0; background: radial-gradient(circle, rgba(255, 230, 120, .9), rgba(255, 200, 60, 0) 70%); font-size: 72px; line-height: 1; width: 112px; height: 112px; border-radius: 50%; padding: 0; }
.golden.swim { animation: swim 9s linear forwards, glow .8s ease-in-out infinite alternate; }
@keyframes swim { 0% { left: -120px; transform: translateY(0); } 25% { transform: translateY(-14px); } 50% { transform: translateY(8px); } 75% { transform: translateY(-10px); } 100% { left: calc(100% + 10px); transform: translateY(0); } }
@keyframes glow { to { filter: drop-shadow(0 0 12px #ffd84d) brightness(1.15); } }

/* ---------- tabs ---------- */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px; background: #fff3e6; }
.tabs button { position: relative; border: 0; border-radius: 18px; background: transparent; min-height: 60px; font-size: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--soft); }
.tabs button span { font-size: 13px; font-weight: 600; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 3px 0 rgba(150, 90, 50, .12); }
.dot { position: absolute; top: 8px; right: calc(50% - 22px); width: 12px; height: 12px; border-radius: 50%; background: var(--pink); border: 2px solid #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.3); } }

.panel { padding: 12px; flex: 1; min-height: 0; }
.list { display: flex; flex-direction: column; gap: 10px; }
.buy-amount { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--soft); font-weight: 600; }
.buy-amount button { border: 2px solid var(--line); background: #fff; border-radius: 12px; min-width: 56px; min-height: 40px; font-weight: 700; }
.buy-amount button[aria-checked="true"] { border-color: var(--orange); background: #fff1e4; color: #d9611f; }

/* shop items */
.item { display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 10px; width: 100%; text-align: left; border: 2px solid var(--line); background: #fffaf5; border-radius: 20px; padding: 10px 12px; min-height: 76px; transition: transform .08s, border-color .15s, background .15s; }
.item.can { border-color: #9fe3c2; background: #f2fff8; }
.item.can:active { transform: scale(.98); }
.item[aria-disabled="true"] { cursor: default; }
.item-icon { position: relative; width: 56px; height: 56px; border-radius: 16px; background: #fff; display: grid; place-items: center; font-size: 30px; box-shadow: 0 3px 0 rgba(150, 90, 50, .1); }
.count { position: absolute; right: -8px; bottom: -8px; font-style: normal; font-size: 13px; font-weight: 700; background: var(--sky); color: #fff; border-radius: 999px; padding: 1px 7px; border: 2px solid #fff; }
.badge { position: absolute; right: -8px; bottom: -8px; font-style: normal; font-size: 18px; }
.item-text { min-width: 0; }
.item-text b { display: block; font-size: 17px; line-height: 1.2; }
.item-text small { display: block; color: var(--soft); font-size: 13px; line-height: 1.3; }
.item-text .makes { color: #2f9d6e; font-weight: 600; }
.price { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-weight: 700; font-size: 16px; white-space: nowrap; color: #b9a596; }
.item.can .price { color: #1f8a5a; }
.price em { font-style: normal; font-size: 11px; font-weight: 500; }
.pbar { width: 74px; height: 8px; border-radius: 999px; background: #f2e3d6; overflow: hidden; order: 2; }
.pbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--mint)); border-radius: 999px; transition: width .25s; }
.item.locked { opacity: .65; border-style: dashed; grid-template-columns: 60px 1fr; }
.empty { text-align: center; color: var(--soft); padding: 30px 10px; font-size: 17px; }

/* ---------- my cat ---------- */
.field { display: block; font-weight: 700; margin: 6px 0 8px; font-size: 16px; }
.name-row { display: flex; gap: 8px; margin-top: 6px; }
.name-row input { flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 18px; background: #fffaf5; outline: none; }
.name-row input:focus { border-color: var(--orange); }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.swatch, .outfit { border: 3px solid var(--line); border-radius: 18px; background: #fffaf5; padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 600; font-size: 14px; }
.swatch svg { width: 62px; height: 62px; }
.swatch[aria-pressed="true"], .outfit[aria-pressed="true"] { border-color: var(--orange); background: #fff1e4; }
.outfits { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 14px; }
.outfit { min-height: 92px; justify-content: center; }
.o-icon { font-size: 30px; }
.outfit small { color: var(--soft); font-size: 11px; font-weight: 500; }
.outfit:disabled { opacity: .55; cursor: default; }
.grown-up { border-top: 2px dashed var(--line); padding-top: 10px; }

/* ---------- stickers ---------- */
.sticker-note { margin: 0 0 12px; color: var(--soft); }
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.sticker { border: 2px dashed var(--line); border-radius: 18px; padding: 10px 6px; text-align: center; background: #fffaf5; }
.sticker.got { border-style: solid; border-color: #ffd98a; background: linear-gradient(#fffbe9, #fff4d1); }
.s-icon { display: block; font-size: 32px; filter: grayscale(1); opacity: .4; }
.sticker.got .s-icon { filter: none; opacity: 1; }
.sticker b { display: block; font-size: 13px; }
.sticker small { display: block; color: var(--soft); font-size: 11px; line-height: 1.25; }

/* ---------- buttons, toasts, modal ---------- */
.btn { border: 0; border-radius: 14px; padding: 10px 18px; min-height: 48px; font-weight: 700; background: #fff1e4; color: var(--ink); box-shadow: 0 3px 0 rgba(150, 90, 50, .15); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(150, 90, 50, .15); }
.btn.primary { background: linear-gradient(#ffa25c, var(--orange)); color: #fff; }
.btn.danger { background: #ff6b6b; color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--soft); text-decoration: underline; }
.btn.small { min-height: 40px; font-size: 14px; }
.btn.big { font-size: 20px; min-height: 56px; padding: 12px 32px; }

.toasts { position: fixed; bottom: calc(12px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { background: #fff; border-radius: 18px; padding: 10px 16px; font-weight: 600; font-size: 15px; border: 2px solid #ffe3c4; box-shadow: var(--shadow); text-align: center; animation: drop .3s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .4s, transform .4s; }
.toast.gold { background: linear-gradient(#fffbe9, #fff0bf); }
.toast.out { opacity: 0; transform: translateY(10px); }
@keyframes drop { from { transform: translateY(20px); opacity: 0; } }

.modal { position: fixed; inset: 0; z-index: 60; background: rgba(74, 52, 40, .45); display: grid; place-items: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 28px; padding: 24px 22px; width: min(420px, 100%); text-align: center; box-shadow: var(--shadow); animation: drop .35s cubic-bezier(.2, 1.4, .4, 1); }
.m-emoji { font-size: 56px; line-height: 1; }
.modal-box h2 { font-size: 26px; margin: 6px 0 8px; }
.modal-box p { color: var(--soft); margin: 0 0 8px; font-size: 17px; }
.m-big { font-size: 34px; font-weight: 700; color: #2f7fd1; margin: 6px 0 14px; }
.m-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

.site-footer { text-align: center; color: var(--soft); font-size: 13px; padding: 10px 16px 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .golden.swim { animation: none; left: 40%; }
}
