/* ============================================================
   Kawaii Cat Adventure — Cloudflare Pages Stylesheet
   Strict mobile design + kawaii pastel theme + modals + ad side blocks
   ============================================================ */

/* ===== STRICT TOUCH CONTROL LOCKS ===== */
* {
  touch-action: pan-x pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

/* ===== CSS RESET / BASE ===== */
:root {
  --pink: #FF6FB5;
  --pink-dark: #E6398B;
  --pink-light: #FFB3D9;
  --pink-pale: #FFE8F5;
  --peach: #FFD9C0;
  --amber: #FFD166;
  --amber-dark: #F5B842;
  --sky: #5BC0EB;
  --purple: #9B7BE0;
  --green: #7FE07F;
  --cream: #FFF5E6;
  --bg: #FFE8F0;
  --card: #FFFFFF;
  --text: #4A3A44;
  --muted: #B89AA4;
  --radius: 1rem;
  --shadow: 0 4px 0 rgba(0,0,0,0.08), 0 8px 24px rgba(255, 160, 200, 0.18);
  --btn-shadow: 0 6px 0 rgba(0,0,0,0.12), 0 9px 20px rgba(255, 130, 170, 0.25);
}

html, body {
  margin: 0;
  padding: 0;
  /* Dynamic viewport height — handles iPhone Safari address bar correctly (100dvh) */
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior: none;
  background: linear-gradient(to bottom, #FFE8F0, #FFF0E6);
  font-family: 'Comic Sans MS', 'Baloo', system-ui, -apple-system, sans-serif;
  color: var(--text);
  overflow-x: hidden;
}

/* Body = flex column → footer always sticks to bottom */
body {
  display: flex;
  flex-direction: column;
}

/* Paw print background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 158, 196, 0.12) 2px, transparent 3px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* ===== LAYOUT: Ad Left | App | Ad Right ===== */
#layout {
  display: flex;
  flex: 1 0 auto; /* grow to fill space → pushes footer to bottom */
  min-height: calc(100vh - 50px);
  min-height: calc(100dvh - 50px);
  position: relative;
  z-index: 1;
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* ===== AD SIDE BLOCKS (left + right vertical ONLY — no top/bottom) ===== */
.ad-side {
  width: 180px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  gap: 8px;
}

.ad-side.hidden {
  display: none;
}

.ad-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ad-side .adsbygoogle {
  max-width: 160px;
}

/* Hide ad side blocks on screens narrower than 1200px */
@media (max-width: 1199px) {
  .ad-side {
    display: none;
  }
}

/* ===== FOOTER (standardized — matches adventure-kids) ===== */
#footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0; /* don't compress footer — stays at bottom */
  background: rgba(255,255,255,0.95);
  border-top: 3px solid var(--pink-light);
  padding: 4px 6px;
  text-align: center;
}
#footer a { font-size: 9px; color: var(--pink-dark); opacity: 0.6; text-decoration: underline; }
#footer a:hover { color: var(--pink); opacity: 1; }
.footer-brand { font-size: 11px; font-weight: 700; margin: 1px 0; color: var(--pink); }
.footer-copyright { font-size: 8px; opacity: 0.5; margin-bottom: 2px; color: var(--pink-dark); }
.footer-links { margin: 1px 0; }

/* ===== LEGAL MODALS (standardized — matches adventure-kids) ===== */
.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.legal-modal.hidden { display: none; }
.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
.legal-modal-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 24px;
  border: 4px solid var(--pink-light);
  box-shadow: 0 8px 32px rgba(255,130,170,0.3);
  padding: 20px;
  max-width: 460px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.legal-modal-title { font-size: 22px; font-weight: 900; color: var(--pink); margin: 0 0 10px; }
.legal-modal-card p { font-size: 12px; color: var(--text); line-height: 1.5; margin: 6px 0; }
.legal-modal-card ul { font-size: 12px; color: var(--text); line-height: 1.6; padding-left: 18px; margin: 6px 0; }
.legal-modal-card li { margin: 3px 0; }
.legal-modal-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,100,130,0.15);
  border: 2px solid var(--pink-light);
  font-size: 14px;
  color: var(--pink-dark);
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.legal-modal-close:hover { background: rgba(255,100,130,0.3); }

.trademark-line {
  font-size: 11px;
  font-weight: 900;
  color: var(--pink-dark);
  margin-top: 10px;
  padding: 6px 8px;
  background: rgba(255, 224, 102, 0.2);
  border-radius: 6px;
  text-align: center;
}

.disclaimer-line {
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
  font-style: italic;
}

/* ===== COOKIE CONSENT BANNER ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to right, #FF6FB5, #E6398B);
  color: white;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 999;
  box-shadow: 0 -4px 20px rgba(255, 130, 170, 0.4);
  animation: slideUp 0.3s ease-out;
}
.cookie-banner.hidden { display: none; }
.cookie-banner-text { flex: 1; font-size: 11px; font-weight: bold; line-height: 1.4; }
.cookie-learn-link { color: #FFE066; text-decoration: underline; font-weight: 900; }
.cookie-learn-link:hover { color: white; }
.cookie-banner-buttons { display: flex; gap: 6px; flex-shrink: 0; }
.cookie-banner-buttons .kawaii-btn { padding: 6px 12px; font-size: 12px; min-height: 32px; }
.cookie-banner-buttons .btn-secondary {
  background: rgba(255,255,255,0.9);
  color: var(--pink-dark);
  box-shadow: 0 3px 0 rgba(0,0,0,0.1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ===== SCREENS ===== */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.screen.active {
  display: flex;
}

/* ===== KAWAII BUTTONS ===== */
.kawaii-btn {
  border: none;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  color: white;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: var(--btn-shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.kawaii-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(0,0,0,0.12), 0 12px 24px rgba(255, 130, 170, 0.3);
}

.kawaii-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.12), 0 4px 10px rgba(255, 130, 170, 0.2);
}

.btn-primary {
  background: linear-gradient(to bottom, var(--pink), var(--pink-dark));
}

.btn-secondary {
  background: linear-gradient(to bottom, var(--amber), var(--amber-dark));
  color: #5A3A00;
}

.btn-sky {
  background: linear-gradient(to bottom, #6Bd5EE, var(--sky));
}

.btn-purple {
  background: linear-gradient(to bottom, #AB8BF0, var(--purple));
}

.btn-green {
  background: linear-gradient(to bottom, #9FE09F, var(--green));
  color: #1A4A1A;
}

/* ===== KAWAII CARD ===== */
.kawaii-card {
  background: var(--card);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}

/* ===== CUTE SCROLLBAR ===== */
.cute-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.cute-scroll::-webkit-scrollbar-track { background: rgba(255, 200, 220, 0.25); border-radius: 8px; }
.cute-scroll::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #FF9EC4, #FF6FAE); border-radius: 8px; border: 2px solid rgba(255,255,255,0.6); }

/* ===== HOME SCREEN ===== */
.home-title {
  font-size: clamp(28px, 7vw, 52px);
  font-weight: 900;
  color: var(--pink);
  text-shadow: 0 2px 0 rgba(255,255,255,0.6), 0 3px 8px rgba(255, 130, 170, 0.3);
  text-align: center;
  margin: 0;
  line-height: 1.1;
}

.home-subtitle {
  font-size: clamp(20px, 5vw, 36px);
  font-weight: 900;
  color: var(--amber-dark);
  text-shadow: 0 2px 0 rgba(255,255,255,0.6);
  text-align: center;
  margin: 0 0 4px;
}

.home-tagline {
  font-size: 12px;
  color: var(--pink-dark);
  font-weight: bold;
  text-align: center;
  margin: 8px 0;
}

.home-cat-canvas {
  width: 180px;
  height: 180px;
  display: block;
}

.home-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 380px;
  margin: 16px 0;
}

.home-buttons .full-width {
  grid-column: 1 / -1;
}

.status-badge {
  background: rgba(255,255,255,0.85);
  border-radius: 999px;
  padding: 6px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: bold;
  font-size: 14px;
  color: var(--amber-dark);
  box-shadow: var(--shadow);
  margin: 4px 0;
}

.status-badge .sep { color: var(--pink-light); }
.status-badge .lvl { color: var(--pink-dark); }

/* Remove ads button in home */
.remove-ads-btn {
  width: 100%;
  max-width: 380px;
  margin-top: 8px;
  background: linear-gradient(to bottom, #FFD166, #FFB347);
  color: #5A3A00;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 3px solid white;
  box-shadow: var(--btn-shadow);
  cursor: pointer;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s;
}

.remove-ads-btn:hover { transform: translateY(-2px); }
.remove-ads-btn:active { transform: translateY(2px); }

.remove-ads-btn.paid {
  background: linear-gradient(to bottom, #7FE07F, #5BC05B);
  color: white;
}

/* ===== LEVEL MAP SCREEN ===== */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
}

.screen-header h2 {
  font-size: 22px;
  font-weight: 900;
  color: var(--pink);
  margin: 0;
  text-shadow: 0 2px 0 rgba(255,255,255,0.6);
}

.back-btn {
  background: white;
  color: var(--pink);
  font-weight: bold;
  border: none;
  border-radius: 12px;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-family: inherit;
  font-size: 14px;
  transition: transform 0.1s;
}

.back-btn:hover { transform: translateY(-1px); }
.back-btn:active { transform: translateY(1px); }

.world-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  width: 100%;
  margin-bottom: 10px;
}

.world-tab {
  flex-shrink: 0;
  border-radius: 14px;
  padding: 8px 10px;
  text-align: center;
  min-width: 80px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-weight: bold;
  font-size: 11px;
  transition: all 0.15s;
}

.world-tab.active {
  background: linear-gradient(to bottom, var(--pink), var(--pink-dark));
  color: white;
  transform: scale(1.05);
  box-shadow: var(--btn-shadow);
}

.world-tab.unlocked {
  background: white;
  color: var(--pink);
}

.world-tab.locked {
  background: rgba(200, 200, 200, 0.5);
  color: #999;
  cursor: not-allowed;
}

.world-banner {
  border-radius: calc(var(--radius) + 8px);
  padding: 14px;
  margin-bottom: 12px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  width: 100%;
}

.world-banner h3 {
  font-size: 22px;
  font-weight: 900;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.world-banner p {
  font-size: 12px;
  font-weight: bold;
  margin: 4px 0 0;
  opacity: 0.9;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: 100%;
}

@media (max-width: 400px) {
  .level-grid { grid-template-columns: repeat(3, 1fr); }
}

.level-btn {
  position: relative;
  border-radius: var(--radius);
  padding: 10px 6px;
  text-align: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
  background: white;
  box-shadow: var(--shadow);
  transition: transform 0.1s;
}

.level-btn:hover { transform: translateY(-2px); }
.level-btn:active { transform: translateY(2px); }

.level-btn.locked {
  background: rgba(200, 200, 200, 0.5);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

.level-btn .lvl-label {
  font-size: 10px;
  font-weight: bold;
  color: var(--pink-light);
}

.level-btn .lvl-num {
  font-size: 24px;
  font-weight: 900;
  color: var(--pink);
}

.level-btn .lvl-name {
  font-size: 9px;
  color: #999;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-btn .lvl-stars {
  display: flex;
  justify-content: center;
  gap: 1px;
  margin-top: 4px;
  font-size: 12px;
}

.level-btn .lvl-stars .star-off { opacity: 0.2; }

.level-btn .special-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 14px;
}

/* ===== GAME / PLAYING SCREEN ===== */
/* Playing screen fills entire viewport — no padding, no max-width, no footer */
.screen.active:has(.game-container) {
  padding: 0;
  max-width: none;
  width: 100%;
  min-height: 100dvh;
}

.game-container {
  position: relative;
  width: 100%;
  flex: 1;
  overflow: hidden;
  border-radius: var(--radius);
  /* Fill available height — uses dynamic viewport for iPhone Safari */
  min-height: calc(100dvh - 80px);
}

.game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  border-radius: var(--radius);
}

/* Fallback for browsers without :has() — apply directly to playing screen */
body.game-active #app {
  min-height: 100dvh;
}
body.game-active .screen.active {
  padding: 0;
  max-width: none;
  width: 100%;
  min-height: 100dvh;
}
body.game-active .game-container {
  min-height: 100dvh;
}

/* HUD overlay */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px;
  pointer-events: none;
  z-index: 5;
}

.hud-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.hud-card {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 6px 10px;
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.hud-hearts {
  display: flex;
  gap: 2px;
  font-size: 16px;
  line-height: 1;
}

.hud-hearts .heart-off { opacity: 0.25; filter: grayscale(1); }

.hud-level-info {
  font-size: 10px;
  font-weight: bold;
  color: var(--pink-dark);
  margin-top: 2px;
}

.hud-center {
  flex: 1;
  max-width: 280px;
}

.hud-progress-bar {
  height: 10px;
  background: var(--pink-pale);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.hud-progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--pink), var(--amber));
  border-radius: 999px;
  transition: width 0.15s;
}

.hud-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: bold;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.hud-mission {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: bold;
  color: var(--pink-dark);
  margin-top: 3px;
}

.hud-mission .mission-progress {
  margin-left: auto;
  color: var(--amber-dark);
}

.hud-pause-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  flex-shrink: 0;
}

.hud-row-2 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.hud-pill {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: bold;
  box-shadow: var(--shadow);
}

.hud-pill.score { color: var(--amber-dark); }
.hud-pill.collected { color: var(--pink-dark); }
.hud-pill.hidden-found {
  background: var(--amber);
  color: white;
  animation: pop 0.4s ease-out;
}

.hud-zoomie {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hud-zoomie-bar {
  width: 60px;
  height: 8px;
  background: rgba(255,200,220,0.5);
  border-radius: 999px;
  overflow: hidden;
}

.hud-zoomie-fill {
  height: 100%;
  background: linear-gradient(to right, var(--purple), var(--pink), var(--amber));
  border-radius: 999px;
  transition: width 0.2s;
}

.hud-zoomie-fill.active {
  animation: pulse-soft 0.8s ease-in-out infinite;
}

.hud-powerups {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.hud-powerup {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: bold;
  color: var(--pink-dark);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 3px;
}

.hud-special-banner {
  margin: 4px auto 0;
  max-width: 280px;
  background: linear-gradient(to right, var(--pink), var(--amber), var(--purple));
  color: white;
  font-weight: 900;
  text-align: center;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  box-shadow: var(--shadow);
  animation: pop 0.4s ease-out;
}

.hud-controls-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  color: rgba(255,255,255,0.8);
  font-size: 10px;
  font-weight: bold;
  border-radius: 999px;
  padding: 3px 10px;
  pointer-events: none;
  white-space: nowrap;
}

/* Pause overlay */
.pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.pause-sheet {
  background: white;
  border-radius: calc(var(--radius) + 8px);
  padding: 24px;
  text-align: center;
  max-width: 300px;
  width: 90%;
  box-shadow: var(--shadow);
  animation: bounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pause-sheet h3 {
  font-size: 28px;
  font-weight: 900;
  color: var(--pink);
  margin: 0 0 4px;
}

.pause-sheet p {
  font-size: 13px;
  color: #999;
  margin: 0 0 16px;
}

.pause-sheet button {
  width: 100%;
  margin-bottom: 8px;
}

/* ===== LEVEL COMPLETE / GAME OVER ===== */
.result-sheet {
  background: white;
  border-radius: calc(var(--radius) + 8px);
  padding: 24px 20px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow);
  animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.result-sheet .confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.result-sheet h2 {
  font-size: 28px;
  font-weight: 900;
  color: var(--pink);
  margin: 0 0 4px;
  position: relative;
}

.result-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0;
  position: relative;
}

.result-star {
  font-size: 48px;
  transition: all 0.3s;
}

.result-star.off {
  opacity: 0.2;
  transform: scale(0.7);
}

.result-star.on {
  animation: pop 0.4s ease-out;
}

.result-breakdown {
  background: var(--pink-pale);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
  text-align: left;
  font-size: 13px;
  font-weight: bold;
  color: var(--pink-dark);
  position: relative;
}

.result-breakdown .row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
}

.result-breakdown .row .val {
  margin-left: auto;
}

.result-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.result-buttons .row-2 {
  display: flex;
  gap: 8px;
}

.result-buttons .row-2 button {
  flex: 1;
}

/* ===== COLLECTION SCREEN ===== */
.collection-section {
  width: 100%;
  margin-bottom: 16px;
}

.collection-section h3 {
  font-size: 16px;
  font-weight: 900;
  color: var(--pink);
  margin: 0 0 8px;
}

.collection-stats {
  display: flex;
  justify-content: space-around;
  background: rgba(255,255,255,0.8);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.collection-stat .num {
  font-size: 20px;
  font-weight: 900;
}

.collection-stat .lbl {
  font-size: 10px;
  font-weight: bold;
  color: var(--pink-dark);
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

@media (max-width: 400px) {
  .collection-grid { grid-template-columns: repeat(3, 1fr); }
}

.collection-item {
  border-radius: var(--radius);
  padding: 8px;
  text-align: center;
  background: white;
  box-shadow: var(--shadow);
}

.collection-item.locked {
  background: rgba(200, 200, 200, 0.5);
  opacity: 0.6;
  box-shadow: none;
}

.collection-item .emoji { font-size: 24px; }
.collection-item .name { font-size: 9px; font-weight: bold; color: var(--pink-dark); }
.collection-item .count { font-size: 12px; font-weight: 900; color: var(--amber-dark); }

/* ===== MY CAT SCREEN ===== */
.cat-room-canvas {
  width: 100%;
  height: 240px;
  display: block;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.cat-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.cat-option {
  border-radius: var(--radius);
  padding: 8px;
  text-align: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
  background: rgba(255, 232, 245, 0.6);
  transition: all 0.15s;
}

.cat-option.selected {
  border: 3px solid var(--pink);
  background: var(--pink-pale);
  transform: scale(1.05);
}

.cat-option.locked { opacity: 0.5; cursor: not-allowed; }

.cat-color-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin: 0 auto 4px;
  border: 3px solid;
}

/* ===== SETTINGS SCREEN ===== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--pink-pale);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 8px;
}

.toggle-row .info { display: flex; align-items: center; gap: 10px; }
.toggle-row .icon { font-size: 20px; }
.toggle-row .label { font-weight: 900; color: var(--pink-dark); }
.toggle-row .desc { font-size: 10px; color: var(--pink); font-weight: bold; }

.toggle-switch {
  width: 50px;
  height: 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  background: #ccc;
}

.toggle-switch.on {
  background: linear-gradient(to right, var(--pink), var(--amber));
}

.toggle-switch .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  transition: left 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.on .knob { left: 25px; }

.settings-help {
  background: white;
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
  box-shadow: var(--shadow);
}

.settings-help h3 {
  font-size: 16px;
  font-weight: 900;
  color: var(--pink);
  margin: 0 0 8px;
}

.settings-help .help-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: bold;
  color: var(--pink-dark);
  margin: 6px 0;
}

.settings-tip {
  margin-top: 10px;
  background: var(--pink-pale);
  border-radius: var(--radius);
  padding: 8px;
  font-size: 11px;
  font-weight: bold;
  color: var(--pink-dark);
  text-align: center;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden { display: none; }

.modal-sheet {
  background: white;
  border-radius: calc(var(--radius) + 8px);
  padding: 20px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow);
  animation: bounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-large {
  max-width: 500px;
}

.modal-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.modal-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--pink);
  margin: 0 0 8px;
}

.modal-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 16px;
}

.modal-scroll {
  max-height: 300px;
  overflow-y: auto;
  text-align: left;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 8px;
  background: var(--pink-pale);
  border-radius: var(--radius);
}

.modal-scroll h3 {
  font-size: 14px;
  font-weight: 900;
  color: var(--pink-dark);
  margin: 12px 0 4px;
}

.modal-scroll h3:first-child { margin-top: 0; }

.modal-scroll p { margin: 4px 0; color: var(--text); }

.modal-scroll ul { margin: 4px 0; padding-left: 18px; }
.modal-scroll li { margin: 2px 0; color: var(--text); }

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-buttons button { width: 100%; }

.modal-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 10px;
}

/* Price tag in ads modal */
.price-tag {
  font-size: 32px;
  font-weight: 900;
  color: var(--pink-dark);
  margin: 12px 0;
}

.price-once {
  font-size: 12px;
  font-weight: bold;
  color: var(--muted);
}

#google-signin-container {
  margin: 12px 0;
  display: flex;
  justify-content: center;
}

.kawaii-input {
  width: 100%;
  padding: 10px 14px;
  border: 3px solid var(--pink-light);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 8px;
  outline: none;
  -webkit-appearance: none;
  background: white;
  color: var(--text);
}

.kawaii-input:focus { border-color: var(--pink); }

/* ===== ANIMATIONS ===== */
@keyframes pop {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes bounceIn {
  0% { transform: translateY(40px) scale(0.9); opacity: 0; }
  60% { transform: translateY(-8px) scale(1.03); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes pulse-soft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.anim-float { animation: float 3s ease-in-out infinite; }
.anim-sparkle { animation: sparkle 2s ease-in-out infinite; }
.anim-wiggle { animation: wiggle 2.5s ease-in-out infinite; }
.anim-pop { animation: pop 0.4s ease-out; }
.anim-bounce-in { animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ===== LOADING SCREEN ===== */
#loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
}

.loading-cat {
  font-size: 64px;
  animation: wiggle 1.5s ease-in-out infinite;
}

#loading-screen p {
  color: var(--pink);
  font-weight: bold;
  font-size: 14px;
}

/* ===== UTILITY ===== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* ===== AFFILIATE POPUP (closable, appears during gameplay) ===== */
.affiliate-popup {
  position: fixed;
  bottom: 60px;
  right: 12px;
  z-index: 800;
  background: white;
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  max-width: 280px;
  width: calc(100% - 24px);
  animation: slideInRight 0.3s ease-out;
  border: 3px solid var(--pink-light);
  overflow: hidden;
}

.affiliate-popup.hidden { display: none; }

.affiliate-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 100, 130, 0.9);
  color: white;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.affiliate-close:hover { background: var(--pink-dark); }

.affiliate-content {
  padding: 10px 12px 12px;
}

.affiliate-content .aff-title {
  font-size: 12px;
  font-weight: 900;
  color: var(--pink-dark);
  margin: 0 0 6px;
}

.affiliate-content .aff-desc {
  font-size: 10px;
  color: #888;
  margin: 0 0 8px;
  line-height: 1.4;
}

.affiliate-content .aff-btn {
  display: block;
  width: 100%;
  background: linear-gradient(to bottom, var(--pink), var(--pink-dark));
  color: white;
  text-align: center;
  padding: 8px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  transition: transform 0.1s;
}

.affiliate-content .aff-btn:hover { transform: scale(1.02); }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== TOP-RIGHT REMOVE ADS BUTTON (home screen) ===== */
.remove-ads-topright {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 50;
  background: linear-gradient(to bottom, #FFD166, #FFB347);
  color: #5A3A00;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid white;
  box-shadow: 0 3px 0 rgba(0,0,0,0.12), 0 5px 14px rgba(255, 130, 170, 0.25);
  cursor: pointer;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.12s;
  font-family: inherit;
}

.remove-ads-topright:hover { transform: translateY(-1px); }
.remove-ads-topright:active { transform: translateY(2px); }

.remove-ads-topright.paid {
  background: linear-gradient(to bottom, #7FE07F, #5BC05B);
  color: white;
}

/* ===== PLAYER NAME + SCORE CARD ===== */
.player-card {
  background: rgba(255,255,255,0.9);
  border-radius: 14px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 12px;
  font-weight: bold;
}

.player-card .player-icon { font-size: 20px; }

.player-card .player-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.player-card .player-name {
  font-size: 13px;
  font-weight: 900;
  color: var(--pink-dark);
}

.player-card .player-score {
  font-size: 10px;
  color: var(--amber-dark);
}

.player-name-input {
  width: 100%;
  padding: 8px 12px;
  border: 3px solid var(--pink-light);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  margin: 4px 0 8px;
  outline: none;
  background: white;
  color: var(--text);
  text-align: center;
}

.player-name-input:focus { border-color: var(--pink); }

/* ===== VOLUME SLIDER ===== */
.volume-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--pink-pale);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 8px;
}

.volume-row .info { display: flex; align-items: center; gap: 10px; }
.volume-row .icon { font-size: 20px; }
.volume-row .label { font-weight: 900; color: var(--pink-dark); }
.volume-row .desc { font-size: 10px; color: var(--pink); font-weight: bold; }

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--pink-light), var(--pink));
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--pink);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--pink);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ===== HIGH SCORE BADGE (level complete) ===== */
.highscore-badge {
  background: linear-gradient(to right, #FFE066, #FFB347);
  color: #5A3A00;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 10px;
}

.highscore-badge.new-best {
  background: linear-gradient(to right, #FF6FB5, #E6398B);
  color: white;
  animation: pop 0.5s ease-out;
}

/* ===== AUTH TABS + FORMS (Register / Login / Payment) ===== */
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: var(--pink-pale);
  border-radius: 12px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--pink-dark);
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s;
}

.auth-tab.active {
  background: linear-gradient(to bottom, var(--pink), var(--pink-dark));
  color: white;
  box-shadow: 0 2px 6px rgba(255, 130, 170, 0.3);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-panel.hidden {
  display: none;
}

.auth-divider {
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  color: var(--muted);
  margin: 4px 0;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: var(--pink-light);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ===== AUTH UI EXTRAS (subtabs, PIN display, modal close) ===== */
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 100, 130, 0.15);
  color: var(--pink-dark);
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
}

.modal-close:hover {
  background: rgba(255, 100, 130, 0.3);
}

/* Login sub-tabs (Username vs PIN) */
.auth-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  background: var(--pink-pale);
  border-radius: 10px;
  padding: 3px;
}

.auth-subtab {
  flex: 1;
  padding: 7px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--pink-dark);
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s;
}

.auth-subtab.active {
  background: white;
  color: var(--pink-dark);
  box-shadow: 0 2px 4px rgba(255, 130, 170, 0.2);
}

.auth-subpanel.hidden {
  display: none;
}

.auth-help {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin: 4px 0 6px;
  font-weight: bold;
}

.auth-pin-input {
  text-align: center;
  font-size: 24px !important;
  letter-spacing: 8px;
  font-family: monospace;
  font-weight: 900;
}

/* Auth switch link (toggle between login/register) */
.auth-switch {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  font-weight: bold;
}

.auth-link {
  color: var(--pink-dark);
  text-decoration: none;
  font-weight: 900;
}

.auth-link:hover {
  text-decoration: underline;
}

/* Auth error message */
.auth-error {
  background: rgba(255, 100, 100, 0.1);
  color: #c0392b;
  font-size: 11px;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 8px;
  margin-top: 6px;
  text-align: center;
}

.auth-error.hidden {
  display: none;
}

/* PIN display (after successful registration) */
.pin-display {
  margin-top: 14px;
  padding: 14px;
  background: linear-gradient(to bottom, #d1fae5, #a7f3d0);
  border-radius: 14px;
  text-align: center;
  border: 2px solid #6ee7b7;
}

.pin-display.hidden {
  display: none;
}

.pin-display-label {
  font-size: 12px;
  color: #065f46;
  font-weight: bold;
  margin: 0 0 6px;
}

.pin-value {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 8px;
  color: #047857;
  font-family: monospace;
  margin: 4px 0;
}

.pin-display-help {
  font-size: 10px;
  color: #065f46;
  margin: 4px 0 8px;
  font-weight: bold;
}

/* ===== SPINNER (loading indicator in buttons) ===== */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== TERMS & CONSENT MODAL ===== */
.terms-scroll {
  max-height: 260px;
  overflow-y: auto;
  background: var(--pink-pale);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 8px 0 12px;
  text-align: left;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text);
}
.terms-scroll h3 {
  font-size: 14px;
  font-weight: 900;
  color: var(--pink-dark);
  margin: 0 0 6px;
}
.terms-scroll p { margin: 5px 0; }

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--pink-pale);
  border-radius: var(--radius);
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  color: var(--pink-dark);
  line-height: 1.4;
  text-align: left;
}
.consent-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--pink);
  cursor: pointer;
  margin-top: 1px;
}
#pay-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ===== TODO LIST SCREEN ===== */
.todo-list {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.todo-item {
  background: white;
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transition: opacity 0.2s;
}
.todo-item.done { opacity: 0.5; }
.todo-item.done .todo-title { text-decoration: line-through; }
.todo-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 3px solid var(--pink-light);
  background: white;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--pink);
}
.todo-item.done .todo-check { background: var(--pink); border-color: var(--pink); color: white; }
.todo-body { flex: 1; min-width: 0; }
.todo-title { font-size: 14px; font-weight: 900; color: var(--pink-dark); word-wrap: break-word; }
.todo-datetime { font-size: 10px; color: var(--muted); font-weight: bold; margin-top: 2px; }
.todo-notes {
  font-size: 11px;
  color: var(--text);
  margin-top: 4px;
  padding: 6px 8px;
  background: var(--pink-pale);
  border-radius: 8px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.todo-actions { display: flex; gap: 4px; flex-shrink: 0; }
.todo-icon-btn {
  width: 28px; height: 28px;
  border: none;
  border-radius: 8px;
  background: var(--pink-pale);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.todo-icon-btn:hover { background: var(--pink-light); }
.todo-form {
  background: white;
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 500px;
  margin-bottom: 12px;
}
.todo-form-row { display: flex; gap: 8px; }
.todo-form-row > * { flex: 1; }
.todo-empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: bold;
}

/* ===== PET DASHBOARD SCREEN ===== */
.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  width: 100%;
}
.pet-card {
  background: white;
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
}
.pet-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 6px;
  display: block;
  border: 4px solid var(--pink-light);
  background: var(--pink-pale);
}
.pet-photo-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  border: 4px solid var(--pink-light);
  background: var(--pink-pale);
}
.pet-name { font-size: 15px; font-weight: 900; color: var(--pink-dark); }
.pet-age { font-size: 11px; color: var(--amber-dark); font-weight: bold; margin-top: 2px; }
.pet-info { font-size: 10px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.pet-actions { display: flex; gap: 4px; margin-top: 8px; }
.pet-action-btn {
  flex: 1;
  padding: 5px;
  border: none;
  border-radius: 8px;
  background: var(--pink-pale);
  color: var(--pink-dark);
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}
.pet-action-btn:hover { background: var(--pink-light); }
.pet-action-btn.danger { background: rgba(255,100,100,0.15); color: #c0392b; }

.pet-detail-card {
  background: white;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 500px;
}
.pet-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.pet-detail-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--pink-light);
}
.pet-detail-info { flex: 1; }
.pet-detail-info h3 { font-size: 18px; font-weight: 900; color: var(--pink-dark); margin: 0; }
.pet-detail-info p { font-size: 11px; color: var(--muted); margin: 2px 0; }

.pet-section { margin-bottom: 14px; }
.pet-section h4 {
  font-size: 13px;
  font-weight: 900;
  color: var(--pink);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pet-record {
  background: var(--pink-pale);
  border-radius: 8px;
  padding: 6px 8px;
  margin: 4px 0;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pet-record .rec-label { font-weight: bold; color: var(--pink-dark); }
.pet-record .rec-val { color: var(--text); }
.pet-record .rec-del { margin-left: auto; cursor: pointer; color: #c0392b; font-weight: bold; }

.pet-add-btn {
  width: 100%;
  padding: 8px;
  border: 2px dashed var(--pink-light);
  border-radius: var(--radius);
  background: transparent;
  color: var(--pink);
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 6px;
}
.pet-add-btn:hover { background: var(--pink-pale); }

.pet-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.pet-input-group label {
  font-size: 11px;
  font-weight: bold;
  color: var(--pink-dark);
  text-align: left;
}
.pet-input-group input,
.pet-input-group textarea,
.pet-input-group select {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid var(--pink-light);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  background: white;
  color: var(--text);
}
.pet-input-group input:focus,
.pet-input-group textarea:focus { border-color: var(--pink); }
.pet-input-group textarea { resize: vertical; min-height: 50px; }
.pet-input-row { display: flex; gap: 8px; }
.pet-input-row > * { flex: 1; }

.file-upload-btn {
  display: inline-block;
  padding: 8px 14px;
  background: var(--pink-pale);
  border: 2px solid var(--pink-light);
  border-radius: 10px;
  color: var(--pink-dark);
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}
.file-upload-btn:hover { background: var(--pink-light); }
.file-upload-btn input[type="file"] { display: none; }

/* ===== RESPONSIVE: ensure all viewport sizes work ===== */
@media (max-width: 480px) {
  .pet-grid { grid-template-columns: 1fr; }
  .todo-form-row { flex-direction: column; }
  .modal-sheet { padding: 16px 14px; }
  .terms-scroll { max-height: 200px; }
}
@media (min-width: 481px) and (max-width: 768px) {
  .pet-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 769px) {
  .pet-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* ===== HIDE FOOTER + COOKIE BANNER DURING GAMEPLAY ===== */
body.game-active #footer,
body.game-active #cookieBanner,
body.game-active .cookie-banner {
  display: none !important;
}

/* ===== iPHONE SE / SAFARI SAFE AREA SUPPORT ===== */
/* Respect notch + home indicator on modern iPhones */
@supports (padding: env(safe-area-inset-top)) {
  body.game-active .screen.active {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .hud {
    padding-top: calc(8px + env(safe-area-inset-top)) !important;
  }
  .hud-controls-hint {
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
  }
}

/* ===== iPHONE SE (375×667) SPECIFIC TUNING ===== */
@media (max-width: 380px) and (max-height: 670px) {
  .home-title { font-size: 28px !important; }
  .home-subtitle { font-size: 18px !important; }
  .home-cat-canvas { width: 140px !important; height: 140px !important; }
  .home-buttons { gap: 6px !important; }
  .kawaii-btn { padding: 10px 14px !important; font-size: 14px !important; }
  .player-card { padding: 6px 10px !important; }
  .status-badge { font-size: 12px !important; padding: 4px 12px !important; }
  .remove-ads-topright { font-size: 9px !important; padding: 4px 10px !important; }
  .hud-card { padding: 4px 8px !important; }
  .hud-pill { font-size: 10px !important; padding: 3px 8px !important; }
  .game-container { min-height: calc(100dvh - 60px) !important; }
}
