/* TitanEnglish - tamna tema sa zlatnim akcentom, prvo za telefon. */
:root {
  --bg: #0b0e15;
  --panel: #131824;
  --panel-2: #1a2030;
  --line: #262d40;
  --text: #eef1f7;
  --muted: #97a0b5;
  --gold: #e8b93c;
  --gold-ink: #1b1403;
  --red: #e0574f;
  --green: #3fb77a;
  --blue: #5b9bf0;
  --radius: 16px;
  --tabs-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; line-height: 1.25; }
h3 { font-size: 1rem; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.pad { padding: 24px 16px; }
.en { font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; }
.gold { color: var(--gold); }
.ok { color: var(--green); }
.bad { color: var(--red); }

/* ---------- Okvir ---------- */
#top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(11, 14, 21, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--gold); color: var(--gold-ink); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.02em;
}
.brand-name { font-weight: 800; color: var(--gold); }
.brand-version { color: var(--muted); font-size: 0.75rem; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); font-size: 0.9rem; white-space: nowrap;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex: none; }

#banner {
  padding: 8px 16px; background: #2a2210; color: #f3d98b; font-size: 0.85rem; text-align: center;
  border-bottom: 1px solid #4a3c17;
}

#view {
  max-width: 680px; margin: 0 auto; padding: 20px 16px calc(var(--tabs-h) + 32px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
}
#view.focus { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(15, 19, 29, 0.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabs-h); color: var(--muted); font-size: 0.72rem;
}
#tabs a .ico { font-size: 1.25rem; line-height: 1; }
#tabs a.on { color: var(--gold); }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 50; max-width: min(92vw, 520px); padding: 12px 16px; border-radius: 12px;
  background: #23293a; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); font-size: 0.92rem;
}
#toast.error { border-color: var(--red); }

/* ---------- Gradivni dijelovi ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
}
.card.hero { background: linear-gradient(160deg, #1d2233 0%, #141925 70%); border-color: #3a3520; }
.card.flat { background: transparent; }
.eyebrow { font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-2); font-weight: 650; text-align: center;
}
.btn.primary { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn.danger { background: transparent; border-color: #5a2b28; color: #f0908a; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 8px 12px; font-size: 0.9rem; border-radius: 10px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:focus-visible, .list button:focus-visible, textarea:focus-visible, input:focus-visible, .opt:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

input[type="text"], input[type="password"], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #0f131d; font-size: 1rem;
}
textarea { resize: vertical; min-height: 64px; }

.list { display: flex; flex-direction: column; }
.list button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px 4px; background: none; border: 0;
  border-bottom: 1px solid var(--line); font-size: 1.1rem; font-weight: 700; text-align: left;
}
.list button:last-child { border-bottom: 0; }
.list .chev { margin-left: auto; color: var(--muted); font-weight: 400; }

.bar { height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: inherit; transition: width 0.25s ease; }

.grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--panel-2); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.8rem; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.week .d { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--muted); }
.week .o { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); }
.week .o.done { background: var(--green); border-color: var(--green); }
.week .o.today { border-color: var(--gold); }

.pill {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 650;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap;
}
.pill.gold { color: var(--gold); border-color: #4a3c17; background: #221c0c; }
.pill.red { color: #f0908a; border-color: #5a2b28; background: #24120f; }
.pill.green { color: #7fdcae; border-color: #1f5a3f; background: #0f2219; }

.opt {
  display: block; width: 100%; text-align: left; padding: 13px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #0f131d;
}
.opt.on { border-color: var(--gold); background: #221c0c; }

.passage { background: #0f131d; border-radius: 12px; padding: 14px; border: 1px solid var(--line); }
.cue { font-size: 1.25rem; font-weight: 700; }
.note { background: var(--panel-2); border-radius: 12px; padding: 12px 14px; font-size: 0.95rem; }
.note.good { border-left: 3px solid var(--green); }
.note.warn { border-left: 3px solid var(--gold); }
.note.err { border-left: 3px solid var(--red); }
del { color: #f0908a; text-decoration-thickness: 1px; }
ins { color: #7fdcae; text-decoration: none; }

.words { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.words span { padding: 2px 8px; border-radius: 8px; background: var(--panel-2); }
.words span.hit { color: #7fdcae; }
.words span.miss { color: #f0908a; background: #24120f; }

/* ---------- Glas ---------- */
.mic {
  width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--gold); color: var(--gold-ink);
  font-size: 1.9rem; display: grid; place-items: center; flex: none; box-shadow: 0 6px 22px rgba(232, 185, 60, 0.25);
}
.mic.small { width: 48px; height: 48px; font-size: 1.2rem; box-shadow: none; }
.mic.live { background: var(--red); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.mic.busy { background: var(--panel-2); color: var(--muted); box-shadow: none; }
.mic:disabled { opacity: 0.5; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 87, 79, 0.55); }
  50% { box-shadow: 0 0 0 16px rgba(224, 87, 79, 0); }
}

.talk { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 88%; padding: 11px 14px; border-radius: 16px; line-height: 1.45; }
.bubble.tutor { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: #2b2410; border: 1px solid #4a3c17; border-bottom-right-radius: 6px; }
.bubble.veil { filter: blur(6px); cursor: pointer; user-select: none; }
.bubble.typing { color: var(--muted); }
.dock {
  position: sticky; bottom: 0; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(11, 14, 21, 0) 0%, var(--bg) 26%);
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.dock .status { font-size: 0.85rem; color: var(--muted); min-height: 1.3em; text-align: center; }

.orb {
  width: 150px; height: 150px; border-radius: 50%; margin: 18px auto;
  background: radial-gradient(circle at 35% 30%, #f5d77a, #b98a1c 60%, #6b4d08);
  box-shadow: 0 0 60px rgba(232, 185, 60, 0.25); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.orb.speaking { animation: breathe 1.1s ease-in-out infinite; }
.orb.hearing { transform: scale(0.92); box-shadow: 0 0 0 10px rgba(63, 183, 122, 0.25); }
.orb.connecting { filter: grayscale(0.8); opacity: 0.6; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.spinner {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold);
  animation: spin 0.9s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.days { display: grid; grid-template-columns: repeat(28, 1fr); gap: 3px; align-items: end; height: 72px; }
.days i { display: block; background: var(--panel-2); border-radius: 3px; min-height: 4px; }
.days i.on { background: var(--gold); }

.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 5px; border-radius: 999px; background: var(--panel-2); }
.steps i.done { background: var(--gold); }
.steps i.now { background: #8f7426; }

@media (min-width: 560px) {
  h1 { font-size: 1.9rem; }
  .grid.levels { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
