/* ================================================================
   Nakrm mlsné zvířátko — style.css  (v2)
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --pink:        #FFB3C6;
  --pink-dark:   #FF8FA3;
  --green:       #B5EAD7;
  --green-dark:  #6DCBA8;
  --purple:      #C9B8FF;
  --purple-dark: #9B84FF;
  --yellow:      #FFD166;
  --orange:      #FF9F43;
  --bg:          #FDF7FF;
  --text:        #3D3050;
  --radius:      22px;
  --shadow:      0 6px 24px rgba(120,80,160,.12);
}

html { font-size: 16px; }

/* Pohádkové pozadí — hvězdičky + měkký gradient */
body {
  font-family: "Nunito", "Varela Round", "Arial Rounded MT Bold", Arial, sans-serif;
  background: linear-gradient(160deg, #FFF9F5 0%, #F5F0FF 50%, #F0F9FF 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,200,230,.55) 1.2px, transparent 1.2px),
    radial-gradient(circle, rgba(200,210,255,.5)  1.2px, transparent 1.2px),
    radial-gradient(circle, rgba(180,240,220,.45) 1px,   transparent 1px);
  background-size: 38px 38px, 61px 61px, 47px 47px;
  background-position: 0 0, 19px 31px, 9px 14px;
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* ================================================================
   SCREENS
   ================================================================ */
.screen { display: none; flex-direction: column; align-items: center; min-height: 100vh; }
.screen.active { display: flex; }

#screen-game.active {
  height: 100dvh;
  max-height: 100dvh;
  min-height: unset;
  overflow: hidden;
}

/* ================================================================
   SCREEN 1 — výběr postavičky
   ================================================================ */
.game-title {
  font-size: clamp(1.7rem, 5.5vw, 2.9rem);
  color: #FF6B9D;
  text-align: center;
  padding: 1.8rem 1rem .4rem;
  text-shadow: 3px 3px 0 #FFD6E7, 0 0 30px rgba(255,107,157,.2);
  letter-spacing: -.3px;
}
.subtitle {
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: #AA90AA;
  text-align: center;
  margin-bottom: 1.8rem;
}

.character-grid {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 1rem 1.4rem;
}

/* Karty postav — každá má svou barvu */
.character-card {
  border: 3px solid transparent;
  border-radius: 28px;
  padding: 1.4rem 1.2rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  min-width: 155px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  font: inherit; color: inherit;
  position: relative; overflow: hidden;
}
[data-char="cat"]     { background: linear-gradient(145deg, #FFF5F8 0%, #FFE8F0 100%); }
[data-char="trex"]    { background: linear-gradient(145deg, #F2FFF8 0%, #E4FAF0 100%); }
[data-char="monster"] { background: linear-gradient(145deg, #F8F4FF 0%, #EDE6FF 100%); }

[data-char="cat"]:hover,     [data-char="cat"]:focus-visible     { border-color: #FF8FA3; box-shadow: 0 14px 34px rgba(255,143,163,.35); transform: translateY(-9px) scale(1.04); outline:none; }
[data-char="trex"]:hover,    [data-char="trex"]:focus-visible    { border-color: #6DCBA8; box-shadow: 0 14px 34px rgba(109,203,168,.35); transform: translateY(-9px) scale(1.04); outline:none; }
[data-char="monster"]:hover, [data-char="monster"]:focus-visible { border-color: #9B84FF; box-shadow: 0 14px 34px rgba(155,132,255,.35); transform: translateY(-9px) scale(1.04); outline:none; }
.character-card:active { transform: translateY(-4px) scale(1.01); }

/* ── Tlačítko pro instalaci PWA ── */
.install-btn {
  margin: 0.5rem auto 1.5rem;
  padding: 0.5rem 1.4rem 0.5rem 0.8rem;
  background: rgba(255, 255, 255, 0.85);
  border: 3px solid #FFD6E0;
  border-radius: 30px;
  color: #C02860;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(200, 60, 100, 0.15);
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.install-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.install-btn:hover {
  transform: translateY(-2px) scale(1.02);
  background: white;
  box-shadow: 0 6px 18px rgba(200, 60, 100, 0.25);
  border-color: #FFB3C6;
}
.install-btn:active {
  transform: translateY(0) scale(1);
}

/* ── Lovná zóna myšiček (výběrová obrazovka) ── */
/* ── Výběr obtížnosti ── */
.difficulty-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 1rem 1.6rem;
}

.diff-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  min-width: 110px;
  padding: .9rem 1.4rem;
  border: 3px solid transparent;
  border-radius: 22px;
  background: rgba(255,255,255,.75);
  cursor: pointer;
  font: inherit;
  box-shadow: 0 4px 14px rgba(120,80,160,.1);
  transition: transform .18s, box-shadow .18s, border-color .18s, background .18s;
}
.diff-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 10px 24px rgba(120,80,160,.2);
}
.diff-btn:active { transform: translateY(-2px) scale(1.02); }

.diff-range {
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  font-weight: 900;
  line-height: 1;
}
.diff-label {
  font-size: clamp(.75rem, 2.5vw, .9rem);
  font-weight: 700;
  color: #AA90AA;
  white-space: nowrap;
}

/* Barvy pro každou obtížnost */
.diff-btn[data-max="10"]                 { border-color: #B5EAD7; }
.diff-btn[data-max="10"] .diff-range     { color: #4DC49A; }
.diff-btn[data-min="1"][data-max="20"]   { border-color: #FFD166; }
.diff-btn[data-min="1"][data-max="20"] .diff-range { color: #F0A500; }
.diff-btn[data-min="11"][data-max="20"]  { border-color: #C9B8FF; }
.diff-btn[data-min="11"][data-max="20"] .diff-range { color: #8B6BFF; }

/* Aktivní stav */
.diff-btn.active {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 10px 28px rgba(120,80,160,.22);
}
.diff-btn[data-max="10"].active              { background: linear-gradient(145deg, #EDFFF8, #C8F5E8); border-color: #6DCBA8; }
.diff-btn[data-min="1"][data-max="20"].active { background: linear-gradient(145deg, #FFFAED, #FFE8A0); border-color: #F0A500; }
.diff-btn[data-min="11"][data-max="20"].active { background: linear-gradient(145deg, #F5F0FF, #E0D4FF); border-color: #9B84FF; }

/* ================================================================
   SCREEN 2 — hra
   ================================================================ */

/* Horní lišta */
.game-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 1rem;
  background: linear-gradient(to right,
    rgba(255,238,248,.97) 0%,
    rgba(248,242,255,.97) 50%,
    rgba(238,248,255,.97) 100%);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 18px rgba(120,80,160,.11), 0 1px 0 rgba(210,180,240,.3);
  position: sticky; top: 0; z-index: 20;
}

/* Levá skupina — jemný pill obal */
.header-left {
  display: flex;
  gap: .22rem;
  align-items: center;
  background: rgba(255,255,255,.55);
  border: 1.5px solid rgba(210,180,240,.25);
  border-radius: 50px;
  padding: .18rem .25rem;
}
.header-right { display: flex; gap: .3rem; align-items: center; }

/* ── Individuální tlačítka ── */
.btn-icon {
  background: none; border: 2px solid transparent;
  font-size: 1.85rem;
  cursor: pointer;
  border-radius: 50%;
  padding: .28rem .34rem;
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s, background .15s, box-shadow .15s;
}
.btn-icon:hover  { transform: scale(1.22); }
.btn-icon:active { transform: scale(1.06); }

/* Domů — pastelová růžová */
#btn-back {
  color: #C02860;
  background: rgba(255,185,210,.32);
  border-color: rgba(210,100,140,.28);
  filter: drop-shadow(0 2px 4px rgba(200,60,100,.15));
}
#btn-back:hover { background: rgba(255,143,175,.48); box-shadow: 0 4px 12px rgba(200,60,100,.2); }

/* Nová hra — výstražné barvení (přebírá roli hvězdičky) */
#btn-reset {
  color: #A03020;
  background: rgba(255,160,130,.28);
  border-color: rgba(200,80,60,.3);
  filter: drop-shadow(0 2px 4px rgba(180,60,40,.14));
}
#btn-reset:hover { background: rgba(255,120,90,.42); box-shadow: 0 4px 12px rgba(180,60,40,.25); }
#btn-reset.confirm {
  background: rgba(220,50,30,.38) !important;
  border-color: rgba(180,30,10,.6) !important;
  color: #CC0000 !important;
  animation: new-game-pulse .38s ease infinite alternate;
}

/* Obchod — pastelová fialová */
#btn-shop {
  color: #5520A8;
  background: rgba(200,180,255,.32);
  border-color: rgba(155,120,240,.3);
  filter: drop-shadow(0 2px 4px rgba(100,60,200,.14));
}
#btn-shop:hover { background: rgba(180,155,255,.5); box-shadow: 0 4px 12px rgba(100,60,200,.2); }

/* Zvuk — neutrální, bez barevného zvýraznění */
#btn-sound { color: #806090; }
#btn-sound:hover { background: rgba(180,140,220,.15); }

/* Zobrazení mincí — vizuální tokeny */
.coin-display {
  background: rgba(255,225,80,.22);
  border: 2px solid rgba(230,180,30,.45);
  border-radius: 10px;
  padding: .22rem .35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: clamp(80px, 22vw, 128px);
  min-width: 2rem;
  min-height: 1.8rem;
}
.coin-tokens {
  display: grid;
  grid-template-columns: repeat(5, auto);
  gap: 1px;
  justify-items: center;
}
.coin-token {
  font-size: 1.05rem;
  line-height: 1;
  display: block;
}
.coin-token--empty { opacity: .22; }
.coin-pop { animation: coin-pop .38s cubic-bezier(.175,.885,.32,1.275); }
@keyframes coin-pop {
  0%   { transform: scale(1); }
  55%  { transform: scale(1.65); }
  100% { transform: scale(1); }
}

@keyframes new-game-pulse {
  from { transform: scale(1);    box-shadow: 0 0 0 2px rgba(200,0,0,.35); }
  to   { transform: scale(1.14); box-shadow: 0 0 0 7px rgba(200,0,0,.18); }
}

/* Malé hlasové ikonky vedle čísla v task boxu */
.btn-voice {
  background: rgba(255,255,255,.65);
  border: 2px solid rgba(200,170,240,.4);
  border-radius: 50%;
  cursor: pointer;
  font-size: .95rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  transition: transform .15s, background .15s, border-color .15s;
}
.btn-voice:hover  { transform: scale(1.25); background: rgba(200,170,240,.25); border-color: rgba(155,132,255,.55); }
.btn-voice:active { transform: scale(1.08); }

.task-box {
  display: flex; align-items: center; gap: .65rem;
  background: rgba(255,248,225,.95);
  border: 2.5px solid var(--yellow);
  border-radius: 50px;
  padding: .4rem 1.4rem;
  box-shadow: 0 2px 10px rgba(255,209,102,.25);
}
.task-text {
  font-size: clamp(.82rem, 2.4vw, 1.05rem);
  color: #B09090;
  white-space: nowrap;
}
.target-number {
  font-size: clamp(2.1rem, 7vw, 3.5rem);
  font-weight: 900;
  color: #FF6B9D;
  line-height: 1;
  min-width: 2ch;
  text-align: center;
}
.target-number.pop { animation: num-pop .38s cubic-bezier(.175,.885,.32,1.275); }

/* ================================================================
   SCÉNA — 2D svět postavičky
   ================================================================ */
.scene-world {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  align-self: center;
  flex: 1;
  overflow: hidden;
}

/* ── Horní zóna scény: doplňky | postavička | miska ── */
.pet-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  padding: 1rem .5rem .6rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  min-height: clamp(340px, 58vw, 430px);
}

/* ── Kočičin pokojíček: světle růžová ── */
.scene-world.scene-cat {
  background: linear-gradient(to bottom, #FFF5F8 0%, #FFE8F0 100%);
}

/* ── T-Rexova jeskyně: světle pastelová zelená ── */
.scene-world.scene-trex {
  background: linear-gradient(to bottom, #F2FFF8 0%, #E4FAF0 100%);
}

/* ── Příšerčí nora: pastelově fialová ── */
.scene-world.scene-monster {
  background: linear-gradient(to bottom, #F8F4FF 0%, #EDE6FF 100%);
}

/* ── Bublina "Mám hlad" ── */
.hungry-bubble {
  position: absolute;
  top: -20px;
  right: -25px;
  background: white;
  border: 3px solid #ffB3C6;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 20px;
  font-weight: bold;
  color: #ff8FA3;
  box-shadow: 0 4px 12px rgba(255, 143, 163, 0.3);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  letter-spacing: 2px;
}
.hungry-bubble.show {
  animation: pop-bubble 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, shake-bubble 0.3s ease-in-out infinite alternate;
}

@keyframes pop-bubble {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes shake-bubble {
  from { transform: rotate(-5deg); }
  to { transform: rotate(5deg); }
}


/* Zóna postavičky — nad dekoracemi */
.char-zone {
  display: flex; flex-direction: column; align-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 10;
}

/* Miska sekce — vpravo od postavičky */
.bowl-section {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  gap: .4rem;
}

/* Obal pro postavu + overlay vrstvu */
.char-wrap {
  position: relative;
  width: clamp(130px, 30vw, 195px);
  height: clamp(130px, 30vw, 195px);
  flex-shrink: 0;
}

.game-char {
  width: 100%;
  height: 100%;
  position: relative;
}

/* ── Zóna zakoupených doplňků — vlevo od postavičky, mřížka 3×3 ── */
.items-zone {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 5px;
  align-content: center;
  justify-content: center;
  padding: 4px;
  z-index: 10;
  position: relative;
  flex-shrink: 0;
  /* pevná šířka = 3 štítky + 2 mezery + padding */
  width: calc(3 * clamp(56px, 13vw, 76px) + 2 * 5px + 8px);
}

.item-sticker {
  width:  clamp(56px, 13vw, 76px);
  height: clamp(56px, 13vw, 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.22);
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 14px;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.18));
  animation: cg-pop .3s cubic-bezier(.175,.885,.32,1.275);
}

.item-sticker img {
  width:  clamp(44px, 10.5vw, 60px);
  height: clamp(44px, 10.5vw, 60px);
  object-fit: contain;
  display: block;
}

@keyframes cg-pop {
  0%   { transform: scale(0) translateY(5px); opacity: 0; }
  100% { transform: scale(1) translateY(0);   opacity: 1; }
}

/* PNG obrázek postavičky — canvas odstraní černé pozadí, zobrazí se jako <canvas> */
.char-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

/* Canvas náhrada za obrázek (bez mix-blend-mode) */
.char-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}

.feedback-msg {
  font-size: clamp(.88rem, 2.4vw, 1.05rem);
  text-align: center; color: #B09090;
  transition: font-size .2s, color .2s;
  margin-top: .4rem; min-height: 1.4em;
  max-width: 200px;
}

.feedback-msg.is-bonus {
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  color: #B86800;
  font-weight: 800;
  text-shadow: 0 1px 6px rgba(255,190,0,.35);
}

/* Stavy postavičky — generické (fallback) */
.char-happy  { animation: char-bounce .45s ease infinite alternate, char-spin .9s ease; }
.char-hungry { animation: char-rock .85s ease infinite; }
.char-sick   { animation: char-wobble .35s ease infinite; }

/* ── Kočička: jemná, mazlivá ── */
.char-happy.char-cat  { animation: cat-happy 1.2s ease-in-out infinite; }
.char-hungry.char-cat { animation: cat-hungry 1.6s ease infinite; }

/* ── T-Rex: velký, dupající, radostný ── */
.char-happy.char-trex  { animation: trex-happy .75s ease-in-out infinite; }
.char-hungry.char-trex { animation: trex-hungry .9s ease-in-out infinite; }

/* ── Příšerka: potrhle, poskakuje ── */
.char-happy.char-monster  { animation: monster-happy .6s cubic-bezier(.36,.07,.19,.97) infinite; }
.char-hungry.char-monster { animation: monster-hungry .75s cubic-bezier(.36,.07,.19,.97) infinite; }

/* ── Bonus (všechny stejná barva): dramatická oslava ── */
.char-bonus                { animation: cat-bonus-seq 3.2s ease forwards; }
.char-bonus.char-cat       { animation: cat-bonus-seq 3.2s ease forwards; }
.char-bonus.char-trex      { animation: trex-bonus-seq 3.2s ease forwards; }
.char-bonus.char-monster   { animation: monster-bonus-seq 3.2s cubic-bezier(.36,.07,.19,.97) forwards; }

/* Zelený nádech při přejezení — na canvas elementu */
.char-sick .char-canvas {
  filter: hue-rotate(100deg) saturate(1.5) brightness(.95);
}

/* ── Miska — kontejner ── */
.bowl-area {
  position: relative;
  width: 90px;
  height: 60px;
  flex-shrink: 0;
}

/* ── Miska — kód-vykreslená sílhueta ── */
.food-bowl {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 78px;
  height: 44px;
  cursor: pointer;
  transition: transform .15s;
}
.food-bowl-rim {
  position: absolute;
  left: 4px; top: 0;
  width: 70px; height: 15px;
  border-radius: 50%;
  background: linear-gradient(to bottom, #f9fbfd 0%, #dde3ea 100%);
  border: 2px solid #9ca6b2;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,.9),
    0 1px 2px rgba(0,0,0,.08);
  z-index: 3;
}
.food-bowl-inner {
  position: absolute;
  left: 12px; top: 4px;
  width: 54px; height: 7px;
  border-radius: 50%;
  background: linear-gradient(to bottom, #d7dde5 0%, #fefefe 100%);
  opacity: .95;
  z-index: 4;
}
.food-bowl-body {
  position: absolute;
  left: 8px; top: 8px;
  width: 62px; height: 28px;
  border-radius: 0 0 32px 32px / 0 0 18px 18px;
  background: linear-gradient(to bottom, #d5dbe3 0%, #bcc4cf 52%, #aab3bf 100%);
  border: 2px solid #9ca6b2;
  box-shadow:
    inset 0 6px 8px rgba(255,255,255,.45),
    inset 0 -8px 10px rgba(0,0,0,.07);
  z-index: 2;
}
.food-bowl-shadow {
  position: absolute;
  left: 10px; bottom: -3px;
  width: 58px; height: 10px;
  border-radius: 50%;
  background: rgba(0,0,0,.12);
  filter: blur(4px);
  z-index: 1;
}
/* Drag-over highlight on the rim */
#bowl.drag-over { transform: scale(1.05); }
#bowl.drag-over .food-bowl-rim {
  box-shadow:
    0 0 0 4px rgba(255,107,157,.55),
    inset 0 2px 4px rgba(255,255,255,.9);
}

/* Tlačítko nápovědy */
.hint-button {
  position: absolute;
  right: -8px; bottom: 2px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid #d8c8ea;
  background: #f7f1fb;
  color: #e64975;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  transition: transform .15s, background .15s;
}
.hint-button:hover  { transform: scale(1.18); background: #ede4f8; }
.hint-button:active { transform: scale(1.05); }

/* Oblast sebrané potravy — uspořádání do mřížky (ten-frame) */
.food-collected {
  display: grid;
  grid-template-columns: repeat(5, 34px);
  gap: 5px;
  min-height: 34px;
  justify-content: center;
  margin-top: 10px;
}

/* (btn-hint-bowl replaced by .hint-button) */

/* ── Myšičky ── */
/* Plovoucí myšičky v herní ploše */
.mouse-item {
  position: absolute;
  width: 50px; height: 50px;
  cursor: grab;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  transition: transform .12s;
  z-index: 1;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.30));
}
.mouse-item svg { width: 100%; height: 100%; pointer-events: none; }
.mouse-item:hover { transform: scale(1.22) rotate(-6deg) !important; }
.mouse-item.is-dragging { opacity: 0; }

/* SVG potrava (myšky / bonbóny / vajíčka) */
.food-svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: visible;
}

/* Sebraná potrava a duchové v misce */
.mouse-item.in-bowl, .food-ghost {
  position: relative !important;
  width: 34px !important; height: 34px !important;
  cursor: pointer;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
  margin: auto;
}
.mouse-item.in-bowl {
  opacity: 1 !important;
}
.mouse-item.in-bowl:hover {
  transform: scale(1.28) !important;
  filter: brightness(1.55) saturate(0.68);
}
/* Animace "propadnutí miskou" — potrava vstoupí zdola a usadí se */
.mouse-item.food-into-bowl {
  animation: food-into-bowl .4s cubic-bezier(.175,.885,.32,1.275) forwards;
}
@keyframes food-into-bowl {
  0%   { transform: scale(0.1) translateY(40px); opacity: 0; }
  60%  { transform: scale(1.3) translateY(-5px);  opacity: 1; }
  100% { transform: scale(1)   translateY(0);     opacity: 1; }
}

.mouse-pop { animation: mouse-pop .3s cubic-bezier(.175,.885,.32,1.275); }

/* ── Herní plocha — dolní část unified scény ── */
.mice-field {
  width: 100%;
  flex: 1;
  min-height: 80px;
  position: relative;
  overflow: hidden;
  background: transparent;
}

/* Neutralizace per-character tříd — background řeší scene-world */
.mice-field.field-cat,
.mice-field.field-trex,
.mice-field.field-monster { background: transparent; }
.mice-field.field-cat::before,
.mice-field.field-cat::after,
.mice-field.field-trex::before,
.mice-field.field-monster::before { display: none; }

/* ── Zvoneček ── */
.bell-row {
  padding: .8rem 1rem 1.2rem;
  display: flex; justify-content: center;
  flex-shrink: 0;
}
.btn-bell {
  background: linear-gradient(135deg, #FFD166, #FF9F43);
  border: none; border-radius: 50px;
  padding: .9rem 2.8rem;
  font: inherit;
  font-size: clamp(1rem, 3.5vw, 1.3rem);
  font-weight: 800; color: white;
  cursor: pointer;
  display: flex; align-items: center; gap: .6rem;
  box-shadow: 0 7px 22px rgba(255,159,67,.5);
  transition: transform .15s, box-shadow .15s, background .35s;
  text-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.btn-bell:hover  { transform: scale(1.07); box-shadow: 0 10px 28px rgba(255,159,67,.55); }
.btn-bell:active { transform: scale(1.02); }
.bell-icon { font-size: clamp(1.5rem, 5vw, 2.1rem); }
.btn-bell.ring { animation: bell-ring .5s ease; }

/* Stav "Další kolo" — zelená barva */
.btn-bell.is-next {
  background: linear-gradient(135deg, #B5EAD7, #6DCBA8);
  box-shadow: 0 7px 22px rgba(109,203,168,.5);
  animation: btn-pulse .7s ease infinite alternate;
}
.btn-bell.is-next:hover { box-shadow: 0 10px 28px rgba(109,203,168,.6); }

/* Stav BONUS — zlatá, pulzující záře */
.btn-bell.is-bonus {
  background: linear-gradient(135deg, #FFE84D, #FF9500);
  border: none;
  color: #4A2000;
  animation: btn-bonus-glow .55s ease infinite alternate;
}
.btn-bell.is-bonus:hover { box-shadow: 0 12px 34px rgba(255,180,0,.7); }

/* ================================================================
   KONFETY
   ================================================================ */
.confetti-wrap {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 400;
  overflow: hidden;
}
.confetti-bit {
  position: absolute; top: -20px;
  border-radius: 3px;
  animation: confetti-fall linear forwards;
}

/* ================================================================
   KEYFRAMES
   ================================================================ */
@keyframes char-bounce {
  from { transform: translateY(0)    scale(1); }
  to   { transform: translateY(-24px) scale(1.09); }
}
@keyframes char-spin {
  0%   { transform: rotate(0deg)   scale(1);   }
  50%  { transform: rotate(200deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1);   }
}
@keyframes char-rock {
  0%,100% { transform: rotate(-8deg) translateX(-5px); }
  50%     { transform: rotate(8deg)  translateX(5px);  }
}
@keyframes char-wobble {
  0%,100% { transform: rotate(-4deg) scale(1);    }
  25%     { transform: rotate(4deg)  scale(1.04); }
  75%     { transform: rotate(-3deg) scale(.96);  }
}
@keyframes mouse-pop {
  0%   { transform: scale(0); }
  65%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}
@keyframes num-pop {
  0%   { transform: scale(1);   }
  50%  { transform: scale(1.55); }
  100% { transform: scale(1);   }
}
@keyframes bell-ring {
  0%,100% { transform: rotate(0); }
  20%     { transform: rotate(20deg); }
  40%     { transform: rotate(-17deg); }
  60%     { transform: rotate(12deg); }
  80%     { transform: rotate(-8deg); }
}
@keyframes confetti-fall {
  0%   { transform: translateY(0)     rotate(0deg);   opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
@keyframes btn-pulse {
  from { transform: scale(1);    box-shadow: 0 7px 22px rgba(109,203,168,.5);  }
  to   { transform: scale(1.05); box-shadow: 0 12px 30px rgba(109,203,168,.7); }
}
@keyframes btn-bonus-glow {
  from { transform: scale(1);    box-shadow: 0 0 0 4px rgba(255,215,0,.5), 0 8px 24px rgba(255,149,0,.5); }
  to   { transform: scale(1.07); box-shadow: 0 0 0 10px rgba(255,215,0,.7), 0 14px 36px rgba(255,149,0,.7); }
}
/* ── Kočička happy: houpání, jemné otočky ── */
@keyframes cat-happy {
  0%,100% { transform: translateY(0)    scale(1)    rotate(0deg); }
  25%     { transform: translateY(-18px) scale(1.07) rotate(-4deg); }
  55%     { transform: translateY(-14px) scale(1.05) rotate(4deg); }
  80%     { transform: translateY(-6px)  scale(1.02) rotate(-2deg); }
}
/* ── Kočička hungry: výrazné kývání, hladí bříško ── */
@keyframes cat-hungry {
  0%,100% { transform: translateY(0)    rotate(0deg)    scale(1)    scaleX(1);    }
  18%     { transform: translateY(8px)   rotate(-13deg)  scale(0.92) scaleX(1.10); }
  35%     { transform: translateY(-5px)  rotate(9deg)    scale(1.03) scaleX(1);    }
  52%     { transform: translateY(10px)  rotate(-12deg)  scale(0.90) scaleX(1.12); }
  70%     { transform: translateY(-4px)  rotate(8deg)    scale(1.02) scaleX(1);    }
  85%     { transform: translateY(7px)   rotate(-9deg)   scale(0.93) scaleX(1.09); }
}

/* ── T-Rex happy: velké dupavé skoky ── */
@keyframes trex-happy {
  0%,100% { transform: translateY(0)    scale(1); }
  18%     { transform: translateY(-34px) scale(1.12) rotate(-7deg); }
  36%     { transform: translateY(6px)   scale(.93)  rotate(0deg); }
  55%     { transform: translateY(-28px) scale(1.1)  rotate(7deg); }
  78%     { transform: translateY(5px)   scale(.95); }
}
/* ── T-Rex hungry: velké dupavé chvění, velká frustrace ── */
@keyframes trex-hungry {
  0%,100% { transform: translateY(0)    scale(1)    rotate(0deg);                }
  14%     { transform: translateY(-22px) scale(1.10) rotate(-15deg);              }
  27%     { transform: translateY(14px)  scale(0.86) rotate(0deg) scaleX(1.15);  }
  42%     { transform: translateY(-20px) scale(1.09) rotate(16deg);               }
  56%     { transform: translateY(14px)  scale(0.85) rotate(0deg) scaleX(1.17);  }
  70%     { transform: translateY(-14px) scale(1.07) rotate(-11deg);              }
  85%     { transform: translateY(9px)   scale(0.92) rotate(0deg);                }
}

/* ── Příšerka happy: potrhle poskakuje ── */
@keyframes monster-happy {
  0%,100% { transform: translateY(0)    scale(1)    rotate(0deg); }
  18%     { transform: translateY(-26px) scale(1.16) rotate(-13deg); }
  36%     { transform: translateY(4px)   scale(.87)  rotate(9deg); }
  55%     { transform: translateY(-22px) scale(1.13) rotate(-9deg); }
  75%     { transform: translateY(3px)   scale(.91)  rotate(6deg); }
  90%     { transform: translateY(-10px) scale(1.07) rotate(-4deg); }
}
/* ── Příšerka hungry: výrazné potrhle kývání ── */
@keyframes monster-hungry {
  0%,100% { transform: scale(1)    rotate(0deg)   translateY(0);                  }
  14%     { transform: scale(1.15) rotate(-19deg) translateY(-16px);               }
  28%     { transform: scale(0.82) rotate(15deg)  translateY(12px) scaleX(1.22);  }
  44%     { transform: scale(1.18) rotate(-15deg) translateY(-14px);               }
  58%     { transform: scale(0.80) rotate(19deg)  translateY(12px) scaleX(1.25);  }
  74%     { transform: scale(1.12) rotate(-12deg) translateY(-10px);               }
  88%     { transform: scale(0.89) rotate(10deg)  translateY(8px);                 }
}

/* ── Cat bonus: výskoky + spin + úklona ── */
@keyframes cat-bonus-seq {
  0%   { transform: scale(1)    rotate(0deg)   translateY(0); }
  7%   { transform: scale(1.18) rotate(-14deg) translateY(-44px); }
  14%  { transform: scale(.88)  rotate(0deg)   translateY(8px); }
  22%  { transform: scale(1.16) rotate(14deg)  translateY(-40px); }
  30%  { transform: scale(.90)  rotate(0deg)   translateY(6px); }
  40%  { transform: scale(1.12) rotate(180deg) translateY(-26px); }
  52%  { transform: scale(1.08) rotate(360deg) translateY(-18px); }
  60%  { transform: scale(1)    rotate(360deg) translateY(0); }
  70%  { transform: scale(1.08) rotate(356deg) translateY(-14px); }
  78%  { transform: scaleY(.62) scaleX(1.28)   rotate(360deg) translateY(12px); }
  88%  { transform: scale(1.08) rotate(360deg) translateY(-10px); }
  100% { transform: scale(1)    rotate(360deg) translateY(0); }
}

/* ── T-Rex bonus: dupavý tanec + spin ── */
@keyframes trex-bonus-seq {
  0%   { transform: scale(1)    rotate(0deg)   translateY(0); }
  6%   { transform: scale(1.22) rotate(-18deg) translateY(-50px); }
  12%  { transform: scale(.82)  rotate(0deg)   translateY(10px) scaleX(1.22); }
  20%  { transform: scale(1.20) rotate(20deg)  translateY(-46px); }
  28%  { transform: scale(.84)  rotate(0deg)   translateY(10px) scaleX(1.24); }
  38%  { transform: scale(1.16) rotate(180deg) translateY(-32px); }
  50%  { transform: scale(1.10) rotate(360deg) translateY(-22px); }
  58%  { transform: scale(1)    rotate(360deg) translateY(0); }
  66%  { transform: scale(1.14) rotate(355deg) translateY(-34px); }
  74%  { transform: scale(.86)  rotate(360deg) translateY(10px) scaleX(1.20); }
  84%  { transform: scale(1.10) rotate(360deg) translateY(-18px); }
  100% { transform: scale(1)    rotate(360deg) translateY(0); }
}

/* ── Monster bonus: divoké dvojité spinning ── */
@keyframes monster-bonus-seq {
  0%   { transform: scale(1)    rotate(0deg)   translateY(0); }
  6%   { transform: scale(1.26) rotate(-22deg) translateY(-46px); }
  12%  { transform: scale(.76)  rotate(18deg)  translateY(12px) scaleX(1.30); }
  20%  { transform: scale(1.22) rotate(-18deg) translateY(-42px); }
  28%  { transform: scale(.78)  rotate(22deg)  translateY(12px) scaleX(1.32); }
  38%  { transform: scale(1.18) rotate(180deg) translateY(-30px); }
  48%  { transform: scale(1.12) rotate(360deg) translateY(-20px); }
  56%  { transform: scale(1.15) rotate(540deg) translateY(-24px); }
  64%  { transform: scale(1)    rotate(720deg) translateY(0); }
  72%  { transform: scale(1.20) rotate(712deg) translateY(-22px); }
  80%  { transform: scale(.84)  rotate(724deg) translateY(8px) scaleX(1.26); }
  90%  { transform: scale(1.12) rotate(718deg) translateY(-12px); }
  100% { transform: scale(1)    rotate(720deg) translateY(0); }
}

/* ================================================================
   RESPONZIVITA
   ================================================================ */
/* ================================================================
   OBCHOD
   ================================================================ */
.shop-overlay {
  position: fixed; inset: 0;
  z-index: 500;
  background: rgba(50, 20, 80, .6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.shop-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.shop-modal {
  background: linear-gradient(160deg, #FFF9F5 0%, #F4F0FF 100%);
  border-radius: 28px;
  padding: 1.4rem 1.4rem 1.8rem;
  width: calc(100% - 2rem);
  max-width: 580px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(70, 30, 120, .45);
}

/* ── Hlavička modalu ── */
.shop-top {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.shop-title {
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  font-weight: 900;
  color: #7040C0;
  margin: 0;
  flex: 1;
}
.shop-wallet {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,230,80,.25);
  border: 2px solid rgba(220,180,30,.4);
  border-radius: 50px;
  padding: .25rem .9rem;
}
.shop-wallet-label {
  font-size: .82rem;
  color: #9A8070;
  white-space: nowrap;
}
.shop-wallet-coins {
  font-size: 1.05rem;
  font-weight: 900;
  color: #B07800;
}
.shop-close-btn {
  background: rgba(180,140,220,.15);
  border: 2px solid rgba(160,120,200,.3);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 700;
  width: 2.2rem; height: 2.2rem;
  display: flex; align-items: center; justify-content: center;
  color: #8050B0;
  transition: background .15s, transform .15s;
  flex-shrink: 0;
}
.shop-close-btn:hover { background: rgba(180,140,220,.35); transform: scale(1.1); }

/* ── Sekce ── */
.shop-section { margin-bottom: 1.2rem; }
.shop-section:last-child { margin-bottom: 0; }
.shop-section-title {
  font-size: clamp(.9rem, 3vw, 1.05rem);
  font-weight: 800;
  color: #9070C0;
  margin: 0 0 .75rem;
  padding-bottom: .35rem;
  border-bottom: 2px dashed rgba(180,140,220,.35);
}

/* ── Mřížka předmětů ── */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: .7rem;
}

/* ── Karta předmětu ── */
.shop-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  padding: .75rem .5rem .65rem;
  border-radius: 18px;
  border: 2.5px solid transparent;
  text-align: center;
  transition: transform .18s, box-shadow .18s;
}
.shop-item:not(.shop-item--locked):hover {
  transform: translateY(-5px);
}

/* Item image — large and image-first */
.shop-item-preview {
  width: 5.6rem;
  height: 5.6rem;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 7px rgba(0,0,0,.22));
}
.shop-item--locked .shop-item-preview { filter: grayscale(.6) drop-shadow(0 1px 3px rgba(0,0,0,.10)); }
.shop-item-emoji {
  font-size: 3.4rem;
  line-height: 1;
  display: block;
}

/* Stav: Lze koupit */
.shop-item--buyable {
  background: linear-gradient(145deg, #FFFDF5, #FFF6DC);
  border-color: rgba(230,185,30,.5);
  box-shadow: 0 4px 14px rgba(230,185,30,.2);
}
.shop-item--buyable:hover {
  box-shadow: 0 8px 22px rgba(230,185,30,.35);
}

/* Stav: Zakoupeno */
.shop-item--owned {
  background: linear-gradient(145deg, #F0FFF6, #DCFFEE);
  border-color: rgba(80,200,130,.55);
  box-shadow: 0 4px 14px rgba(80,200,130,.2);
}
.shop-item-owned {
  font-size: 1.4rem;
  font-weight: 900;
  color: #1A9A50;
  line-height: 1;
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(80,200,130,.22);
  border-radius: 50%;
}

/* Stav: Nedostupné */
.shop-item--locked {
  background: rgba(220,215,230,.4);
  border-color: rgba(180,170,200,.35);
  opacity: .65;
}
.shop-item--locked .shop-item-icon { filter: grayscale(.5); }

/* Tlačítko Koupit */
.shop-buy-btn {
  font: inherit;
  font-size: .9rem;
  font-weight: 900;
  background: linear-gradient(135deg, #FFD166, #FF9F43);
  color: white;
  border: none;
  border-radius: 50px;
  padding: .35rem .9rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(255,159,67,.4);
  transition: transform .15s, box-shadow .15s;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
  white-space: nowrap;
}
.shop-buy-btn:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 5px 14px rgba(255,159,67,.55);
}
.shop-buy-btn:active:not(:disabled) { transform: scale(1.02); }
.shop-buy-btn:disabled {
  background: rgba(180,170,190,.5);
  box-shadow: none;
  cursor: not-allowed;
  color: rgba(100,90,110,.7);
  text-shadow: none;
}

/* ================================================================
   RESPONZIVITA
   ================================================================ */
@media (max-width: 600px) {
  .game-header { padding: .4rem .3rem; gap: .2rem; }
  .header-left, .header-right { gap: .15rem; }
  .btn-icon     { font-size: 1.3rem; padding: .15rem .2rem; }
  .btn-icon svg { width: 16px; height: 16px; }
  .btn-voice    { width: 1.65rem; height: 1.65rem; font-size: .85rem; }
  .task-box     { padding: .3rem .4rem; gap: .2rem; flex-shrink: 1; }
  .task-text    { font-size: clamp(0.7rem, 2vw, 0.9rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50px; }
  .target-number { font-size: 1.4rem; }
  .coin-token   { font-size: .85rem; }
  .coin-display { max-width: clamp(50px, 15vw, 80px); padding: .15rem .2rem; min-width: 1.5rem; }
  .difficulty-stars { font-size: 0.8rem; margin-left: 2px; }
}

@media (max-width: 768px) {
  .bowl-area                    { width: 72px; height: 50px; }
  .food-bowl                    { width: 62px; height: 36px; }
  .food-bowl-rim                { left: 3px; width: 56px; height: 12px; }
  .food-bowl-inner              { left: 10px; top: 3px; width: 44px; height: 6px; }
  .food-bowl-body               { left: 6px; top: 7px; width: 50px; height: 22px; }
  .food-bowl-shadow             { left: 8px; width: 46px; height: 8px; }
  .hint-button                  { width: 26px; height: 26px; font-size: 15px; right: -6px; }
}

@media (max-width: 540px) {
  .pet-zone                     { gap: .35rem; padding: .5rem .2rem .4rem; min-height: clamp(260px, 54vw, 340px); }
  .items-zone                   { gap: 4px; padding: 3px; width: calc(3 * clamp(44px, 12vw, 60px) + 2 * 4px + 6px); }
  .item-sticker                 { width: clamp(44px, 12vw, 60px); height: clamp(44px, 12vw, 60px); font-size: clamp(1.6rem, 5vw, 2.3rem); border-radius: 12px; }
  .char-wrap                    { width: clamp(86px, 22vw, 130px); height: clamp(86px, 22vw, 130px); }
  .game-char                    { width: 100%; height: 100%; }
  .food-collected               { grid-template-columns: repeat(5, 26px); gap: 2px; min-height: 26px; }
  .mouse-item.in-bowl, .food-ghost { width: 26px !important; height: 26px !important; }
  .mice-field                   { min-height: 60px; }
  .character-card               { min-width: 130px; padding: 1.1rem 1rem .9rem; }
  .char-preview                 { width: 120px; height: 120px; }
  .shop-item-preview            { width: 4.6rem; height: 4.6rem; }
}

@media (max-width: 380px) {
  .character-grid               { gap: .8rem; }
  .character-card               { min-width: 110px; }
  .char-preview                 { width: 100px; height: 100px; }
  .task-box                     { padding: .35rem .9rem; gap: .45rem; }
  .food-collected               { grid-template-columns: repeat(5, 20px); gap: 2px; min-height: 20px; }
  .mouse-item.in-bowl, .food-ghost { width: 20px !important; height: 20px !important; }
  .shop-item-preview            { width: 4rem; height: 4rem; }
  .items-zone                   { gap: 3px; padding: 2px; width: calc(3 * 40px + 2 * 3px + 4px); }
  .item-sticker                 { width: 40px; height: 40px; font-size: 1.5rem; border-radius: 10px; }
  .pet-zone                     { gap: .25rem; }
}
