/* Croatian Flashcards — look & feel
   Adriatic navy, sea blue, terracotta roofs and limestone paper. */
:root {
  --paper: #f6f0e4;
  --paper-2: #efe6d4;
  --card: #fffdf8;
  --ink: #1d2a3a;
  --ink-soft: #5d6878;
  --navy: #15365e;
  --sea: #2a6fa6;
  --sea-soft: #dce9f4;
  --terra: #c4553a;
  --terra-soft: #f6dfd6;
  --olive: #66773a;
  --good: #2f8a4c;
  --good-soft: #dff1e3;
  --bad: #c23a32;
  --bad-soft: #f8dedb;
  --line: #e2d8c4;
  --radius: 18px;
  --shadow: 0 1px 0 rgba(29,42,58,.06), 0 8px 24px -12px rgba(29,42,58,.25);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(42,111,166,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(196,85,58,.08), transparent 60%),
    var(--paper);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; }
code { font-size: .9em; background: var(--paper-2); padding: 1px 5px; border-radius: 5px; }

/* šahovnica strip */
.checker {
  height: 8px;
  background:
    conic-gradient(#c8102e 25%, #fff 0 50%, #c8102e 0 75%, #fff 0) 0 0 / 16px 16px;
  opacity: .9;
}

.topbar {
  max-width: 920px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.25rem; color: var(--navy); }
.brand b { font-weight: 700; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px; box-shadow: inset 0 0 0 2px var(--navy);
  background: conic-gradient(#c8102e 25%, #fff 0 50%, #c8102e 0 75%, #fff 0) 0 0 / 14px 14px;
}
.icon-btn { width: 40px; height: 40px; border-radius: 50%; font-size: 1.15rem; background: var(--card); box-shadow: var(--shadow); }
.icon-btn.on { background: var(--sea-soft); }

.app { max-width: 920px; margin: 0 auto; padding: 8px 20px 40px; }
.foot { text-align: center; color: var(--ink-soft); font-size: .8rem; padding: 10px 20px 30px; }

h1, h2, h3 { font-family: var(--serif); color: var(--navy); margin: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---------- home ---------- */
.hero { padding: 18px 0 22px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; letter-spacing: -.01em; }
.lead { margin: 8px 0 0; font-size: 1.1rem; color: var(--ink-soft); }

.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.topic {
  text-align: left; background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); display: grid; gap: 2px; position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
  border: 1px solid transparent;
}
.topic:hover { transform: translateY(-2px); border-color: var(--line); }
.topic-icon { font-size: 1.9rem; line-height: 1; margin-bottom: 8px; }
.topic-icon.lg { font-size: 2.6rem; margin: 0; }
.topic-name { font-weight: 700; font-size: 1.02rem; }
.topic-hr { font-family: var(--serif); font-style: italic; color: var(--sea); }
.topic-count { font-size: .78rem; color: var(--ink-soft); margin-top: 6px; }
.topic.feature { grid-column: span 2; background: var(--navy); color: #fff; padding: 20px; }
.topic.feature .topic-hr { color: #a9cdee; }
.topic.feature .topic-count { color: #c9d6e6; }
.topic.feature:nth-child(2) { background: #7a1f3d; }
.topic.feature:nth-child(2) .topic-hr { color: #f2b9c8; }
.topic.feature .topic-icon { font-size: 2.4rem; }
@media (max-width: 520px) { .topic.feature { grid-column: span 1; } .topics { grid-template-columns: 1fr 1fr; } .topic.feature { grid-column: span 2; } }

/* ---------- mode screen ---------- */
.back { color: var(--ink-soft); padding: 6px 2px; font-weight: 500; }
.back:hover { color: var(--navy); }
.mode-head { display: flex; gap: 16px; align-items: center; margin: 8px 0 18px; }
.mode-head h2 { font-size: 2rem; }
.mode-head p { margin: 2px 0 0; }

.panel { background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.panel h3, .settings h3 { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin-bottom: 8px; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 22px; }
.level-note { grid-column: 1 / -1; margin: 0; }
.seg { display: inline-flex; background: var(--paper-2); padding: 4px; border-radius: 12px; gap: 2px; }
.seg button { padding: 8px 14px; border-radius: 9px; font-weight: 500; color: var(--ink-soft); }
.seg button.on { background: var(--card); color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { padding: 7px 13px; border-radius: 999px; background: var(--paper-2); color: var(--ink-soft); font-weight: 500; font-size: .92rem; }
.chip-btn.on { background: var(--sea); color: #fff; }

.section-title { font-size: 1.35rem; margin: 22px 0 12px; }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mode {
  display: flex; gap: 14px; align-items: flex-start; text-align: left; background: var(--card);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 1px solid transparent;
  transition: transform .15s, border-color .15s;
}
.mode:hover { transform: translateY(-2px); border-color: var(--sea); }
.mode-icon { font-size: 1.6rem; width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: var(--sea-soft); border-radius: 12px; }
.mode b { display: block; margin-bottom: 2px; }
.mode .muted { font-size: .88rem; }

/* ---------- play ---------- */
.play-top { display: flex; align-items: center; gap: 14px; margin: 4px 0 10px; }
.play-top .back { font-size: 1.2rem; width: 36px; height: 36px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); }
.progress { flex: 1; height: 10px; background: var(--paper-2); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--sea), var(--navy)); border-radius: 99px; transition: width .3s; }
.counter { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 500; min-width: 58px; text-align: right; }
.play-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tag { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--sea); font-weight: 700; }
.streak { font-weight: 700; color: var(--ink-soft); transition: transform .2s; }
.streak.hot { color: var(--terra); transform: scale(1.12); }

.card {
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow); padding: 26px 22px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  max-width: 640px; margin: 0 auto 18px; border: 1px solid var(--line);
}
.ask { margin: 0; color: var(--ink-soft); font-weight: 500; }
.big { font-family: var(--serif); font-size: clamp(1.8rem, 6vw, 2.8rem); line-height: 1.15; color: var(--navy); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.big.en { font-family: var(--sans); font-weight: 700; color: var(--ink); font-size: clamp(1.5rem, 5vw, 2.2rem); }
.gap { color: var(--terra); letter-spacing: .05em; }
.pron-inline { color: var(--sea); font-style: italic; margin-right: .25em; }
.say { font-size: 1.1rem; width: 38px; height: 38px; border-radius: 50%; background: var(--sea-soft); flex: none; }
.say:hover { background: #c9ddef; }

.equation { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.chip { font-family: var(--serif); font-size: 1.6rem; padding: 8px 16px; border-radius: 14px; background: var(--paper-2); color: var(--navy); }
.chip.pron { background: var(--sea); color: #fff; font-style: italic; }
.chip.verb { background: var(--terra-soft); color: #8a3420; }
.chip.blank { background: transparent; border: 2px dashed var(--line); color: var(--ink-soft); }
.plus { color: var(--ink-soft); font-size: 1.4rem; }

/* pictures */
.pic { position: relative; width: 120px; height: 120px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(160deg, #fff, var(--paper-2)); overflow: hidden; }
.pic.pic-lg { width: min(240px, 60vw); height: min(240px, 60vw); border-radius: 26px; }
.pic.pic-md { width: 130px; height: 130px; }
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.pic.has-img > :not(img) { visibility: hidden; }
.emoji { font-size: 4.2rem; line-height: 1; }
.pic-lg .emoji { font-size: 8rem; }
.pic-md .emoji { font-size: 4.6rem; }
.swatch { position: absolute; inset: 14%; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), 0 6px 16px -6px rgba(0,0,0,.35); }
.pictext { font-family: var(--serif); font-size: 2.6rem; font-weight: 700; color: var(--navy); }
.pic-lg .pictext { font-size: 4.2rem; }

/* options */
.options { display: grid; grid-template-columns: 1fr; gap: 10px; max-width: 640px; margin: 0 auto; }
.options.n4, .options.n6 { grid-template-columns: 1fr 1fr; }
.options.grid { grid-template-columns: repeat(2, 1fr); max-width: 440px; }
.options.grid.n6 { max-width: 560px; }
.options.grid.n6 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 480px) { .options.grid.n6 { grid-template-columns: repeat(2, 1fr); } }
.option {
  position: relative; background: var(--card); border-radius: 16px; padding: 16px 18px; min-height: 62px;
  box-shadow: var(--shadow); border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: transform .12s, border-color .12s, background .2s;
}
.option:hover:not(:disabled) { border-color: var(--sea); transform: translateY(-1px); }
.opt-label { font-family: var(--serif); font-size: 1.3rem; color: var(--navy); }
.opt-sub { font-size: .8rem; color: var(--ink-soft); }
.options.grid .option { padding: 10px; }
.options.grid .option .pic { width: 100%; height: auto; aspect-ratio: 1; }
.options.grid .opt-sub { visibility: hidden; }
.options.grid .option.correct .opt-sub, .options.grid .option.wrong .opt-sub { visibility: visible; }
.kbd { position: absolute; top: 6px; left: 9px; font-size: .7rem; color: #b6ad9b; }
.option.correct { background: var(--good-soft); border-color: var(--good); animation: pop .35s ease; }
.option.correct .opt-label { color: var(--good); font-weight: 700; }
.option.wrong { background: var(--bad-soft); border-color: var(--bad); animation: shake .35s ease; }
.option.wrong .opt-label { color: var(--bad); }
.option.dim { opacity: .45; }
@keyframes pop { 50% { transform: scale(1.04); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* typing */
.type-area { max-width: 520px; margin: 0 auto; display: grid; gap: 12px; }
.type-input {
  font-family: var(--serif); font-size: 1.7rem; text-align: center; padding: 14px 16px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--card); color: var(--navy); outline: none; width: 100%;
}
.type-input:focus { border-color: var(--sea); box-shadow: 0 0 0 4px var(--sea-soft); }
.type-input.correct { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.type-input.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); animation: shake .35s; }
.accent-keys { display: flex; gap: 8px; justify-content: center; }
.key { width: 48px; height: 44px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font-family: var(--serif); font-size: 1.3rem; color: var(--navy); }
.key:hover:not(:disabled) { background: var(--sea-soft); }
.type-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.primary, .secondary, .ghost { padding: 12px 22px; border-radius: 14px; font-weight: 700; }
.primary { background: var(--navy); color: #fff; }
.primary:hover { background: #0f2a4a; }
.secondary { background: var(--terra); color: #fff; }
.ghost { background: var(--paper-2); color: var(--ink); font-weight: 500; }
.ghost:disabled { opacity: .5; }

/* feedback */
.feedback { max-width: 640px; margin: 16px auto 0; padding: 0 18px; min-height: 56px; border-radius: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; opacity: 0; transition: opacity .2s; }
.feedback.show { opacity: 1; padding: 14px 18px; }
.feedback.good { background: var(--good-soft); color: #1f5e33; }
.feedback.bad { background: var(--bad-soft); color: #7e2620; }
.feedback b { font-family: var(--serif); font-size: 1.15rem; }
.feedback .next { margin-left: auto; }
.accent-note { flex-basis: 100%; font-style: normal; font-size: .9rem; }

/* restaurant scene */
.scene { width: 100%; max-width: 460px; display: grid; gap: 14px; }
.scene-row { display: flex; align-items: flex-end; gap: 10px; }
.avatar { font-size: 2.6rem; line-height: 1; }
.bubble { background: var(--navy); color: #fff; font-family: var(--serif); font-size: 1.5rem; padding: 12px 16px; border-radius: 18px 18px 18px 4px; display: flex; align-items: center; gap: 10px; text-align: left; }
.bubble .say { background: rgba(255,255,255,.15); }
.bubble .muted { color: #a9bcd3; }
.scene-task { background: var(--terra-soft); color: #7d2f1c; padding: 12px 14px; border-radius: 14px; font-weight: 500; text-align: left; }

/* results */
.results { text-align: center; display: grid; gap: 12px; justify-items: center; padding-top: 12px; }
.score-ring { --p: 0; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--sea) calc(var(--p) * 1%), var(--paper-2) 0); }
.score-ring span { width: 118px; height: 118px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; font-family: var(--serif); font-size: 2.2rem; font-weight: 700; color: var(--navy); }
.results h2 { font-size: 2rem; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 6px 0 10px; }
.missed { width: 100%; max-width: 560px; text-align: left; }
.missed ul { list-style: none; margin: 0; padding: 0; }
.missed li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-family: var(--serif); font-size: 1.1rem; }
.missed li:first-child { border-top: 0; }
.missed .say { width: 32px; height: 32px; font-size: .95rem; }

/* ================================================================
   Hover: grow a little + highlight ring on anything clickable
   ================================================================ */
.topbar-right { display: flex; gap: 8px; }
.topic, .mode, .option, .chip-btn, .seg button, .primary, .secondary, .ghost,
.key, .say, .icon-btn, .play-top .back, .brand-mark {
  transition: transform .16s cubic-bezier(.3,1.6,.5,1), box-shadow .16s ease, background .2s, border-color .16s;
}
.topic:hover, .mode:hover, .option:hover:not(:disabled), .chip-btn:hover, .seg button:hover,
.primary:hover:not(:disabled), .secondary:hover:not(:disabled), .ghost:hover:not(:disabled),
.key:hover:not(:disabled), .say:hover, .icon-btn:hover, .play-top .back:hover,
.topic:focus-visible, .mode:focus-visible, .option:focus-visible, .primary:focus-visible, .ghost:focus-visible {
  transform: scale(1.04);
  box-shadow: 0 0 0 3px var(--sea), 0 0 0 7px rgba(42,111,166,.18), 0 10px 26px -12px rgba(21,54,94,.45);
  border-color: transparent;
  outline: none;
  position: relative; z-index: 2;
}
.topic.feature:hover { box-shadow: 0 0 0 3px #f2c230, 0 0 0 7px rgba(242,194,48,.25), 0 12px 28px -12px rgba(0,0,0,.5); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }
.topic:active, .mode:active, .option:active:not(:disabled), .primary:active, .ghost:active, .key:active, .chip-btn:active, .seg button:active { transform: scale(.97); }
.option:disabled:hover { transform: none; }
.option.correct, .option.wrong { box-shadow: none; }
.back:hover { transform: none; }

/* ================================================================
   Guided spelling
   ================================================================ */
.spell { position: relative; padding: 18px 12px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); border: 2px solid var(--line); cursor: text; transition: border-color .2s, background .3s; }
.spell:focus-within { border-color: var(--sea); box-shadow: 0 0 0 4px var(--sea-soft); }
.spell-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 16px; caret-color: transparent; cursor: text; }
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; pointer-events: none; }
.slot { width: 38px; height: 50px; border-bottom: 3px solid var(--line); display: grid; place-items: center; font-family: var(--serif); font-size: 1.9rem; color: var(--navy); line-height: 1; }
.slot.space { width: 16px; border: 0; }
.slot.punct { width: 18px; border: 0; color: var(--ink-soft); }
.slot.cur { border-color: var(--sea); animation: blink 1.1s ease-in-out infinite; }
.slot.filled { border-color: var(--navy); animation: drop .22s ease; }
.slot.hint { color: #b07a10; border-color: #e0b13c; }
.slot.accent { color: var(--terra); border-color: var(--terra); }
.slot.bad { color: var(--bad); border-color: var(--bad); }
.slot.shake { animation: shake .35s ease; }
@keyframes blink { 50% { border-color: #9cc3e3; } }
@keyframes drop { from { transform: translateY(-8px) scale(1.15); opacity: .3; } }
.spell.done-good { border-color: var(--good); background: var(--good-soft); }
.spell.done-good .slot { border-color: var(--good); }
.spell.done-good .slot.filled:not(.hint):not(.accent) { color: var(--good); }
.spell.done-help { border-color: #e0b13c; background: #fbf1d8; }
@media (max-width: 480px) { .slot { width: 28px; height: 42px; font-size: 1.5rem; } }
.feedback.help { background: #fbf1d8; color: #6e4b06; }

/* ================================================================
   Confetti burst on a correct answer
   ================================================================ */
.confetti { position: fixed; width: 0; height: 0; pointer-events: none; z-index: 50; }
.confetti i { position: absolute; width: 9px; height: 9px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08);
  animation: burst .9s cubic-bezier(.15,.7,.3,1) forwards; }
.confetti i:nth-child(3n) { border-radius: 50%; width: 7px; height: 7px; }
@keyframes burst {
  0% { transform: translate(0,0) rotate(0) scale(.6); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) + 60px)) rotate(var(--r)) scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.key:disabled { opacity: .45; }

.en-cap { margin: -2px 0 0; font-weight: 700; color: var(--sea); font-size: 1.15rem; letter-spacing: .01em; }
.settings .seg { flex-wrap: wrap; }

/* noun ladder */
.ladder { display: flex; align-items: center; justify-content: center; gap: 0; margin: -4px 0 14px; }
.ladder i { width: 34px; height: 3px; background: var(--line); }
.rung { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--paper-2); color: var(--ink-soft); }
.rung.done { background: var(--good); color: #fff; }
.rung.now { background: var(--sea); color: #fff; box-shadow: 0 0 0 4px var(--sea-soft); transform: scale(1.1); }
.adj-word { color: var(--terra); font-size: 1.1em; }
.rung.miss { background: #e0b13c; color: #fff; }

/* match boards */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 720px; margin: 0 auto; }
@media (max-width: 560px) { .board { grid-template-columns: repeat(2, 1fr); } }
.tile { position: relative; min-height: 84px; padding: 12px 10px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); border: 2px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center;
  transition: transform .16s cubic-bezier(.3,1.6,.5,1), box-shadow .16s, background .2s, opacity .3s; }
.tile .tile-label { font-family: var(--serif); font-size: 1.25rem; color: var(--navy); line-height: 1.15; }
.tile.en .tile-label { font-family: var(--sans); font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.tile.pic-tile { padding: 6px; }
.tile.pic-tile .pic { width: 100%; height: auto; aspect-ratio: 1; }
.tile-tag { position: absolute; top: 5px; right: 8px; font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--terra); font-weight: 700; }
.tile:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 0 0 3px var(--sea), 0 0 0 7px rgba(42,111,166,.18), 0 10px 26px -12px rgba(21,54,94,.45); z-index: 2; }
.tile.sel { background: var(--sea-soft); box-shadow: 0 0 0 3px var(--sea), 0 0 0 7px rgba(42,111,166,.25); transform: scale(1.05); }
.tile.bad { background: var(--bad-soft); box-shadow: 0 0 0 3px var(--bad); }
.tile.shake { animation: shake .35s ease; }
.tile.matched { background: var(--good-soft); box-shadow: 0 0 0 2px var(--good); opacity: .55; transform: scale(.96); animation: pop .35s ease; }
.tile.matched .tile-label { color: var(--good); }

/* Vanja Doma banner */
.hero { padding-top: 4px; }
.banner { display: block; width: 100%; max-width: 900px; height: auto; margin: 0 auto 18px; filter: drop-shadow(0 14px 22px rgba(21,54,94,.22)); animation: bannerIn .6s cubic-bezier(.2,.9,.3,1.2) both; }
.hero h1 { text-align: center; font-size: clamp(1.6rem, 4vw, 2.3rem); }
.hero .lead { text-align: center; }
@keyframes bannerIn { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.on-home .brand { visibility: hidden; }

/* =====================================================================
   CHALKBOARD THEME — every button is a little wooden-framed chalkboard
   (shapes in brand/ui/, cut from the UI sheet) with chalk lettering
   ===================================================================== */
:root {
  --chalk: #f6f3ea;
  --chalk-dim: rgba(246,243,234,.72);
  --chalk-yellow: #ffe48a;
  --chalk-green: #b9f3a4;
  --chalk-red: #ffb2a6;
  --chalk-blue: #a9d8ff;
  --hand: 'Kalam', 'Chalkboard SE', 'Comic Sans MS', cursive;
  --board-rect: url(brand/ui/frame-btn.png) 40 fill / 20px stretch;
  --board-plaque: url(brand/ui/frame-box.png) 34 fill / 18px stretch;
  --board-pill: url(brand/ui/board-pill.png) 44 108 44 108 / 18px 40px stretch;
  --board-arrow: url(brand/ui/frame-arrow.png) 65 100 65 45 fill / 21px 33px 21px 15px stretch;
}

.topic, .mode, .option, .tile, .card, .panel, .spell, .chip-btn, .seg button, .ghost, .secondary, .primary, .key, .say, .icon-btn, .play-top .back {
  background: none !important;
  backface-visibility: hidden;
  will-change: transform;
  box-shadow: none !important;
  border-style: solid !important;
  border-color: transparent !important;
  color: var(--chalk);
  font-family: var(--hand);
}
/* rounded corners only so glows follow each board's outline */
.topic, .option, .tile, .card, .spell, .panel { border-radius: 20px !important; }
.mode { border-radius: 14px !important; }
.chip-btn, .seg button, .ghost, .secondary { border-radius: 16px !important; }
/* the chalk inside each board comes straight from your frame art (border-image fill) — no pasted rectangle */
.topic, .option, .tile, .card, .spell, .panel, .mode, .chip-btn, .seg button, .ghost, .secondary { background: none !important; }
/* the wooden frame is drawn 8px wider than the border, so it overlaps the chalk texture underneath —
   no hairline can show between them when a board grows or glows */
.topic, .option, .tile, .card, .spell, .panel, .mode { border-width: 10px !important; }
.chip-btn, .seg button, .ghost, .secondary { border-width: 10px !important; }
.topic { padding: 18px 20px 20px; }
.mode { padding: 16px 22px 18px; }
.option { padding: 14px 18px; }
.tile { padding: 12px 14px; }
.card { padding: 22px 24px 28px; }
.panel { padding: 20px 24px; }
.spell { padding: 18px 14px; }
.chip-btn, .seg button { padding: 10px 16px; }
.ghost, .secondary { padding: 12px 18px; }
.topic.big { padding: 26px 20px 28px; }
.topic.hub { padding: 24px 18px 26px; }
@media (max-width: 640px) { .topic.big { padding: 18px 22px; } }
.topic, .option, .tile, .card, .spell { border-width: 18px !important; border-image: var(--board-rect); }
.panel { border-width: 18px !important; border-image: var(--board-rect); }
.mode { border-width: 18px !important; border-image: var(--board-plaque); }
.chip-btn, .seg button, .ghost, .secondary { border-width: 16px !important; border-image: url(brand/ui/frame-btn.png) 40 fill / 20px stretch; }
.primary { border-width: 22px 50px 22px 20px !important; border-image: var(--board-arrow); }
.key, .say, .icon-btn, .play-top .back {
  border: 0 !important;
  background: url(brand/ui/frame-circle.png) center / contain no-repeat !important;
}
.key { background-image: url(brand/ui/frame-box.png) !important; width: 54px; height: 52px; }
.say { width: 44px; height: 44px; font-size: 1rem; }
.icon-btn, .play-top .back { width: 48px; height: 48px; }

/* padding now sits inside the wooden frame */
.topic { padding: 10px 12px 12px; }
.mode { padding: 8px 14px 10px; }
.option { padding: 6px 10px; min-height: 72px; }
.tile { padding: 4px 6px; min-height: 80px; }
.card { padding: 14px 16px 20px; }
.panel { padding: 12px 16px; }
.spell { padding: 10px 6px; }
.chip-btn, .seg button { padding: 2px 8px; font-size: 1rem; }
.ghost, .secondary { padding: 4px 10px; font-size: 1.05rem; }
.primary { padding: 0 8px 0 10px; font-size: 1.15rem; }
.seg { background: none; padding: 0; gap: 4px; flex-wrap: wrap; }

/* chalk lettering */
.topic *, .mode *, .option *, .tile *, .card *, .panel *, .spell *, .chip-btn, .seg button, .ghost, .secondary, .primary {
  color: var(--chalk);
  text-shadow: 0 0 1px rgba(255,255,255,.55), 0 0 6px rgba(255,255,255,.12);
}
.topic-name, .mode b { font-family: var(--hand); font-weight: 700; font-size: 1.18rem; letter-spacing: .01em; }
.topic-hr { font-family: var(--hand); font-style: normal; color: var(--chalk-yellow) !important; }
.topic-count, .mode .muted, .card .muted, .panel .muted, .opt-sub { color: var(--chalk-dim) !important; font-family: var(--hand); }
.topic.feature { padding: 10px 14px 12px; }
.topic.feature .topic-name { font-size: 1.5rem; }
.topic.feature:nth-child(2) { background: none; }
.mode-icon { background: rgba(255,255,255,.08); border: 2px dashed rgba(246,243,234,.45); }
.card .big, .card .big.en, .opt-label, .tile-label, .tile.en .tile-label, .pictext, .slot { font-family: var(--hand) !important; font-weight: 700; color: var(--chalk) !important; }
.card .big { font-size: clamp(1.9rem, 6vw, 2.9rem); }
.card .ask { color: var(--chalk-dim) !important; font-family: var(--hand); font-size: 1.1rem; }
.card .gap { color: var(--chalk-yellow) !important; }
.card .pron-inline, .card .en-cap, .adj-word { color: var(--chalk-blue) !important; font-family: var(--hand); }
.card .chip { font-family: var(--hand); background: rgba(255,255,255,.06); border: 2px dashed rgba(246,243,234,.5); color: var(--chalk); }
.card .chip.pron { border-color: var(--chalk-blue); color: var(--chalk-blue); }
.card .chip.verb { border-color: var(--chalk-yellow); color: var(--chalk-yellow); }
.card .plus { color: var(--chalk-dim); }
.panel h3, .settings h3 { color: var(--chalk-yellow) !important; font-family: var(--hand); text-transform: none; letter-spacing: 0; font-size: 1.05rem; font-weight: 700; }
.kbd { color: rgba(246,243,234,.35) !important; }
.tile-tag { color: var(--chalk-yellow) !important; }
.key { font-family: var(--hand); font-weight: 700; color: var(--chalk) !important; }
.icon-btn.on { filter: drop-shadow(0 0 6px rgba(255,214,90,.95)); }

/* pictures sit straight on the chalkboard (they're transparent PNGs) */
.pic { background: none !important; box-shadow: none !important; overflow: visible; }
.pic img { object-fit: contain; filter: drop-shadow(0 0 1px rgba(255,255,255,.35)) drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
.pic .swatch { box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* selected / on states: yellow chalk + glow */
.seg button.on, .chip-btn.on { color: var(--chalk-yellow) !important; font-weight: 700; box-shadow: none !important; filter: drop-shadow(0 0 6px rgba(255,214,90,.8)); }
.seg button:not(.on), .chip-btn:not(.on) { opacity: .78; }

/* hover = grow a little + a glow that hugs the board's own outline (drop-shadow follows the picture's edges) */
.topic, .mode, .option, .tile, .chip-btn, .seg button, .secondary, .ghost, .primary, .key, .say, .icon-btn, .play-top .back, .lvl-label {
  transition: transform .18s cubic-bezier(.3,1.6,.5,1), filter .18s ease, opacity .2s;
}
.topic:hover, .mode:hover, .option:hover:not(:disabled), .tile:hover:not(:disabled), .chip-btn:hover, .seg button:hover,
.secondary:hover:not(:disabled), .ghost:hover:not(:disabled), .primary:hover:not(:disabled), .key:hover:not(:disabled),
.say:hover, .icon-btn:hover, .play-top .back:hover,
.topic:focus-visible, .mode:focus-visible, .option:focus-visible, .ghost:focus-visible, .tile:focus-visible, .primary:focus-visible {
  transform: scale(1.05);
  box-shadow: none !important;
  filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 7px rgba(120,190,255,.95));
  outline: none; position: relative; z-index: 2;
}
.topic.feature:hover, .topic.big:hover { filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 8px rgba(255,214,90,.95)); }

/* answers */
.option.correct, .tile.matched { box-shadow: none !important; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 10px rgba(90,220,100,.95)); }
.option.correct .opt-label, .tile.matched .tile-label { color: var(--chalk-green) !important; }
.option.wrong, .tile.bad { box-shadow: none !important; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 10px rgba(255,80,70,.95)); }
.option.wrong .opt-label { color: var(--chalk-red) !important; }
.tile.sel { transform: scale(1.06); box-shadow: none !important; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 10px rgba(255,214,90,1)); }
.tile.matched { opacity: .6; }
.option.dim { opacity: .4; }

/* spelling on the board */
.slot { border-bottom-color: rgba(246,243,234,.45); }
.slot.cur { border-color: var(--chalk-yellow); }
.slot.filled { border-color: var(--chalk); }
.slot.hint { color: var(--chalk-yellow) !important; border-color: var(--chalk-yellow); }
.slot.accent { color: var(--chalk-blue) !important; border-color: var(--chalk-blue); }
.slot.bad { color: var(--chalk-red) !important; border-color: var(--chalk-red); }
.spell:focus-within { box-shadow: none !important; filter: drop-shadow(0 0 8px rgba(120,190,255,.8)); }
.spell.done-good { background: none; box-shadow: none !important; filter: drop-shadow(0 0 10px rgba(90,220,100,.9)); }
.spell.done-good .slot.filled:not(.hint):not(.accent) { color: var(--chalk-green) !important; }
.spell.done-help { background: none; box-shadow: none !important; filter: drop-shadow(0 0 10px rgba(255,200,80,.9)); }

.options.n8 { grid-template-columns: 1fr 1fr; }
.options.grid.n8 { grid-template-columns: repeat(4, 1fr); max-width: 720px; }
@media (max-width: 520px) { .options.grid.n8 { grid-template-columns: repeat(2, 1fr); } }

/* page title: a plain chalkboard rectangle (the old ribbon banner is gone) */
.ribbon { display: flex; justify-content: center; margin: 22px auto 10px; }
.ribbon span {
  display: inline-block; padding: 6px 40px; min-width: min(420px, 88vw); border: 20px solid transparent;
  border-image: url(brand/ui/frame-bar.png) 40 fill / 20px stretch; background: #173a31; background-clip: padding-box; border-radius: 16px;
  font-family: var(--hand); font-weight: 700; color: var(--chalk); font-size: clamp(1.35rem, 4.2vw, 2rem);
  text-shadow: 0 0 1px rgba(255,255,255,.6); text-align: center; box-shadow: 0 4px 10px rgba(0,0,0,.18);
}
@media (max-width: 520px) { .ribbon span { padding: 4px 22px; } }

/* ---------------- level slider ---------------- */
.home-level { max-width: 760px; margin: 0 auto 6px; text-align: center; }
.lvl-ask { margin: 0 0 4px; font-family: var(--hand); font-weight: 700; font-size: 1.25rem; color: var(--navy); }
.lvl-ask span { font-weight: 400; color: var(--ink-soft); }
.lvl { --x: 13.9%; position: relative; width: 100%; max-width: 760px; margin: 0 auto; padding-top: clamp(40px, 9vw, 66px); user-select: none; -webkit-user-select: none; outline: none; }
.lvl-labels { position: absolute; inset: 0 0 auto 0; height: clamp(40px, 9vw, 66px); }
.lvl-label { position: absolute; bottom: 4px; width: 17.5%; transform: translateX(-50%); padding: 0; transition: transform .18s cubic-bezier(.3,1.6,.5,1), filter .2s, opacity .2s; opacity: .55; filter: saturate(.7); }
.lvl-label img { display: block; width: 100%; height: auto; pointer-events: none; }
.lvl-label.on { opacity: 1; filter: none; transform: translateX(-50%) scale(1.12); }
.lvl-label:hover { opacity: 1; transform: translateX(-50%) scale(1.12); filter: drop-shadow(0 0 6px rgba(42,111,166,.5)); }
.lvl-track { position: relative; cursor: pointer; touch-action: none; }
.lvl-bar { display: block; width: 100%; height: auto; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(21,54,94,.2)); }
.lvl-knob {
  position: absolute; top: 50%; left: var(--x); height: 120%; width: auto; transform: translate(-50%, -50%);
  transition: left .35s cubic-bezier(.3,1.5,.5,1); pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35));
}
.lvl.dragging .lvl-knob { transition: none; transform: translate(-50%, -50%) scale(1.08); }
.lvl:focus-visible .lvl-knob { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 10px rgba(42,111,166,.9)); }
.lvl-note { margin: 8px auto 0; max-width: 620px; font-size: .92rem; color: var(--ink-soft); text-align: center; min-height: 2.6em; }
.panel .lvl-note { color: var(--chalk-dim) !important; }
.lvl-row { grid-column: 1 / -1; }
.panel .lvl-ask { color: var(--chalk); }
@media (prefers-reduced-motion: reduce) { .lvl-knob { transition: none; } }

/* =====================================================================
   NEW NAVIGATION — home boards, topic grid, two-step topic screen
   ===================================================================== */
.ico { position: relative; display: inline-grid; place-items: center; width: 64px; height: 64px; flex: none; }
.ico img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.ico-fb { font-size: 2.3rem; line-height: 1; }
.ico.has-img .ico-fb { display: none; }
.ico.lg { width: 76px; height: 76px; }
.ico.lg .ico-fb { font-size: 3rem; }
.ico.sm { width: 18px; height: 18px; vertical-align: -3px; }
.ico.sm .ico-fb { font-size: .9rem; }

.big-boards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.topic.big { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 12px 20px; gap: 4px; }
.topic.big .ico { width: 92px; height: 92px; }
.topic.big .ico-fb { font-size: 3.4rem; }
.topic.big .topic-name { font-size: 1.7rem; }
@media (max-width: 640px) {
  .big-boards { grid-template-columns: 1fr; }
  .topic.big { flex-direction: row; text-align: left; gap: 14px; padding: 10px 14px; }
  .topic.big .ico { width: 64px; height: 64px; }
  .topic.big .ico-fb { font-size: 2.4rem; }
  .topic.big .topic-name { font-size: 1.45rem; display: block; }
}
.topic.big .topic-hr { font-size: 1rem; }

.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 10px; }
.topic.hub { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 10px 18px; position: relative; }
.topic.hub .ico { width: 78px; height: 78px; }
.topic.hub .ico-fb { font-size: 2.9rem; }
.topic.hub .topic-name { font-size: 1.45rem; }
@media (max-width: 520px) { .hub-grid { grid-template-columns: 1fr 1fr; } .topic.hub .topic-name { font-size: 1.2rem; } }

.locked { opacity: .5; filter: grayscale(.6); }
.locked:hover { transform: none !important; box-shadow: none !important; }
.lock { display: inline-flex; align-items: center; gap: 4px; font-family: var(--hand); font-size: .9rem; color: var(--chalk-yellow) !important; }
.topic.hub .lock { position: absolute; top: 4px; right: 8px; }
.chip-btn.locked { opacity: .45; }

.step { margin-top: 18px; }
.step-title { display: flex; align-items: baseline; gap: 10px; font-family: var(--hand); font-size: 1.6rem; margin: 0 0 10px; color: var(--navy); }
.step-title span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: url(brand/ui/frame-circle.png) center / contain no-repeat; color: var(--chalk); font-size: 1.1rem; }
.step-title small { font-family: var(--sans); font-size: .95rem; color: var(--ink-soft); font-weight: 400; }
.step-title.sub { font-size: 1.15rem; }
.step .chips { gap: 8px; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mode.game { display: flex; align-items: center; gap: 12px; text-align: left; position: relative; }
.mode.game .game-text b { font-size: 1.4rem; display: block; }
.mode.game .muted { font-size: .92rem; }
.mode.game .lock { position: absolute; top: 2px; right: 6px; }

.tiny-settings { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; font-family: var(--hand); color: var(--ink-soft); flex-wrap: wrap; }
.tiny-settings .seg button { font-size: .95rem; }

.mode-head .ico { margin-right: 4px; }
.center { text-align: center; }
.ribbon { margin-top: 6px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 60; pointer-events: none;
  padding: 14px 22px; border: 16px solid transparent; border-image: url(brand/ui/frame-btn.png) 40 fill / 20px stretch;
  background: none;
  color: var(--chalk); font-family: var(--hand); font-size: 1.05rem; transition: transform .3s cubic-bezier(.3,1.5,.5,1), opacity .25s; max-width: 92vw; text-align: center; }
.toast b { color: var(--chalk-yellow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.shake { animation: shake .35s ease; }

.lock .ico, .topic.hub .lock .ico, .mode.game .lock .ico, .chip-btn .ico.sm { width: 18px !important; height: 18px !important; }
.lock .ico-fb, .chip-btn .ico.sm .ico-fb { font-size: .9rem !important; }
.mode.game { min-height: 96px; }
/* icon images in the small round buttons and labels */
.icon-btn img { width: 62%; height: 62%; object-fit: contain; }
#speakToggle:not(.on) img { opacity: .45; filter: grayscale(.6); }
.ico.bk { width: 26px; height: 26px; vertical-align: middle; }
.ico.bk .ico-fb { font-size: 1.1rem; }
.back { display: inline-flex; align-items: center; gap: 6px; }
.play-top .back .ico.bk { width: 28px; height: 28px; }
.streak { display: inline-flex; align-items: center; gap: 4px; }
.streak .ico.bk { width: 28px; height: 28px; }
.tiny-settings .ico.bk { width: 24px; height: 24px; }

/* soft shade along the inside of each frame so the chalk blends into the wood (hides the hairline) */
.topic, .option, .tile, .card, .spell, .panel, .mode, .chip-btn, .seg button, .ghost, .secondary { box-shadow: none !important; }
.spell.done-good, .spell.done-help { box-shadow: none !important; }

/* round buttons: icon dead-centre in the circle */
.say, .icon-btn, .play-top .back { display: inline-flex !important; align-items: center; justify-content: center; padding: 0 !important; gap: 0 !important; line-height: 0; }
.icon-btn img { width: 26px; height: 26px; display: block; margin: 0; }
.play-top .back .ico.bk { width: 26px; height: 26px; margin: 0; display: block; }
.play-top .back .ico.bk img { display: block; width: 100%; height: 100%; }

/* 50:50 */
.option.gone { display: none !important; }
.fifty-row { margin-top: 14px; }
.fifty { font-family: var(--hand, inherit); font-size: 1.1rem; letter-spacing: .03em; min-width: 120px; }
.fifty:disabled { opacity: .45; }

/* restaurant scene, drawn in chalk */
.scene { max-width: 560px; gap: 16px; }
.scene-row { align-items: center; gap: 14px; }
img.avatar { width: 92px; height: 92px; object-fit: contain; flex: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.scene .bubble { position: relative; background: rgba(255,255,255,.06); color: var(--chalk, #f4f1e8);
  font-family: var(--hand, 'Kalam', cursive); font-size: 1.7rem; font-weight: 700;
  border: 3px solid rgba(244,241,232,.85); border-radius: 26px 26px 26px 26px; padding: 10px 18px;
  box-shadow: 0 0 1px rgba(255,255,255,.6), inset 0 0 6px rgba(255,255,255,.08); }
/* little chalk tail pointing at the waiter */
.scene .bubble::before { content: ''; position: absolute; left: -15px; top: 50%; margin-top: -9px;
  border: 9px solid transparent; border-right: 14px solid rgba(244,241,232,.85); border-left: 0; }
.scene .bubble .say { background: none; }
.scene-task { display: flex; align-items: center; gap: 12px; background: none !important; color: var(--chalk-yellow, #f6dd7a) !important;
  font-family: var(--hand, 'Kalam', cursive); font-size: 1.2rem; font-weight: 700; padding: 8px 14px;
  border: 2px dashed rgba(246,221,122,.6); border-radius: 14px; }
.goal-ico { width: 46px; height: 46px; object-fit: contain; flex: none; }
@media (max-width: 640px) { img.avatar { width: 64px; height: 64px; } .scene .bubble { font-size: 1.35rem; } .goal-ico { width: 36px; height: 36px; } }
.card .scene-task, .card .scene-task span { color: var(--chalk-yellow) !important; }

/* Pitanja bar — how many questions */
.q-bar { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap;
  margin: 22px auto 0; width: fit-content; max-width: 100%; padding: 8px 22px 10px;
  border: 18px solid transparent; border-image: url(brand/ui/frame-btn.png) 40 fill / 20px stretch; }
.q-title { height: 46px; width: auto; }
.q-opts { display: flex; gap: 4px; }
.q-btn { padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; border-image: none !important; cursor: pointer; transition: transform .15s; }
.q-btn img { display: block; width: 80px; height: 64px; }
.q-btn:hover { transform: scale(1.08); }
.q-btn:active { transform: scale(.96); }
@media (max-width: 520px) { .q-btn img { width: 62px; height: 50px; } .q-title { height: 36px; } }

/* ================= Rječnik ================= */
.dict-board { display: flex !important; flex-direction: row !important; align-items: center; justify-content: center; gap: 14px; width: 100%; max-width: 760px; margin: 18px auto 0; padding: 14px 22px !important; }
.dict-board .topic-name { font-size: 1.6rem; }
.dict-board .ico-swap .ico:not(.has-img) { display: none; }
.dict-board .ico { width: 76px; height: 76px; }
.dict-sub { text-align: center; color: var(--ink-soft); margin: 0 auto 12px; max-width: 640px; }
.dict-searchbar { max-width: 640px; margin: 0 auto 12px; }
.dict-input { width: 100%; border: 0; background: transparent; color: var(--chalk); font-family: var(--hand); font-size: 1.5rem; padding: 4px 6px; outline: none; }
.dict-input::placeholder { color: rgba(244,241,232,.55); }
.dict-filters { justify-content: center; margin-bottom: 10px; }
.dict-letters { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 760px; margin: 0 auto 14px; }
.dict-letter { min-width: 34px; height: 34px; border-radius: 9px; font-family: var(--hand); font-weight: 700; font-size: 1.05rem; color: var(--ink); background: rgba(255,255,255,.55); border: 1.5px solid rgba(0,0,0,.12); }
.dict-letter.on { background: #1f3d35; color: var(--chalk-yellow); border-color: #c98a2b; }
.dict-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; max-width: 980px; margin: 0 auto; }
.dict-row { display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px 12px; border-radius: 14px; background: rgba(255,255,255,.7); border: 1.5px solid rgba(0,0,0,.08); transition: transform .12s, box-shadow .12s; }
.dict-row:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.1); border-color: #c98a2b; }
.dict-thumb { width: 48px; height: 48px; object-fit: contain; flex: none; }
.dict-thumb.none { display: inline-block; }
.dict-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dict-main b { font-size: 1.12rem; color: var(--ink); }
.dict-en { color: var(--ink-soft); font-size: .92rem; }
.dict-how { color: #a5671b; font-size: .82rem; font-weight: 600; }
.dict-pos { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); text-align: right; max-width: 90px; }
.dict-empty { text-align: center; color: var(--ink-soft); padding: 20px; }
.word-card { max-width: 640px; margin: 0 auto 14px; text-align: center; }
.word-pic { width: 150px; height: 150px; margin: 0 auto 4px; }
.word-head { display: flex; align-items: center; justify-content: center; gap: 12px; }
.word-hr { font-family: var(--hand); color: var(--chalk) !important; font-size: 2.6rem; margin: 0; }
.word-en { color: var(--chalk-yellow) !important; font-family: var(--hand); font-size: 1.3rem; margin: 2px 0 10px; }
.word-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.wchip { font-size: .8rem; padding: 3px 10px; border-radius: 999px; border: 1.5px solid rgba(244,241,232,.7); color: var(--chalk); }
.wchip.soft { border-style: dashed; opacity: .8; }
.wchip.dal { border-color: var(--chalk-yellow); color: var(--chalk-yellow); }
.word-std, .word-note { color: var(--chalk) !important; margin: 10px 0 0; font-size: .95rem; }
.linkish { color: var(--chalk-yellow); text-decoration: underline; background: none; border: 0; font: inherit; cursor: pointer; }
.forms-panel { max-width: 640px; margin: 0 auto; color: var(--chalk); }
.forms-table { width: 100%; border-collapse: collapse; font-family: var(--hand); }
.forms-table th, .forms-table td { padding: 5px 8px; border-bottom: 1px dashed rgba(244,241,232,.25); text-align: left; vertical-align: middle; color: var(--chalk); }
.forms-table thead th { color: var(--chalk-yellow); font-size: 1.05rem; }
.forms-table th small, .forms-h small { display: block; font-family: 'DM Sans', sans-serif; font-size: .7rem; opacity: .7; font-weight: 400; }
.forms-table tbody th { width: 38%; font-weight: 700; }
.forms-table.verb tbody th { width: 30%; }
.case-hr { text-transform: capitalize; }
.form-cell { font-family: var(--hand); font-size: 1.2rem; color: var(--chalk); background: none; border: 0; padding: 2px 4px; border-radius: 6px; cursor: pointer; text-align: left; }
.form-cell:hover { background: rgba(255,255,255,.1); color: var(--chalk-yellow); }
.form-cell.plain { cursor: default; } .form-cell.plain:hover { background: none; color: var(--chalk); }
.form-cell.none { opacity: .5; cursor: default; }
.forms-h { font-family: var(--hand); color: var(--chalk-yellow); font-size: 1.25rem; margin: 16px 0 4px; }
.forms-h:first-child { margin-top: 0; }
.say.mini { width: 30px !important; height: 30px !important; font-size: .8rem; margin-left: 6px; vertical-align: middle; }
.case-help { display: grid; gap: 2px; font-size: .78rem; opacity: .8; margin: 10px 0 0; }
.gender-tabs { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
.gender-tabs button small { display: block; font-size: .65rem; opacity: .75; }
.dict-foot { text-align: center; color: var(--ink-soft); font-size: .82rem; max-width: 640px; margin: 12px auto 0; }
@media (max-width: 520px) { .word-hr { font-size: 2rem; } .forms-table th, .forms-table td { padding: 4px 4px; } .form-cell { font-size: 1.05rem; } .dict-results { grid-template-columns: 1fr; } }
.dict-letters[hidden] { display: none !important; }

/* ================= Question builder ================= */
.qb-en { font-family: var(--hand); font-size: 1.8rem; color: var(--chalk) !important; margin: 4px 0 0; }
.qb-note { color: var(--chalk-yellow) !important; font-size: .95rem; margin: 2px 0 0; }
.qb-sentence { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 18px auto 14px; max-width: 720px; min-height: 60px; }
.qb-fixed { font-family: var(--hand); font-size: 1.6rem; font-weight: 700; color: var(--ink); }
.qb-fixed.qm { margin-left: -4px; }
.qb-slot { min-width: 84px; height: 50px; padding: 0 12px; border-radius: 12px; border: 2.5px dashed rgba(30,60,50,.45); background: rgba(255,255,255,.55);
  font-family: var(--hand); font-size: 1.5rem; font-weight: 700; color: var(--ink); transition: transform .12s, border-color .12s; }
.qb-slot.cur { border-color: #c98a2b; box-shadow: 0 0 0 3px rgba(201,138,43,.2); }
.qb-slot.filled { border-style: solid; background: #1f3d35; color: var(--chalk); border-color: #1f3d35; }
.qb-slot.right { background: #2f8a4c; border-color: #2f8a4c; color: #fff; }
.qb-slot.wrongslot { background: #c8102e; border-color: #c8102e; color: #fff; animation: shake .35s; }
.qb-slot.hinted { outline: 2px solid var(--chalk-yellow); }
.qb-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 720px; margin: 0 auto 10px; }
.qb-tile { font-family: var(--hand) !important; font-size: 1.35rem !important; font-weight: 700; padding: 8px 18px !important; transition: transform .12s, opacity .2s; }
.qb-tile.used { opacity: .18; pointer-events: none; }
.qb-explain { display: block; font-size: .9rem; opacity: .85; margin-top: 4px; }
@media (max-width: 520px) { .qb-en { font-size: 1.4rem; } .qb-fixed, .qb-slot { font-size: 1.25rem; } .qb-slot { min-width: 64px; height: 44px; } .qb-tile { font-size: 1.15rem !important; } }

/* =====================================================================
   NEW CHALKBOARD FRAMES (clean wood, no chalk outline)
   Each kind of element uses the frame whose shape is closest, so the
   art is barely stretched: btn (wide button), box (squarish), bar (long),
   card (big landscape), circle, arrow.
   ===================================================================== */
:root {
  --fr-btn:  url(brand/ui/frame-btn.png) 40 fill / 20px stretch;
  --fr-box:  url(brand/ui/frame-box.png) 34 fill / 18px stretch;
  --fr-bar:  url(brand/ui/frame-bar.png) 40 fill / 20px stretch;
  --fr-card: url(brand/ui/frame-card.png) 44 fill / 22px stretch;
  --fr-tall: url(brand/ui/frame-tall.png) 44 fill / 22px stretch;
  --fr-arrow: url(brand/ui/frame-arrow.png) 65 100 65 45 fill / 21px 33px 21px 15px stretch;
}
.option, .chip-btn, .seg button, .ghost, .secondary, .spell, .qb-tile { border-image: var(--fr-btn) !important; border-width: 20px !important; }
.tile, .topic, .mode { border-image: var(--fr-box) !important; border-width: 18px !important; }
.card, .panel, .word-card { border-image: var(--fr-card) !important; border-width: 22px !important; }
.dict-board, .q-bar, .dict-searchbar { border-image: var(--fr-bar) !important; border-width: 20px !important; }
.primary { border-image: var(--fr-arrow) !important; border-width: 21px 33px 21px 15px !important; }
.key, .say, .icon-btn, .play-top .back, .step-title span { background-image: url(brand/ui/frame-circle.png) !important; background-size: contain !important; background-repeat: no-repeat !important; background-position: center !important; }
.key { background-image: url(brand/ui/frame-box.png) !important; background-size: 100% 100% !important; }
/* a little less inner padding now the frame itself is a touch thicker */
.option { padding: 4px 8px; }
.chip-btn, .seg button { padding: 0 6px; }
.ghost, .secondary { padding: 2px 8px; }
.card { padding: 10px 14px 14px; }
.panel { padding: 8px 12px; }
.topic { padding: 8px 10px 10px; }

/* question builder scenes: your people + flags */
.qb-scene { gap: 12px; }
.qb-cast { display: flex; justify-content: center; align-items: flex-end; gap: 4px; }
.qb-person { width: 96px; height: 96px; object-fit: contain; }
.qb-flag { width: 86px; height: 86px; object-fit: contain; margin-left: 6px; }
.qb-howto { font-size: .85rem; color: var(--chalk-dim) !important; margin: 0; text-align: center; }
.scene-task small { opacity: .8; font-weight: 400; }
@media (max-width: 520px) { .qb-person { width: 70px; height: 70px; } .qb-flag { width: 64px; height: 64px; } }

/* ================= Reading + tap-to-learn ================= */
.card { position: relative; }
.rd-head { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rd-head span { font-family: var(--hand); color: var(--chalk-yellow) !important; font-size: 1.1rem; }
.rd-head small { color: var(--chalk-dim) !important; font-size: .8rem; }
.rd-story { text-align: left; font-family: var(--hand); font-size: 1.45rem; line-height: 1.9; max-width: 620px; margin: 0 auto 10px; }
.rw { font: inherit; color: var(--chalk); background: none; border: 0; padding: 0 1px; margin: 0 3px 0 0; border-bottom: 2px dotted rgba(246,243,234,.3); border-radius: 3px; cursor: pointer; line-height: 1.3; }
.rw:hover { border-bottom-color: var(--chalk-yellow); color: var(--chalk-yellow); }
.rw.on { background: rgba(255,228,138,.22); color: var(--chalk-yellow); border-bottom-color: var(--chalk-yellow); }
.rw-wrap { white-space: nowrap; }
.rd-p { margin: 0 2px 0 -3px; color: var(--chalk); }
.rd-q { font-family: var(--hand); font-size: 1.5rem; font-weight: 700; color: var(--chalk-yellow) !important; margin: 10px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
.rd-q-en { color: var(--chalk-dim) !important; margin: 2px 0 0; font-size: .95rem; }
.rd-pop { position: absolute; z-index: 20; background: #fffdf6; color: #1c2b28; border-radius: 14px; padding: 10px 12px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.35); text-align: left; font-family: 'DM Sans', sans-serif; }
.rd-pop * { color: #1c2b28 !important; text-shadow: none !important; }
.rd-pop::before { content: ''; position: absolute; top: -7px; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top: 0; border-bottom-color: #fffdf6; }
.pop-top { display: flex; align-items: center; gap: 8px; }
.pop-w { font-family: var(--hand); font-size: 1.5rem; flex: 1; }
.pop-x { background: none; border: 0; font-size: 1rem; cursor: pointer; opacity: .6; }
.rd-pop .say { width: 34px !important; height: 34px !important; font-size: .8rem; }
.pop-en { margin: 2px 0 6px; font-weight: 700; font-size: 1.05rem; }
.pop-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pop-chips .wchip { border-color: #c98a2b; color: #7a4d12 !important; font-size: .75rem; background: #fff4df; }
.pop-lemma, .pop-note { margin: 6px 0 0; font-size: .85rem; }
.pop-note { color: #5b6b66 !important; }
.pop-more { margin-top: 8px; font-size: .9rem !important; }
.pop-more, .pop-more * { color: var(--chalk) !important; }
.modal-back { position: fixed; inset: 0; background: rgba(20,30,28,.55); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { max-width: 620px; width: 100%; max-height: 88vh; overflow: auto; text-align: center; }
.modal .forms-panel { text-align: left; }
.modal-close { margin-top: 10px; }
@media (max-width: 520px) { .rd-story { font-size: 1.2rem; } .rd-q { font-size: 1.25rem; } }

/* Fill the board behind its frame with chalkboard green, so at in-between zoom levels the hairline gaps
   between the frame's slices show green instead of a faint white line */
.option, .chip-btn, .seg button, .ghost, .secondary, .spell, .qb-tile, .tile, .topic, .mode, .card, .panel, .word-card, .dict-board, .q-bar, .dict-searchbar {
  background: #173a31 !important;
  background-clip: border-box !important;
  border-radius: 16px !important;
}

/* a few of the newer icons have more empty space around them — nudge them up to match the others */
.ico img[src*="icon-odakle"] { transform: scale(1.45); }
.ico img[src*="icon-suprotno"] { transform: scale(1.4); }
.ico img[src*="icon-pitaj"] { transform: scale(1.35); }
.ico img[src*="icon-ljestve"], .ico img[src*="icon-dalmatin"] { transform: scale(1.3); }

/* ================= Preživi! (survival) ================= */
.home-bottom { display: flex; gap: 16px; max-width: 880px; margin: 18px auto 0; align-items: stretch; }
.home-bottom .dict-board { flex: 1; margin: 0 !important; max-width: none; }
.dict-text { display: flex; flex-direction: column; align-items: flex-start; }
.surv-card { flex: none; width: 210px; min-height: 150px; border: 18px solid transparent !important; border-image: var(--surv) 36 fill / 18px stretch !important; background: none !important;
  display: flex; align-items: center; gap: 8px; padding: 0 2px !important; cursor: pointer; transition: transform .15s, filter .15s; color: #fff; }
.surv-card:hover { transform: scale(1.04); filter: drop-shadow(0 0 8px rgba(255,214,90,.9)); }
.surv-skull { width: 74px; height: 74px; object-fit: contain; flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.surv-text { display: flex; flex-direction: column; text-align: left; font-family: var(--hand); line-height: 1.15; }
.surv-text, .surv-text * { color: #fff !important; text-shadow: 0 1px 2px rgba(0,0,0,.55), 0 0 6px rgba(0,0,0,.25) !important; }
.surv-text > b { font-size: 1.45rem; }
.surv-text small { font-size: .8rem; opacity: .95; }
.surv-best { margin-top: 4px; font-size: .95rem; }
.surv-best b { font-size: 1.15rem; }
.surv-card.in-grid { width: auto; min-height: 0; }
.surv-bar { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hearts { display: flex; gap: 4px; font-size: 1.7rem; line-height: 1; }
.hearts i { font-style: normal; color: #d0102a; text-shadow: 0 1px 0 #7a0616; transition: transform .3s, opacity .3s; }
.hearts i.lost { color: #c9bfae; text-shadow: none; opacity: .55; }
.hearts i.pop { animation: heartpop .5s; }
@keyframes heartpop { 0% { transform: scale(1.6); color: #d0102a; } 100% { transform: scale(1); } }
.surv-now { display: flex; align-items: center; gap: 6px; font-family: var(--hand); font-size: 1.6rem; color: var(--ink); }
.surv-now .ico { width: 34px; height: 34px; }
.surv-result { text-align: center; max-width: 520px; margin: 10px auto 16px; }
.surv-skull.big { width: 130px; height: 130px; }
.surv-result h1 { font-family: var(--hand); color: var(--chalk-yellow) !important; margin: 4px 0; }
.surv-score { font-family: var(--hand); font-size: 1.4rem; margin: 0; }
.surv-score b { font-size: 3rem; color: var(--chalk) !important; }
@media (max-width: 640px) { .home-bottom { flex-direction: column; } .surv-card { width: 100%; justify-content: center; } }

/* after answering: what the word means */
.opt-meaning { display: block; font-family: var(--hand); font-size: 1.05rem; color: var(--chalk-yellow) !important; margin-top: 2px; animation: meaningIn .25s ease-out; }
.option.correct .opt-meaning { color: #d9ffc8 !important; }
@keyframes meaningIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.voice-pick { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 8px auto 0; font-size: .9rem; color: var(--ink-soft); }
.voice-pick select { font: inherit; padding: 4px 8px; border-radius: 8px; border: 1.5px solid #c98a2b; background: #fffdf6; color: var(--ink); max-width: 260px; }
.voice-pick .say.mini { width: 32px !important; height: 32px !important; }
.voice-tip { flex-basis: 100%; text-align: center; font-size: .8rem; color: #a5671b; }
.voice-tip:empty { display: none; }

/* ================= Moj profil ================= */
.profile-btn { padding: 0 !important; overflow: hidden; }
.profile-btn img { width: 80%; height: 80%; object-fit: contain; display: block; margin: auto; }
.prof-head { display: flex !important; flex-direction: row !important; justify-content: center; align-items: center; gap: 18px; max-width: 640px; margin: 0 auto 10px; text-align: left; }
.prof-avatar { width: 110px; height: 110px; object-fit: contain; flex: none; }
.prof-id h1 { font-family: var(--hand); margin: 0; color: var(--chalk) !important; font-size: 2rem; }
.prof-id p { margin: 0 0 8px; color: var(--chalk-yellow) !important; font-family: var(--hand); }
.prof-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.prof-h { text-align: center; margin: 14px 0 6px; }
.prof-h img { height: 60px; }
.prof-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 760px; margin: 0 auto 14px; }
.pstat { background: #fffdf6; border: 2px solid #e8d7b4; border-radius: 16px; padding: 10px 8px; text-align: center; display: flex; flex-direction: column; }
.pstat b { font-family: var(--hand); font-size: 2.1rem; color: #1f3d35; line-height: 1.1; }
.pstat span { font-size: .85rem; color: var(--ink); }
.pstat small { font-size: .72rem; color: var(--ink-soft); }
.prof-panel { max-width: 760px; margin: 0 auto 14px; color: var(--chalk); }
.prof-panel h3 { font-family: var(--hand); color: var(--chalk-yellow) !important; margin: 0 0 6px; font-size: 1.4rem; }
.prof-panel h3 small { font-family: 'DM Sans', sans-serif; font-size: .75rem; color: var(--chalk-dim) !important; }
.weak-list { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.weak-list li { display: flex; align-items: center; gap: 8px; font-family: var(--hand); }
.weak-list li b { font-size: 1.15rem; }
.weak-list li span { color: var(--chalk-dim) !important; font-size: .9rem; flex: 1; }
.weak-list li small { font-size: .75rem; color: var(--chalk-yellow) !important; }
.weak-list .say { width: 30px !important; height: 30px !important; font-size: .75rem; flex: none; }
.acc-row { display: grid; grid-template-columns: 150px 1fr 48px auto; align-items: center; gap: 10px; margin: 6px 0; font-family: var(--hand); }
.acc-bar { height: 12px; border-radius: 8px; background: rgba(255,255,255,.15); overflow: hidden; }
.acc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #e0513b, #f2c230 50%, #4bb05a); border-radius: 8px; }
.acc-row .chip-btn { font-size: .85rem !important; }
.surv-recs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.surv-rec { border: 14px solid transparent; border-image: var(--surv) 36 fill / 14px stretch; display: flex; flex-direction: column; align-items: center; padding: 2px; font-family: var(--hand); }
.surv-rec, .surv-rec * { color: #fff !important; text-shadow: 0 1px 2px rgba(0,0,0,.6) !important; }
.surv-rec span { font-size: .8rem; } .surv-rec b { font-size: 1.8rem; line-height: 1; }
.prof-edit { max-width: 560px; margin: 0 auto; text-align: center; }
.prof-name { display: flex; flex-direction: column; gap: 6px; font-family: var(--hand); color: var(--chalk-yellow) !important; font-size: 1.1rem; }
.prof-name input { font: inherit; font-size: 1.4rem; padding: 8px 12px; border-radius: 10px; border: 2px solid #c98a2b; background: #fffdf6; color: #1c2b28 !important; text-align: center; }
.avatar-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 14px; }
.av { width: 86px; height: 86px; border-radius: 50%; background: rgba(255,255,255,.08); border: 3px solid transparent; padding: 4px; }
.av img { width: 100%; height: 100%; object-fit: contain; }
.av.on { border-color: var(--chalk-yellow); background: rgba(255,228,138,.18); }
.prof-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; max-width: 760px; margin: 0 auto; }
.prof-pick { display: flex !important; flex-direction: column; align-items: center; gap: 4px; }
.prof-pick img { width: 90px; height: 90px; object-fit: contain; }
.prof-pick.on { filter: drop-shadow(0 0 8px rgba(255,214,90,.9)); }
.prof-pick .plus { font-size: 3rem; line-height: 90px; height: 90px; color: var(--chalk-yellow) !important; }
@media (max-width: 640px) { .prof-stats { grid-template-columns: repeat(2, 1fr); } .surv-recs { grid-template-columns: repeat(3, 1fr); } .acc-row { grid-template-columns: 100px 1fr 40px; } .acc-row .chip-btn { display: none; } }

/* home-screen app: keep clear of the notch / home bar */
@supports (padding: env(safe-area-inset-top)) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom); }
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
}

.surv-finish { font-size: .95rem !important; white-space: nowrap; }

/* ================= Razgovor (conversation) ================= */
.cv-head { text-align: center; font-family: var(--hand); color: var(--chalk-yellow) !important; font-size: 1.1rem; margin-bottom: 6px; }
.cv-head small { color: var(--chalk-dim) !important; font-size: .8rem; margin-left: 6px; }
.cv-log { display: flex; flex-direction: column; gap: 8px; max-width: 560px; margin: 0 auto 10px; max-height: 340px; overflow-y: auto; }
.cv-row { display: flex; align-items: flex-end; gap: 8px; }
.cv-row.me { justify-content: flex-end; }
.cv-av { width: 46px; height: 46px; object-fit: contain; flex: none; }
.cv-b { font-family: var(--hand); font-size: 1.25rem; padding: 6px 14px; border-radius: 18px; max-width: 75%; line-height: 1.3; display: flex; align-items: center; gap: 8px; }
.cv-row.them .cv-b { border: 2.5px solid rgba(244,241,232,.85); border-bottom-left-radius: 4px; color: var(--chalk) !important; }
.cv-row.me .cv-b { background: rgba(255,228,138,.16); border: 2.5px dashed rgba(255,228,138,.7); border-bottom-right-radius: 4px; color: var(--chalk-yellow) !important; }
.cv-b .say { width: 30px !important; height: 30px !important; font-size: .75rem; flex: none; }
.qb-cast.small .qb-person { width: 70px; height: 70px; } .qb-cast.small .qb-flag { width: 62px; height: 62px; }
.cv-bye { display: block; margin-top: 4px; font-weight: 700; }
.prof-g { margin-bottom: 10px; }
.prof-g button small { display: block; font-size: .7rem; opacity: .8; }
@media (max-width: 520px) { .cv-b { font-size: 1.05rem; } .cv-av { width: 36px; height: 36px; } }

/* U konobi: order ticket */
.cv-wrap.with-ticket { display: grid; grid-template-columns: 1fr 190px; gap: 12px; align-items: start; max-width: 640px; margin: 0 auto; }
.cv-wrap.with-ticket .cv-log { margin: 0; }
.cv-task { max-width: 560px; margin: 0 auto 10px; padding: 6px 12px; border-radius: 10px; background: rgba(255,228,138,.14); font-family: var(--hand); color: var(--chalk-yellow) !important; text-align: center; }
.ticket { background: #fffdf6; border-radius: 6px; padding: 8px 10px 12px; box-shadow: 0 4px 10px rgba(0,0,0,.3); transform: rotate(1.5deg); font-family: var(--hand);
  background-image: repeating-linear-gradient(#fffdf6 0 23px, #e6eef0 23px 24px); }
.ticket, .ticket * { color: #22302c !important; text-shadow: none !important; }
.ticket > b { display: block; text-align: center; border-bottom: 2px dashed #c98a2b; margin-bottom: 4px; font-size: .95rem; }
.t-line { display: grid; grid-template-columns: 28px 1fr; column-gap: 6px; align-items: center; margin: 4px 0; line-height: 1.1; }
.t-line img { width: 28px; height: 28px; object-fit: contain; grid-row: span 2; }
.t-dot { grid-row: span 2; text-align: center; }
.t-line span { font-size: .95rem; font-weight: 700; }
.t-line small { font-size: .7rem; opacity: .7; }
.t-empty { text-align: center; opacity: .5; }
@media (max-width: 640px) { .cv-wrap.with-ticket { grid-template-columns: 1fr; } .ticket { transform: none; } }

/* tappable words inside speech bubbles */
.cv-b .rw, .bubble .rw { color: inherit; margin: 0 1px; border-bottom-color: rgba(246,243,234,.28); }
.cv-row.me .cv-b .rw { border-bottom-color: rgba(255,228,138,.35); }
.cv-b .rw.on, .bubble .rw.on { color: var(--chalk-yellow); }
.cv-t { display: inline; }
.cv-t .rw { margin: 0; padding: 0 1px; white-space: nowrap; }

/* Danas: streak, done-for-today lock, first-time level pick, result */
.topic.big { position: relative; }
.danas-streak { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--chalk-yellow) !important; font-size: 1rem; }
.danas-streak .ico.sm { width: 22px; height: 22px; }
.topic.big.danas-done > .ico, .topic.big.danas-done > .topic-name { opacity: .45; }
.danas-lock { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); }
.danas-lock .ico { width: 70px; height: 70px; }
@media (max-width: 640px) { .danas-lock { top: 50%; left: 50px; transform: translate(-50%, -50%); } .danas-lock .ico { width: 48px; height: 48px; } }
.danas-setup { text-align: center; }
.danas-levels { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.danas-lvl { background: none; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; }
.danas-lvl img { width: 160px; max-width: 42vw; transition: transform .15s; }
.danas-lvl:hover img { transform: scale(1.06); }
.danas-result { display: flex; gap: 16px; align-items: center; text-align: left; max-width: 560px; margin: 12px auto; }
.danas-flame { position: relative; display: grid; place-items: center; flex: none; }
.danas-flame b { position: absolute; bottom: -4px; right: -6px; font-size: 1.5rem; background: #fff7e0; border-radius: 999px; padding: 0 8px; color: #b4471e; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.danas-result h3 { margin: 0 0 4px; }
.danas-result p { margin: 2px 0; }

/* why was that wrong */
.feedback .why { display: block; margin: 6px 0 2px; padding: 6px 10px; border-radius: 10px; background: rgba(242,194,48,.22); color: #4a3a08; font-size: .95rem; text-align: left; }

/* Danas: today's new words */
.new-words { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 12px 0 16px; }
.new-word { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border-radius: 14px; background: rgba(255,255,255,.06); }
.new-word .pic { width: 96px; height: 96px; }
.new-word b { font-size: 1.15rem; }
.new-word small { opacity: .75; }
.danas-result.fail h3 { color: var(--chalk-yellow); }
.center { text-align: center; }
/* round clock */


/* ---------- dark mode: the chalkboards stay, the page goes black and its text white ---------- */
body.dark {
  --paper: #0b0d0c; --paper-2: #1c2321; --ink: #f4f1ea; --ink-soft: #c9c5bb; --line: #333b38;
  background: #0b0d0c; color: #f4f1ea;
}
body.dark .brand { color: #f4f1ea; }
body.dark .foot, body.dark .back, body.dark .muted, body.dark .lead, body.dark .lvl-note { color: #c9c5bb; }
body.dark h1, body.dark h2, body.dark h3 { color: #f4f1ea; }
body.dark .foot code { background: #1c2321; color: #f4f1ea; }
body.dark .lvl-ask, body.dark .lvl-ask span { color: #f4f1ea; }

/* story mode, napredak, calendar */
.lvl-label.locked { opacity: .45; filter: grayscale(.6); }
.lvl-label.locked::after { content: '🔒'; position: absolute; top: -10px; right: -6px; font-size: .75rem; }
.story-lvl.locked { opacity: .55; }
.story-lvl-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.story-lvl-head img { width: 110px; }
.story-lvl-head small { display: block; opacity: .8; }
.story-row span small { opacity: .6; font-size: .7rem; }
.acc-bar.pass i { background: #2f8a4c; }
.cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; overflow-x: auto; padding: 4px 0; }
.cal i { width: 12px; height: 12px; border-radius: 3px; background: rgba(127,127,127,.18); }
.cal i.c1 { background: #b8dcc0; } .cal i.c2 { background: #7cc08d; } .cal i.c3 { background: #3f9a58; } .cal i.c4 { background: #1f6b35; }
.small { font-size: .85rem; }
/* dark mode: light cards keep their dark text */
body.dark :is(.pstat, .feedback, .rd-pop, .ticket, .spell, .key, .voice-pick select, .prof-name input, .forms-modal, .modal) {
  --ink: #1d2a3a; --ink-soft: #5d6878; --paper-2: #efe6d4; --line: #e2d8c4; color: #1d2a3a;
}
body.dark .pstat span, body.dark .pstat small { color: #5d6878; }
body.dark .score-ring span { color: #f4f1ea; }

/* ---------- Story Mode / Free Play bar (chalkboard art + live progress) ---------- */
.mode-bar { position: relative; display: block; margin: 10px auto 4px; container-type: inline-size; background: center / 100% 100% no-repeat; }
.mode-bar.story { width: min(100%, 640px); aspect-ratio: 1100 / 164; background-image: url(brand/ui/mode-story.png); --fill-max: 21.3cqw; }
.mode-bar.free { width: min(67%, 430px); aspect-ratio: 739 / 156; background-image: url(brand/ui/mode-free.png); }
.mode-bar button { position: absolute; background: none !important; border: 0 !important; border-image: none !important; padding: 0 !important; margin: 0; cursor: pointer; box-shadow: none !important; }
.mode-bar.story .mode-open { left: 2%; top: 10%; width: 78%; height: 80%; }
.mode-bar.story .mode-switch { left: 80.5%; top: 22%; width: 16.5%; height: 58%; border-radius: 999px; }
.mode-bar.free .mode-open { left: 3%; top: 10%; width: 66%; height: 80%; }
.mode-bar.free .mode-switch { left: 70%; top: 20%; width: 25.5%; height: 60%; border-radius: 999px; }
.mode-bar button:focus-visible { outline: 3px solid #f2c230; outline-offset: 2px; }
.mode-bar .mode-switch:hover { filter: brightness(1.1); background: rgba(255,255,255,.06) !important; }
.mode-fill { position: absolute; left: 48.65%; top: 51.5%; height: 14.8%; min-width: 0; max-width: var(--fill-max);
  background: url(brand/ui/mode-fill.png) left center / auto 100% repeat-x; border-radius: 999px; pointer-events: none; transition: width .6s ease; }
.mode-pct { position: absolute; left: 71.1%; width: 8.6%; top: 39%; text-align: center; font-family: 'Kalam', 'Chalkboard SE', 'Marker Felt', 'Comic Sans MS', cursive; font-weight: 700;
  font-size: 4cqw; line-height: 1; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.35); pointer-events: none; white-space: nowrap; }

/* ---------- Napredak: the big Continue button ---------- */
.story-hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: stretch; max-width: 900px; margin: 14px auto; }
.story-continue { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 230px; padding: 22px !important; }
.story-continue .ico { width: 120px; height: 120px; }
.story-continue .topic-name { font-size: 2.1rem; }
.story-continue-bar { display: block; width: 80%; height: 14px; border-radius: 999px; border: 2px solid rgba(255,255,255,.85); background: rgba(0,0,0,.35); overflow: hidden; margin-top: 6px; }
.story-continue-bar i { display: block; height: 100%; background: url(brand/ui/mode-fill.png) left center / auto 100% repeat-x; border-radius: 999px; }
.story-continue-note { font-size: .85rem; color: #f2e9c9; opacity: .9; margin-top: 4px; }
.story-side { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.story-side button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px !important; }
.story-side small { font-size: .75rem; opacity: .75; }
.story-rule { text-align: center; max-width: 760px; margin: 0 auto 6px; }
@media (max-width: 640px) { .story-hero { grid-template-columns: 1fr; } .story-continue { min-height: 190px; } .story-continue .ico { width: 90px; height: 90px; } }
.story-lvl.current { outline: 3px solid #f2c230; outline-offset: 3px; }
button.story-row { width: 100%; background: none; border: 0; padding: 6px 8px; margin: 3px 0; border-radius: 10px; color: inherit; font: inherit; font-family: var(--hand); text-align: left; cursor: pointer; grid-template-columns: 150px 1fr 48px 22px; }
button.story-row:hover { background: rgba(255,255,255,.08); }
button.story-row.focus { background: rgba(242,194,48,.14); }
.story-row em { font-style: normal; font-size: .7rem; background: #f2c230; color: #1d2a1f; border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.row-go { opacity: .7; text-align: center; }
@media (max-width: 520px) { .acc-row, button.story-row { grid-template-columns: 110px 1fr 40px 18px; gap: 6px; } }

/* ---------- chalkboard arrows: ← Home / back, → next / continue (your arrow art; only the body stretches) ---------- */
button.arrow-l, button.arrow-r {
  display: inline-flex !important; align-items: center; justify-content: center; height: 60px; min-width: 150px;
  padding: 0 10px !important; margin: 0; border-style: solid !important; border-radius: 0 !important;
  background: none !important; box-shadow: none !important; color: var(--chalk, #f4f1ea) !important;
  font-family: var(--hand); font-weight: 700; font-size: 1.05rem; line-height: 1; white-space: nowrap; text-decoration: none;
}
button.arrow-l { border-width: 0 8px 0 39px !important; border-image: url(brand/ui/arrow-left.png) 0 34 0 162 fill / 0 8px 0 39px stretch !important; }
button.arrow-r { border-width: 0 38px 0 10px !important; border-image: url(brand/ui/arrow-right.png) 0 158 0 41 fill / 0 38px 0 10px stretch !important; }
button.arrow-l:hover, button.arrow-r:hover { filter: brightness(1.08); color: #fff !important; }
button.arrow-l:hover { transform: translateX(-3px); }
button.arrow-r:hover { transform: translateX(3px); }
button.back.arrow-l { margin: 4px 0 6px; font-size: 1.1rem; }
.feedback .next.arrow-r { margin-left: auto; height: 54px; min-width: 150px; }

/* ---------- story progress on Teme tiles and topic chips ---------- */
.tp { display: flex; align-items: center; gap: 8px; width: 86%; margin: 8px auto 0; }
.tp-bar { flex: 1; height: 12px; border-radius: 999px; border: 2px solid rgba(255,255,255,.85); background: rgba(0,0,0,.35); overflow: hidden; }
.tp-bar i { display: block; height: 100%; background: url(brand/ui/mode-fill.png) left center / auto 100% repeat-x; border-radius: 999px; }
.tp-num { font-family: var(--hand); font-weight: 700; font-size: .9rem; color: var(--chalk, #fff); min-width: 2.6em; text-align: right; }
.tp-none { display: block; margin-top: 6px; font-size: .75rem; opacity: .65; font-style: italic; }
.chip-btn.has-tp { display: inline-flex; flex-direction: column; align-items: stretch; gap: 3px; }
.tp.sm { width: 100%; margin: 2px 0 0; gap: 5px; }
.tp.sm .tp-bar { height: 7px; border-width: 1.5px; }
.tp.sm .tp-num { font-size: .7rem; min-width: 2.2em; }
.chip-btn .tp-none { margin-top: 1px; font-size: .65rem; }
.teme-story { margin: 4px 0 12px; }

/* ---------- Štoperica · time trial ---------- */
.tt-bar { max-width: 760px; margin: 6px auto 16px; }
.tt-title { font-family: var(--hand); font-weight: 700; font-size: 1.5rem; color: var(--chalk, #fff); display: flex; flex-direction: column; line-height: 1.05; text-align: center; }
.tt-title small { font-size: .85rem; font-weight: 400; opacity: .8; }
.tt-btn img { width: 78px !important; height: 78px !important; }
.tt-btn.on { filter: drop-shadow(0 0 8px rgba(255,214,90,.75)); }
@media (max-width: 520px) { .tt-btn img { width: 60px !important; height: 60px !important; } .tt-title { font-size: 1.2rem; } }
.tt-go { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 18px auto; text-align: center; }
.tt-best { font-size: 1.05rem; margin: 0; }
.tt-go .arrow-r { height: 72px; font-size: 1.35rem; min-width: 230px; }
/* the countdown: a little chalkboard with the stopwatch and white chalk numbers */
.tt-clock { display: inline-flex; align-items: center; gap: 8px; padding: 4px 16px 4px 8px; border-style: solid; border-width: 10px; border-image: url(brand/ui/frame-btn.png) 40 fill / 14px stretch;
  background: #173a31; background-clip: padding-box; border-radius: 14px; white-space: nowrap; }
.tt-clock .ico.tt-ico { width: 38px; height: 38px; }
.tt-clock b { font-family: 'Kalam', var(--hand); font-weight: 700; font-size: 1.7rem; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; min-width: 2.6em; text-align: center; }
.tt-clock.low b { color: #ffd65a; animation: tt-pulse 1s infinite; }
@keyframes tt-pulse { 50% { transform: scale(1.12); } }
.tt-result { display: flex; align-items: center; gap: 14px; text-align: left; max-width: 560px; margin: 12px auto; }
.tt-result .ico.lg { width: 74px; height: 74px; flex: none; }
.tt-result h3 { margin: 0 0 4px; }
.tt-result p { margin: 2px 0; }
/* Napredak side buttons with your icons */
.story-side .side-ico { flex-direction: row !important; gap: 12px !important; justify-content: flex-start; text-align: left; }
.story-side .side-ico .ico { width: 58px; height: 58px; flex: none; }
.story-side .side-ico span { display: flex; flex-direction: column; }
.chip-btn .ico.sm { vertical-align: -4px; }
.tt-tabs { display: flex; justify-content: center; gap: 6px; margin: 4px 0 12px; }
.tt-tabs .tt-btn img { width: 64px !important; height: 64px !important; }
.prof-panel h3 .ico.sm { width: 22px; height: 22px; }
.tt-pool { max-width: 640px; margin: 4px auto 0; }
.chip-btn.has-tp { min-width: 140px; }

/* ---------- "Naučeno!" word pop ---------- */
.word-pop { position: fixed; left: 50%; top: 12px; transform: translate(-50%, -140%); z-index: 9000; display: flex; align-items: center; gap: 12px;
  min-width: 260px; max-width: min(92vw, 460px); padding: 10px 18px 10px 10px; border-style: solid; border-width: 12px; border-image: url(brand/ui/frame-btn.png) 40 fill / 16px stretch;
  background: #173a31; background-clip: padding-box; border-radius: 18px; color: #fff; font-family: var(--hand); transition: transform .35s cubic-bezier(.2,1.4,.4,1); pointer-events: none; }
.word-pop.show { transform: translate(-50%, 0); }
.word-pop b { display: block; color: #9be36b; font-size: 1.05rem; }
.word-pop.mastered b { color: #ffd65a; }
.word-pop .pop-word { display: block; font-size: 1.35rem; font-weight: 700; line-height: 1.15; }
.word-pop .pop-word small { font-size: .85rem; font-weight: 400; opacity: .8; }
.word-pop small { display: block; font-size: .78rem; opacity: .85; }
.word-pop .pic.pop-pic { width: 62px; height: 62px; flex: none; margin: 0; }
.word-pop .pic.pop-pic img { width: 100%; height: 100%; object-fit: contain; }
.word-pop .pop-badge { font-size: 2rem; }
.row-star { font-size: .7rem; margin-left: 4px; color: #ffd65a; }
.pic-check { margin: 18px auto 6px; }
.word-pop .pop-word small { display: inline; }
