/* ==========================================================================
   KódDuo — štýly. Mobil-first (Android), tmavá téma, tyrkysový akcent.
   Duolingo-style cesta lekcií + gamifikácia.
   ========================================================================== */

:root {
  --accent: #2dd4bf;
  --accent-soft: #7defdf;
  --bg: #0e1116;
  --bg-2: #161b22;
  --bg-3: #1c232d;
  --panel: #12171f;
  --border: #2a323d;
  --text: #e6edf3;
  --text-dim: #9aa7b4;
  --ok: #3fb950;
  --ok-soft: #7ee787;
  --err: #f85149;
  --err-soft: #ff9d97;
  --radius: 14px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-code: "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font-ui); font-size: 17px; line-height: 1.5;
  overscroll-behavior: none;
}
button { font-family: inherit; }

.screen { min-height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* =========================================================== GAMI HEAD === */
.gami {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(14,17,22,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.gami .brand { font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.gami .brand .k { color: var(--accent); }
.gami-stats { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.gami-stats .stat { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.gami-stats .stat b { color: var(--accent-soft); }
.stat-btn {
  background: none; border: 1px solid var(--border); color: var(--text);
  width: 38px; height: 38px; border-radius: 50%; font-size: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.stat-btn:active { background: var(--bg-3); }
.stat-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Profil a nastavenia ---------------------------------------------------- */
.settings-top { justify-content: flex-start; gap: 12px; }
.settings-title { font-size: 17px; margin: 0; font-weight: 800; }
.settings-area {
  max-width: 640px; margin: 0 auto; width: 100%;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto; flex: 1;
}
.set-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.set-h { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.set-note { margin: 0 0 12px; font-size: 14px; color: var(--text-dim); line-height: 1.5; }
.set-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-secondary {
  flex: 1; min-width: 160px; background: var(--bg-3); color: var(--text);
  border: 1px solid var(--border); font-size: 15px; padding: 12px 14px;
}
.btn-secondary:active { background: var(--bg-2); }
.btn-secondary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.set-status { margin: 12px 0 0; font-size: 14px; min-height: 20px; color: var(--text-dim); }
.set-status.ok { color: var(--ok-soft); }
.set-status.err { color: var(--err-soft); }

/* denný cieľ — prstenec */
.goal-ring {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--accent) 0%, var(--bg-3) 0);
  transition: background .5s ease;
}
.goal-text {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--text-dim);
}
.gami .goal.hit .goal-text { color: var(--ok-soft); }

/* =============================================================== HOME ==== */
.home-scroll { flex: 1; overflow-y: auto; padding: 16px 16px 40px; max-width: 640px; margin: 0 auto; width: 100%; }

/* pás jazykov */
.courses-strip {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px;
  scrollbar-width: none;
}
.courses-strip::-webkit-scrollbar { display: none; }
.course-chip {
  flex: 0 0 auto; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 14px; min-width: 74px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 14px; color: var(--text); cursor: pointer;
}
.course-chip.active { border-color: var(--accent); background: var(--bg-3); box-shadow: 0 0 0 1px var(--accent) inset; }
.course-chip.locked { opacity: .55; }
.course-chip .cc-emoji { font-size: 24px; }
.course-chip .cc-lang { font-size: 12px; font-weight: 700; }
.course-chip .cc-lock { position: absolute; top: 4px; right: 6px; font-size: 11px; }

/* hlavička kurzu */
.course-head {
  display: flex; align-items: center; gap: 14px;
  margin: 14px 0 8px; padding: 14px 16px;
  background: linear-gradient(135deg, var(--bg-2), var(--panel));
  border: 1px solid var(--border); border-radius: var(--radius);
}
.ch-emoji {
  font-size: 30px; width: 54px; height: 54px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: var(--bg-3);
  box-shadow: 0 0 0 2px var(--c, var(--accent)) inset;
}
.ch-title { font-size: 18px; font-weight: 800; }
.ch-desc { font-size: 14px; color: var(--text-dim); }

/* --- cesta lekcií --------------------------------------------------------- */
.path { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 12px 0 4px; }
.unit-head {
  align-self: stretch; text-align: center; margin: 14px 0 2px;
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); font-weight: 800;
  position: relative;
}
.unit-head::before, .unit-head::after {
  content: ""; position: absolute; top: 50%; width: 22%; height: 1px; background: var(--border);
}
.unit-head::before { left: 4%; } .unit-head::after { right: 4%; }

.node {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 2px;
  transition: transform .12s ease;
}
.node:active { transform: scale(.96); }
.node-circle {
  width: 66px; height: 66px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800;
  background: var(--bg-3); border: 2px solid var(--border);
  box-shadow: 0 4px 0 rgba(0,0,0,.4);
}
.node-label { font-size: 13px; color: var(--text-dim); max-width: 150px; text-align: center; }
.node-xp { font-size: 11px; color: var(--text-dim); opacity: .7; }

.node.open .node-circle {
  background: linear-gradient(135deg, var(--accent), #12a594); color: #04211d;
  border-color: var(--accent-soft);
  box-shadow: 0 4px 0 #0c6b60, 0 0 18px rgba(45,212,191,.4);
  animation: pulse 2s ease-in-out infinite;
}
.node.open .node-label { color: var(--text); font-weight: 700; }
.node.done .node-circle {
  background: var(--ok); color: #06210c; border-color: var(--ok-soft);
  box-shadow: 0 4px 0 #256b30;
}
.node.done .node-label { color: var(--text); }
.node.locked { cursor: default; }
.node.locked .node-circle { opacity: .5; }
.node.locked .node-xp { visibility: hidden; }

@keyframes pulse { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.path-empty {
  align-self: stretch; text-align: center; padding: 30px 20px;
  color: var(--text-dim); background: var(--bg-2);
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.path-progress { align-self: center; margin-top: 10px; font-size: 13px; color: var(--text-dim); }

/* --- odznaky -------------------------------------------------------------- */
.section-title { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin: 26px 2px 10px; }
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge {
  text-align: center; padding: 12px 6px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--border); opacity: .45;
}
.badge.earned { opacity: 1; border-color: var(--accent); background: var(--bg-3); }
.badge-emoji { font-size: 26px; filter: grayscale(1); }
.badge.earned .badge-emoji { filter: none; }
.badge-title { font-size: 11px; font-weight: 700; margin-top: 4px; }
.badge-desc { font-size: 10px; color: var(--text-dim); line-height: 1.25; margin-top: 2px; }

/* ============================================================= LESSON ==== */
.lesson-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.close-x { background: none; border: none; color: var(--text-dim); font-size: 22px; cursor: pointer; padding: 0 4px; line-height: 1; }
.step-progress { flex: 1; height: 12px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.step-progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-soft)); border-radius: 99px; transition: width .35s ease; }
.lesson-badge { font-size: 22px; }

.step-area { flex: 1; overflow-y: auto; padding: 18px 16px 24px; max-width: 640px; margin: 0 auto; width: 100%; }
.step-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); font-weight: 700; margin-bottom: 12px; }

/* --- spoločné pre cvičenia ------------------------------------------------ */
.ex-prompt { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.ex-prompt code, .teach-body code {
  background: var(--bg-3); color: var(--accent-soft);
  padding: 1px 6px; border-radius: 6px; font-family: var(--font-code); font-size: .88em;
}
.ex-code {
  background: #0b0e13; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin: 0 0 16px; overflow-x: auto;
  font-family: var(--font-code); font-size: 15px; color: #cdd9e5; line-height: 1.55;
  white-space: pre;
}

/* --- výklad (teach) ------------------------------------------------------- */
.teach-body p { margin: 10px 0; }
.teach-body pre {
  background: #0b0e13; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; overflow-x: auto; font-family: var(--font-code);
  font-size: 14px; color: #cdd9e5; line-height: 1.55; white-space: pre;
}

/* --- výber odpovede (choice / output) ------------------------------------ */
.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  text-align: left; padding: 15px 16px; border-radius: 12px;
  background: var(--bg-2); border: 2px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 16px;
}
.opt code { background: transparent; color: var(--text); font-family: var(--font-code); }
.opt.sel { border-color: var(--accent); background: var(--bg-3); }
.opt.right { border-color: var(--ok); background: rgba(63,185,80,.14); }
.opt.right code { color: var(--ok-soft); }
.opt.wrong { border-color: var(--err); background: rgba(248,81,73,.12); }
.opt.wrong code { color: var(--err-soft); }

/* --- doplň (fill) --------------------------------------------------------- */
.fill-code { display: block; white-space: pre-wrap; }
.fill-input {
  display: inline-block; min-width: 90px; width: auto;
  background: var(--bg); color: var(--accent-soft);
  border: none; border-bottom: 2px solid var(--accent);
  font-family: var(--font-code); font-size: 15px; padding: 2px 6px; margin: 0 2px;
}
.fill-input:focus { outline: none; background: var(--bg-3); }
.fill-input.right { color: var(--ok-soft); border-color: var(--ok); }
.fill-input.wrong { color: var(--err-soft); border-color: var(--err); }

/* --- poskladaj (order) ---------------------------------------------------- */
.order-target {
  min-height: 60px; border: 2px dashed var(--border); border-radius: 12px;
  padding: 8px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px;
  background: rgba(0,0,0,.2);
}
.order-hint { color: var(--text-dim); font-size: 14px; text-align: center; padding: 14px 6px; }
.order-line {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px;
}
.order-line code { flex: 1; font-family: var(--font-code); font-size: 14px; white-space: pre; color: #cdd9e5; overflow-x: auto; }
.order-line.right { border-color: var(--ok); background: rgba(63,185,80,.12); }
.order-line.wrong { border-color: var(--err); background: rgba(248,81,73,.10); }
.order-x { background: none; border: none; color: var(--text-dim); font-size: 14px; cursor: pointer; padding: 2px 4px; }
.order-sep { text-align: center; font-size: 12px; color: var(--text-dim); margin: 4px 0 10px; }
.order-pool { display: flex; flex-direction: column; gap: 8px; }
.order-block {
  text-align: left; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; cursor: pointer; color: var(--text);
}
.order-block code { font-family: var(--font-code); font-size: 14px; white-space: pre; color: #cdd9e5; }
.order-block.used { opacity: .3; pointer-events: none; }
.order-block:active { transform: scale(.98); }

/* --- napíš kód (editor) --------------------------------------------------- */
.editor-shell { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 4px 0 12px; background: #0b0e13; }
.editor-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-2); border-bottom: 1px solid var(--border); }
.editor-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.editor-bar .dot.r { background: #ff5f57; } .editor-bar .dot.y { background: #febc2e; } .editor-bar .dot.g { background: #28c840; }
.editor-bar .file { margin-left: 6px; font-family: var(--font-code); font-size: 13px; color: var(--text-dim); }
.editor-bar .reset { margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text-dim); font-size: 13px; padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.editor-bar .reset:active { background: var(--bg-3); }

.CodeMirror { height: auto; min-height: 150px; font-family: var(--font-code) !important; font-size: 16px !important; line-height: 1.5 !important; }
.CodeMirror-gutters { border-right: 1px solid #1c2530 !important; }

.code-controls { display: flex; gap: 10px; margin: 0 0 10px; }
.btn { padding: 14px 18px; font-size: 17px; font-weight: 700; border: none; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-run { flex: 1; background: linear-gradient(135deg, var(--accent), #12a594); color: #04211d; box-shadow: 0 4px 14px rgba(45,212,191,.3); }
.btn-run:active { transform: translateY(1px); }
.btn-run:disabled { opacity: .6; cursor: default; }

.stdin-wrap { margin: 8px 0; }
.stdin-wrap summary { cursor: pointer; font-size: 14px; color: var(--text-dim); padding: 6px 2px; user-select: none; }
.stdin-wrap summary b { color: var(--accent); }
.stdin-wrap summary code { color: var(--accent-soft); font-family: var(--font-code); font-size: .9em; }
.stdin-wrap textarea { width: 100%; margin-top: 6px; background: #0b0e13; color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px; font-family: var(--font-code); font-size: 15px; resize: vertical; min-height: 50px; }

.console-shell { margin: 6px 0 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.console-bar { padding: 8px 12px; background: var(--bg-2); border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-dim); }
.console { background: #08090c; padding: 12px 14px; min-height: 60px; max-height: 260px; overflow-y: auto; font-family: var(--font-code); font-size: 15px; white-space: pre-wrap; word-break: break-word; color: #cdd9e5; }
.console .out { color: #cdd9e5; } .console .err { color: var(--err); } .console .sys { color: var(--text-dim); font-style: italic; } .console .placeholder { color: #556; }

/* --- SQL výsledok (tabuľka) ----------------------------------------------- */
.sql-result { background: #08090c; padding: 10px; min-height: 60px; max-height: 300px; overflow: auto; }
.sql-result .placeholder { color: #556; font-family: var(--font-code); font-size: 15px; }
.sql-table { border-collapse: collapse; width: 100%; font-family: var(--font-code); font-size: 14px; }
.sql-table th, .sql-table td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; white-space: nowrap; }
.sql-table th { background: var(--bg-3); color: var(--accent-soft); font-weight: 700; }
.sql-table td { color: #cdd9e5; }
.sql-table tbody tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.sql-note { margin-top: 8px; font-size: 13px; color: var(--text-dim); font-family: var(--font-code); }
.sql-error { color: var(--err); font-family: var(--font-code); font-size: 14px; white-space: pre-wrap; }

/* --- pätka lekcie --------------------------------------------------------- */
.lesson-foot {
  position: sticky; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(14,17,22,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  max-width: 640px; margin: 0 auto; width: 100%;
}
.feedback { display: none; margin-bottom: 10px; padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: 15px; }
.feedback.show { display: block; }
.feedback.ok { background: rgba(63,185,80,.14); border: 1px solid var(--ok); color: var(--ok-soft); }
.feedback.no { background: rgba(248,81,73,.10); border: 1px solid var(--err); color: var(--err-soft); font-weight: 500; }
.feedback.wait { background: var(--bg-3); border: 1px solid var(--border); color: var(--text-dim); }
.feedback code { color: var(--accent-soft); font-family: var(--font-code); }
.btn-primary { width: 100%; background: linear-gradient(135deg, var(--accent), #12a594); color: #04211d; box-shadow: 0 4px 14px rgba(45,212,191,.28); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .5; }

/* ========================================================= CELEBRATION == */
.celebrate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(6,8,11,.86); backdrop-filter: blur(4px);
}
.celebrate-card {
  width: 100%; max-width: 380px; text-align: center;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 20px;
  padding: 28px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: pop .3s ease;
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.celebrate-emoji { font-size: 56px; }
.celebrate-card h2 { margin: 6px 0 18px; font-size: 24px; }
.cel-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.cel-row { display: flex; align-items: center; gap: 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.cr-emoji { font-size: 22px; }
.cr-big { font-weight: 800; font-size: 17px; color: var(--accent-soft); }
.cr-small { margin-left: auto; font-size: 13px; color: var(--text-dim); }
.cel-badges { margin-top: 14px; }
.cel-badge-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.cel-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--bg-3); border: 1px solid var(--accent); border-radius: 99px; padding: 8px 14px; margin: 4px; }
.cel-badge .cb-emoji { font-size: 20px; }
.cel-badge .cb-name { font-size: 14px; font-weight: 700; }
.celebrate .btn-primary { margin-top: 20px; }

/* =============================================================== TOAST === */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  z-index: 60; max-width: 88%; padding: 12px 18px;
  background: var(--bg-3); border: 1px solid var(--accent); border-radius: 12px;
  color: var(--text); font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.footer-note { text-align: center; color: #556; font-size: 12px; margin-top: 30px; }

/* ============================================================= DESKTOP === */
@media (min-width: 720px) {
  .badges { grid-template-columns: repeat(4, 1fr); }
  .node-circle { width: 72px; height: 72px; }
}

/* --- Prístupnosť ----------------------------------------------------------- */
/* Viditeľný focus pre klávesnicu (myš/dotyk ho nedostane) */
.node:focus-visible, .course-chip:focus-visible, .opt:focus-visible,
.order-block:focus-visible, .btn:focus-visible, .close-x:focus-visible,
.fill-input:focus-visible, .reset:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.step-area:focus { outline: none; }   /* focus po prechode kroku — bez rámika */

/* Rešpektuj systémové „obmedziť pohyb" (vestibulárne ťažkosti, ADHD, nevoľnosť) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Onboarding (prvé spustenie) ------------------------------------------- */
.onb {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8,10,14,.92); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.onb-card {
  width: 100%; max-width: 420px; text-align: center;
  background: var(--panel); border: 1px solid var(--accent);
  border-radius: 20px; padding: 26px 22px 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.onb-emoji { font-size: 52px; line-height: 1; margin-bottom: 10px; }
.onb-title { margin: 0 0 10px; font-size: 22px; font-weight: 800; }
.onb-title:focus { outline: none; }
.onb-body { font-size: 15px; color: var(--text-dim); line-height: 1.55; text-align: left; }
.onb-body p { margin: 0 0 10px; }
.onb-body b { color: var(--text); }

.onb-goals { display: flex; gap: 8px; margin: 14px 0 4px; }
.goal-opt {
  flex: 1; display: flex; flex-direction: column; gap: 2px; align-items: center;
  padding: 12px 6px; cursor: pointer;
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
}
.goal-opt b { font-size: 14px; }
.goal-opt span { font-size: 11px; color: var(--text-dim); }
.goal-opt.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.goal-opt.sel span { color: var(--accent-soft); }
.goal-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.onb-dots { display: flex; justify-content: center; gap: 6px; margin: 16px 0 14px; }
.onb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bg-3); }
.onb-dot.on { background: var(--accent); width: 18px; border-radius: 99px; }

.onb-actions { display: flex; gap: 10px; }
.onb-actions .btn { flex: 1; }
.onb-skip {
  margin-top: 10px; background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 13px; text-decoration: underline; padding: 6px;
}
.onb-skip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Nastavenia: profil, cieľ, zvuk, nebezpečná zóna ----------------------- */
.set-label { display: block; font-size: 13px; color: var(--text-dim); margin: 10px 0 6px; }
.set-input {
  width: 100%; padding: 12px 14px; font-size: 16px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
}
.set-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.avatar-row { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-opt {
  width: 44px; height: 44px; font-size: 22px; cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.avatar-opt.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.avatar-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.set-range { width: 100%; accent-color: var(--accent); height: 30px; }
.set-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.goal-value { margin: 4px 0 0; font-weight: 800; color: var(--accent-soft); font-size: 15px; }

.set-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.switch {
  flex: 0 0 auto; width: 52px; height: 30px; border-radius: 99px; cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--border); padding: 3px;
  display: flex; align-items: center; transition: background .18s ease;
}
.switch-knob {
  width: 22px; height: 22px; border-radius: 50%; background: var(--text-dim);
  transition: transform .18s ease, background .18s ease;
}
.switch.on { background: var(--bg-3); border-color: var(--accent); }
.switch.on .switch-knob { transform: translateX(22px); background: var(--accent); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.danger-card { border-color: rgba(248,81,73,.35); }
.btn-danger {
  width: 100%; background: linear-gradient(135deg, var(--err), #c0392f); color: #fff;
  box-shadow: 0 4px 14px rgba(248,81,73,.25);
}
.btn-danger:active { transform: translateY(1px); }
.btn-danger:focus-visible { outline: 2px solid var(--err-soft); outline-offset: 2px; }

/* --- Modál (namiesto natívneho confirm()) --------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(8,10,14,.86); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  width: 100%; max-width: 380px; text-align: center;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; padding: 24px 20px 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
}
.modal-emoji { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.modal-title { margin: 0 0 8px; font-size: 19px; font-weight: 800; }
.modal-title:focus { outline: none; }
.modal-body { margin: 0 0 18px; font-size: 15px; color: var(--text-dim); line-height: 1.55; }
.modal-body b { color: var(--text); }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* --- Úroveň (level) -------------------------------------------------------- */
.stat.lvl {
  position: relative; gap: 3px;
  padding: 4px 9px 6px; border-radius: 10px;
  background: var(--bg-3); border: 1px solid var(--border);
  overflow: hidden;
}
.stat.lvl .lvl-tag { font-size: 10px; color: var(--text-dim); font-weight: 700; letter-spacing: .5px; }
.stat.lvl b { color: var(--accent-soft); font-size: 15px; }
/* tenký prúžok postupu v rámci úrovne (--lvl-pct nastavuje app.js) */
.stat.lvl::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px;
  width: var(--lvl-pct, 0%); background: var(--accent); transition: width .4s ease;
}

.lvl-card { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lvl-big {
  flex: 0 0 auto; font-weight: 800; font-size: 15px; color: #04211d;
  background: linear-gradient(135deg, var(--accent), #12a594);
  padding: 8px 12px; border-radius: 10px;
}
.lvl-info { flex: 1; min-width: 0; }
.lvl-bar { height: 8px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.lvl-bar > span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 99px; transition: width .4s ease;
}
.lvl-sub { font-size: 12px; color: var(--text-dim); margin-top: 5px; }

/* --- Vekový gate (neutrálny, bez zberu veku) ------------------------------- */
.onb-fine { font-size: 13px; opacity: .8; font-style: italic; }
.footer-note a { color: var(--accent-soft); text-decoration: none; }
.footer-note a:hover, .footer-note a:focus-visible { text-decoration: underline; }

/* --- Načítavanie (boot) ---------------------------------------------------- */
.boot {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .3s ease;
}
.boot.gone { opacity: 0; pointer-events: none; }
.boot-card { text-align: center; }
.boot-logo {
  font-family: var(--font-code); font-size: 34px; font-weight: 800; color: var(--accent);
  width: 84px; height: 84px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 22px;
}
.boot-title { font-size: 22px; font-weight: 800; margin-bottom: 18px; }
.boot-title .k { color: var(--accent); }
.boot-spinner {
  width: 28px; height: 28px; margin: 0 auto 12px;
  border: 3px solid var(--bg-3); border-top-color: var(--accent);
  border-radius: 50%; animation: boot-spin .8s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }
.boot-note { font-size: 13px; color: var(--text-dim); }

/* pri „obmedziť pohyb" nech sa točiaci krúžok nekrúti (globálne pravidlo ho spomalí,
   tu ho radšej nahradíme jemným pulzom opacity) */
@media (prefers-reduced-motion: reduce) {
  .boot-spinner { animation: none; border-top-color: var(--accent); opacity: .8; }
}
