/* Égig érő szó — one shell, three skins.
   A  Szocreál × Bauhaus   poster red, black, steel, ochre on newsprint
   B  Szecesszió           Zsolnay glaze, eosin, Lechner gold, majolica roof
   C  Honfoglalás × népmese  tarsoly leather, silver gilt, folk red/ochre/green */

/* ------------------------------------------------------------ skin tokens */
:root, [data-skin="a"] {
  color-scheme: light;
  --bg: #d9d9d4;
  --surface: #f0f0ec;
  --surface-2: #c9c9c2;
  --ink: #151413;
  --muted: #4f4b45;
  --line: #151413;
  --line-soft: #b9b3a6;
  --accent: #c7271f;
  --accent-ink: #fff6ee;
  --accent-2: #23507a;
  --accent-3: #d99a1e;
  --play: #c7271f;
  --play-ink: #fff6ee;
  --word-off: #8d877c;
  --bar-bg: #c7271f;
  --bar-ink: #fff6ee;
  --display: "Big Shoulders Display", "Jost", sans-serif;
  --display-weight: 900;
  --display-case: uppercase;
  --display-track: 0.01em;
  --ui: "Jost", system-ui, sans-serif;
  --r-btn: 0;
  --r-btn-top: 0;
  --r-panel: 0;
  --bw: 2px;
  --shadow: none;
}

[data-skin="b"] {
  color-scheme: light;
  --bg: #7fbfb5;
  --surface: #f5f8f2;
  --surface-2: #e2efe9;
  --ink: #0e2a27;
  --muted: #1f3f3a;
  --line: #a9853a;
  --line-soft: #a7c7bd;
  --accent: #0f5a5c;
  --accent-ink: #f7f1dc;
  --accent-2: #6d2b5e;
  --accent-3: #c39532;
  --play: #6d2b5e;
  --play-ink: #fbf3fa;
  --word-off: #5f7f78;
  --bar-bg: #0f5a5c;
  --bar-ink: #f7f1dc;
  --display: "Marcellus", Georgia, serif;
  --display-weight: 400;
  --display-case: none;
  --display-track: 0.02em;
  --ui: "Commissioner", system-ui, sans-serif;
  --r-btn: 6px;
  --r-btn-top: 22px;
  --r-panel: 26px 26px 8px 8px;
  --bw: 1.5px;
  --shadow: 0 1px 0 #fff8 inset, 0 6px 16px -10px #0f3d3a66;
}

[data-skin="c"] {
  color-scheme: dark;
  --bg: #1d130e;
  --surface: #2a1b14;
  --surface-2: #3a271c;
  --ink: #f1e6d0;
  --muted: #c5b394;
  --line: #a9a294;
  --line-soft: #4d382b;
  --accent: #c8372d;
  --accent-ink: #fff3e6;
  --accent-2: #5f9a55;
  --accent-3: #dcaa45;
  --play: #c8372d;
  --play-ink: #fff3e6;
  --word-off: #7d6a55;
  --bar-bg: #1d130e;
  --bar-ink: #f1e6d0;
  --display: "Inknut Antiqua", Georgia, serif;
  --display-weight: 700;
  --display-case: none;
  --display-track: 0;
  --ui: "Alegreya Sans", system-ui, sans-serif;
  --r-btn: 12px;
  --r-btn-top: 12px;
  --r-panel: 14px;
  --bw: 1px;
  --shadow: 0 1px 0 #ffffff12 inset, 0 10px 22px -14px #000c;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--ui);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  transition: background-color .3s ease;
}
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent-3); outline-offset: 2px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: progress; opacity: .6; }
svg { width: 1.25em; height: 1.25em; flex: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--bg); padding: 10px 14px; }
.skip:focus { top: 12px; }
a { color: inherit; text-underline-offset: .2em; }
* { scrollbar-width: thin; scrollbar-color: var(--line-soft) transparent; }
.noscript { padding: 24px; }
.sprite { position: absolute; }

.primary, .ghost, .icon {
  display: inline-flex; align-items: center; gap: .5em;
  border: var(--bw) solid var(--line); border-radius: var(--r-btn);
  padding: .55em 1em; min-height: 44px;
  font-weight: 600; line-height: 1.1;
  transition: background-color .15s ease, color .15s ease, transform .1s ease;
}
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.primary:hover { filter: brightness(1.08); }
.ghost { background: transparent; }
.ghost:hover { background: var(--surface-2); }
.icon { padding: 0; width: 44px; justify-content: center; background: transparent; }
.primary:active, .ghost:active, .icon:active { transform: translateY(1px); }

/* ------------------------------------------------------------ top bar */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bar-bg); color: var(--bar-ink);
  padding-top: env(safe-area-inset-top);
}
.bar-in {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 28px;
  padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  position: relative;
}
.mark { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.mark-sign { width: 40px; height: 40px; flex: none; background: center / contain no-repeat; }
.mark-words { display: grid; line-height: 1; }
.mark-name { font: var(--display-weight) 1.6rem/1 var(--display); text-transform: var(--display-case); letter-spacing: var(--display-track); white-space: nowrap; }
.mark-sub { font-size: .8rem; opacity: .85; margin-top: 4px; letter-spacing: .04em; }

.views { display: flex; gap: 4px; justify-self: center; }
.views button {
  background: transparent; border: 0; border-bottom: 3px solid transparent;
  color: inherit; padding: 10px 14px; min-height: 44px; font-weight: 600; letter-spacing: .02em; opacity: .8;
}
.views button:hover { opacity: 1; }
.views button[aria-selected="true"] { opacity: 1; border-bottom-color: currentColor; }

.tools { display: flex; align-items: center; gap: 10px; }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 10px; opacity: .75; pointer-events: none; }
.search input {
  width: 200px; min-height: 40px; padding: 8px 10px 8px 36px;
  border: var(--bw) solid currentColor; border-radius: var(--r-btn);
  background: transparent; color: inherit; caret-color: currentColor;
}
.search input::placeholder { color: inherit; opacity: .7; }
.search input:focus-visible { outline-color: currentColor; }
.seg { display: flex; border: var(--bw) solid currentColor; border-radius: var(--r-btn); overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 6px 10px; min-height: 40px; display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.seg button + button { border-left: var(--bw) solid currentColor; }
.seg button b { font-weight: 800; }
.seg button[aria-checked="true"] { background: var(--bar-ink); color: var(--bar-bg); }
.skins button span { display: none; }
@media (min-width: 1380px) { .skins button span { display: inline; } }

/* ------------------------------------------------------------ layout */
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 370px;
  align-items: start;
  min-height: calc(100dvh - 64px);
}
main { padding: 24px 28px 120px; min-width: 0; outline: none; }

/* rail: the ladder */
.rail {
  position: sticky; top: 64px; max-height: calc(100dvh - 64px); overflow: auto;
  padding: 22px 18px 24px 22px; border-right: var(--bw) solid var(--line-soft);
  display: flex; flex-direction: column; gap: 18px;
}
.rail-head { margin: 0; font: var(--display-weight) 1.15rem/1 var(--display); text-transform: var(--display-case); letter-spacing: var(--display-track); }
.rail-dir { display: block; font: 400 .82rem/1.3 var(--ui); color: var(--muted); text-transform: none; margin-top: 6px; letter-spacing: 0; }
.rungs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rung { display: grid; grid-template-columns: 30px 1fr; column-gap: 8px; }
.rung-n { grid-row: span 2; font: var(--display-weight) 1.5rem/1 var(--display); color: var(--accent); }
.rung-name { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rung-ps { list-style: none; margin: 4px 0 0; padding: 0; }
.rung-ps a { display: block; padding: 3px 0; text-decoration: none; font-size: .95rem; }
.rung-ps a:hover { color: var(--accent); text-decoration: underline; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: var(--bw) solid var(--line-soft); }
.offline-state { margin: 0; font-size: .82rem; color: var(--muted); min-height: 1.2em; }

.switch { display: flex; align-items: center; gap: 10px; font-size: .92rem; cursor: pointer; min-height: 44px; }
.switch input {
  appearance: none; width: 40px; height: 24px; margin: 0; flex: none; border-radius: 99px;
  background: var(--surface-2); border: var(--bw) solid var(--line); position: relative; cursor: pointer;
  transition: background-color .15s ease;
}
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink); transition: transform .18s cubic-bezier(.2, .8, .2, 1);
}
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(16px); background: var(--accent-ink); }

/* board */
.chips { display: none; }

.deck-offline { display: none; }
.chip-toggle { cursor: pointer; font: inherit; color: inherit; }
.chip-dot { width: 14px; height: 14px; border-radius: 50%; border: var(--bw) solid currentColor; }
.chip-toggle[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-toggle[aria-pressed="true"] .chip-dot { background: var(--accent-3); border-color: var(--accent-3); }
.result-note { margin: 0 0 18px; font-weight: 600; }
.result-note.empty { padding: 18px; border: var(--bw) dashed var(--line); border-radius: var(--r-btn); font-weight: 400; }
.tier { margin-bottom: 44px; }
.tier-h {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin: 0 0 18px; padding-bottom: 10px; border-bottom: var(--bw) solid var(--line);
}
.tier-n { font: var(--display-weight) 3.4rem/.8 var(--display); color: var(--accent); }
.tier-name { font: var(--display-weight) 1.9rem/1 var(--display); text-transform: var(--display-case); letter-spacing: var(--display-track); }
.tier-alt { color: var(--muted); font-size: .95rem; }

.persona { margin: 0 0 30px; scroll-margin-top: 84px; }
.persona.flash .persona-name { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { color: var(--accent); } 100% { color: inherit; } }
.persona-h { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.persona-name { margin: 0; font: var(--display-weight) 1.5rem/1.1 var(--display); text-transform: var(--display-case); letter-spacing: var(--display-track); }
.persona-meta { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.persona-blurb { margin: 6px 0 0; max-width: 62ch; font-size: .95rem; }
.play-all { flex: none; }
.rovas { display: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.ln {
  --p: 0;
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  min-height: 92px; padding: 12px 14px 14px;
  background: var(--surface); color: var(--ink);
  border: var(--bw) solid var(--line); border-radius: var(--r-btn-top) var(--r-btn-top) var(--r-btn) var(--r-btn);
  box-shadow: var(--shadow);
  transition: transform .12s ease, background-color .15s ease, color .15s ease;
}
.ln::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--play-sweep, #ffffff30); transform-origin: left; transform: scaleX(var(--p));
}
.ln:hover { background: var(--surface-2); }
.ln:active { transform: translateY(1px) scale(.995); }
.ln.playing { color: var(--play-ink); }
.ln.playing .ln-task, .ln.playing .ln-en, .ln.playing .ln-src { color: inherit; opacity: .85; }
.ln-foot { margin-top: auto; padding-top: 4px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ln-task { font-size: .8rem; font-weight: 500; color: var(--muted); }
.ln-rung { flex: none; width: 56px; height: 4px; background: var(--line-soft); position: relative; overflow: hidden; border-radius: 2px; }
.ln-rung::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(calc(var(--rung, 1) / 7)); }
.ln.playing .ln-rung { background: #ffffff40; }
.ln.playing .ln-rung::after { background: currentColor; }
/* register you can see: the street speaks heavier, Parnassus in the display voice */
.ln[data-rung="1"] .ln-hu, .ln[data-rung="2"] .ln-hu { font-weight: 700; }
.ln[data-rung="6"] .ln-hu, .ln[data-rung="7"] .ln-hu { font-family: var(--display); font-weight: 400; letter-spacing: .005em; }
.ln-hu { font-size: 1.02rem; font-weight: 500; line-height: 1.32; }
.ln-en { display: none; font-size: .86rem; color: var(--muted); line-height: 1.35; }
.ln-src { font-size: .78rem; color: var(--muted); font-style: italic; }
.learner .ln-en { display: block; }
.ln:focus-visible .ln-en { display: block; }

/* ladder view: the staircase */
.view-title { margin: 0 0 6px; font: var(--display-weight) clamp(1.8rem, 3.2vw, 2.8rem)/1.05 var(--display); text-transform: var(--display-case); letter-spacing: var(--display-track); max-width: 22ch; }
.view-lede { margin: 0 0 18px; color: var(--muted); max-width: 60ch; }
.ladder-head { margin-bottom: 26px; }
.task-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.task-tabs button {
  border: var(--bw) solid var(--line); background: transparent; border-radius: var(--r-btn);
  padding: 7px 13px; min-height: 40px; font-weight: 600; font-size: .92rem;
}
.task-tabs button:hover { background: var(--surface-2); }
.task-tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.stairs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; gap: 8px; }
.step {
  display: grid; grid-template-columns: 44px minmax(120px, 190px) minmax(0, 1fr); align-items: stretch; gap: 12px;
  margin-left: calc(var(--i) / (var(--n) - 1) * min(26%, 240px));
  position: relative;
}
.step-rung { font: var(--display-weight) 1.7rem/1 var(--display); color: var(--accent); align-self: center; text-align: right; }
.step-who { display: flex; flex-direction: column; justify-content: center; font-size: .85rem; color: var(--muted); }
.step-who b { color: var(--ink); font-size: 1rem; font-weight: 700; }
.step-ln { min-height: 64px; }
.step-ln .ln-foot { display: none; }

/* scenes */
.scene { border: var(--bw) solid var(--line); border-radius: var(--r-panel); background: var(--surface); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.scene-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.scene-title { margin: 0; font: var(--display-weight) 1.5rem/1.1 var(--display); text-transform: var(--display-case); letter-spacing: var(--display-track); }
.scene-alt { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.scene-cast { margin: 8px 0 0; font-size: .85rem; font-weight: 600; color: var(--accent); }
.scene-note { margin: 12px 0 14px; max-width: 70ch; font-size: .95rem; }
.script { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cue {
  --p: 0; position: relative; isolation: isolate; overflow: hidden;
  width: 100%; display: grid; grid-template-columns: 150px 1fr; column-gap: 14px; text-align: left;
  background: transparent; border: 0; border-top: 1px solid var(--line-soft); padding: 10px 6px; min-height: 44px;
}
.cue::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--play); opacity: .16; transform-origin: left; transform: scaleX(var(--p)); }
.cue:hover { background: var(--surface-2); }
.cue.playing .cue-hu { color: var(--accent); }
.cue-who { grid-row: span 2; font-weight: 700; font-size: .88rem; }
.cue-hu { font-weight: 500; }
.cue-en { color: var(--muted); font-size: .88rem; display: none; }
.learner .cue-en { display: block; }

/* deck: now playing */
.deck {
  position: sticky; top: 64px; height: calc(100dvh - 64px); overflow: auto;
  border-left: var(--bw) solid var(--line-soft); background: var(--surface);
}
.deck-in { padding: 26px 26px 32px; position: relative; }
.deck-close { display: none; }
.deck-empty-h { font: var(--display-weight) 1.6rem/1.1 var(--display); text-transform: var(--display-case); letter-spacing: var(--display-track); margin: 0 0 10px; }
.deck-empty p:last-child { color: var(--muted); max-width: 34ch; }
.deck-who { margin: 0; font: var(--display-weight) 1.25rem/1.15 var(--display); text-transform: var(--display-case); letter-spacing: var(--display-track); color: var(--accent); }
.deck-meta { margin: 4px 0 18px; font-size: .85rem; color: var(--muted); }
.deck-hu { margin: 0 0 14px; font: 600 clamp(1.45rem, 2.1vw, 1.9rem)/1.25 var(--ui); text-wrap: balance; }
.deck-hu .w { color: var(--word-off); transition: color .12s ease; }
.deck-hu .w.on { color: var(--ink); }
.deck-en { margin: 0 0 20px; font-size: 1.05rem; font-style: italic; }
.deck-notes { margin: 0 0 22px; display: grid; gap: 14px; }
.deck-notes dt { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.deck-notes dd { margin: 3px 0 0; font-size: .95rem; }
.deck-ctl { display: flex; gap: 10px; flex-wrap: wrap; }
#d-slow[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.nowbar { display: none; }

/* ------------------------------------------------------------ skin A: Szocreál × Bauhaus */
[data-skin="a"] .bar { border-bottom: 6px solid var(--ink); overflow: hidden; }
[data-skin="a"] .bar::before {
  content: ""; position: absolute; left: 640px; top: -150px; width: 230px; height: 230px; border-radius: 50%;
  background: var(--ink); pointer-events: none;
}
[data-skin="a"] .bar::after {
  content: ""; position: absolute; left: 300px; top: 0; bottom: 0; width: 26px; background: var(--accent-3);
  transform: skewX(-24deg); pointer-events: none;
}
[data-skin="a"] .bar-in { z-index: 1; }
[data-skin="a"] .mark-sign { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='19' fill='%23151413'/%3E%3Cpath d='M20 5 23.8 16.2H35.6L26 23.2 29.6 34.6 20 27.6 10.4 34.6 14 23.2 4.4 16.2H16.2Z' fill='%23d99a1e'/%3E%3C/svg%3E"); }
[data-skin="a"] .mark-name { font-size: 1.85rem; }
[data-skin="a"] .mark-sub, [data-skin="a"] .views button { opacity: 1; }
[data-skin="a"] .views button[aria-selected="false"] { font-weight: 500; }
[data-skin="a"] .seg button[aria-checked="true"] { background: var(--accent-3); color: var(--ink); }
[data-skin="a"] .seg, [data-skin="a"] .search input { background: var(--accent); }
[data-skin="a"] .ln { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }
[data-skin="a"] .ln::after { content: ""; position: absolute; right: -1px; top: -1px; width: 20px; height: 20px; background: linear-gradient(225deg, var(--ink) 50%, transparent 50%); }
[data-skin="a"] .ln[data-rung="3"] .ln-rung::after, [data-skin="a"] .ln[data-rung="5"] .ln-rung::after { background: var(--accent-2); }
[data-skin="a"] .tier[data-rung="2"] .tier-n, [data-skin="a"] .tier[data-rung="6"] .tier-n { background: var(--accent-2); }
[data-skin="a"] .tier-n { clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%); }
[data-skin="a"] .deck-empty { position: relative; min-height: 70vh; overflow: hidden; }
[data-skin="a"] .deck-empty::before { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; background: var(--accent); right: -120px; bottom: -40px; }
[data-skin="a"] .deck-empty::after { content: ""; position: absolute; left: -40px; right: -40px; bottom: 150px; height: 46px; background: var(--accent-3); transform: rotate(-24deg); }
[data-skin="a"] .deck-empty-h { position: relative; z-index: 1; font-size: 3.2rem; line-height: .95; color: var(--accent-ink); }
[data-skin="a"] .deck-empty p { position: relative; z-index: 1; }
[data-skin="a"] .tier-h { border-bottom-width: 6px; }
[data-skin="a"] .tier-n { background: var(--accent); color: var(--accent-ink); padding: 6px 10px 2px; font-size: 3rem; }
[data-skin="a"] .tier[data-rung="5"] .tier-n, [data-skin="a"] .tier[data-rung="7"] .tier-n { background: var(--ink); }
[data-skin="a"] .tier[data-rung="3"] .tier-n { background: var(--accent-2); }
[data-skin="a"] .ln { border-width: 2px; }
[data-skin="a"] .ln:hover { background: var(--ink); color: var(--accent-ink); }
[data-skin="a"] .ln:hover .ln-task { color: var(--accent-3); }
[data-skin="a"] .ln:hover .ln-en, [data-skin="a"] .ln:hover .ln-src { color: #cfc9bd; }
[data-skin="a"] .persona-name { font-size: 1.8rem; }
[data-skin="a"] .deck { background: #151413; color: var(--accent-ink); --muted: #bdb6a9; --word-off: #6c665d; --ink: #fff6ee; --line: #fff6ee; --surface-2: #34312c; border-left: 0; }
[data-skin="a"] .deck .deck-who, [data-skin="a"] .deck dt { color: var(--accent-3); }
[data-skin="a"] .deck-hu { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(1.9rem, 2.6vw, 2.5rem); line-height: 1.02; letter-spacing: .005em; }
[data-skin="a"] .step-rung { color: var(--ink); }
[data-skin="a"] .task-tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
[data-skin="a"] .scene { border-width: 2px; }
[data-skin="a"] .scene-title { font-size: 1.9rem; }

/* ------------------------------------------------------------ skin B: Szecesszió */
[data-skin="b"] body, [data-skin="b"] { --majolica: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='20' viewBox='0 0 28 20'%3E%3Crect width='28' height='20' fill='%230f5a5c'/%3E%3Cpath d='M14 1 26 10 14 19 2 10Z' fill='%23c39532'/%3E%3Cpath d='M14 5 20.6 10 14 15 7.4 10Z' fill='%232f7d5b'/%3E%3Cpath d='M0 1 0 0 1.3 0ZM28 1 28 0 26.7 0Z' fill='%23c39532'/%3E%3C/svg%3E"); }
[data-skin="b"] .bar { background-color: var(--accent); }
[data-skin="b"] .bar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -14px; height: 14px; background: var(--majolica) repeat-x left top / 28px 20px;
  border-bottom: 2px solid var(--accent-3); pointer-events: none;
}
[data-skin="b"] .rail, [data-skin="b"] .deck { top: 78px; }
[data-skin="b"] .rail { height: auto; max-height: calc(100dvh - 78px); }
[data-skin="b"] .deck { height: calc(100dvh - 78px); }
[data-skin="b"] main { padding-top: 38px; }
[data-skin="b"] .mark-sign { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 2C30 2 36 9 36 18V38H4V18C4 9 10 2 20 2Z' fill='%23c39532'/%3E%3Cpath d='M20 7C27 7 31 12 31 19V34H9V19C9 12 13 7 20 7Z' fill='%236d2b5e'/%3E%3Cpath d='M20 12C16 17 16 23 20 30 24 23 24 17 20 12Z' fill='%23d5e7e1'/%3E%3C/svg%3E"); }
[data-skin="b"] .mark-name { font-size: 1.7rem; letter-spacing: .04em; }
[data-skin="b"] .views button[aria-selected="true"] { border-bottom-color: var(--accent-3); color: #fff; }
[data-skin="b"] .seg, [data-skin="b"] .search input { border-color: #f7f1dc99; }
[data-skin="b"] .seg button + button { border-left-color: #f7f1dc99; }
[data-skin="b"] .seg button[aria-checked="true"] { background: var(--accent-3); color: var(--ink); }
[data-skin="b"] .tier-h { border-bottom: 0; padding-bottom: 14px; position: relative; }
[data-skin="b"] .tier-h::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--majolica) repeat-x left center / 14px 10px; border-radius: 4px; opacity: .9; }
[data-skin="b"] .tier-n {
  display: grid; place-items: center; width: 56px; height: 64px; font-size: 2.2rem; line-height: 1;
  background: var(--accent); color: var(--accent-ink); border-radius: 28px 28px 6px 6px; border: 2px solid var(--accent-3); padding-top: 6px;
}
[data-skin="b"] .tier-name { font-size: 2rem; color: var(--accent); }
[data-skin="b"] .ln { border-color: color-mix(in srgb, var(--line) 70%, transparent); }
[data-skin="b"] .ln:hover { background: #fff; border-color: var(--line); }
[data-skin="b"] .ln { border-radius: 50% 50% 6px 6px / 38px 38px 6px 6px; padding-top: 24px; border-width: 2px; border-color: var(--line); }
[data-skin="b"] .step-ln { border-radius: 50% 50% 6px 6px / 30px 30px 6px 6px; padding-top: 18px; }
[data-skin="b"] .ln-rung::after { background: var(--accent-3); }
[data-skin="b"] .rail, [data-skin="b"] .persona-blurb, [data-skin="b"] .persona-meta { color: var(--ink); }
[data-skin="b"] .rail { --muted: #1f3f3a; }
[data-skin="b"] .tier-alt, [data-skin="b"] .view-lede, [data-skin="b"] .rail-dir { color: #1f3f3a; }
[data-skin="b"] .ln-task { color: var(--accent-2); }
[data-skin="b"] .persona-name { color: var(--accent); font-size: 1.65rem; }
[data-skin="b"] .deck { background: var(--surface); border-left: 2px solid var(--line); }
[data-skin="b"] .deck-in::before {
  content: ""; display: block; height: 10px; margin: -6px 0 22px; background: var(--majolica) repeat-x left center / 14px 10px; border-radius: 5px;
}
[data-skin="b"] .deck-hu { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 2.3vw, 2.1rem); }
[data-skin="b"] .deck-who { color: var(--accent-2); }
[data-skin="b"] .step-ln { border-radius: 26px 26px 6px 6px; }
[data-skin="b"] .step-rung {
  justify-self: end; display: grid; place-items: center; width: 40px; height: 46px; font-size: 1.4rem;
  background: var(--accent); color: var(--accent-ink); border-radius: 20px 20px 4px 4px; border: 1.5px solid var(--accent-3);
}
[data-skin="b"] .task-tabs button { border-radius: 18px 18px 4px 4px; border-color: var(--accent); color: var(--accent); }
[data-skin="b"] .task-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
[data-skin="b"] .scene { border-color: var(--line); }
[data-skin="b"] .scene-title { color: var(--accent); }
[data-skin="b"] .primary { background: var(--accent-2); border-color: var(--accent-2); color: var(--play-ink); border-radius: 18px 18px 6px 6px; }
[data-skin="b"] .ghost { border-color: var(--accent); color: var(--accent); background: var(--surface); }
[data-skin="b"] .ghost:hover { background: #fff; }

/* ------------------------------------------------------------ skin C: Honfoglalás × népmese */
[data-skin="c"] { --palmette: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'%3E%3Cg fill='none' stroke='%23cfc3a0' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M0 20C8 20 10 22 14 22S20 20 24 20 34 22 38 22 44 20 48 20'/%3E%3Cpath d='M24 19C24 14 24 9 24 4M24 19C21 15 18 11 16 7M24 19C27 15 30 11 32 7M24 19C19 17 15 15 12 12M24 19C29 17 33 15 36 12'/%3E%3Cpath d='M16 7C17 4 20 2 24 2S31 4 32 7M12 12C11 9 13 6 16 7M36 12C37 9 35 6 32 7'/%3E%3C/g%3E%3Ccircle cx='24' cy='20' r='1.8' fill='%23c8372d'/%3E%3Ccircle cx='2' cy='19' r='1.3' fill='%23dcaa45'/%3E%3Ccircle cx='46' cy='19' r='1.3' fill='%23dcaa45'/%3E%3C/svg%3E"); }
[data-skin="c"] .bar { border-bottom: 1px solid #3e2b20; }
[data-skin="c"] .bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -23px; height: 22px; background: var(--palmette) repeat-x left center / 48px 24px; pointer-events: none; opacity: .9; }
[data-skin="c"] main { padding-top: 40px; }
[data-skin="c"] .rail { padding-top: 44px; }
[data-skin="c"] .mark-sign { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 38V6' stroke='%23a9a294' stroke-width='2'/%3E%3Cpath d='M20 30C12 30 6 24 6 17M20 30C28 30 34 24 34 17M20 21C14 21 10 16 10 11M20 21C26 21 30 16 30 11' fill='none' stroke='%23a9a294' stroke-width='1.6'/%3E%3Ccircle cx='20' cy='5' r='3.2' fill='%23c8372d'/%3E%3Ccircle cx='6' cy='15' r='2.4' fill='%23dcaa45'/%3E%3Ccircle cx='34' cy='15' r='2.4' fill='%23dcaa45'/%3E%3Ccircle cx='10' cy='9' r='2' fill='%235f9a55'/%3E%3Ccircle cx='30' cy='9' r='2' fill='%235f9a55'/%3E%3C/svg%3E"); }
[data-skin="c"] .mark-name { font-size: 1.45rem; }
[data-skin="c"] .views button[aria-selected="true"] { border-bottom-color: var(--accent); }
[data-skin="c"] .seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); }
[data-skin="c"] .rovas {
  display: block; direction: rtl; unicode-bidi: isolate; text-align: left;
  font: 400 .95rem/1.4 "Noto Sans Old Hungarian", sans-serif; color: var(--accent-3); letter-spacing: .12em; text-transform: none; margin-top: 4px;
}
[data-skin="c"] .persona-name .rovas { font-size: .9rem; opacity: .9; }
[data-skin="c"] .tier-h { border-bottom: 0; padding-bottom: 26px; position: relative; }
[data-skin="c"] .tier-h::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22px; background: var(--palmette) repeat-x left center / 48px 24px; opacity: .55; }
[data-skin="c"] .tier-n {
  display: grid; place-items: center; width: 54px; height: 54px; font-size: 1.9rem; line-height: 1;
  border: 1.5px solid var(--line); border-radius: 50%; color: var(--accent-3); background: var(--surface-2); padding-top: 4px;
}
[data-skin="c"] .tier[data-rung="1"] .tier-n, [data-skin="c"] .tier[data-rung="4"] .tier-n, [data-skin="c"] .tier[data-rung="7"] .tier-n { color: var(--accent); }
[data-skin="c"] .tier[data-rung="3"] .tier-n, [data-skin="c"] .tier[data-rung="6"] .tier-n { color: var(--accent-2); }
[data-skin="c"] .ln { background: linear-gradient(var(--surface), var(--surface)) padding-box; border-color: #5a4334; }
[data-skin="c"] .ln:hover { background: var(--surface-2); border-color: var(--line); }
[data-skin="c"] .ln-rung::after { background: var(--accent-3); }
[data-skin="c"] .tier-n { box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px #cfc3a0; }
[data-skin="c"] .deck-in::before, [data-skin="c"] .bar::after { filter: drop-shadow(0 1px 0 #0008); }
[data-skin="c"] .deck { background: #24170f; border-left: 1px solid #3e2b20; }
[data-skin="c"] .deck-in { padding-top: 40px; }
[data-skin="c"] .deck-hu { font-family: var(--display); font-weight: 500; font-size: clamp(1.35rem, 1.9vw, 1.7rem); line-height: 1.45; }
[data-skin="c"] .deck-who { color: var(--accent-3); }
[data-skin="c"] .stairs { position: relative; }
[data-skin="c"] .step::before {
  content: ""; position: absolute; left: 22px; top: -9px; bottom: -9px; width: 2px; background: #5a4334;
}
[data-skin="c"] .step-rung { position: relative; z-index: 1; justify-self: center; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--line); font-size: 1.15rem; color: var(--accent-3); }
[data-skin="c"] .task-tabs button { border-radius: 99px; border-color: #6a5040; }
[data-skin="c"] .task-tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
[data-skin="c"] .scene { border-color: #5a4334; }
[data-skin="c"] .ghost { border-color: #6a5040; }
[data-skin="c"] .switch input { border-color: #6a5040; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .rail { display: none; }
  .chips {
    display: flex; gap: 6px; overflow-x: auto; margin: -6px -28px 22px; padding: 6px 28px 10px;
    position: sticky; top: 64px; z-index: 5; background: var(--bg); scroll-snap-type: x proximity;
  }
  .chip {
    flex: none; display: inline-flex; align-items: center; gap: 6px; scroll-snap-align: start;
    border: var(--bw) solid var(--line); border-radius: 99px; padding: 6px 12px; min-height: 40px; text-decoration: none; font-size: .9rem; font-weight: 600; background: var(--surface);
  }
  .chip-n { font: var(--display-weight) 1rem/1 var(--display); color: var(--accent); }
  [data-skin="b"] .chips { top: 78px; }
  .deck-offline { display: inline-flex; }
  p.deck-offline { display: block; margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
  p.deck-offline:empty { display: none; }
  .search input { width: 160px; }
}

@media (max-width: 860px) {
  html { scroll-padding-top: 70px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .bar { position: relative; }
  .bar-in { grid-template-columns: minmax(0, 1fr) auto auto; padding: 10px 16px 0; gap: 10px 8px; }
  .mark-name { font-size: 1.35rem; }
  [data-skin="a"] .mark-name { font-size: 1.55rem; }
  [data-skin="a"] .bar::after { display: none; }
  [data-skin="a"] .bar::before { left: auto; right: -110px; top: -170px; }
  .mark-sign { width: 30px; height: 30px; }
  .mark-sub { display: none; }
  .bar-in { padding-top: 8px; }
  .views { grid-column: 1 / 3; grid-row: 2; justify-self: stretch; }
  .views button { flex: 1; padding: 8px 6px; font-size: .92rem; }
  .tools { display: contents; }
  .search { grid-column: 3; grid-row: 2; width: 118px; }
  .search input { min-height: 38px; font-size: .9rem; }
  .skins { grid-row: 1; grid-column: 2; }
  .langs { grid-row: 1; grid-column: 3; justify-self: end; }
  .mark-name, [data-skin="a"] .mark-name { font-size: 1.25rem; }
  [data-skin="b"] .mark-name, [data-skin="c"] .mark-name { font-size: 1.08rem; letter-spacing: 0; }
  .mark-sign { display: none; }
  .mark-name { line-height: 1.2; }
  .mark { grid-column: 1; grid-row: 1; }
  .seg button { min-height: 36px; padding: 4px 9px; }
  .search input { width: 100%; }
  .langs { display: flex; }
  main { padding: 18px 16px calc(110px + env(safe-area-inset-bottom)); }
  [data-skin="b"] main { padding-top: 32px; }
  [data-skin="c"] main { padding-top: 36px; }
  .chips { margin: -6px -16px 18px; padding: 8px 16px 10px; top: 0; }
  [data-skin="b"] .chips { top: 0; }
  .tier { margin-bottom: 32px; }
  .tier-h { margin-bottom: 12px; padding-bottom: 8px; gap: 10px; }
  .tier-n { font-size: 2rem; }
  [data-skin="a"] .tier-n { font-size: 2rem; }
  [data-skin="b"] .tier-n { width: 34px; height: 40px; font-size: 1.3rem; padding-top: 4px; }
  [data-skin="b"] .tier-name { font-size: 1.15rem; }
  .chips { margin-bottom: 12px; }
  [data-skin="c"] .tier-n { width: 40px; height: 40px; font-size: 1.4rem; }
  .tier-name { font-size: 1.25rem; }
  [data-skin="a"] .tier-name { font-size: 1.45rem; }
  .tier-alt { display: none; }
  .persona-h { gap: 10px; margin-bottom: 10px; }
  .persona-name, [data-skin="a"] .persona-name, [data-skin="b"] .persona-name { font-size: 1.3rem; }
  .persona-blurb { font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .play-all { min-height: 40px; padding: .4em .8em; }
  .grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ln { min-height: 84px; padding: 10px 11px 12px; }
  .ln-hu { font-size: .95rem; }
  .step { grid-template-columns: 34px minmax(0, 1fr); margin-left: calc(var(--i) / (var(--n) - 1) * 14%); gap: 4px 10px; }
  .step-rung { grid-row: span 2; align-self: start; }
  .step-who { flex-direction: row; gap: 8px; align-items: baseline; flex-wrap: wrap; }
  .cue { grid-template-columns: 1fr; }
  .cue-who { grid-row: auto; color: var(--accent); }
  .scene-h { flex-direction: column; }

  .deck {
    position: fixed; inset: auto 0 0 0; top: auto; height: auto; max-height: 82dvh; z-index: 40;
    border: 0; border-top: var(--bw) solid var(--line); border-radius: 18px 18px 0 0;
    transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -18px 40px -20px #0008;
  }
  [data-skin="a"] .deck { border-radius: 0; }
  [data-skin="b"] .deck { top: auto; height: auto; }
  .sheet .deck { transform: none; }
  .deck-close { display: inline-flex; position: absolute; right: 12px; top: 12px; border: 0; }
  [data-skin="a"] .deck-close { color: var(--accent-ink); }
  .deck-in { padding: 22px 20px 26px; }
  .deck-empty { display: none; }

  .nowbar {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
    align-items: stretch; background: var(--ink); color: var(--bg); border-radius: var(--r-btn); box-shadow: 0 12px 30px -12px #000a;
  }
  [data-skin="a"] .nowbar { background: var(--ink); color: var(--accent-ink); box-shadow: inset 0 6px 0 var(--accent), 0 12px 30px -12px #000a; }
  [data-skin="b"] .nowbar { background: var(--accent); color: var(--accent-ink); border-radius: 22px 22px 8px 8px; border: 1.5px solid var(--accent-3); }
  [data-skin="c"] .nowbar { background: #3a271c; color: var(--ink); border: 1px solid var(--line); }
  .nowbar-main { flex: 1; min-width: 0; display: grid; text-align: left; background: none; border: 0; padding: 10px 14px 12px; position: relative; }
  .nowbar-who { font-size: .82rem; font-weight: 500; opacity: .85; }
  .nowbar-hu { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
  .nowbar-prog { position: absolute; left: 14px; right: 14px; bottom: 6px; height: 3px; background: #ffffff26; overflow: hidden; border-radius: 2px; }
  .nowbar-prog i { display: block; height: 100%; background: var(--accent-3); transform-origin: left; transform: scaleX(0); }
  .nowbar-stop { color: inherit; border: 0; width: 52px; min-height: 52px; }
  .nowbar:not(.live) .nowbar-stop { opacity: .4; }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
  .seg button { padding: 6px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* playing state last, so it wins over each skin's hover */
.ln.playing, [data-skin] .ln.playing { background: var(--play); color: var(--play-ink); border-color: var(--play); }

[data-skin] .ln.playing .ln-task, [data-skin] .ln.playing .ln-en, [data-skin] .ln.playing .ln-src { color: inherit; opacity: .88; }
