/* ============================================================
   Self-hosted font: Baloo 2 (rounded, kid friendly)
   Hosted locally so it works offline on the LAN and so that
   Slovenian characters (č ć š ž đ) always render correctly.
   ============================================================ */

@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/baloo-2-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/baloo-2-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/baloo-2-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/baloo-2-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/baloo-2-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/baloo-2-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/baloo-2-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/baloo-2-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   Kids App — shared design system
   Rounded, friendly, high-contrast, tablet-first.
   ============================================================ */

:root {
  /* Playful palette */
  --sun:    #FFC93C;
  --sun-d:  #E9A800;
  --coral:  #FF6B6B;
  --coral-d:#E24B4B;
  --mint:   #21C7A8;
  --mint-d: #12A98D;
  --sky:    #4D96FF;
  --sky-d:  #2A73DB;
  --grape:  #9B5DE5;
  --grape-d:#7B3FCB;
  --pink:   #FF7BC5;

  --ink:      #23304A;
  --ink-soft: #5A6B87;
  --paper:    #FFFDF7;
  --card:     #FFFFFF;

  --radius:   26px;
  --radius-s: 18px;

  /* one spacing scale for every settings screen */
  --gap:       16px;
  --panel-pad: 20px;
  --chip-gap:  12px;
  --chip-h:    70px;
  --shadow:   0 10px 0 rgba(35,48,74,.10), 0 18px 40px rgba(35,48,74,.12);
  --shadow-s: 0 6px 0 rgba(35,48,74,.08), 0 10px 24px rgba(35,48,74,.10);

  --font: "Baloo 2", "Nunito", -apple-system, "SF Pro Rounded", "Segoe UI Rounded",
          system-ui, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%,  rgba(255,201,60,.35)  0, transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(77,150,255,.28)  0, transparent 32%),
    radial-gradient(circle at 78% 88%, rgba(33,199,168,.30)  0, transparent 34%),
    radial-gradient(circle at 8%  86%, rgba(255,123,197,.28) 0, transparent 32%);
  background-attachment: fixed;
  min-height: 100%;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  --wrap-top: 18px;
  --wrap-x: 18px;
  --wrap-bottom: 40px;
  padding: var(--wrap-top) var(--wrap-x) var(--wrap-bottom);
  /* na iPhonih z zarezo vsebina ne sme pod zarezo ali pod domačo črtico
     — pomembno predvsem, ko je aplikacija dodana na domači zaslon */
  padding:
    max(var(--wrap-top),    env(safe-area-inset-top,    0px))
    max(var(--wrap-x),      env(safe-area-inset-right,  0px))
    max(var(--wrap-bottom), env(safe-area-inset-bottom, 0px))
    max(var(--wrap-x),      env(safe-area-inset-left,   0px));
  min-height: 100dvh;        /* fill the screen, never more: no scrolling */
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  border: 3px solid rgba(35,48,74,.10);
  border-radius: 999px;
  padding: 8px 16px 8px 12px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: var(--shadow-s);
  transition: transform .12s ease;
}
.back:active { transform: translateY(3px); }
.back .ico { font-size: 1.25rem; line-height: 1; }

h1.title {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1.05;
}
.subtitle {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  font-weight: 500;
}

.header-block { text-align: center; padding: 10px 0 22px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.35rem;
  color: #fff;
  background: var(--sky);
  border: none;
  border-radius: var(--radius);
  padding: 18px 34px;
  cursor: pointer;
  box-shadow: 0 7px 0 var(--sky-d);
  transition: transform .1s ease, box-shadow .1s ease, filter .15s ease;
}
.btn:hover  { filter: brightness(1.04); }
.btn:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--sky-d); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.big { font-size: 1.7rem; padding: 22px 56px; width: 100%; max-width: 420px; }
.btn.green { background: var(--mint); box-shadow: 0 7px 0 var(--mint-d); }
.btn.green:active { box-shadow: 0 2px 0 var(--mint-d); }

/* ---------- Cards ---------- */
/* Tloris ni besedilo — sme biti širši od 900 px, da gre več iger
   v vrsto in cela zbirka na en zaslon. */
.wrap.hub { max-width: 1120px; }

.grid {
  display: grid;
  /* Ožji stolpci = več iger v vrsto. Pri trinajstih igrah je to
     razlika med tremi in štirimi vrstami. */
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 11px;
}

.tile {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border-radius: var(--radius);
  padding: 13px 15px 15px;
  box-shadow: var(--shadow);
  border: 4px solid transparent;
  transition: transform .15s ease, border-color .15s ease;
}
.tile { position: relative; }
.tile:hover  { transform: translateY(-4px); border-color: rgba(35,48,74,.10); }
.tile .flags {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: .95rem;
  line-height: 1;
  opacity: .95;
}
.tile:active { transform: translateY(2px); }

.tile .emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 15px;
  font-size: 1.55rem;
  margin-bottom: 6px;
}
.tile h2 { margin: 0 0 2px; font-size: 1.12rem; font-weight: 700; line-height: 1.15; }
.tile p  { margin: 0; color: var(--ink-soft); font-weight: 500; font-size: .86rem; line-height: 1.28; }

.tile.soon { opacity: .55; pointer-events: none; }
.tile .badge {
  display: inline-block;
  margin-top: 12px;
  background: rgba(35,48,74,.08);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.bg-sun   { background: rgba(255,201,60,.25); }
.bg-sky   { background: rgba(77,150,255,.20); }
.bg-mint  { background: rgba(33,199,168,.20); }
.bg-grape { background: rgba(155,93,229,.18); }
.bg-coral { background: rgba(255,107,107,.20); }

/* ---------- Utility ---------- */
.center { display: flex; justify-content: center; }
.cta { margin-top: var(--gap); }   /* same distance from the panels in every game */
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   Shared game components — settings panels, game bar, score chips.
   Used by every game so they all look and behave the same.
   Landscape rule: never make a kid scroll on an iPad.
   ============================================================ */

.panels {
  display: grid;
  gap: var(--gap) var(--gap);
  align-items: stretch;          /* panels in a row are always the same height */
}

.panel {
  position: relative;            /* so .hint can sit at the bottom without adding height */
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  padding: var(--panel-pad) var(--panel-pad) calc(var(--panel-pad) + 10px);
  margin: 0 0 var(--gap);
}
.panels .panel { margin-bottom: 0; }   /* the grid gap spaces them instead */

.panel-title {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: var(--chip-gap);
  flex: 1;                       /* chips sit centred in whatever height the row has */
}

.chip {
  white-space: nowrap;
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--ink);
  background: #F1F4FA;
  border: 4px solid transparent;
  border-radius: 20px;
  padding: 10px 20px;
  min-width: 78px;
  min-height: var(--chip-h);     /* one-line and two-line chips match */
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: transform .1s ease, background .15s ease, color .15s ease;
}
.chip:active { transform: translateY(3px); }
.chip.on {
  background: var(--sky);
  color: #fff;
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 5px 0 var(--sky-d);
}

.record-line {
  text-align: center;
  margin-top: 20px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 1.05rem;
  min-height: 1.5em;
}

/* validation hint is pinned to the bottom of its panel, so a panel with a hint
   is never taller than one without */
.hint {
  position: absolute;
  left: var(--panel-pad);
  right: var(--panel-pad);
  bottom: 6px;
  margin: 0;
  color: var(--coral-d);
  font-weight: 600;
  font-size: .95rem;
  visibility: hidden;
}
.hint.show { visibility: visible; }

/* settings screens sit optically centred when there is room to spare */
#setup {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#setup .header-block { margin-top: auto; }
#setup .record-line { margin-bottom: auto; }

/* ---------- game bar ---------- */
.game-bar { justify-content: space-between; }
.bar-left { display: flex; align-items: center; gap: 10px; }
.back.icon-only { padding: 8px 14px; }
.back.home .ico { font-size: 1.35rem; }
.back.icon-only .ico { font-size: 1.3rem; }
.back.muted { opacity: .55; }

.scores { display: flex; gap: 10px; flex-wrap: wrap; }
.score-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 18px;
  padding: 6px 16px;
  box-shadow: var(--shadow-s);
  min-width: 86px;
  border: 3px solid transparent;
}
.score-chip .lbl { font-size: .8rem; font-weight: 600; color: var(--ink-soft); letter-spacing: .3px; }
.score-chip .val { font-size: 1.6rem; font-weight: 700; line-height: 1.05; }
.score-chip.pop { animation: pop .45s ease; }
@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.2) rotate(-3deg); }
  100% { transform: scale(1); }
}


/* ============================================================
   Skupne sestavine iger
   Ta pravila so bila prej po črki enaka v treh ali več igrah.
   Zdaj so tu: en popravek namesto šestih, in brskalnik jih
   naloži samo enkrat za vse igre.
   Posamezna igra jih lahko še vedno povozi v svoji datoteki,
   ker se ta naloži za kids.css.
   ============================================================ */

#game { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.answers.locked .answer { pointer-events: none; }

.feedback.good { color: var(--mint-d); }

.feedback.bad  { color: var(--coral-d); }

.chip.lang { gap: 1px; }

.chip.lang .l-flag { font-size: 1.15rem; line-height: 1; }

.chip.lang .l-name { font-size: .82rem; line-height: 1.1; font-weight: 500; opacity: .9; }

.overlay {
  position: fixed; inset: 0;
  background: rgba(35,48,74,.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 20;
  animation: fade .25s ease;
}

.overlay-card {
  background: #fff; border-radius: 34px; box-shadow: var(--shadow);
  padding: clamp(20px, 4vh, 34px) 30px clamp(18px, 3.4vh, 30px);
  text-align: center; max-width: 460px; width: 100%;
  animation: rise .35s cubic-bezier(.2,.9,.3,1.3);
}

.overlay-emoji { font-size: clamp(2.4rem, 7vh, 4rem); line-height: 1; }

.overlay-card h2 { margin: 8px 0 6px; font-size: clamp(1.5rem, 4.4vh, 2.1rem); font-weight: 700; }

.overlay-card p { margin: 0; font-size: clamp(1rem, 2.6vh, 1.2rem); font-weight: 500; color: var(--ink-soft); }

.win-record { margin-top: 10px !important; color: var(--sun-d) !important; font-weight: 700 !important; }

.overlay-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: clamp(14px, 3vh, 24px); }

.overlay-btns .btn { font-size: 1.1rem; padding: 12px 24px; }

#levels .chip.on { background: var(--grape); box-shadow: 0 5px 0 var(--grape-d); }

.turn-line .who {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: clamp(1.05rem, 2.6vh, 1.3rem);
  font-weight: 700; color: #fff;
  border-radius: 999px; padding: 7px 20px;
  animation: turnIn .35s cubic-bezier(.2,.9,.3,1.4);
}

.turn-line .who.p1 { background: var(--sky);   box-shadow: 0 4px 0 var(--sky-d); }

.turn-line .who.p2 { background: var(--coral); box-shadow: 0 4px 0 var(--coral-d); }

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

@keyframes rise { from { transform: translateY(26px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

@keyframes turnIn { from { transform: translateY(-8px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}


/* ============================================================
   Skupne sestavine iger
   Ta pravila so bila prej po črki enaka v treh ali več igrah.
   Zdaj so tu: en popravek namesto šestih, in brskalnik jih
   naloži samo enkrat za vse igre.
   Posamezna igra jih lahko še vedno povozi v svoji datoteki,
   ker se ta naloži za kids.css.
   ============================================================ */

.score-chip.player { position: relative; transition: background .2s ease, transform .2s ease, box-shadow .2s ease, opacity .2s ease; }

.score-chip.player .lbl, .score-chip.player .val { transition: color .2s ease; }

.score-chip.player:not(.active) { opacity: .8; }

.score-chip.player.p1:not(.active) .val { color: var(--sky-d); }

.score-chip.player.p2:not(.active) .val { color: var(--coral-d); }

.score-chip.player.active .lbl, .score-chip.player.active .val { color: #fff; }

.score-chip.player.p1.active { background: var(--sky);   box-shadow: 0 7px 0 var(--sky-d); }

.score-chip.player.p2.active { background: var(--coral); box-shadow: 0 7px 0 var(--coral-d); }



/* ---------- landscape / short screens: fit on one screen ----------
   iPad landscape, laptops, phones turned sideways.              */
@media (min-width: 700px) {
  .panels { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .header-block { padding: 4px 0 12px; }
  /* one tidy row per panel instead of a ragged wrap */
  .panels .chip { flex: 1 1 0; min-width: 0; padding-left: 10px; padding-right: 10px; }
}

/* hub on a short screen: trim the header, keep the tiles tidy */
@media (max-height: 700px) {
  :root { --chip-h: 60px; --gap: 12px; }
  .header-block { padding: 0 0 6px; }
  h1.title { font-size: clamp(1.7rem, 5vw, 2.3rem); }
  .subtitle { font-size: .98rem; margin-top: 3px; }
  .tile { padding: 12px 14px 14px; }
  .tile .emoji { width: 44px; height: 44px; font-size: 1.5rem; border-radius: 14px; margin-bottom: 6px; }
  .tile h2 { font-size: 1.1rem; }
  .tile p { font-size: .85rem; }
}

@media (orientation: landscape) and (max-height: 560px) {
  :root { --gap: 10px; --panel-pad: 14px; --chip-gap: 7px; --chip-h: 50px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .tile p { display: none; }
  .tile { padding: 10px 12px 12px; }
  .wrap { --wrap-top: 8px; --wrap-x: 14px; --wrap-bottom: 14px; }
  .header-block { padding: 0 0 6px; }
  h1.title { font-size: 1.45rem; }
  .subtitle { display: none; }              /* phones sideways: every pixel counts */
  .topbar { margin-bottom: 8px; }
  .panel-title { font-size: .95rem; margin-bottom: 7px; }
  .chip { font-size: .95rem; padding: 5px 12px; min-width: 52px; border-radius: 14px; border-width: 3px; }
  .btn.big { font-size: 1.15rem; padding: 11px 30px; }
  .record-line { margin-top: 8px; font-size: .85rem; min-height: 1.2em; }
  .score-chip { padding: 3px 11px; min-width: 68px; border-radius: 14px; }
  .score-chip .val { font-size: 1.2rem; }
  .score-chip .lbl { font-size: .68rem; }
  .back { padding: 6px 13px 6px 10px; font-size: .92rem; }
  .back.icon-only .ico { font-size: 1.1rem; }
}

@media (orientation: landscape) and (max-height: 380px) {
  :root { --gap: 8px; --panel-pad: 10px; --chip-gap: 6px; --chip-h: 40px; }
  /* Telefon na boku: enajst iger mora v dve vrsti, sicer se pojavi drsnik. */
  .grid { grid-template-columns: repeat(6, 1fr); gap: 7px; }
  .tile { padding: 7px 8px 9px; border-radius: 16px; }
  .tile .emoji { width: 32px; height: 32px; font-size: 1.1rem; border-radius: 11px; margin-bottom: 3px; }
  .tile h2 { font-size: .78rem; line-height: 1.12; }
  .tile .flags { top: 5px; right: 6px; font-size: .62rem; }
  .wrap { --wrap-top: 6px; --wrap-x: 12px; --wrap-bottom: 10px; }
  h1.title { font-size: 1.2rem; }
  .panel-title { font-size: .85rem; margin-bottom: 5px; }
  .chip { font-size: .85rem; padding: 4px 10px; min-width: 44px; border-radius: 12px; }
  .btn.big { font-size: 1rem; padding: 8px 24px; }
  .record-line { margin-top: 6px; font-size: .78rem; min-height: 1em; }
  .topbar { margin-bottom: 6px; }
  .score-chip { padding: 2px 9px; min-width: 60px; }
  .score-chip .val { font-size: 1.05rem; }
  .score-chip .lbl { font-size: .62rem; }
}

/* ---------- narrow phones in portrait ---------- */
@media (max-width: 480px) {
  :root { --gap: 8px; --panel-pad: 12px; --chip-gap: 7px; --chip-h: 58px; }

  /* hub: three name-only tiles per row, so every game fits on one screen */
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tile { padding: 8px 6px 10px; border-radius: 16px; text-align: center; }
  .tile .emoji { width: 36px; height: 36px; font-size: 1.2rem; border-radius: 12px; margin-bottom: 4px; }
  .tile h2 { font-size: .85rem; line-height: 1.12; }
  .tile p { display: none; }
  /* na ozkem telefonu zastavici ne smeta sedeti čez ikono — gresta pod ime */
  .tile { display: flex; flex-direction: column; align-items: center; }
  .tile .emoji { order: 1; }
  .tile h2 { order: 2; }
  .tile .flags {
    order: 3;
    position: static;
    margin-top: 4px;
    font-size: .78rem;
    line-height: 1;
  }
  .wrap { --wrap-top: 14px; --wrap-x: 14px; --wrap-bottom: 24px; }
  .header-block { padding: 4px 0 14px; }
  .panel-title { font-size: .98rem; margin-bottom: 7px; }
  .chip { font-size: 1.02rem; padding: 6px 12px; min-width: 52px; }
  .header-block { padding: 2px 0 10px; }
  h1.title { font-size: clamp(1.5rem, 7vw, 1.9rem); }
  .subtitle { font-size: .92rem; }
  .record-line { margin-top: 14px; }
  .btn.big { font-size: 1.45rem; padding: 16px 40px; }
}

/* ---------- Namig: dodaj na začetni zaslon ---------- */
/* Lebdi nad vsebino (position: fixed), da ne premakne postavitve
   in ne povzroči drsenja na nobeni velikosti zaslona. */
#installTip {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(160%);
  z-index: 60;
  width: min(540px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 3px solid rgba(35,48,74,.10);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(35,48,74,.20);
  transition: transform .38s cubic-bezier(.2,.9,.3,1.25);
}
#installTip.show { transform: translateX(-50%) translateY(0); }

#installTip .ic { flex: none; font-size: 1.5rem; line-height: 1; }
#installTip .tx { flex: 1; font-size: .9rem; font-weight: 500; line-height: 1.35; color: var(--ink); }
#installTip .tx b { font-weight: 700; white-space: nowrap; }

#installTip .share {
  width: 1em; height: 1em;
  vertical-align: -.16em;
  color: var(--sky);
}

#installTip .go {
  flex: none;
  font: inherit;
  font-weight: 700;
  font-size: .92rem;
  color: #fff;
  background: var(--sky);
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  box-shadow: 0 4px 0 var(--sky-d);
  cursor: pointer;
}
#installTip .go:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--sky-d); }

#installTip .x {
  flex: none;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--ink-soft);
  background: rgba(35,48,74,.06);
  border: 0;
  border-radius: 999px;
  width: 30px; height: 30px;
  cursor: pointer;
}

@media (max-width: 480px) {
  #installTip { gap: 9px; padding: 10px 11px; border-radius: 18px; }
  #installTip .tx { font-size: .82rem; }
  #installTip .ic { display: none; }
}

/* Na ležečem telefonu je višine premalo — namig raje preskočimo. */
@media (orientation: landscape) and (max-height: 430px) {
  #installTip { display: none; }
}

/* ---------- Izbirnik na tlorisu: za koga je igra ---------- */
.filter {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 var(--gap);
}
.fchip {
  font: inherit;
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink-soft);
  background: #fff;
  border: 3px solid rgba(35,48,74,.10);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.fchip:hover { border-color: rgba(35,48,74,.20); }
.fchip.on {
  background: var(--sky);
  border-color: var(--sky-d);
  color: #fff;
  box-shadow: 0 4px 0 var(--sky-d);
}
.tile.hidden { display: none; }

@media (max-height: 700px) {
  .filter { margin-bottom: 6px; }
  .fchip { font-size: .84rem; padding: 5px 13px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .filter { gap: 6px; margin-bottom: 8px; }
  .fchip { font-size: .8rem; padding: 4px 12px; border-width: 2px; }
}
@media (orientation: landscape) and (max-height: 380px) {
  .fchip { font-size: .72rem; padding: 3px 10px; }
}

/* ---------- Mali Genij: odziv v kotu ---------- */
/* Škatla stalne velikosti; slika se vanjo vedno prilega v celoti.
   Razmerja izrazov se močno razlikujejo (0,84 do 1,41), zato sme
   velikost določati samo škatla — sicer se sovi odreže noge. */
.owl-pop {
  position: fixed;
  left: max(10px, env(safe-area-inset-left, 0px));
  top: auto;
  bottom: max(10px, env(safe-area-inset-bottom, 0px));
  width:  clamp(96px, 19vh, 170px);
  height: clamp(96px, 19vh, 170px);
  z-index: 30;
  pointer-events: none;          /* nikoli ne prestreza tapa */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(28px) scale(.85);
  transition: opacity .22s ease, transform .32s cubic-bezier(.2,.9,.3,1.4);
}
.owl-pop img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 14px rgba(35,48,74,.18));
}
.owl-pop.show { opacity: 1; transform: translateY(0) scale(1); }

/* Sova ob koncu kroga stoji v okencu namesto emojija. */
.overlay-emoji .owl-end {
  width: clamp(110px, 24vh, 180px);
  height: clamp(110px, 24vh, 180px);
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Sova na tlorisu, ob imenu. */
.brand-owl {
  display: inline-block;
  height: clamp(46px, 9vh, 76px);
  width: auto;
  vertical-align: -.20em;
  /* Negativna robova preprečita, da bi slika raztegnila vrstico
     naslova — sicer tloris zdrsne čez rob zaslona. Spodnji je
     manjši, da glava ne sede na podnaslov. */
  margin: -.34em 0 -.12em 8px;
  filter: drop-shadow(0 6px 10px rgba(35,48,74,.16));
}

/* Nizek telefon (iPhone SE, starejši Androidi): trinajst iger mora
   v pet vrst brez drsnika, zato so ploščice še malo nižje. */
@media (max-width: 480px) and (max-height: 700px) {
  .grid { gap: 6px; }
  .tile { padding: 6px 5px 8px; border-radius: 14px; }
  .tile .emoji { width: 30px; height: 30px; font-size: 1rem; border-radius: 10px; margin-bottom: 3px; }
  .tile h2 { font-size: .78rem; line-height: 1.08; }
  .tile .flags { font-size: .58rem; margin-top: 2px; }
  .filter { margin-bottom: 5px; }
  .fchip { font-size: .78rem; padding: 4px 11px; }
  .header-block { padding: 0 0 4px; }
  .brand-owl { height: 40px; margin: -.3em 0 -.1em 6px; }
}

/* Na telefonu je vsak kot zaseden — sova mora biti manjša,
   sicer pokrije tipkovnico ali karte. */
@media (max-width: 700px) {
  /* Na telefonu se pokaže samo glava — pri tej velikosti je
     razločnejša od celega lika. */
  .owl-pop { width: clamp(66px, 12vh, 92px); height: clamp(66px, 12vh, 92px); left: 6px; bottom: 6px; }
}

/* Na ležečem telefonu ni prostora — odziv preskočimo. */
@media (orientation: landscape) and (max-height: 430px) {
  .owl-pop { display: none; }
  .overlay-emoji .owl-end { width: 84px; height: 84px; }
  /* Na boku telefona je vsaka pika višine dragocena. */
  .brand-owl { height: 26px; margin: -2px 0 -2px 6px; vertical-align: -.26em; }
}
