:root {
  --bg: #3a3e48; --bg2: #30343e; --ink: #f6f6f2; --ink2: #c4c8d0; --edge: #0e1016;
  --bevel: #5a5f6c; --acc: #c8303a; --acc2: #3faa4a; --gold: #e8c050; --void: #121620;
  --font: 'Jersey 10', ui-monospace, 'SF Mono', Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { font-synthesis: none; margin: 0; height: 100%; overflow: hidden; background: var(--void); color: var(--ink); font-family: var(--font); }
body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }

#game { position: fixed; inset: 0; display: block; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: none; cursor: pointer; }

.panel {
  background: var(--bg); color: var(--ink);
  border: 3px solid var(--edge);
  box-shadow: inset 0 0 0 2px var(--bevel), 0 3px 0 var(--edge);
}

#hud-top {
  position: fixed; left: 0; right: 0; top: 0;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none;
}
#hud-top > * { pointer-events: auto; }
.hud-right { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
body.in-title #hud-top, body.in-title #hint { display: none; }
#sync-status:empty::before { content: '\00a0'; }

.brand { display: flex; align-items: center; gap: 8px; padding: 6px 12px 8px 8px; position: relative; }
.brand::after { content: ''; position: absolute; left: 2px; right: 2px; bottom: 2px; height: 3px;
  background: linear-gradient(90deg, var(--acc) 0 33.3%, #f4f0e6 33.3% 66.6%, var(--acc2) 66.6%); }
.brand img { image-rendering: pixelated; display: block; }
.brand b { display: block; font-size: 23px; font-weight: 700; letter-spacing: .5px; line-height: 1.05; text-shadow: 0 2px 0 var(--edge); }
.brand small { display: block; font-size: 14px; color: var(--ink2); }

.btn { font: inherit; font-size: 18px; padding: 8px 12px; cursor: pointer; min-height: 40px; }
.btn:hover { background: #454a56; }
.btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px var(--bevel), 0 1px 0 var(--edge); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

#hint {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  padding: 8px 14px; font-size: 18px; max-width: calc(100vw - 32px); text-align: center; pointer-events: none;
  transition: opacity .6s;
}
#hint.hide { opacity: 0; }

#dialog {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(640px, calc(100vw - 32px)); min-height: 96px;
  padding: 22px 18px 14px; cursor: pointer;
}
#dialog[hidden] { display: none; }
.dlg-name {
  position: absolute; top: -14px; left: 12px; padding: 2px 10px 3px;
  background: var(--acc); border: 3px solid var(--edge); font-weight: 700; font-size: 18px;
}
.dlg-text { font-size: 22px; line-height: 1.4; min-height: 48px; }
.dlg-next { position: absolute; right: 12px; bottom: 6px; font-size: 16px; color: var(--gold); animation: bob 1s steps(2) infinite; }
@keyframes bob { 50% { transform: translateY(2px); } }
.dlg-next[hidden] { display: none; }
.dlg-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dlg-choices[hidden] { display: none; }
.dlg-choices .btn { text-align: left; display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 20px; }
.dlg-choices .key { display: inline-grid; place-items: center; width: 20px; height: 20px; background: var(--bg2); border: 2px solid var(--edge); font-size: 16px; color: var(--gold); }
@media (pointer: coarse) { .dlg-choices .key { display: none; } }

#area-banner {
  position: fixed; left: 50%; top: max(70px, calc(env(safe-area-inset-top) + 60px)); transform: translate(-50%, -8px);
  padding: 6px 18px 7px; font-size: 26px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap;
  color: #fff; background: var(--acc); border: 3px solid var(--edge); box-shadow: inset 0 0 0 2px #e04850, 0 3px 0 var(--edge);
  opacity: 0; pointer-events: none; transition: opacity .4s, transform .4s;
}
#area-banner.show { opacity: 1; transform: translate(-50%, 0); }
body.in-title #area-banner { display: none; }

/* ---------- címképernyő ---------- */
#title {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at center, rgba(18,22,32,.15) 0%, rgba(18,22,32,.6) 100%);
  overflow-y: auto;
}
#title[hidden] { display: none; }
.title-box { display: flex; flex-direction: column; align-items: center; width: min(380px, 100%); margin: auto 0; }
.title-crest { image-rendering: pixelated; filter: drop-shadow(0 4px 0 var(--edge)); }
.title-name {
  margin: 4px 0 6px; font-size: clamp(56px, 17vw, 88px); font-weight: 700; letter-spacing: 2px; line-height: 1;
  text-transform: uppercase; color: #fff;
  text-shadow: 3px 0 0 var(--edge), -3px 0 0 var(--edge), 0 3px 0 var(--edge), 0 -3px 0 var(--edge), 3px 3px 0 var(--edge), -3px 3px 0 var(--edge), 3px -3px 0 var(--edge), -3px -3px 0 var(--edge), 0 7px 0 var(--edge);
}
.title-ribbon {
  background: var(--acc); border: 3px solid var(--edge); box-shadow: inset 0 0 0 2px #e04850;
  padding: 3px 14px 4px; font-weight: 700; font-size: 18px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 16px;
}
.title-foot { position: fixed; right: 14px; bottom: max(10px, env(safe-area-inset-bottom)); font-size: 17px; color: var(--ink); text-shadow: 0 2px 0 var(--edge); }

.auth { width: 100%; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.auth h2 { margin: 0 0 2px; font-size: 26px; }
.auth p { margin: 0; font-size: 20px; line-height: 1.4; color: var(--ink2); }
.auth p b { color: var(--ink); }
.auth p.small { font-size: 17px; }
.auth form { display: flex; flex-direction: column; gap: 10px; }
.auth label, .sheet label { display: flex; flex-direction: column; gap: 4px; font-size: 18px; }
.auth label small, .sheet label small { color: var(--ink2); }
.auth input, .sheet input {
  font: inherit; font-size: 21px; color: var(--ink); background: var(--bg2);
  border: 3px solid var(--edge); box-shadow: inset 0 2px 0 rgba(0,0,0,.35); padding: 8px 10px; border-radius: 0; width: 100%;
}
.auth input:focus, .sheet input:focus { outline: 3px solid var(--gold); outline-offset: 0; }
.auth label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 20px; cursor: pointer; }
.auth label.check input { width: 20px; height: 20px; accent-color: var(--acc2); box-shadow: none; }
.auth .btn, .sheet .btn { width: 100%; font-size: 21px; font-weight: 600; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn { border: 3px solid var(--edge); background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 2px var(--bevel), 0 3px 0 var(--edge); }
.btn-red { background: var(--acc); box-shadow: inset 0 0 0 2px #e04850, 0 3px 0 var(--edge); }
.btn-red:hover { background: #d63a44; }
.btn-white { background: #f6f6f2; color: #1d2230; box-shadow: inset 0 0 0 2px #fff, 0 3px 0 var(--edge); }
.btn-white:hover { background: #fff; }
.btn-ghost { background: transparent; box-shadow: none; border-color: #6a2a30; color: #f0a0a6; }
.btn:disabled { opacity: .6; cursor: default; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; font-size: 18px; }
.auth-links a, .auth a { color: var(--gold); }
.auth-msg, .acc-msg { font-size: 18px !important; padding: 8px 10px; border: 2px solid var(--edge); }
.auth-msg.err, .acc-msg.err { background: #5a1c22; color: #ffd6d9 !important; }
.auth-msg.ok, .acc-msg.ok { background: #1f4a2a; color: #d6f5dc !important; }
.loading { text-align: center; padding: 10px 0; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .55; } }

/* ---------- fiók-panel ---------- */
.sheet {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 5;
  width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.sheet[hidden] { display: none; }
.acc-head { display: flex; justify-content: space-between; align-items: center; }
.acc-head h2 { margin: 0; font-size: 26px; }
.x { font: inherit; font-size: 23px; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 4px 8px; }
.acc-name { display: flex; gap: 8px; align-items: flex-end; }
.acc-name label { flex: 1; }
.acc-name .btn { width: auto; }
.sheet dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 18px; }
.sheet dt { color: var(--ink2); }
.sheet dd { margin: 0; word-break: break-all; }
.acc-danger { border-top: 2px dashed var(--bevel); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 18px; }
.acc-danger p { margin: 0; line-height: 1.4; }
.brand small#sync-status { min-height: 1em; }

/* ---------- fő menü ---------- */
:root { --nav-w: 0px; --nav-h: 0px; }
body:not(.in-title) { --nav-w: 92px; }
.mainnav { position: fixed; z-index: 4; display: flex; gap: 6px; padding: 8px; }
body.in-title .mainnav, body.modal .mainnav { display: none; }
.mainnav button { font: inherit; color: var(--ink2); background: transparent; border: 3px solid transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; font-size: 16px; fill: currentColor; }
.mainnav button:hover { color: var(--ink); background: #454a56; }
.mainnav button.on { color: #fff; background: var(--acc); border-color: var(--edge); box-shadow: inset 0 0 0 2px #e04850; }
.mainnav button:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
@media (min-width: 761px) {
  .mainnav { left: max(10px, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); flex-direction: column; width: 76px; }
  body:not(.in-title) #hud-top { padding-left: calc(var(--nav-w) + 10px); }
  .page { left: calc(var(--nav-w) + 20px); right: 20px; top: 70px; bottom: 20px; margin: 0 auto; max-width: 760px; }
}
@media (max-width: 760px) {
  body:not(.in-title) { --nav-w: 0px; --nav-h: calc(66px + env(safe-area-inset-bottom)); }
  .mainnav { left: 0; right: 0; bottom: 0; justify-content: space-around; padding: 4px 6px max(4px, env(safe-area-inset-bottom)); border-width: 3px 0 0; box-shadow: inset 0 2px 0 var(--bevel); }
  .mainnav button { flex: 1; font-size: 15px; padding: 4px 2px; }
  .page { left: 8px; right: 8px; top: calc(max(10px, env(safe-area-inset-top)) + 54px); bottom: calc(var(--nav-h) + 8px); }
  #hint, #dialog { bottom: calc(var(--nav-h) + 12px) !important; }
}
.page { position: fixed; z-index: 3; overflow-y: auto; padding: 0; display: flex; flex-direction: column; }
.page[hidden] { display: none; }
.pg-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 8px 16px; background: var(--acc); border-bottom: 3px solid var(--edge); }
.pg-head h2 { margin: 0; font-size: 28px; }
.pg-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.pg-card { background: var(--bg2); border: 3px solid var(--edge); box-shadow: inset 0 0 0 2px #262a34; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.pg-card h3 { margin: 0; font-size: 23px; color: var(--gold); }
.pg-card p { margin: 0; font-size: 18px; line-height: 1.35; }
.pg-muted { color: var(--ink2); font-size: 16px !important; }
.pg-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pg-stats div { background: var(--bg2); border: 3px solid var(--edge); padding: 8px 4px; text-align: center; display: flex; flex-direction: column; }
.pg-stats b { font-size: 23px; font-weight: 400; } .pg-stats span { font-size: 15px; color: var(--ink2); }
.recs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.recs li { display: flex; align-items: center; gap: 10px; font-size: 18px; line-height: 1.3; }
.recs li span { flex: 1; }
.recs .btn, .chal-row .btn { flex: 0 0 auto; width: auto; min-height: 40px; font-size: 18px; }
.nl-topic { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 2px dashed var(--bevel); }
.nl-top { display: flex; align-items: center; gap: 8px; font-size: 19px; }
.nl-top b { font-weight: 400; flex: 1; } .nl-pct { color: var(--gold); }
.nl-topic small { font-size: 15px; color: var(--ink2); }
.bar { position: relative; height: 10px; background: var(--edge); }
.bar i { display: block; height: 100%; background: var(--acc2); }
.bar em { position: absolute; top: -2px; width: 2px; height: 14px; background: var(--gold); transform: translateX(-1px); }
.seal { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--edge); }
.seal.big { width: 46px; height: 46px; border-width: 3px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.3); }
.seal-bronz { background: #b8743a; } .seal-ezust { background: #c4c8d0; } .seal-arany { background: #e8c050; }
.seal.empty { background: transparent; border-style: dashed; border-color: var(--bevel); box-shadow: none; }
.seals { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.seal-cell { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; font-size: 17px; }
.seal-cell b { font-weight: 400; } .seal-cell small { font-size: 14px; color: var(--ink2); }
.chal.done { box-shadow: inset 0 0 0 2px #5ac46a; }
.chal-text { font-size: 22px !important; }
.chal-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chal-reward { color: var(--gold); font-size: 19px; }
.chal-ok { color: #8ee09a; font-size: 20px; }
.torch-big { display: flex; align-items: center; gap: 14px; }
.torch-big .flame { font-size: 46px; line-height: 1; }
.torch-big.out .flame { filter: grayscale(1); opacity: .5; }
.torch-big div { display: flex; flex-direction: column; gap: 2px; font-size: 18px; }
.torch-big b { font-size: 24px; font-weight: 400; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 360px; }
.cal-h { text-align: center; font-size: 15px; color: var(--ink2); }
.cal-d { aspect-ratio: 1; display: grid; place-items: center; font-size: 15px; background: var(--bg); border: 2px solid var(--edge); color: var(--ink2); }
.cal-d.on { background: #b8640a; color: #fff; box-shadow: inset 0 0 0 2px #e8a040; }
.cal-d.today { outline: 2px solid var(--gold); outline-offset: 1px; }
.cal-d.future { opacity: .3; }
.prof-head { flex-direction: row; align-items: center; gap: 14px; }
.avatar { width: 96px; height: 108px; image-rendering: pixelated; background: var(--bg); border: 3px solid var(--edge); flex: 0 0 auto; }
.prof-info { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.prof-name { font-size: 26px; font-weight: 400; }
.prof-rank { color: var(--gold); font-size: 20px; }
.prof-info small { font-size: 15px; color: var(--ink2); }
.ranks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; counter-reset: r; }
.ranks li { display: flex; justify-content: space-between; padding: 4px 10px; background: var(--bg); border: 2px solid var(--edge); font-size: 18px; color: var(--ink2); }
.ranks li b { font-weight: 400; }
.ranks li.past { color: var(--ink); } .ranks li.past b::before { content: '✓ '; color: #8ee09a; }
.ranks li.cur { color: #fff; background: var(--acc); box-shadow: inset 0 0 0 2px #e04850; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; font-size: 18px; }
.kv dt { color: var(--ink2); } .kv dd { margin: 0; text-align: right; }
.acc { display: flex; flex-direction: column; gap: 10px; }
.acc label { display: flex; flex-direction: column; gap: 4px; font-size: 18px; }
.acc input { font: inherit; font-size: 21px; color: var(--ink); background: var(--bg); border: 3px solid var(--edge); padding: 6px 10px; width: 100%; }
.acc .btn { min-height: 42px; font-size: 19px; width: 100%; }
.acc .acc-name .btn { width: auto; }
.acc dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 17px; }
.acc dt { color: var(--ink2); } .acc dd { margin: 0; word-break: break-all; }
.stats { cursor: pointer; }
@media (max-width: 560px) { .pg-stats { grid-template-columns: repeat(2, 1fr); } .recs li { flex-direction: column; align-items: stretch; } .recs .btn { width: 100%; } }

/* ---------- HUD: rang, fáklya, dukát ---------- */
.stats { display: flex; align-items: center; gap: 10px; padding: 5px 10px; min-height: 40px; }
.stats[hidden] { display: none; }
.st-rank { display: flex; flex-direction: column; gap: 3px; min-width: 70px; }
.st-rank b { font-size: 18px; line-height: 1; color: var(--gold); }
.st-xp { display: block; height: 6px; background: var(--edge); box-shadow: inset 0 0 0 1px #000; }
.st-xp i { display: block; height: 100%; width: 0; background: var(--acc2); transition: width .5s; }
.st-chip { display: flex; align-items: center; gap: 4px; font-size: 19px; }
.st-chip b { font-weight: 400; }
.st-torch.out { filter: grayscale(1); opacity: .6; }
.coin { width: 13px; height: 13px; background: var(--gold); box-shadow: inset -2px -2px 0 #b88a28, 0 0 0 2px var(--edge); display: inline-block; border-radius: 50%; }
@media (max-width: 480px) { .stats { gap: 7px; padding: 4px 7px; } .st-rank { min-width: 54px; } .st-rank b { font-size: 16px; } .st-chip { font-size: 17px; } }

/* ---------- feladatlap ---------- */
.tasksheet { width: min(640px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); padding: 0; gap: 0; z-index: 6; }
.ts-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 8px 14px; background: var(--acc); border-bottom: 3px solid var(--edge); }
.ts-title { flex: 1; font-size: 21px; line-height: 1.1; }
.ts-badge { font-size: 14px; background: var(--edge); padding: 1px 6px; vertical-align: middle; color: var(--gold); }
.ts-meta { display: flex; gap: 10px; font-size: 19px; }
.ts-timer.low { color: #ffe27a; animation: blink 1s steps(2) infinite; }
.ts-bar { height: 6px; background: var(--edge); }
.ts-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .3s; }
.ts-body { padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.ts-body > * { flex-shrink: 0; }
.ts-foot { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px 10px; border-top: 2px solid var(--bevel); }
.ts-foot[hidden] { display: none; }
.ts-link { font: inherit; font-size: 16px; background: none; border: 0; color: var(--ink2); text-decoration: underline; cursor: pointer; padding: 4px 0; }
.ts-gain { font-size: 20px; color: var(--gold); opacity: 0; }
.ts-gain.pop { animation: pop 1.6s ease-out; }
@keyframes pop { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }
.ts-q { margin: 0; font-size: 23px; line-height: 1.25; }
.ts-q.small { font-size: 20px; }
.ts-help { margin: 0; font-size: 17px; color: var(--ink2); }
.ts-opts { display: flex; flex-direction: column; gap: 7px; }
.ts-opts.compact { gap: 5px; }
.tasksheet .ts-opt, .tasksheet .ts-oitem { width: 100%; text-align: left; display: flex; align-items: center; justify-content: flex-start; gap: 10px; font-size: 20px; min-height: 44px; padding: 6px 10px; }
.tasksheet .ts-opts.compact .ts-opt { min-height: 38px; font-size: 18px; }
.key { display: inline-grid; place-items: center; min-width: 22px; height: 22px; background: var(--bg2); border: 2px solid var(--edge); font-size: 15px; color: var(--gold); flex: 0 0 auto; }
.ts-opt.picked, .ts-oitem.on { background: #4a5060; box-shadow: inset 0 0 0 2px var(--gold), 0 3px 0 var(--edge); }
.ts-opt.right, .ts-oitem.right { background: #1f5a2e; box-shadow: inset 0 0 0 2px #5ac46a, 0 3px 0 var(--edge); }
.ts-opt.wrong, .ts-oitem.wrong { background: #5a1c22; box-shadow: inset 0 0 0 2px #e06a72, 0 3px 0 var(--edge); }
.ts-opt:disabled { opacity: 1; cursor: default; }
.ts-oitem.done { border: 3px solid var(--edge); }
.ts-when { margin-left: auto; color: var(--gold); font-size: 18px; }
.ts-order { display: flex; flex-direction: column; gap: 7px; }
.ts-actions { display: flex; gap: 8px; }
.ts-actions .btn { flex: 1; min-height: 44px; font-size: 20px; }
.btn-green { background: var(--acc2); box-shadow: inset 0 0 0 2px #5ac46a, 0 3px 0 var(--edge); }
.ts-next { min-height: 46px; font-size: 21px; }
.ts-fb { padding: 8px 12px; border: 3px solid var(--edge); font-size: 19px; line-height: 1.3; }
.ts-fb.ok { background: #1f4a2a; } .ts-fb.no { background: #5a1c22; }
.ts-card { min-height: 170px; display: grid; place-items: center; text-align: center; padding: 18px; cursor: pointer;
  background: #f1e6c8; color: #2a2016; border: 3px solid var(--edge); box-shadow: inset 0 0 0 3px #d8c89e, 0 4px 0 var(--edge); }
.ts-card-front { font-size: 28px; line-height: 1.2; }
.ts-card-back { font-size: 21px; line-height: 1.35; border-top: 2px dashed #b8a67a; padding-top: 10px; margin-top: 10px; }
.ts-card.flipped .ts-card-front { font-size: 22px; color: #6b5a3a; }
.ts-map canvas { width: 100%; image-rendering: pixelated; display: block; border: 3px solid var(--edge); cursor: crosshair; }
.ts-pins { flex-direction: row; flex-wrap: wrap; }
.tasksheet .ts-pins .ts-opt { width: calc(50% - 4px); }
.ts-source { margin: 0; background: #f1e6c8; color: #2a2016; border: 3px solid var(--edge); padding: 10px 14px; max-height: 240px; overflow-y: auto; }
.ts-source figcaption { font-size: 18px; color: #6b4226; margin-bottom: 6px; }
.ts-source blockquote { margin: 0; font-size: 19px; line-height: 1.35; }
.ts-source cite { display: block; margin-top: 6px; font-size: 15px; color: #6b5a3a; }
.ts-subq { display: flex; flex-direction: column; gap: 6px; }
.ts-subqs { display: flex; flex-direction: column; gap: 12px; }
.ts-hints { margin: 0; padding-left: 26px; font-size: 20px; line-height: 1.35; display: flex; flex-direction: column; gap: 4px; }
.ts-hints li::marker { color: var(--gold); }
.ts-report-box { padding: 10px 14px; border-top: 2px dashed var(--bevel); display: flex; flex-direction: column; gap: 8px; }
.ts-report-box label { display: flex; flex-direction: column; gap: 4px; font-size: 17px; }
.ts-report-box textarea { font: inherit; font-size: 18px; color: var(--ink); background: var(--bg2); border: 3px solid var(--edge); padding: 6px 8px; resize: vertical; }
.ts-result { display: flex; flex-direction: column; gap: 12px; text-align: center; }
.ts-result h3 { margin: 4px 0 0; font-size: 34px; color: var(--gold); text-shadow: 0 3px 0 var(--edge); }
.ts-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ts-stats div { background: var(--bg2); border: 3px solid var(--edge); padding: 8px 4px; display: flex; flex-direction: column; gap: 2px; }
.ts-stats b { font-size: 25px; font-weight: 400; } .ts-stats span { font-size: 15px; color: var(--ink2); }
.ts-up { background: #4a3a10; border: 3px solid var(--edge); box-shadow: inset 0 0 0 2px var(--gold); padding: 8px; font-size: 20px; }
.ts-review { text-align: left; margin: 0; padding-left: 24px; font-size: 17px; display: flex; flex-direction: column; gap: 3px; }
.ts-review .ok { color: #8ee09a; } .ts-review .no { color: #ff9aa2; } .ts-review .skip { color: var(--ink2); }
@media (max-width: 560px) {
  .tasksheet { top: auto; bottom: 0; transform: translateX(-50%); width: 100vw; max-height: 96dvh; }
  .ts-stats { grid-template-columns: repeat(2, 1fr); }
  .tasksheet .ts-pins .ts-opt { width: 100%; }
}

/* ---------- Ruhatár ---------- */
.wardrobe { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); gap: 10px; }
.wr-intro { margin: 0; font-size: 20px; line-height: 1.3; color: var(--ink2); }
.wr-body { display: flex; gap: 16px; align-items: flex-start; }
.wr-preview { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; position: sticky; top: 0;
  background: var(--bg2); border: 3px solid var(--edge); box-shadow: inset 0 0 0 2px #262a34; padding: 10px; }
.wr-preview canvas { width: 168px; height: 189px; image-rendering: pixelated; display: block; }
.wr-turn { display: flex; gap: 8px; }
.wr-turn .btn { width: 48px !important; min-height: 40px; font-size: 22px; padding: 0; }
.wr-opts { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.wr-row { display: flex; flex-direction: column; gap: 5px; }
.wr-label { font-size: 18px; color: var(--ink2); }
.wr-cycle { display: flex; align-items: center; gap: 8px; }
.wr-cycle .btn { width: 44px !important; min-height: 40px; font-size: 24px; padding: 0; flex: 0 0 auto; }
.wr-val { flex: 1; text-align: center; font-size: 22px; background: var(--bg2); border: 3px solid var(--edge); padding: 5px 6px; }
.wr-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 32px; height: 32px; padding: 0; cursor: pointer; background: var(--c); border: 3px solid var(--edge); box-shadow: inset 0 0 0 2px rgba(255,255,255,.18); }
.sw.on { outline: 3px solid var(--gold); outline-offset: 1px; }
.sw:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }
.wr-togs { display: flex; gap: 8px; }
.wr-togs .btn { width: auto !important; flex: 1; }
.wr-tog.on { background: var(--acc2); box-shadow: inset 0 0 0 2px #5ac46a, 0 3px 0 var(--edge); }
.wr-foot { display: flex; gap: 8px; }
.wr-foot .btn { flex: 1; }
@media (max-width: 560px) {
  .wardrobe { top: auto; bottom: 0; transform: translateX(-50%); width: 100vw; max-height: 92dvh; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); }
  .wr-body { flex-direction: column; align-items: stretch; }
  .wr-preview { flex-direction: row; justify-content: center; gap: 14px; padding: 6px; z-index: 1; }
  .wr-preview canvas { width: 96px; height: 108px; }
  .wr-turn { flex-direction: column; }
  .wr-foot { position: sticky; bottom: calc(-1 * max(12px, env(safe-area-inset-bottom))); background: var(--bg); padding: 8px 0 max(4px, env(safe-area-inset-bottom)); margin-bottom: calc(-1 * max(12px, env(safe-area-inset-bottom))); box-shadow: 0 -3px 0 var(--edge); z-index: 1; }
  .wr-swatches { gap: 5px; }
  .sw { width: 28px; height: 28px; }
}

@media (max-width: 480px) {
  .brand b { font-size: 21px; }
  .btn { font-size: 17px; padding: 6px 10px; }
  .dlg-text { font-size: 21px; }
}

/* ---------- Küldetések (menu.js) ---------- */
.mainnav button { position: relative; }
.nav-badge { position: absolute; top: 2px; right: 8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--acc); color: #fff; border: 2px solid var(--edge); font-style: normal; font-size: 14px; line-height: 16px; text-align: center; animation: navPulse 1.6s ease-in-out infinite; }
@keyframes navPulse { 50% { transform: scale(1.15); } }
.qbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.qb { border: 3px solid var(--edge); background: #2a2e38; padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.qb.master { border-color: var(--gold); box-shadow: inset 0 0 0 2px #6a5420; }
.qb-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .qb-h b { font-weight: 400; font-size: 20px; }
.qb-seal { color: var(--gold); font-size: 16px; }
.qr { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; font-size: 16px; padding: 4px 0; border-top: 1px dashed #4a4e5a; }
.qr-t { grid-column: 1; } .qr-p { grid-column: 1; display: flex; align-items: center; gap: 8px; } .qr-p .bar { flex: 1; } .qr-p small { color: var(--ink2); font-size: 14px; white-space: nowrap; }
.qr > :last-child { grid-column: 2; grid-row: 1 / 3; }
.qr-r { color: var(--ink2); font-size: 15px; } .qr-ok { color: #8fd07a; font-size: 18px; }
.qr.done .qr-t { color: var(--gold); } .qr.claimed .qr-t { color: var(--ink2); text-decoration: line-through; }
.qr-btn { font-size: 16px; padding: 4px 10px; animation: navPulse 1.6s ease-in-out infinite; }
.qr.just { animation: qrJust .8s ease-out; } @keyframes qrJust { from { background: #6a5420; } }
.qb-up { color: var(--gold); font-size: 17px !important; }
@media (max-width: 760px) { .mainnav button { font-size: 13px; } .nav-badge { right: 4px; } }

/* ---------- fő menü: fatáblák (menu.js) ---------- */
.mainnav { background: repeating-linear-gradient(90deg, #4a2e18 0 22px, #52341c 22px 24px), #4a2e18; border: 3px solid #1c1008; box-shadow: inset 0 0 0 2px #6a4424, 0 4px 0 #0007; border-radius: 8px; }
.mainnav button { color: #f4e4c4; background: linear-gradient(#8a5a30, #6a4220); border: 3px solid #2a1808; border-radius: 6px; box-shadow: inset 0 2px 0 #b07a48, 0 3px 0 #0006; text-shadow: 0 2px 0 #2a1808; }
.mainnav button::before, .mainnav button::after { content: ''; position: absolute; top: 4px; width: 4px; height: 4px; border-radius: 50%; background: #d8c090; box-shadow: 0 1px 0 #2a1808; }
.mainnav button::before { left: 5px; } .mainnav button::after { right: 5px; }
.mainnav button:hover { color: #fff; background: linear-gradient(#9a6a3a, #7a4e28); }
.mainnav button.on { color: #fff; background: linear-gradient(#c8303a, #9a1e26); border-color: #3a0a0e; box-shadow: inset 0 2px 0 #f06068, 0 3px 0 #0006; transform: translateY(-1px); }
@media (max-width: 760px) { .mainnav { border-radius: 0; border-width: 3px 0 0; gap: 4px; } .mainnav button::before, .mainnav button::after { display: none; } }

/* ---------- a Napló mint könyv ---------- */
.page.book { background: #5a2a18; border: 4px solid #2a1008; box-shadow: inset 0 0 0 3px #8a4a28, inset 0 0 0 6px #3a1a0e, 0 8px 0 #0008; border-radius: 10px; color: #3a2a1a; }
.page.book .pg-head { background: linear-gradient(#7a1a1e, #5a1014); border-bottom: 3px solid #2a1008; } .page.book .pg-head h2 { color: #f8e4b0; text-shadow: 0 2px 0 #2a0808; }
.page.book .pg-body { margin: 10px; border-radius: 4px; background: radial-gradient(ellipse at center, #f6ecd2 0 55%, #e8d6ac 100%); box-shadow: inset 0 0 18px #a07a4a66; }
.page.book :is(.pg-card, .pg-stats div) { background: transparent; border: none; box-shadow: none; color: #3a2a1a; }
.page.book .pg-card { border-bottom: 2px solid #c9a66c; padding-bottom: 14px; } .page.book .pg-card h3 { color: #7a1a1e; } .page.book .pg-card h3::after { content: ' ❦'; color: #b8902a; }
.page.book .pg-stats div { border: 2px solid #c9a66c; background: #fff8e4aa; } .page.book .pg-stats span, .page.book .pg-muted { color: #6a5236; }
.page.book .bar { background: #d8c8a4; } .page.book .bar i { background: #4a8a3a; } .page.book .nl-topic small { color: #6a5236; }
@media (min-width: 1100px) {
  .page.book .pg-body { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; align-items: start;
    background: linear-gradient(90deg, #e8d6ac 0, #f6ecd2 6%, #f6ecd2 46%, #c8b088 50%, #f6ecd2 54%, #f6ecd2 94%, #e8d6ac 100%); }
  .page.book .pg-stats { grid-column: 1 / -1; }
}
/* Napló: tárgy-fülek, „menj oda” gombok; Profil: pecsétek tárgyanként */
.nl-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.nl-tab { position: relative; overflow: hidden; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 5px 9px 8px; border: 3px solid var(--edge); background: var(--bg2); color: var(--ink); text-align: left; }
.nl-tab b { font-weight: 400; font-size: 19px; } .nl-tab span { font-size: 14px; color: var(--ink2); }
.nl-tab i { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--acc2); }
.nl-tab.on { border-color: var(--gold); box-shadow: inset 0 0 0 2px #6a5420; }
.page.book .nl-tab { background: #fff8e4aa; border-color: #c9a66c; color: #3a2a1a; } .page.book .nl-tab span { color: #6a5236; } .page.book .nl-tab.on { border-color: #7a1a1e; box-shadow: inset 0 0 0 2px #e8c88a; } .page.book .nl-tab i { background: #4a8a3a; }
.nl-go { font: inherit; font-size: 14px; cursor: pointer; background: none; border: none; padding: 0; color: #a8302a; text-decoration: underline; } .page:not(.book) .nl-go { color: var(--gold); }
.seal-h { margin: 6px 0 4px; font-weight: 400; font-size: 20px; color: var(--gold); } .seal-h small { font-size: 15px; color: var(--ink2); }
@media (max-width: 560px) { .nl-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .page.book .pg-body > .pg-card:nth-of-type(2) { grid-row: span 2; } }
