/* Naša hra – spoločný vzhľad. Pokojná paleta, veľké ciele, bez blikania. */
@font-face { font-family: "Andika"; src: url("/fonts/andika-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("/fonts/andika-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #FBF6EC; --paper-2: #F3EBDB; --line: #E2D8C5; --ink: #2E3A4B; --ink-soft: #6B7686; --card: #FFFDF8;
  --blue: #7FA7D8; --blue-soft: #DCE8F6; --blue-ink: #3F6797;
  --sage: #9DBF9E; --sage-soft: #E2EEDF; --apricot: #EFB38A; --apricot-soft: #F9E3D3;
  --lavender: #B7A6D9; --lavender-soft: #ECE6F6; --sand: #E8C27A; --sand-soft: #FBF0D9;
  --ok: #8CC7A1; --ok-soft: #E3F2E8; --star: #F2C76B;
  --shadow: 0 5px 0 rgba(46,58,75,.07), 0 10px 22px rgba(46,58,75,.08);
  --shadow-lift: 0 16px 34px rgba(46,58,75,.18);
  --r: 26px;
  --target: 64px;
  --slow: 420ms cubic-bezier(.3,.7,.3,1);
  --font: "Andika", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 18px; line-height: 1.4;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; -webkit-user-select: text; user-select: text; }
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 100dvh; position: relative;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 16px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --- tlačidlá --- */
.round-btn { width: 76px; height: 76px; min-width: var(--target); border-radius: 50%; border: none; background: var(--card);
  box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; padding: 0; transition: transform 150ms; }
.round-btn svg { width: 40px; height: 40px; }
.round-btn:active { transform: scale(.94); }
.round-btn.speaker { background: var(--blue); }
.round-btn.speaker.playing { box-shadow: 0 0 0 8px var(--blue-soft), var(--shadow); }
.btn { min-height: 56px; padding: 12px 24px; border-radius: 18px; border: none; background: var(--card); box-shadow: var(--shadow);
  font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.small { min-height: 44px; padding: 8px 16px; font-size: 16px; border-radius: 14px; }
.btn.ghost { background: transparent; box-shadow: none; text-decoration: underline; font-weight: 400; color: var(--ink-soft); }
.btn.danger { color: #8a4b2a; background: var(--apricot-soft); }
.btn:disabled { opacity: .5; cursor: default; }

/* --- horná lišta --- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.topbar .who { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 700; background: none; border: none; cursor: pointer; padding: 0; }
.avatar { border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex: none; }
.avatar img { width: 82%; height: 82%; }
.jar { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 40px; padding: 10px 18px 10px 12px;
  box-shadow: var(--shadow); font-size: 24px; font-weight: 700; }
.jar svg { width: 34px; height: 34px; }

/* --- dlaždice --- */
.title-voice { font-size: clamp(24px, 4vmin, 34px); font-weight: 700; text-align: center; margin: 0; display: flex; align-items: center; gap: 14px; }
.tiles { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 42vw), 1fr)); gap: clamp(14px, 3vmin, 28px);
  padding: 8px clamp(16px, 4vw, 48px) 48px; align-content: center; max-width: 1100px; width: 100%; margin: 0 auto; }
.tile { border: none; border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; font-size: clamp(22px, 3.4vmin, 30px); font-weight: 700; cursor: pointer; min-height: 200px;
  padding: 20px; transition: transform 150ms; }
.tile:active { transform: scale(.97); }
.tile .ico { width: min(70%, 220px); aspect-ratio: 1.3; border-radius: 22px; display: grid; place-items: center; background: rgba(255,255,255,.65); }
.tile .ico img { width: 72%; height: 72%; object-fit: contain; }
.tile .ico svg { width: 58%; height: 58%; }
.calm-illu svg { width: 100%; height: auto; display: block; }
.c-blue { background: var(--blue-soft); } .c-sage { background: var(--sage-soft); } .c-apricot { background: var(--apricot-soft); }
.c-lavender { background: var(--lavender-soft); } .c-sand { background: var(--sand-soft); }
.tile .badge { background: var(--star); color: var(--ink); border-radius: 20px; padding: 2px 12px; font-size: 18px; }

/* --- profily --- */
.profiles { display: flex; flex-wrap: wrap; gap: clamp(16px, 4vmin, 36px); justify-content: center; padding: 0 16px; }
.profile { width: clamp(150px, 26vmin, 230px); background: var(--card); border: none; border-radius: var(--r); box-shadow: var(--shadow);
  padding: 20px 14px 16px; text-align: center; cursor: pointer; transition: transform 150ms; }
.profile:active { transform: scale(.96); }
.profile .avatar { width: 75%; aspect-ratio: 1; margin: 0 auto 12px; }
.profile .name { font-size: clamp(22px, 3.6vmin, 30px); font-weight: 700; }
.bg-fox, .bg-mouse { background: var(--apricot-soft); } .bg-bear, .bg-frog { background: var(--sage-soft); }
.bg-owl, .bg-rabbit { background: var(--lavender-soft); } .bg-cat, .bg-penguin { background: var(--blue-soft); }

/* --- rodičovská brána (podržať 3 s) --- */
.gate { position: absolute; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 68px; height: 68px; border-radius: 50%;
  border: none; background: var(--paper-2); display: grid; place-items: center; cursor: pointer; touch-action: none; padding: 0; }
.gate svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.gate svg.ring circle.prog { transition: stroke-dashoffset 300ms ease-out; }
.gate.holding svg.ring circle.prog { transition: stroke-dashoffset 3s linear; }
.gate .lock { width: 30px; height: 30px; }

/* --- hra --- */
.progress { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.dot { width: 22px; height: 22px; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--line); display: grid; place-items: center; }
.dot.current { border-color: var(--blue); background: var(--blue-soft); }
.dot.done { border: none; background: none; }
.dot.done svg { width: 30px; height: 30px; animation: pop 500ms ease-out; }
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(18px, 4vmin, 40px);
  padding: 8px 16px 40px; }
.cards { display: flex; flex-wrap: wrap; gap: clamp(14px, 3vmin, 28px); justify-content: center; max-width: 1000px; }

.lc { --size: clamp(92px, 20vmin, 190px); width: var(--size); height: calc(var(--size) * 1.12); background: var(--card);
  border-radius: var(--r); border: 3px solid transparent; box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer;
  font-size: calc(var(--size) * .62); line-height: 1; padding: 0; position: relative;
  transition: transform var(--slow), opacity var(--slow), background var(--slow), border-color var(--slow), box-shadow var(--slow); }
.lc.wide { font-size: calc(var(--size) * .5); }
.lc:active { transform: scale(.96); }
.lc.dim { opacity: .28; pointer-events: none; }
.lc.correct { background: var(--ok-soft); border-color: var(--ok); }
.lc.reveal { background: var(--ok-soft); border-color: var(--ok); transform: scale(1.1); }
.lc.wrong { background: var(--sand-soft); }
.lc.glow { border-color: var(--sand); box-shadow: 0 0 0 6px var(--sand-soft), var(--shadow); }
.nudge { animation: nudge 900ms ease-in-out; }

/* dvojice */
.pairs { flex: 1; width: 100%; max-width: 900px; display: grid; grid-template-columns: 1fr minmax(20px, 120px) 1fr; align-items: center; }
.pairs .col { display: flex; flex-direction: column; gap: clamp(12px, 2.6vmin, 22px); align-items: center; }
.pairs .lc { --size: clamp(84px, 14vmin, 140px); height: calc(var(--size) * .82); }
.pairs .lc.dragging { transition: none; box-shadow: var(--shadow-lift); z-index: 10; transform: var(--drag) scale(1.08); cursor: grabbing; }
.pairs .lc.returning { transition: transform 380ms cubic-bezier(.3,.7,.3,1); transform: var(--drag); }
.pairs .lc.matched { background: var(--ok-soft); border-color: var(--ok); box-shadow: none; pointer-events: none; }
.pairs .lc.selected { border-color: var(--blue); box-shadow: 0 0 0 6px var(--blue-soft), var(--shadow); }
.pairs .lc.over { border-color: var(--blue); transform: scale(1.06); }
.lc[data-draggable] { touch-action: none; cursor: grab; }

/* koniec kola */
.end-stars { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 600px; }
.end-stars svg { width: clamp(44px, 8vmin, 72px); height: clamp(44px, 8vmin, 72px); animation: pop 600ms ease-out both; }
.row { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; align-items: center; }
.big-round { width: 110px; height: 110px; }
.big-round svg { width: 56px; height: 56px; }

/* nálepky */
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(84px, 14vmin, 130px), 1fr)); gap: 16px; width: 100%;
  max-width: 1000px; padding: 0 20px 40px; margin: 0 auto; }
.slot { position: relative; aspect-ratio: 1; border-radius: 22px; background: var(--paper-2); border: 3px dashed var(--line); display: grid; place-items: center; }
.slot.owned { background: var(--card); border: none; box-shadow: var(--shadow); }
.slot img { width: 78%; height: 78%; }
.offer { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.offer button { width: clamp(120px, 22vmin, 190px); aspect-ratio: 1; border-radius: 28px; border: none; background: var(--card);
  box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; padding: 0; }
.offer img { width: 78%; height: 78%; }

/* zatiaľ / pokoj */
.calm-illu { width: min(260px, 50vmin); }
.msg { font-size: clamp(20px, 3.2vmin, 28px); text-align: center; max-width: 640px; color: var(--ink); margin: 0; }
.msg.soft { color: var(--ink-soft); font-size: 18px; }

/* prihlásenie */
.login { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 28px; width: min(420px, 100%); display: grid; gap: 16px; }
.login h1 { margin: 0; font-size: 28px; text-align: center; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 16px; }
.input { min-height: 52px; border-radius: 14px; border: 2px solid var(--line); padding: 10px 14px; background: #fff; font-size: 18px; }
.input:focus { outline: none; border-color: var(--blue); }
.error { color: #9a4a22; min-height: 1.4em; margin: 0; font-size: 16px; }

/* --- rodičovská časť --- */
.parent { -webkit-user-select: text; user-select: text; }
.parent .topbar { background: var(--paper-2); }
.parent h1 { margin: 0; font-size: 24px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px 0; }
.tab { min-height: 48px; padding: 8px 18px; border-radius: 14px 14px 0 0; border: none; background: transparent; cursor: pointer; font-weight: 700; color: var(--ink-soft); }
.tab.active { background: var(--card); color: var(--ink); box-shadow: 0 -2px 0 var(--blue) inset; }
.pbody { padding: 20px; display: grid; gap: 18px; max-width: 1100px; width: 100%; margin: 0 auto; }
.panel { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 18px 20px; display: grid; gap: 14px; }
.panel h2 { margin: 0; font-size: 20px; }
.panel h3 { margin: 0; font-size: 17px; }
.panel .desc { margin: -8px 0 0; color: var(--ink-soft); font-size: 15px; }
.prow { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.prow .grow { flex: 1; min-width: 160px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 48px; min-width: 48px; padding: 6px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: 18px; }
.chip.on { background: var(--blue-soft); border-color: var(--blue); font-weight: 700; }
.avatar-pick { width: 64px; height: 64px; border-radius: 50%; border: 3px solid transparent; padding: 0; cursor: pointer; }
.avatar-pick.on { border-color: var(--blue); }
.avatar-pick img { width: 80%; height: 80%; }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper output { min-width: 2.4em; text-align: center; font-weight: 700; font-size: 20px; }
.seg { justify-self: start; max-width: 100%; flex-wrap: wrap; display: inline-flex; border-radius: 14px; overflow: hidden; border: 2px solid var(--line); }
.seg button { min-height: 46px; padding: 6px 16px; border: none; background: #fff; cursor: pointer; }
.seg button.on { background: var(--blue-soft); font-weight: 700; }
.toggle { width: 64px; height: 36px; border-radius: 20px; border: none; background: var(--line); position: relative; cursor: pointer; flex: none; }
.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: left 200ms; }
.toggle.on { background: var(--ok); }
.toggle.on::after { left: 32px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { background: var(--paper); border-radius: 14px; padding: 10px 14px; }
.stat .v { font-size: 22px; font-weight: 700; }
.stat .l { font-size: 14px; color: var(--ink-soft); }
.sgrid { border-collapse: separate; border-spacing: 4px; }
.sgrid th { font-size: 13px; color: var(--ink-soft); font-weight: 400; padding: 2px 6px; }
.sgrid td { width: 52px; height: 46px; text-align: center; border-radius: 10px; font-size: 24px; }
.sgrid tr.muted td { opacity: .45; }
.lvl-0 { background: var(--paper-2); color: #b5ab99; } .lvl-1 { background: var(--sand-soft); }
.lvl-2 { background: #EAF2D9; } .lvl-3 { background: #CFE8D7; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); }
.legend span::before { content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }
.legend .l0::before { background: var(--paper-2); } .legend .l1::before { background: var(--sand-soft); }
.legend .l2::before { background: #EAF2D9; } .legend .l3::before { background: #CFE8D7; }
.conf { display: grid; gap: 6px; }
.conf div { display: flex; gap: 12px; align-items: baseline; }
.conf b { font-size: 26px; min-width: 2.2em; }
.conf small { color: var(--ink-soft); }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rec { display: flex; align-items: center; gap: 8px; background: var(--paper); border-radius: 14px; padding: 8px 10px; }
.rec .ch { font-size: 30px; min-width: 1.5em; text-align: center; }
.rec .st { margin-left: auto; font-size: 20px; color: var(--ok); }
.rec .icon-btn { width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--card); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; padding: 0; }
.rec .icon-btn svg { width: 22px; height: 22px; }
.rec .icon-btn.rec-on { background: #F4B9A0; }
.form-order { display: grid; gap: 6px; }
.form-order div { display: flex; align-items: center; gap: 10px; background: var(--paper); border-radius: 12px; padding: 4px 8px; }
.form-order span { flex: 1; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px;
  border-radius: 14px; z-index: 100; font-size: 16px; }

/* --- animácie (pomalé, jemné) --- */
@keyframes nudge { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes float-up { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-50%, -90px) scale(1.1); opacity: 0; } }
.fly-star { position: absolute; left: 50%; top: 10%; width: 54px; height: 54px; pointer-events: none; animation: float-up 900ms ease-out forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
@media (max-width: 600px) {
  .round-btn { width: 64px; height: 64px; }
  .round-btn svg { width: 32px; height: 32px; }
  .topbar { padding: 10px 12px; }
  .tile { min-height: 150px; }
  .progress { gap: 6px; flex-wrap: nowrap; }
  .dot { width: 14px; height: 14px; } .dot.done svg { width: 20px; height: 20px; }
}
@media (orientation: portrait) and (max-width: 700px) {
  .pairs { grid-template-columns: 1fr 24px 1fr; }
}
