/* Kvizić-Kružić — osnovni raspored i komponente (boje i fontovi dolaze iz themes.css) */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--sky);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .6s ease, color .4s ease;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- Scena i ekrani ---------- */
#scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility 0s .7s; }
body[data-theme="kids"] .scene-kids,
body[data-theme="castle"] .scene-castle,
body[data-theme="future"] .scene-future { opacity: 1; visibility: visible; transition: opacity .7s ease; }
.scene * { animation-play-state: paused; }
body[data-theme="kids"] .scene-kids *,
body[data-theme="castle"] .scene-castle *,
body[data-theme="future"] .scene-future * { animation-play-state: running; }

#app { position: relative; z-index: 1; height: 100%; height: 100dvh; }
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: max(14px, env(safe-area-inset-top)) clamp(12px, 3vw, 32px) max(14px, env(safe-area-inset-bottom));
  overflow-y: auto; overflow-x: hidden;
  opacity: 0; visibility: hidden; transform: translateY(18px) scale(.985);
  transition: opacity .35s ease, transform .4s cubic-bezier(.2, .9, .3, 1), visibility 0s .4s;
}
.screen.active { opacity: 1; visibility: visible; transform: none; transition: opacity .35s ease, transform .4s cubic-bezier(.2, .9, .3, 1); }

/* ---------- Gumbi ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .75em 1.4em; border-radius: var(--btn-radius);
  font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; letter-spacing: .01em;
  transition: transform .12s ease, box-shadow .12s ease, filter .2s, opacity .2s;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(3px); }
.btn:disabled { opacity: .45; filter: grayscale(.4); }
.btn-primary { background: var(--accent); color: var(--btn-text); box-shadow: 0 5px 0 var(--accent-dark), 0 10px 22px -8px var(--accent); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn-primary:active:not(:disabled) { box-shadow: 0 2px 0 var(--accent-dark); }
.btn-ghost { background: var(--ghost-bg); color: var(--text); box-shadow: inset 0 0 0 2px var(--panel-border); }
.btn-ghost:hover { background: var(--ghost-bg-hover); }
.btn-big { font-size: 1.3rem; padding: .8em 1.8em; }
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 1.35rem;
  background: var(--panel); box-shadow: var(--panel-shadow), inset 0 0 0 2px var(--panel-border);
  transition: transform .15s ease;
}
.icon-btn:hover { transform: scale(1.08); }
.icon-btn:active { transform: scale(.94); }
.link-btn { font-weight: 800; padding: .55em 1em; border-radius: 999px; background: var(--panel); box-shadow: var(--panel-shadow); color: var(--text); }
.link-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--panel-shadow), inset 0 0 0 2px var(--panel-border);
  padding: clamp(14px, 2.2vw, 24px);
}

/* ---------- Početni ekran ---------- */
.start-wrap { width: min(1100px, 100%); margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2vh, 20px); padding: 12px 0; }
.logo { text-align: center; }
.logo-title {
  margin: 0; font-family: var(--font-logo); font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 5.6rem); line-height: 1; letter-spacing: .01em;
  white-space: nowrap;
}
.logo-title .ltr, .logo-title .dash { display: inline-block; animation: letterIn .7s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--i) * 45ms); }
.logo-sub { margin: .5em 0 0; font-weight: 800; font-size: clamp(1rem, 2.4vw, 1.3rem); color: var(--text-soft); }
.section-title { margin: .4em 0 .1em; font-family: var(--font-head); font-size: clamp(1.15rem, 2.6vw, 1.5rem); font-weight: 700; }

.age-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2vw, 24px); width: 100%; }
.age-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 0 16px 18px; border-radius: 26px; overflow: hidden;
  background: var(--ac-panel); color: var(--ac-text);
  box-shadow: 0 14px 30px -14px rgba(30, 10, 60, .45), inset 0 0 0 3px var(--ac-border);
  transition: transform .25s cubic-bezier(.2, 1.4, .4, 1), box-shadow .25s;
  animation: cardUp .6s cubic-bezier(.2, 1.2, .4, 1) both;
}
.age-card:nth-child(2) { animation-delay: .08s; }
.age-card:nth-child(3) { animation-delay: .16s; }
.age-card:hover, .age-card:focus-visible { transform: translateY(-8px) rotate(-.6deg) scale(1.02); }
.ac-art { position: relative; display: block; width: calc(100% + 32px); height: clamp(110px, 17vh, 150px); margin-bottom: 10px; background: var(--ac-art); overflow: hidden; }
.ac-chars { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; align-items: flex-end; gap: 2px; }
.ac-char { width: clamp(58px, 7vw, 84px); filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .18)); animation: bob 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
.ac-char:nth-child(2) { width: clamp(70px, 8.6vw, 100px); }
.ac-label { font-family: var(--ac-font); font-weight: 900; font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1; color: var(--ac-accent); }
.ac-name { font-family: var(--ac-font); font-weight: 700; font-size: 1.2rem; margin-top: 4px; }
.ac-desc { font-size: .95rem; font-weight: 700; opacity: .8; margin-top: 4px; }
.ac-count { margin-top: 10px; font-size: .8rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--ac-chip); }
.start-footer { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* ---------- Postavke ---------- */
.topbar { width: min(1100px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: clamp(10px, 2vh, 20px); flex: none; }
.screen-title { margin: 0; font-family: var(--font-head); font-size: clamp(1.1rem, 2.6vw, 1.6rem); text-align: center; }
.setup-grid { width: min(1100px, 100%); display: grid; grid-template-columns: 1fr minmax(280px, 340px) 1fr; gap: clamp(12px, 2vw, 22px); align-items: start; margin: auto 0; }
.player-setup { display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; }
.player-tag { font-family: var(--font-head); font-weight: 700; padding: 4px 16px; border-radius: 999px; background: var(--pc); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--pc) 70%, #000); }
.avatar-big {
  width: clamp(96px, 13vw, 136px); aspect-ratio: 1; border-radius: var(--token-radius); padding: 10px;
  background: var(--pc); box-shadow: 0 8px 0 color-mix(in srgb, var(--pc) 70%, #000), inset 0 0 0 5px rgba(255, 255, 255, .45);
  clip-path: var(--token-clip);
  animation: bob 3s ease-in-out infinite;
}
.avatar-big.bump { animation: bump .45s cubic-bezier(.3, 1.8, .5, 1); }
.char-name { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; margin-top: 4px; }
.name-input {
  width: 100%; max-width: 260px; text-align: center; font-weight: 800; font-size: 1.15rem;
  padding: .6em .8em; border-radius: var(--btn-radius); border: 0;
  background: var(--input-bg); box-shadow: inset 0 0 0 2px var(--panel-border); outline: none;
  transition: box-shadow .2s;
}
.name-input:focus { box-shadow: inset 0 0 0 3px var(--pc); }
.name-input::placeholder { color: var(--text-soft); opacity: .8; }
.char-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 270px; }
.char-btn {
  aspect-ratio: 1; border-radius: 18px; padding: 6px; background: var(--seg-bg);
  box-shadow: inset 0 0 0 2px var(--panel-border);
  transition: transform .15s ease, box-shadow .15s, background .15s, opacity .2s;
}
.char-btn:hover:not(:disabled) { transform: translateY(-3px) scale(1.04); }
.char-btn.on { background: color-mix(in srgb, var(--pc) 28%, transparent); box-shadow: inset 0 0 0 3px var(--pc), 0 6px 14px -6px var(--pc); transform: scale(1.05); }
.char-btn:disabled { opacity: .25; filter: grayscale(1); }

.options { display: flex; flex-direction: column; gap: 10px; }
.opt-title { margin: 0; font-family: var(--font-head); font-size: 1.1rem; }
.hint { margin: 0; font-size: .9rem; font-weight: 700; color: var(--text-soft); }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 2px dashed var(--panel-border); }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: var(--btn-radius); background: var(--seg-bg); box-shadow: inset 0 0 0 2px var(--panel-border); }
.seg button { flex: 1; padding: .55em .8em; border-radius: calc(var(--btn-radius) - 4px); font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; transition: background .2s, color .2s, transform .15s; }
.seg button.on { background: var(--accent); color: var(--btn-text); box-shadow: 0 3px 0 var(--accent-dark); }
.seg.small button { padding: .35em 1em; }
.eat-count { display: flex; align-items: center; justify-content: space-between; gap: 8px; transition: opacity .25s; }
.eat-count.off { opacity: .35; pointer-events: none; }
.options .btn-big { margin-top: 8px; }

.switch { position: relative; flex: none; width: 58px; height: 32px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--seg-bg); box-shadow: inset 0 0 0 2px var(--panel-border); transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.3, 1.5, .5, 1); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(26px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* ---------- Igra ---------- */
.game-title { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.mini-logo { font-family: var(--font-logo); font-weight: 700; font-size: clamp(1.1rem, 3vw, 1.6rem); }
.round-label { font-size: .85rem; font-weight: 800; color: var(--text-soft); }

.game-layout {
  width: min(1100px, 100%); flex: 1; min-height: 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(12px, 2.5vw, 32px);
}
.player-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 18px 14px; border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--panel-shadow), inset 0 0 0 2px var(--panel-border);
  filter: saturate(.5) brightness(.96); transform: scale(.94);
  transition: transform .35s cubic-bezier(.2, 1.4, .4, 1), filter .3s, box-shadow .3s;
}
.player-card.active { filter: none; transform: scale(1); box-shadow: var(--panel-shadow), inset 0 0 0 3px var(--pc), 0 0 0 6px color-mix(in srgb, var(--pc) 25%, transparent); }
.pc-avatar {
  width: clamp(70px, 9vw, 108px); aspect-ratio: 1; padding: 8px; border-radius: var(--token-radius); clip-path: var(--token-clip);
  background: var(--pc); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .45);
}
.player-card.active .pc-avatar { animation: bob 1.8s ease-in-out infinite; }
.pc-name { font-family: var(--font-head); font-weight: 700; font-size: clamp(1rem, 2vw, 1.3rem); word-break: break-word; }
.pc-char { font-size: .85rem; font-weight: 700; color: var(--text-soft); }
.pc-score { display: flex; flex-direction: column; align-items: center; line-height: 1; margin-top: 2px; }
.pc-score b { font-family: var(--font-head); font-size: clamp(1.8rem, 3.6vw, 2.6rem); color: var(--pc); }
.pc-score small { font-size: .75rem; font-weight: 800; color: var(--text-soft); text-transform: uppercase; letter-spacing: .06em; }
.pc-eat { font-size: .8rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--pc) 22%, transparent); }
.pc-eat.used { opacity: .45; text-decoration: line-through; }

.board-wrap { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 1.8vh, 16px); }
.turn-banner {
  display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border-radius: 999px;
  background: var(--panel); box-shadow: var(--panel-shadow), inset 0 0 0 3px var(--pc);
  font-weight: 800; font-size: clamp(.95rem, 2vw, 1.15rem); max-width: 100%;
}
.turn-banner.flip { animation: bannerIn .45s cubic-bezier(.2, 1.5, .4, 1); }
.turn-banner b { color: var(--pc); }
.tb-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--pc); padding: 3px; }

.board {
  --n: 3; --gap: clamp(7px, 1.4vw, 12px);
  display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: var(--gap); padding: var(--gap);
  width: min(88vw, calc(100dvh - 300px), 540px); min-width: 240px; aspect-ratio: 1;
  border-radius: var(--radius); background: var(--board-bg);
  box-shadow: var(--panel-shadow), inset 0 0 0 2px var(--panel-border);
  transition: box-shadow .4s;
}
.cell {
  position: relative; border-radius: var(--cell-radius); background: var(--cell);
  box-shadow: var(--cell-shadow);
  animation: cellIn .45s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: var(--d);
  transition: transform .15s ease, background .2s, box-shadow .2s, opacity .25s;
}
.cell:not(.taken):hover { transform: translateY(-3px); background: var(--cell-hover); box-shadow: var(--cell-shadow), inset 0 0 0 3px var(--turn); }
.cell.picked { background: var(--cell-hover); box-shadow: var(--cell-shadow), inset 0 0 0 4px var(--turn); animation: pulse 1s ease-in-out infinite; }
.cell.nope { animation: shake .35s ease; }
.token {
  position: absolute; inset: 7%; display: grid; place-items: center; padding: 8%;
  border-radius: var(--token-radius); clip-path: var(--token-clip);
  background: var(--pc); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .45), 0 4px 0 rgba(0, 0, 0, .12);
}
.token svg { width: 100%; height: 100%; }
.token.pop { animation: pop .5s cubic-bezier(.3, 1.7, .5, 1); }
.token.chomp svg { animation: chomp .5s ease .1s; }
.token.eaten { animation: eaten .5s cubic-bezier(.6, -.4, .7, 1) forwards; }
.cell.win .token { animation: winPulse 1s ease-in-out infinite; }
.board.finished .cell:not(.win) { opacity: .45; }
.board.eat-mode .cell:not(.target) { pointer-events: none; }
.board.eat-mode .cell:not(.target) .token { filter: grayscale(1) opacity(.45); }
.board.eat-mode .cell:not(.target):not(.taken) { opacity: .55; }
.board.eat-mode .cell.target { cursor: crosshair; box-shadow: var(--cell-shadow), inset 0 0 0 3px var(--turn); }
.board.eat-mode .cell.target::after { content: "🍽️"; position: absolute; right: 4%; top: 4%; font-size: clamp(14px, 2.6vw, 22px); z-index: 1; animation: bob 1s ease-in-out infinite; }
.board.eat-mode .cell.target .token { animation: wiggle .7s ease-in-out infinite; }
.board.eat-mode .cell.target:hover { transform: scale(1.05); box-shadow: var(--cell-shadow), inset 0 0 0 4px var(--turn); }
.cell.eat-target { box-shadow: var(--cell-shadow), inset 0 0 0 4px var(--turn); }
.board-actions { display: flex; gap: 10px; min-height: 52px; }
.btn-eat { background: var(--pc, var(--accent-2)); color: #fff; box-shadow: 0 5px 0 color-mix(in srgb, var(--pc) 65%, #000); }
.btn-eat small { font-size: .78em; opacity: .9; }
.btn-eat:not(:disabled):hover { filter: brightness(1.08); }

/* ---------- Modali ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 14px;
  background: var(--modal-bg); animation: fadeIn .22s ease;
  overflow-y: auto;
}
.modal.closing { animation: fadeOut .18s ease forwards; }
.q-card, .result-card, .small-card {
  width: min(680px, 100%); border-radius: var(--radius); padding: clamp(16px, 3vw, 28px);
  background: var(--card-bg); box-shadow: 0 30px 60px -20px rgba(20, 0, 50, .55), inset 0 0 0 2px var(--panel-border);
  animation: cardIn .4s cubic-bezier(.2, 1.4, .4, 1);
}
.modal.closing .q-card, .modal.closing .result-card, .modal.closing .small-card { animation: cardOut .18s ease forwards; }
.q-card { box-shadow: 0 30px 60px -20px rgba(20, 0, 50, .55), inset 0 0 0 3px var(--pc); }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; }
.q-player { display: flex; align-items: center; gap: 8px; font-weight: 800; min-width: 0; }
.q-player span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--pc); padding: 3px; }
.q-cat { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 800; color: #fff; background: var(--cc); box-shadow: 0 4px 0 color-mix(in srgb, var(--cc) 65%, #000); white-space: nowrap; }
.q-cat:empty { visibility: hidden; }
.q-cat span { font-size: 1.2em; }
.q-timer { position: relative; width: 52px; height: 52px; flex: none; }
.q-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.q-timer circle { fill: none; stroke-width: 5; }
.q-timer .track { stroke: var(--seg-bg); }
.q-timer .bar { stroke: var(--accent-2); stroke-linecap: round; stroke-dasharray: 125.66; stroke-dashoffset: 0; }
.q-timer span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.q-timer.warn .bar { stroke: var(--bad); }
.q-timer.warn span { color: var(--bad); animation: tickPulse 1s ease infinite; }
.q-eat-progress { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 8px 14px; border-radius: var(--btn-radius); background: color-mix(in srgb, var(--pc) 16%, transparent); font-weight: 800; }
.q-eat-progress .dots { display: flex; gap: 6px; }
.q-eat-progress i { width: 14px; height: 14px; border-radius: 50%; background: var(--seg-bg); box-shadow: inset 0 0 0 2px var(--pc); }
.q-eat-progress i.done { background: var(--ok); box-shadow: none; }
.q-eat-progress i.cur { background: var(--pc); animation: tickPulse 1s ease infinite; }

.q-spin { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: clamp(24px, 5vh, 48px) 0; }
.spin-icon {
  width: 110px; height: 110px; display: grid; place-items: center; font-size: 3.6rem; border-radius: 50%;
  background: color-mix(in srgb, var(--cc, #888) 22%, var(--card-bg)); box-shadow: inset 0 0 0 5px var(--cc, #888);
  transition: box-shadow .1s, background .1s;
}
.spin-icon.roll { animation: roll .14s ease-out; }
.spin-name { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; }
.q-spin.landed .spin-icon { animation: land .5s cubic-bezier(.3, 1.8, .5, 1); }
.q-spin.landed .spin-name { color: var(--cc); }

.q-body { animation: bodyIn .3s ease; }
.q-text { margin: 18px 0 16px; font-weight: 900; font-size: clamp(1.2rem, 3.2vw, 1.65rem); line-height: 1.3; text-align: center; text-wrap: balance; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer {
  display: flex; align-items: center; gap: 10px; text-align: left; min-height: 60px;
  padding: 10px 14px; border-radius: var(--btn-radius); font-weight: 800; font-size: clamp(.98rem, 2.2vw, 1.12rem);
  background: var(--answer-bg); box-shadow: inset 0 0 0 2px var(--panel-border), 0 4px 0 var(--answer-shadow);
  animation: answerIn .35s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: var(--d);
  transition: transform .12s ease, background .2s, box-shadow .2s, opacity .25s;
}
.answer:hover:not(:disabled) { transform: translateY(-2px); box-shadow: inset 0 0 0 3px var(--pc), 0 6px 0 var(--answer-shadow); }
.answer:active:not(:disabled) { transform: translateY(2px); }
.answer .letter { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-family: var(--font-head); background: var(--pc); color: #fff; }
.answer:disabled { cursor: default; }
.answer.correct { background: var(--ok); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--ok) 65%, #000); animation: correctBounce .5s cubic-bezier(.3, 1.8, .5, 1); }
.answer.correct .letter { background: #fff; color: var(--ok); }
.answer.wrong { background: var(--bad); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--bad) 65%, #000); animation: shake .4s ease; }
.answer.wrong .letter { background: #fff; color: var(--bad); }
.answer.dim { opacity: .45; }
.q-feedback { margin-top: 16px; padding: 14px 16px; border-radius: var(--btn-radius); text-align: center; animation: bodyIn .3s ease; }
.q-feedback.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); }
.q-feedback.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); }
.fb-title { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; }
.q-feedback.ok .fb-title { color: var(--ok); }
.q-feedback.bad .fb-title { color: var(--bad); }
.fb-info { margin: 6px 0 12px; font-weight: 700; line-height: 1.4; }

.result-card { text-align: center; width: min(520px, 100%); }
.result-art { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.ra-avatar { width: 150px; aspect-ratio: 1; padding: 12px; border-radius: var(--token-radius); clip-path: var(--token-clip); background: var(--pc); box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .5); animation: winnerIn .7s cubic-bezier(.3, 1.6, .5, 1) both; }
.ra-avatar.small { width: 110px; }
.crown { position: absolute; top: -34px; left: 50%; font-size: 3rem; transform: translateX(-50%) rotate(-8deg); animation: crownDrop .8s cubic-bezier(.3, 1.6, .5, 1) .3s both; z-index: 1; }
.vs { font-size: 2rem; }
.result-title { margin: 10px 0 4px; font-family: var(--font-head); font-size: clamp(1.6rem, 5vw, 2.3rem); }
.result-sub { margin: 0 0 14px; font-weight: 700; color: var(--text-soft); }
.result-score { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 14px; margin-bottom: 18px; font-weight: 800; }
.result-score span { color: var(--pc); }
.result-score b { font-family: var(--font-head); font-size: 2rem; }
.result-score small { width: 100%; color: var(--text-soft); }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.small-card { width: min(460px, 100%); text-align: center; }
.small-card h3 { font-family: var(--font-head); font-size: 1.35rem; margin: 6px 0 18px; }
.rules-card { width: min(600px, 100%); text-align: left; }
.rules-card h2 { font-family: var(--font-head); margin: 0 0 8px; text-align: center; }
.rules-card ol { padding-left: 1.3em; line-height: 1.5; font-weight: 700; }
.rules-card li { margin-bottom: 6px; }
.rules-card .hint { text-align: center; margin-bottom: 14px; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
#toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 70;
  transform: translate(-50%, 140%); padding: 12px 20px; border-radius: 999px; max-width: calc(100% - 24px);
  background: var(--toast-bg); color: var(--toast-text); font-weight: 800; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5);
  transition: transform .35s cubic-bezier(.2, 1.4, .4, 1), opacity .25s, visibility 0s .35s; text-align: center;
  opacity: 0; visibility: hidden;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .35s cubic-bezier(.2, 1.4, .4, 1), opacity .2s; }

/* ---------- Animacije ---------- */
@keyframes letterIn { from { opacity: 0; transform: translateY(-40px) scale(.6) rotate(-12deg); } }
@keyframes cardUp { from { opacity: 0; transform: translateY(40px) scale(.95); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes bump { 0% { transform: scale(.7) rotate(-8deg); } 100% { transform: scale(1); } }
@keyframes cellIn { from { opacity: 0; transform: scale(.6); } }
@keyframes pop { 0% { transform: scale(0) rotate(-25deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes eaten { 0% { transform: scale(1); } 30% { transform: scale(1.15) rotate(8deg); } 100% { transform: scale(0) rotate(-90deg); opacity: 0; } }
@keyframes chomp { 0%, 100% { transform: scale(1); } 25% { transform: scale(1.2, .85); } 50% { transform: scale(.9, 1.15); } 75% { transform: scale(1.1, .92); } }
@keyframes winPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); filter: brightness(1.15); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-7deg) scale(.96); } 75% { transform: rotate(7deg) scale(.96); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(.96); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes bannerIn { from { transform: scale(.85); opacity: .3; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(.92); } }
@keyframes cardOut { to { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes bodyIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes answerIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes correctBounce { 0% { transform: scale(.96); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes roll { from { transform: translateY(-14px) scale(.85); opacity: .4; } }
@keyframes land { 0% { transform: scale(.7); } 100% { transform: scale(1); } }
@keyframes tickPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes winnerIn { from { transform: scale(0) rotate(-20deg); } }
@keyframes crownDrop { from { opacity: 0; transform: translate(-50%, -40px) rotate(-30deg); } }

/* ---------- Prilagodba ekranu ---------- */
@media (max-width: 900px) {
  .setup-grid { grid-template-columns: 1fr 1fr; }
  .options { grid-column: 1 / -1; order: 3; }
}
@media (max-width: 760px) {
  .age-cards { grid-template-columns: 1fr; max-width: 440px; }
  .age-card { display: grid; grid-template-columns: 120px 1fr; align-items: start; text-align: left; padding: 0; column-gap: 12px; }
  .age-card .ac-art { grid-row: 1 / 6; width: 120px; height: 100%; min-height: 128px; margin: 0; }
  .age-card > span:not(.ac-art) { padding-right: 14px; }
  .ac-chars { bottom: 4px; }
  .ac-char:nth-child(1), .ac-char:nth-child(3) { display: none; }
  .ac-char:nth-child(2) { width: 88px; }
  .ac-label { padding-top: 12px; font-size: 1.7rem; }
  .ac-desc { font-size: .88rem; }
  .ac-count { justify-self: start; margin: 6px 0 12px; }
  .game-layout { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; align-content: start; gap: 10px; }
  .board-wrap { grid-column: 1 / -1; grid-row: 2; }
  .player-card { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; text-align: left; padding: 8px 10px; column-gap: 8px; row-gap: 2px; }
  .pc-avatar { width: 48px; padding: 4px; grid-row: 1 / 3; }
  .pc-info { min-width: 0; }
  .pc-name { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pc-char { display: none; }
  .pc-score { grid-row: 1 / 3; grid-column: 3; }
  .pc-score b { font-size: 1.7rem; }
  .pc-score small { display: none; }
  .pc-eat { grid-column: 2; justify-self: start; font-size: .7rem; padding: 1px 8px; white-space: nowrap; }
  .board { width: min(94vw, calc(100dvh - 290px)); }
}
@media (max-width: 560px) {
  .setup-grid { grid-template-columns: 1fr; }
  .char-grid { grid-template-columns: repeat(6, 1fr); max-width: 100%; gap: 6px; }
  .char-btn { border-radius: 12px; padding: 4px; }
  .avatar-big { width: 84px; }
  .answers { grid-template-columns: 1fr; }
  .answer { min-height: 52px; }
  .q-text { margin: 14px 0 12px; }
  .spin-icon { width: 90px; height: 90px; font-size: 3rem; }
  .btn-big { font-size: 1.15rem; }
}
@media (max-height: 640px) and (min-width: 761px) {
  .board { width: min(88vw, calc(100dvh - 220px), 540px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
