/* ===== Alapok / paletta ===== */
:root{
  --bg:#f4f6fb; --surface:#fff; --surface-2:#f8fafc;
  --ink:#0f172a; --ink-2:#475569; --ink-3:#94a3b8;
  --line:#e2e8f0; --line-2:#cbd5e1;
  --brand:#1d4ed8; --brand-2:#3b82f6; --brand-soft:#eff4ff;
  --ok:#059669; --ok-soft:#ecfdf5;
  --warn:#b45309; --warn-soft:#fffbeb;
  --bad:#dc2626; --bad-soft:#fef2f2;
  --radius:14px; --radius-lg:20px;
  --shadow:0 1px 2px rgba(15,23,42,.06),0 8px 24px -12px rgba(15,23,42,.18);
}
@media (prefers-color-scheme:dark){
  :root{
    --bg:#0b1120; --surface:#111827; --surface-2:#0f172a;
    --ink:#f1f5f9; --ink-2:#cbd5e1; --ink-3:#94a3b8;
    --line:#1e293b; --line-2:#334155;
    --brand:#60a5fa; --brand-2:#3b82f6; --brand-soft:#172554;
    --ok:#34d399; --ok-soft:#052e2b;
    --warn:#fbbf24; --warn-soft:#2c2003;
    --bad:#f87171; --bad-soft:#2b0d0d;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px -12px rgba(0,0,0,.6);
  }
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink);
  font:15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  padding-bottom:env(safe-area-inset-bottom);
}
h1,h2,h3{margin:0;line-height:1.25}
button{font:inherit}
.hide{display:none !important}

/* ===== Fejléc ===== */
.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 20px;
  background:color-mix(in srgb,var(--surface) 88%,transparent);
  backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--line);
}
.brand{display:flex; align-items:center; gap:12px; min-width:0}
.brand-mark{
  width:42px;height:42px;flex:none;display:grid;place-items:center;font-size:22px;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  border-radius:12px; box-shadow:0 4px 12px -4px var(--brand);
}
.topbar h1{font-size:17px; font-weight:650; letter-spacing:-.01em}
.brand-sub{margin:2px 0 0; font-size:12.5px; color:var(--ink-3)}
@media(max-width:560px){ .brand-sub{display:none} }

main{max-width:860px; margin:0 auto; padding:22px 18px 60px}

/* ===== Kártyák ===== */
.card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); padding:22px; margin-bottom:18px; box-shadow:var(--shadow);
}
.card-title{font-size:16px; font-weight:650; letter-spacing:-.01em}
.card-hint{margin:6px 0 16px; font-size:13.5px; color:var(--ink-3)}

/* ===== Témaválasztó ===== */
.topic-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:10px}
.topic{
  display:flex; gap:11px; align-items:flex-start; text-align:left;
  padding:13px 14px; cursor:pointer;
  background:var(--surface-2); border:1.5px solid var(--line); border-radius:var(--radius);
  transition:border-color .15s,background .15s,transform .12s;
}
.topic:hover{border-color:var(--line-2); transform:translateY(-1px)}
.topic.on{border-color:var(--brand); background:var(--brand-soft)}
.topic-ic{font-size:20px; line-height:1.2; flex:none}
.topic-name{font-weight:600; font-size:14px}
.topic-desc{font-size:12.5px; color:var(--ink-3); margin-top:3px}
.topic.on .topic-name{color:var(--brand)}

/* ===== Űrlapelemek ===== */
.input{
  width:100%; padding:11px 13px; font-size:15px;
  color:var(--ink); background:var(--surface-2);
  border:1.5px solid var(--line); border-radius:11px; outline:none;
  transition:border-color .15s,box-shadow .15s;
}
.input:focus{border-color:var(--brand); box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 18%,transparent)}
select.input{cursor:pointer}
.row-2{display:grid; grid-template-columns:1fr 1fr; gap:14px}
@media(max-width:560px){ .row-2{grid-template-columns:1fr} }
.field{display:block; margin-bottom:14px}
.field-label{display:block; font-size:13px; font-weight:600; color:var(--ink-2); margin-bottom:6px}
.field-help{display:block; font-size:12.5px; color:var(--ink-3); margin-top:6px}
.chips{display:flex; flex-wrap:wrap; gap:7px; margin-top:11px}
.chip{
  padding:5px 11px; font-size:12.5px; cursor:pointer; color:var(--ink-2);
  background:var(--surface-2); border:1px solid var(--line); border-radius:999px;
}
.chip:hover{border-color:var(--brand); color:var(--brand)}

/* ===== Kapcsolók ===== */
.toggles{display:flex; flex-direction:column; gap:6px}
.toggle{display:flex; gap:13px; align-items:flex-start; padding:12px; border-radius:var(--radius); cursor:pointer}
.toggle:hover{background:var(--surface-2)}
.toggle input{position:absolute; opacity:0; width:0; height:0}
.toggle-box{
  flex:none; width:42px; height:24px; margin-top:2px; border-radius:999px; position:relative;
  background:var(--line-2); transition:background .18s;
}
.toggle-box::after{
  content:""; position:absolute; top:3px; left:3px; width:18px; height:18px;
  background:#fff; border-radius:50%; transition:transform .18s; box-shadow:0 1px 3px rgba(0,0,0,.3);
}
.toggle input:checked + .toggle-box{background:var(--brand)}
.toggle input:checked + .toggle-box::after{transform:translateX(18px)}
.toggle input:focus-visible + .toggle-box{box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 30%,transparent)}
.toggle-text{font-size:13px; color:var(--ink-3)}
.toggle-text strong{display:block; font-size:14px; font-weight:600; color:var(--ink); margin-bottom:2px}

/* ===== Gombok ===== */
.btn-primary{
  padding:12px 22px; font-weight:600; color:#fff; cursor:pointer;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  border:none; border-radius:12px; box-shadow:0 4px 14px -6px var(--brand);
  transition:transform .12s,box-shadow .15s,opacity .15s;
}
.btn-primary:hover{transform:translateY(-1px); box-shadow:0 8px 20px -8px var(--brand)}
.btn-primary:disabled{opacity:.5; cursor:not-allowed; transform:none}
.btn-lg{width:100%; padding:15px; font-size:16px}
.btn-ic{margin-right:6px}
.btn-ghost{
  padding:9px 15px; font-size:14px; font-weight:500; color:var(--ink-2); cursor:pointer;
  background:var(--surface); border:1.5px solid var(--line); border-radius:11px;
}
.btn-ghost:hover{border-color:var(--line-2); color:var(--ink)}
.btn-link{background:none; border:none; color:var(--brand); font-size:13px; cursor:pointer; padding:4px 8px}
.btn-link:hover{text-decoration:underline}
.start-bar{margin-top:6px}
.note{margin:10px 0 0; font-size:12.5px; color:var(--ink-3); text-align:center}

/* átvezetés a másik gyakorlási módra */
.crosslink{
  display:flex; align-items:center; gap:15px; flex-wrap:wrap;
  margin-top:26px; padding:18px 20px;
  background:var(--brand-soft); border:1.5px dashed var(--brand); border-radius:var(--radius-lg);
}
.crosslink-ic{font-size:30px; flex:none}
.crosslink-text{flex:1; min-width:200px; font-size:13px; color:var(--ink-2); line-height:1.55}
.crosslink-text strong{display:block; font-size:15px; color:var(--ink); margin-bottom:3px}

/* ===== Beszélgetés ===== */
.chat-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  flex-wrap:wrap; margin-bottom:14px;
}
.pill{
  display:inline-block; padding:5px 12px; font-size:12.5px; font-weight:600;
  color:var(--brand); background:var(--brand-soft); border-radius:999px;
}
.pill-soft{color:var(--ink-3); background:var(--surface-2); font-weight:500; margin-left:6px}
.chat{display:flex; flex-direction:column; gap:14px; margin-bottom:20px; min-height:200px}
.msg{max-width:82%; display:flex; flex-direction:column; gap:5px}
.msg-ai{align-self:flex-start}
.msg-me{align-self:flex-end; align-items:flex-end}
.who{font-size:11.5px; font-weight:600; color:var(--ink-3); text-transform:uppercase; letter-spacing:.04em; padding:0 4px}
.bubble{
  padding:13px 16px; border-radius:var(--radius); font-size:15px; line-height:1.6;
  border:1px solid var(--line); box-shadow:var(--shadow);
}
.msg-ai .bubble{background:var(--surface); border-bottom-left-radius:5px}
.msg-me .bubble{
  background:linear-gradient(135deg,var(--brand),var(--brand-2)); color:#fff;
  border-color:transparent; border-bottom-right-radius:5px;
}
.bubble-meta{display:flex; gap:12px; font-size:11.5px; color:var(--ink-3); padding:0 4px; flex-wrap:wrap}
.speak-btn{background:none;border:none;cursor:pointer;font-size:14px;padding:2px 6px;opacity:.6}
.speak-btn:hover{opacity:1}

/* magyar fordítás — csak gombnyomásra jelenik meg */
.msg-tools{display:flex; gap:6px; padding:0 2px; flex-wrap:wrap}
.tool-btn{
  padding:5px 11px; font-size:12.5px; font-weight:500; cursor:pointer;
  color:var(--ink-2); background:var(--surface); border:1px solid var(--line); border-radius:999px;
  transition:border-color .15s,color .15s,background .15s;
}
.tool-btn:hover{border-color:var(--brand); color:var(--brand); background:var(--brand-soft)}
.tool-btn:disabled{opacity:.55; cursor:wait}
.tool-hu{border-style:dashed}
.hu-panel{
  margin:2px 0 6px; padding:11px 14px; font-size:14.5px; line-height:1.6;
  color:var(--ink-2); background:var(--surface-2);
  border:1px solid var(--line); border-left:3px solid var(--brand);
  border-radius:10px;
  animation:huIn .22s ease;
}
@keyframes huIn{from{opacity:0; transform:translateY(-4px)}to{opacity:1; transform:none}}

/* gépelés-jelző */
.dots{display:inline-flex; gap:4px; padding:4px 0}
.dots i{width:7px;height:7px;border-radius:50%;background:var(--ink-3);animation:blink 1.3s infinite}
.dots i:nth-child(2){animation-delay:.2s}
.dots i:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,60%,100%{opacity:.25}30%{opacity:1}}

/* élő javítás kártya */
.fb{
  align-self:flex-end; max-width:82%; margin-top:-6px;
  background:var(--warn-soft); border:1px solid color-mix(in srgb,var(--warn) 30%,transparent);
  border-radius:var(--radius); padding:12px 14px; font-size:13.5px;
}
.fb-ok{background:var(--ok-soft); border-color:color-mix(in srgb,var(--ok) 30%,transparent)}
.fb-title{font-weight:650; font-size:12.5px; margin-bottom:7px; color:var(--warn)}
.fb-ok .fb-title{color:var(--ok)}
.fb-row{margin:5px 0; line-height:1.5}
.wrong{color:var(--bad); text-decoration:line-through}
.right{color:var(--ok); font-weight:600}
.fb-why{color:var(--ink-3); font-size:12.5px}
.fb-tip{margin-top:8px; padding-top:8px; border-top:1px solid color-mix(in srgb,var(--warn) 22%,transparent); color:var(--ink-2)}

/* ===== Mikrofon ===== */
.mic-bar{
  position:sticky; bottom:0;
  background:color-mix(in srgb,var(--bg) 92%,transparent);
  backdrop-filter:blur(12px);
  border-top:1px solid var(--line);
  padding:16px 0 calc(16px + env(safe-area-inset-bottom));
  text-align:center; margin:0 -18px;
}
.status{font-size:13.5px; color:var(--ink-2); margin-bottom:12px; min-height:20px}
.mic-row{display:flex; justify-content:center}
.mic{
  position:relative; width:74px; height:74px; border-radius:50%; cursor:pointer;
  background:linear-gradient(135deg,var(--brand),var(--brand-2)); border:none;
  box-shadow:0 6px 20px -6px var(--brand);
  display:grid; place-items:center;
  transition:transform .12s,background .2s;
}
.mic:hover{transform:scale(1.04)}
.mic:active{transform:scale(.97)}
.mic:disabled{opacity:.45; cursor:not-allowed; transform:none}
.mic-ic{font-size:29px; line-height:1}
.mic.rec{background:linear-gradient(135deg,#dc2626,#ef4444); box-shadow:0 6px 22px -4px #dc2626}
.mic-ring{
  position:absolute; inset:-6px; border-radius:50%;
  border:3px solid var(--bad); opacity:0; pointer-events:none;
}
.mic.rec .mic-ring{animation:pulse 1.5s ease-out infinite}
@keyframes pulse{0%{transform:scale(1);opacity:.7}100%{transform:scale(1.35);opacity:0}}
.mic-meta{display:flex; align-items:center; justify-content:center; gap:6px; margin-top:11px; min-height:26px}
.timer{font-variant-numeric:tabular-nums; font-size:14px; font-weight:600; color:var(--bad)}
.text-row{display:flex; gap:8px; margin:12px 18px 0}
.finish-row{margin-top:14px; padding:0 18px}
.finish-row .btn-primary{width:100%; max-width:420px}

/* ===== Jelentés ===== */
.score-hero{
  background:linear-gradient(135deg,var(--brand),var(--brand-2)); color:#fff;
  border-radius:var(--radius-lg); padding:26px; text-align:center; margin-bottom:18px;
  box-shadow:0 10px 30px -12px var(--brand);
}
.score-num{font-size:56px; font-weight:750; line-height:1; letter-spacing:-.03em}
.score-lbl{font-size:13.5px; opacity:.85; margin-top:6px}
.score-level{
  display:inline-block; margin-top:14px; padding:6px 16px; font-weight:650; font-size:14px;
  background:rgba(255,255,255,.2); border-radius:999px;
}
.bars{display:flex; flex-direction:column; gap:13px}
.bar-row{display:grid; grid-template-columns:112px 1fr 44px; align-items:center; gap:11px; font-size:13.5px}
.bar-track{height:9px; background:var(--line); border-radius:999px; overflow:hidden}
.bar-fill{height:100%; border-radius:999px; background:linear-gradient(90deg,var(--brand),var(--brand-2)); transition:width .6s ease}
.bar-val{text-align:right; font-weight:650; font-variant-numeric:tabular-nums}
.stats{display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:11px}
.stat{background:var(--surface-2); border:1px solid var(--line); border-radius:var(--radius); padding:14px; text-align:center}
.stat-num{font-size:23px; font-weight:700; letter-spacing:-.02em}
.stat-lbl{font-size:11.5px; color:var(--ink-3); margin-top:4px; line-height:1.35}
.stat-note{font-size:11px; color:var(--ink-3); margin-top:3px}
ul.plain{margin:0; padding-left:20px}
ul.plain li{margin:7px 0}
.err{background:var(--surface-2); border:1px solid var(--line); border-left:3px solid var(--bad); border-radius:10px; padding:11px 13px; margin-bottom:9px; font-size:14px}
.upg{background:var(--surface-2); border:1px solid var(--line); border-left:3px solid var(--ok); border-radius:10px; padding:11px 13px; margin-bottom:9px; font-size:14px}
.arrow{color:var(--ink-3); margin:0 7px}
.summary-box{background:var(--brand-soft); border-radius:var(--radius); padding:15px; font-size:14.5px; line-height:1.65}

/* ===== Előzmények ===== */
.hist{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:13px 0; border-bottom:1px solid var(--line); font-size:14px;
}
.hist:last-child{border-bottom:none}
.hist-main{min-width:0}
.hist-role{font-weight:600}
.hist-meta{font-size:12.5px; color:var(--ink-3); margin-top:2px}
.hist-score{font-weight:700; font-size:17px; color:var(--brand); flex:none}

/* ===== Fülek — látható kapcsoló, nem sima szöveg ===== */
.tabs{display:flex; align-items:center; gap:10px; flex-wrap:wrap; flex:none}
.segmented{
  display:flex; gap:3px; padding:4px;
  background:var(--surface-2); border:1.5px solid var(--line-2); border-radius:13px;
}
.tab{
  padding:9px 16px; font-size:14px; font-weight:600; cursor:pointer; white-space:nowrap;
  color:var(--ink-2); background:none; border:none; border-radius:10px;
  transition:background .15s,color .15s,box-shadow .15s;
}
.tab:hover{color:var(--ink); background:var(--surface)}
.tab.on{
  color:#fff; background:linear-gradient(135deg,var(--brand),var(--brand-2));
  box-shadow:0 2px 8px -3px var(--brand);
}
@media(max-width:640px){
  .topbar{flex-wrap:wrap}
  .tabs{width:100%; justify-content:space-between}
  .segmented{flex:1}
  .tab{flex:1; text-align:center; padding:10px 8px}
}

/* ===== Forrásválasztó / gyakorlási módok ===== */
.source-grid,.mode-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px}
.source,.mode-card{
  display:flex; flex-direction:column; gap:5px; text-align:left; cursor:pointer;
  padding:15px; background:var(--surface-2);
  border:1.5px solid var(--line); border-radius:var(--radius);
  transition:border-color .15s,background .15s,transform .12s;
}
.source:hover,.mode-card:hover{border-color:var(--brand); transform:translateY(-1px)}
.source.on{border-color:var(--brand); background:var(--brand-soft)}
.source-ic,.mode-ic{font-size:22px}
.source-name,.mode-name{font-weight:650; font-size:14.5px; color:var(--ink)}
.source-desc,.mode-desc{font-size:12.5px; color:var(--ink-3); line-height:1.5}
.mode-desc strong{color:var(--ink-2)}

/* csúszka */
.range{width:100%; accent-color:var(--brand); cursor:pointer}
.mix-bar{display:flex; gap:7px; margin-top:9px; flex-wrap:wrap}
.mix-new,.mix-rev{
  padding:4px 11px; font-size:12.5px; font-weight:600; border-radius:999px;
}
.mix-new{background:var(--brand-soft); color:var(--brand)}
.mix-rev{background:var(--warn-soft); color:var(--warn)}

/* ismétlésre visszahozott szó */
.wcard-review{border-left-color:var(--warn); background:color-mix(in srgb,var(--warn-soft) 55%,var(--surface-2))}
.rev-tag{
  padding:2px 8px; font-size:10.5px; font-weight:700; letter-spacing:.03em;
  text-transform:uppercase; color:var(--warn);
  background:var(--warn-soft); border:1px solid color-mix(in srgb,var(--warn) 35%,transparent);
  border-radius:999px;
}

/* rádiós választó (interjú / mentett készlet) */
.pick{display:flex; gap:11px; align-items:flex-start; padding:11px; border-radius:11px; cursor:pointer; font-size:14px; flex:1}
.pick:hover{background:var(--surface-2)}
.pick input{margin-top:3px; accent-color:var(--brand); flex:none}
.pick .hist-meta{display:block}
.pick-row{display:flex; align-items:center; gap:4px}
.del-btn{
  flex:none; width:30px; height:30px; cursor:pointer; font-size:14px;
  color:var(--ink-3); background:none; border:1px solid transparent; border-radius:8px;
}
.del-btn:hover{color:var(--bad); border-color:var(--bad); background:var(--bad-soft)}

/* mentési állapot a szólista fölött */
.saved-bar{
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
  margin-bottom:16px; padding:11px 15px; font-size:13px; color:var(--ink-2);
  background:var(--ok-soft); border:1px solid color-mix(in srgb,var(--ok) 30%,transparent);
  border-radius:12px;
}
.saved-state strong{color:var(--ink)}
.saved-note{color:var(--ink-3); font-style:italic}

/* ===== Szókártyák ===== */
.wcard{
  padding:13px 15px; margin-bottom:9px;
  background:var(--surface-2); border:1px solid var(--line);
  border-left:3px solid var(--brand); border-radius:11px;
}
.wcard-en{font-size:16px; font-weight:650; color:var(--ink); display:flex; align-items:center; gap:6px; flex-wrap:wrap}
.wcard-hu{font-size:14.5px; color:var(--brand); font-weight:550; margin-top:2px}
.wcard-alt{color:var(--ink-3); font-weight:400; font-size:13px}
.wcard-say{display:flex; gap:6px; margin-top:9px; flex-wrap:wrap}
.wcard-ex{font-size:13.5px; color:var(--ink-3); font-style:italic; margin-top:6px; line-height:1.5}
.wcard-trap{
  font-size:12.5px; color:var(--warn); margin-top:7px;
  background:var(--warn-soft); padding:6px 9px; border-radius:8px;
}

/* ===== Gyakorlás ===== */
.drill-top{display:flex; align-items:center; gap:12px; margin-bottom:20px}
.progress{flex:1; height:7px; background:var(--line); border-radius:999px; overflow:hidden}
.progress-fill{height:100%; width:0; border-radius:999px;
  background:linear-gradient(90deg,var(--brand),var(--brand-2)); transition:width .35s ease}
.drill-card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:30px 22px; margin-bottom:20px; box-shadow:var(--shadow); text-align:center; min-height:230px;
}
.drill-task{display:flex; flex-direction:column; gap:4px; margin-bottom:22px}
.drill-task strong{font-size:16px; font-weight:650}
.drill-task span{font-size:13px; color:var(--ink-3)}
.drill-prompt{margin:18px 0 22px}
.drill-actions{display:flex; gap:8px; justify-content:center; flex-wrap:wrap}

.big-word{font-size:33px; font-weight:700; letter-spacing:-.02em; line-height:1.25; word-break:break-word}
.big-hu{color:var(--brand)}
.big-say{margin-top:9px; font-size:13.5px; color:var(--ink-3)}

/* hallás utáni mód — a szó szándékosan rejtve */
.listen-blob{
  width:96px; height:96px; margin:0 auto; display:grid; place-items:center; font-size:40px;
  background:var(--brand-soft); border:2px dashed var(--brand); border-radius:50%;
  animation:beat 2.2s ease-in-out infinite;
}
@keyframes beat{0%,100%{transform:scale(1)}50%{transform:scale(1.05)}}
.listen-hint{margin-top:13px; font-size:13px; color:var(--ink-3)}

/* megfejtés */
.reveal{margin-top:22px; padding:16px; border-radius:var(--radius); text-align:left; border:1px solid var(--line)}
.reveal.ok{background:var(--ok-soft); border-color:color-mix(in srgb,var(--ok) 32%,transparent)}
.reveal.half{background:var(--warn-soft); border-color:color-mix(in srgb,var(--warn) 32%,transparent)}
.reveal.bad{background:var(--bad-soft); border-color:color-mix(in srgb,var(--bad) 32%,transparent)}
.reveal-verdict{font-weight:700; font-size:15px; margin-bottom:5px}
.reveal.ok .reveal-verdict{color:var(--ok)}
.reveal.half .reveal-verdict{color:var(--warn)}
.reveal.bad .reveal-verdict{color:var(--bad)}
.reveal-heard{font-size:13px; color:var(--ink-3); font-style:italic}
.reveal-note{font-size:13.5px; color:var(--ink-2); margin-top:7px; line-height:1.5}
.reveal-word{margin-top:13px; padding-top:13px; border-top:1px solid color-mix(in srgb,var(--ink-3) 25%,transparent)}

/* ===== Belépés / regisztráció ===== */
.auth-body{display:block; min-height:100vh; padding:28px 18px 48px}
.auth-wrap{width:100%; max-width:480px; margin:0 auto}
.auth-brand{text-align:center; margin-bottom:22px}
.auth-brand .brand-mark{width:60px; height:60px; margin:0 auto 14px; font-size:30px}
.auth-brand h1{font-size:26px; font-weight:750; letter-spacing:-.02em}
.auth-brand .tagline{margin:7px 0 0; font-size:15px; color:var(--ink-3)}

/* ===== Bemutatkozó blokk (aki először jár itt) ===== */
.hero{
  margin-bottom:26px; padding:24px 22px; text-align:center;
  background:linear-gradient(160deg,var(--brand-soft),var(--surface));
  border:1.5px solid color-mix(in srgb,var(--brand) 22%,transparent);
  border-radius:var(--radius-lg);
}
.hero-q{
  font-size:23px; font-weight:750; line-height:1.35; letter-spacing:-.02em;
  color:var(--brand); margin-bottom:14px;
}
.hero-lead{margin:0 0 20px; font-size:16px; line-height:1.65; color:var(--ink-2)}
.hero-points{display:flex; flex-direction:column; gap:12px; text-align:left; margin-bottom:22px}
.hp{
  display:flex; gap:12px; align-items:flex-start;
  padding:12px 14px; background:var(--surface);
  border:1px solid var(--line); border-radius:13px;
}
.hp-ic{font-size:21px; line-height:1.2; flex:none}
.hp strong{display:block; font-size:15px; color:var(--ink); margin-bottom:2px}
.hp span:last-child{font-size:14px; line-height:1.55; color:var(--ink-3)}
.hero-cta{font-size:17px}
.hero-note{margin:12px 0 0; font-size:13.5px; color:var(--ink-3)}
.auth-card{margin-bottom:14px}
.auth-tabs{margin-bottom:22px}
.auth-tabs .tab{flex:1; text-align:center}
.auth-form .field:last-of-type{margin-bottom:20px}
.auth-msg{
  margin:16px 0 0; padding:11px 14px; border-radius:11px; font-size:13.5px; text-align:center;
  background:var(--bad-soft); color:var(--bad); border:1px solid color-mix(in srgb,var(--bad) 30%,transparent);
}
.auth-msg.ok{background:var(--ok-soft); color:var(--ok); border-color:color-mix(in srgb,var(--ok) 30%,transparent)}
.auth-foot{text-align:center; font-size:12.5px; color:var(--ink-3)}
.invite-note{
  padding:12px 14px; margin-bottom:18px; font-size:13px; line-height:1.55;
  color:var(--ink-2); background:var(--surface-2);
  border:1px solid var(--line); border-left:3px solid var(--brand); border-radius:11px;
}
.invite-note.first{background:var(--ok-soft); border-left-color:var(--ok)}

/* ===== Fiók-sáv a fejlécben ===== */
.who-bar{display:flex; align-items:center; gap:8px; font-size:13px; color:var(--ink-3)}
.who-name{font-weight:600; color:var(--ink-2); max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
@media(max-width:640px){ .who-name{display:none} }

/* ===== Visszajelzés ===== */
.fb-fab{
  position:fixed; right:18px; bottom:18px; z-index:40;
  display:flex; align-items:center; gap:8px;
  padding:11px 17px; font-size:13.5px; font-weight:600; cursor:pointer; color:#fff;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  border:none; border-radius:999px; box-shadow:0 6px 20px -6px var(--brand);
  transition:transform .12s;
}
.fb-fab:hover{transform:translateY(-2px)}
@media(max-width:640px){ .fb-fab{right:12px; bottom:12px; padding:11px 14px} .fb-fab span{display:none} }

.modal-bg{
  position:fixed; inset:0; z-index:50; display:grid; place-items:center; padding:18px;
  background:rgba(15,23,42,.55); backdrop-filter:blur(3px);
}
.modal{
  width:100%; max-width:480px; max-height:88vh; overflow:auto;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); padding:24px; box-shadow:0 20px 60px -20px rgba(0,0,0,.5);
}
.modal-head{display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:6px}
.modal-close{
  flex:none; width:32px; height:32px; cursor:pointer; font-size:17px; color:var(--ink-3);
  background:none; border:1px solid transparent; border-radius:9px;
}
.modal-close:hover{color:var(--ink); border-color:var(--line); background:var(--surface-2)}
/* ===== Használati útmutató ===== */
.guide{margin:18px 0 0; padding-left:0; list-style:none; counter-reset:step}
.guide li{
  position:relative; padding:0 0 18px 44px; font-size:14.5px; line-height:1.6; color:var(--ink-3);
  counter-increment:step;
}
.guide li::before{
  content:counter(step);
  position:absolute; left:0; top:0;
  width:30px; height:30px; display:grid; place-items:center;
  font-size:14px; font-weight:700; color:#fff;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  border-radius:50%;
}
.guide li::after{
  content:""; position:absolute; left:14px; top:34px; bottom:2px; width:2px;
  background:var(--line);
}
.guide li:last-child::after{display:none}
.guide strong{display:block; font-size:15.5px; color:var(--ink); margin-bottom:3px}
.guide em{color:var(--brand); font-style:normal; font-weight:600}
.guide-h{font-size:15.5px; font-weight:650; margin:22px 0 10px; color:var(--ink)}
.guide-tips li{font-size:14px; line-height:1.6; color:var(--ink-3); margin:9px 0}
.guide-tips strong{color:var(--ink)}
.guide-tips em{color:var(--brand); font-style:normal; font-weight:600}

.stars{display:flex; gap:5px; margin:4px 0 16px}
.star{
  width:42px; height:42px; font-size:22px; cursor:pointer; line-height:1;
  background:var(--surface-2); border:1.5px solid var(--line); border-radius:11px;
  filter:grayscale(1); opacity:.5; transition:all .12s;
}
.star:hover,.star.on{filter:none; opacity:1; border-color:var(--brand); background:var(--brand-soft)}
textarea.input{min-height:110px; resize:vertical; font-family:inherit; line-height:1.55}

/* ===== Admin felület ===== */
.admin-main{max-width:1280px; margin:0 auto; padding:22px 18px 60px}
.table-wrap{overflow-x:auto; -webkit-overflow-scrolling:touch}
.tbl{width:100%; border-collapse:collapse; font-size:13.5px; min-width:860px}
.tbl th{
  text-align:left; padding:9px 10px; font-size:11.5px; font-weight:650;
  text-transform:uppercase; letter-spacing:.04em; color:var(--ink-3);
  border-bottom:1.5px solid var(--line); white-space:nowrap;
}
.tbl td{padding:11px 10px; border-bottom:1px solid var(--line); vertical-align:top}
.tbl tr:last-child td{border-bottom:none}
.tbl tr.off{opacity:.5}
.tbl .r{text-align:right; font-variant-numeric:tabular-nums}
.tbl .empty{text-align:center; color:var(--ink-3); padding:22px}
.sub{font-size:12px; color:var(--ink-3)}
.sub.note{color:var(--warn)}
.code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:14px; font-weight:650;
  padding:3px 8px; background:var(--brand-soft); color:var(--brand); border-radius:7px;
}
.tag{
  display:inline-block; padding:2px 9px; font-size:11.5px; font-weight:600; border-radius:999px;
  background:var(--surface-2); color:var(--ink-2); border:1px solid var(--line);
}
.tag-ok{background:var(--ok-soft); color:var(--ok); border-color:transparent}
.tag-bad{background:var(--bad-soft); color:var(--bad); border-color:transparent}
.tag-admin{background:var(--brand-soft); color:var(--brand); border-color:transparent}
.acts{display:flex; gap:5px; flex-wrap:wrap}
.mini{
  padding:5px 10px; font-size:12px; font-weight:500; cursor:pointer; white-space:nowrap;
  color:var(--ink-2); background:var(--surface); border:1px solid var(--line); border-radius:8px;
}
.mini:hover{border-color:var(--brand); color:var(--brand); background:var(--brand-soft)}
.mini.danger:hover{border-color:var(--bad); color:var(--bad); background:var(--bad-soft)}
.badge{
  display:inline-block; min-width:18px; padding:1px 6px; margin-left:5px;
  font-size:11px; font-weight:700; text-align:center;
  background:var(--bad); color:#fff; border-radius:999px;
}
.row-inline{display:flex; gap:8px; flex-wrap:wrap}
.row-inline .input{flex:1; min-width:200px}
.fb-item{
  padding:14px; margin-bottom:11px; font-size:14px;
  background:var(--surface-2); border:1px solid var(--line);
  border-left:3px solid var(--brand); border-radius:11px;
}
.fb-item.done{opacity:.55; border-left-color:var(--ok)}
.fb-top{display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:8px}
.fb-text{white-space:pre-wrap; line-height:1.6; margin-bottom:10px}

/* továbblépés közvetlenül a megfejtés alatt */
.reveal-next{width:100%; margin-top:14px; padding:13px}
.reveal{scroll-margin-block:80px}

/* =========================================================
   TELEFONOS MEGJELENÍTÉS
   A felhasználók jelentős része telefonon gyakorol, ezért a
   szövegek nem lehetnek aprók, a gombok pedig ujjal is
   biztosan eltalálhatók (min. 44px).
   ========================================================= */
@media (max-width:640px){
  body{font-size:16px}                     /* 15 -> 16: olvashatóbb kis kijelzőn */
  main{padding:16px 14px 40px}
  .card{padding:18px 16px; border-radius:16px}
  .card-title{font-size:17px}
  .card-hint{font-size:14px}

  /* iOS Safari BELENAGYÍT a mezőbe, ha a betű 16px alatt van —
     ettől elcsúszik az egész elrendezés. Ezért itt kötelezően 16px. */
  .input, select.input, textarea.input{font-size:16px; padding:13px 14px}

  /* ujjal is eltalálható gombok */
  .btn-ghost, .tool-btn, .mini, .chip{min-height:44px; display:inline-flex; align-items:center}
  .btn-primary{min-height:48px}
  .speak-btn{min-width:40px; min-height:40px}
  .btn-link{padding:10px 12px; font-size:14px}

  /* témaválasztó és módkártyák egy oszlopban */
  .topic-grid, .source-grid, .mode-grid{grid-template-columns:1fr}
  .stats{grid-template-columns:1fr 1fr}

  /* gyakorlás: tömörebb kártya, hogy a megfejtés is elférjen */
  .drill-card{padding:20px 15px; min-height:0}
  .drill-task{margin-bottom:16px}
  .drill-prompt{margin:14px 0 16px}
  .big-word{font-size:27px}
  .listen-blob{width:80px; height:80px; font-size:34px}
  .reveal{padding:14px}

  /* beszélgetés */
  .bubble{font-size:16px; padding:12px 14px}
  .msg{max-width:92%}
  .mic-bar{padding:13px 0 calc(13px + env(safe-area-inset-bottom))}
  .mic{width:66px; height:66px}
  .mic-ic{font-size:26px}

  /* értékelés */
  .score-num{font-size:46px}
  .bar-row{grid-template-columns:92px 1fr 38px; font-size:13px}
  .wcard-en{font-size:16px}
  .wcard-hu{font-size:15px}

  /* táblázatok: vízszintesen görgethetők, nem törik szét az oldalt */
  .table-wrap{margin:0 -16px; padding:0 16px}
  .modal{padding:18px; border-radius:16px}
  .star{width:48px; height:48px}
}

/* nagyon keskeny kijelző (kis telefonok) */
@media (max-width:380px){
  .big-word{font-size:23px}
  .stats{grid-template-columns:1fr}
  .tab{padding:10px 6px; font-size:13px}
}

/* ===== Toast ===== */
.toast{
  position:fixed; left:50%; bottom:26px; transform:translateX(-50%);
  background:var(--ink); color:var(--bg); padding:11px 20px; border-radius:11px;
  font-size:14px; z-index:60; box-shadow:var(--shadow); max-width:88vw; text-align:center;
}
.toast.bad{background:var(--bad); color:#fff}
