/* Klangwald – design system */
:root {
  --bg: #FFF7E8; --card: #FFFFFF; --ink: #1F2747; --soft: #5A6385; --line: #EDE5D2; --cream2: #FFEFD0;
  --coral: #F25C45; --sky: #38A8E8; --sun: #FFC533; --plum: #8B5FD1; --terra: #C27A45; --slate: #5B6781; --forest: #23A06B; --forest-d: #157A50;
  --hu: #157A50; --en: #68718F;
  --r: 22px; --r-s: 14px;
  --shadow: 0 1px 0 rgba(31, 39, 71, .05), 0 16px 32px -20px rgba(31, 39, 71, .38);
  --shadow-s: 0 1px 0 rgba(31, 39, 71, .06), 0 8px 18px -14px rgba(31, 39, 71, .4);
  --font-d: 'Fredoka', ui-rounded, system-ui, sans-serif; --font-b: 'Nunito', system-ui, -apple-system, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-b); font-size: 17px; line-height: 1.5; color: var(--ink); background: var(--bg);
  background-image: radial-gradient(60rem 30rem at 110% -10%, #FFE9B8 0, transparent 60%), radial-gradient(50rem 28rem at -20% 30%, #E4F5EA 0, transparent 60%);
  background-attachment: fixed; min-height: 100vh; padding-bottom: calc(96px + var(--safe-b)); -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
h1, h2, h3 { font-family: var(--font-d); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 .7em; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 10px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- languages ---------- */
.tx { display: block; }
.tx.inline, .tx.inline > .de { display: inline; }
.tx .de { display: block; }
.tx .hu, .tx .en, .sub-title .hu, .sub-title .en, .chelp .hu, .chelp .en, .vw .hu, .vw .en { display: none; }
.tx .hu, .hu { color: var(--hu); font-style: italic; font-weight: 600; font-size: .88em; }
.tx .en, .en { color: var(--en); font-weight: 600; font-size: .8em; }
body.show-hu .tx .hu, body.show-hu .sub-title .hu, body.show-hu .chelp .hu, body.show-hu .vw .hu { display: block; }
body.show-en .tx .en, body.show-en .sub-title .en, body.show-en .chelp .en, body.show-en .vw .en { display: block; }
.tx.inline .de { display: inline; }
body.show-hu .tx.inline .hu, body.show-en .tx.inline .en { display: inline; }
body.show-hu .tx.inline .hu::before, body.show-en .tx.inline .en::before { content: " · "; font-style: normal; }
.tx .huopt { color: var(--ink); font-style: normal; font-size: 1em; font-weight: 700; display: block !important; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--safe-t)) clamp(14px, 4vw, 28px) 10px; background: rgba(255, 247, 232, .86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: var(--shadow-s); }
.brand .word { font-family: var(--font-d); font-weight: 600; font-size: 1.45rem; letter-spacing: -.02em; }
.brand .word em { font-style: normal; color: var(--forest); }
.tools { display: flex; gap: 6px; }
.pill { border: 0; background: #fff; border-radius: 999px; height: 40px; min-width: 44px; padding: 0 12px; font-family: var(--font-d); font-weight: 600; font-size: .95rem; color: var(--soft);
  box-shadow: var(--shadow-s); display: inline-flex; align-items: center; justify-content: center; transition: transform .12s, background .15s, color .15s; }
.pill.icon { padding: 0; width: 40px; }
.pill svg { width: 21px; height: 21px; }
.pill[aria-pressed="true"]:not(.icon) { background: var(--forest); color: #fff; }
.pill#toggle-en[aria-pressed="true"] { background: var(--slate); }
.pill:active { transform: scale(.94); }

/* ---------- layout ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 8px clamp(14px, 4vw, 28px) 24px; }
.wrap.narrow { max-width: 760px; }
#view.enter { animation: rise .38s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.block { margin-top: clamp(28px, 5vw, 44px); }
.h { font-size: clamp(1.35rem, 3.4vw, 1.75rem); margin-bottom: 14px; }
.h .hu, .h .en { font-family: var(--font-b); }
.card { background: var(--card); border-radius: var(--r); padding: clamp(18px, 3.4vw, 28px); box-shadow: var(--shadow); margin-top: 18px; }
.card.soft { background: var(--cream2); box-shadow: none; }
.card.dashed { background: transparent; box-shadow: none; border: 2px dashed #DDD3BC; }
.card > h2 { font-size: 1.35rem; margin-bottom: 8px; }
.muted { color: var(--soft); font-size: .95rem; }
.small { font-size: .85rem; }
.center { text-align: center; justify-content: center; }
.intro { font-size: 1.08rem; margin: 6px 0 16px; max-width: 46rem; }
.eyebrow { font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); margin: 0 0 6px; display: block; }
.eyebrow .tx .hu, .eyebrow .tx .en { font-style: normal; font-size: 1em; color: inherit; }
.tag { display: inline-block; background: var(--cream2); border-radius: 999px; padding: 3px 12px; font-size: .78rem; font-weight: 800; letter-spacing: .04em; color: var(--soft); margin: 2px 0 10px; }
.backlink { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 800; color: var(--soft); padding: 8px 12px 8px 4px; margin: 2px 0 2px -4px; border-radius: 12px; }
.backlink svg { width: 20px; height: 20px; }

/* ---------- buttons ---------- */
.btn { --b: #fff; --f: var(--ink); --d: #D9D0BB; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-align: left; text-decoration: none; border: 0; border-radius: 18px;
  padding: 12px 20px; min-height: 52px; background: var(--b); color: var(--f); font-family: var(--font-d); font-weight: 600; font-size: 1.06rem; line-height: 1.15;
  box-shadow: 0 4px 0 var(--d); transition: transform .1s, box-shadow .1s, filter .15s; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn .tx .hu, .btn .tx .en { font-family: var(--font-b); font-size: .78em; }
.btn.primary { --b: var(--forest); --f: #fff; --d: #14784F; }
.btn.primary .tx .hu { color: #D9F5E6; } .btn.primary .tx .en { color: #C9EBDB; }
.btn:hover { filter: brightness(1.03); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--d); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.round { width: 52px; padding: 0; border-radius: 50%; }
.btn.small { min-height: 42px; padding: 8px 16px; font-size: .95rem; }
.btnrow { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.say { border: 0; background: var(--cream2); color: var(--ink); border-radius: 999px; min-height: 40px; min-width: 40px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .9rem; transition: transform .12s, background .15s; }
.say svg { width: 20px; height: 20px; }
.say:hover { background: var(--sun); } .say:active { transform: scale(.92); }

/* ---------- tab bar ---------- */
.tabs { position: fixed; left: 50%; bottom: calc(12px + var(--safe-b)); transform: translateX(-50%); z-index: 40; display: flex; gap: 2px; background: var(--ink); border-radius: 26px; padding: 6px;
  box-shadow: 0 18px 36px -14px rgba(31, 39, 71, .6); width: min(560px, calc(100vw - 20px)); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: #B9C0D8; padding: 8px 2px 7px; border-radius: 20px; font-family: var(--font-d); font-weight: 500; font-size: .76rem; line-height: 1.1; text-align: center; transition: background .18s, color .18s; }
.tabs a svg { width: 24px; height: 24px; }
.tabs a .tx .hu, .tabs a .tx .en { font-size: .82em; font-style: normal; color: inherit; opacity: .8; font-family: var(--font-b); }
.tabs a.on { background: var(--sun); color: var(--ink); }
body.in-game .tabs { display: none; }
body.in-game { padding-bottom: 24px; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(18px, 4vw, 44px); align-items: center; margin-top: 6px; }
.hero-art { position: relative; border-radius: 30px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16 / 10; background: #FBF1D6; }
.hero-img { width: 100%; height: 100%; object-fit: cover; animation: breathe 14s ease-in-out infinite alternate; transform-origin: 30% 60%; }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.06); } }
.fnote { position: absolute; color: var(--ink); opacity: 0; animation: floaty 6s ease-in infinite; }
.fnote svg { width: 26px; height: 26px; }
.fnote.n1 { left: 44%; top: 36%; animation-delay: .2s; } .fnote.n2 { left: 52%; top: 30%; animation-delay: 2.2s; color: var(--coral); } .fnote.n3 { left: 38%; top: 32%; animation-delay: 4.1s; color: var(--plum); }
@keyframes floaty { 0% { opacity: 0; transform: translate(0, 10px) rotate(-8deg) scale(.7); } 15% { opacity: .95; } 100% { opacity: 0; transform: translate(34px, -90px) rotate(14deg) scale(1.1); } }
.fly { position: absolute; width: 13%; top: 12%; left: -16%; animation: fly 16s linear infinite; animation-delay: 3s; }
@keyframes fly { 0% { left: -16%; top: 16%; } 12% { top: 8%; } 25% { top: 15%; } 38% { top: 7%; } 50% { left: 104%; top: 12%; } 100% { left: 104%; top: 12%; } }
.hero-copy h1 { font-size: clamp(2.5rem, 7vw, 4.2rem); line-height: .98; letter-spacing: -.03em; }
.hero-copy h1 em { font-style: normal; color: var(--coral); }
.sub-title { font-family: var(--font-d); margin: 8px 0 0; }
.sub-title .hu { font-size: 1.5rem; font-style: normal; font-weight: 500; }
.sub-title .en { font-size: 1.1rem; font-weight: 500; }
.lead { font-size: 1.12rem; margin-top: 12px; color: var(--soft); }
.lead .tx .de { color: var(--ink); font-weight: 700; }

.progress { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; margin-top: clamp(24px, 4vw, 36px); }
.ring { --p: 0; width: 86px; height: 86px; border-radius: 50%; background: conic-gradient(var(--sun) calc(var(--p) * 1%), #F3EAD4 0); display: grid; place-items: center; }
.ring > div { width: 64px; height: 64px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.ring b { font-family: var(--font-d); font-size: 1.5rem; }
.ring small { font-size: .72rem; color: var(--soft); font-weight: 800; }
.pg-text h2 { font-size: 1.3rem; margin-bottom: 4px; }
.pg-text p { margin: 0; color: var(--soft); font-size: .95rem; }

.cast { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(6px, 1.6vw, 16px); }
.castb { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.bubble { width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--s); display: grid; place-items: center; position: relative; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s; box-shadow: inset 0 -6px 0 rgba(31, 39, 71, .06); }
.bubble { overflow: hidden; }
.bubble img { position: absolute; left: 12%; top: 12%; width: 76%; height: 76%; object-fit: contain; animation: bob 3.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6%); } }
.castb:hover .bubble, .castb:focus-visible .bubble { transform: scale(1.08) rotate(-3deg); }
.castb .nm { font-family: var(--font-d); font-weight: 600; font-size: .98rem; line-height: 1.15; }
.castb .nm .hu, .castb .nm .en { font-family: var(--font-b); font-size: .78em; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; text-decoration: none; background: var(--card); border-radius: var(--r); padding: 16px 16px 18px; box-shadow: var(--shadow); overflow: hidden; transition: transform .18s, box-shadow .18s; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 118px; background: var(--s); }
.tile-pic { position: relative; height: 104px; display: grid; place-items: center; margin-bottom: 6px; }
.tile-pic img { max-height: 100px; width: auto; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.tile:hover { transform: translateY(-4px); } .tile:hover .tile-pic img { transform: scale(1.1) rotate(-4deg); }
.tile-t { font-family: var(--font-d); font-weight: 600; font-size: 1.16rem; line-height: 1.15; }
.tile-t .hu, .tile-t .en { font-family: var(--font-b); }
.tile-d { color: var(--soft); font-size: .92rem; line-height: 1.35; padding-right: 30px; }
.tile .go { position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; }
.tile .go svg { width: 18px; height: 18px; }

.goals ol { list-style: none; margin: 10px 0 0; padding: 0; }
.goals li { display: grid; grid-template-columns: 38px 1fr 40px; gap: 12px; align-items: center; padding: 12px 0; border-top: 1.500px solid var(--line); }
.goals li:first-child { border-top: 0; }
.gcheck { width: 36px; height: 36px; border-radius: 12px; background: #F3EAD4; color: var(--soft); display: grid; place-items: center; font-family: var(--font-d); font-weight: 600; }
.goals li.ok .gcheck { background: var(--forest); color: #fff; }
.gcheck svg { width: 20px; height: 20px; }
.goals .tx .de { font-weight: 700; }
.mini { width: 40px; height: 40px; border-radius: 50%; background: var(--cream2); display: grid; place-items: center; text-decoration: none; }
.mini svg { width: 18px; height: 18px; }
.forest { margin: 34px -6px -30px; opacity: .9; }
.forest img { width: 100%; }

/* ---------- page head ---------- */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--c); color: #fff; border-radius: 28px; padding: clamp(18px, 4vw, 30px) clamp(20px, 4vw, 34px); margin: 6px 0 20px; min-height: 132px; position: relative; overflow: hidden; }
.pagehead::after { content: ""; position: absolute; right: -40px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.pagehead h1 { font-size: clamp(1.9rem, 5.4vw, 2.9rem); }
.pagehead .eyebrow { color: rgba(255, 255, 255, .86); }
.pagehead .tx .hu { color: #fff; opacity: .95; font-family: var(--font-b); font-size: .52em; margin-top: 4px; }
.pagehead .tx .en { color: #fff; opacity: .82; font-family: var(--font-b); font-size: .42em; }
.pagehead .eyebrow .tx .hu, .pagehead .eyebrow .tx .en { font-size: 1em; margin: 0; }
.ph-pic { position: relative; z-index: 1; flex: none; width: clamp(84px, 20vw, 128px); height: clamp(84px, 20vw, 128px); background: #fff; border-radius: 50%; display: grid; place-items: center; }
.ph-pic img { animation: bob 3.6s ease-in-out infinite; }

.facts { margin: 4px 0 0; padding: 0; list-style: none; }
.facts li { position: relative; padding: 9px 0 9px 26px; border-top: 1.500px solid var(--line); }
.facts li:first-child { border-top: 0; }
.facts li::before { content: ""; position: absolute; left: 4px; top: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--sun); }
.steps { margin: 8px 0 0; padding-left: 22px; } .steps li { padding: 5px 0; }

.timeline { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6%; right: 6%; top: 21px; height: 4px; background: #EADFF8; border-radius: 4px; }
.timeline li { position: relative; text-align: center; font-size: .92rem; line-height: 1.3; }
.timeline li b { display: inline-grid; place-items: center; min-width: 70px; height: 42px; padding: 0 12px; border-radius: 999px; background: var(--plum); color: #fff; font-family: var(--font-d); font-weight: 600; font-size: 1.05rem; margin-bottom: 8px; position: relative; }
.timeline li b .tx .hu, .timeline li b .tx .en { color: #fff; font-style: normal; font-size: .8em; }

.flips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; perspective: 1000px; }
.flip { position: relative; border: 0; background: none; padding: 0; min-height: 138px; text-align: center; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3, 1.3, .5, 1); }
.flip .face { position: absolute; inset: 0; border-radius: 18px; padding: 14px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; font-weight: 700; line-height: 1.3; }
.flip .front { background: #EDE5FA; }
.flip .back { background: var(--plum); color: #fff; transform: rotateY(180deg); font-family: var(--font-d); font-weight: 600; font-size: 1.15rem; }
.flip .back .tx .hu, .flip .back .tx .en { color: #fff; opacity: .9; font-family: var(--font-b); }
.flip.on { transform: rotateY(180deg); }

/* ---------- story ---------- */
.story-fig { margin: 0; }
.frame { position: relative; border-radius: 22px; overflow: hidden; background: #FBF1D6; aspect-ratio: 4 / 3; }
.frame img { width: 100%; height: 100%; object-fit: cover; animation: zoomin .7s cubic-bezier(.2, .8, .2, 1); }
@keyframes zoomin { from { transform: scale(1.08); opacity: .4; } to { transform: none; opacity: 1; } }
.frame .badge { position: absolute; left: 14px; top: 14px; width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-family: var(--font-d); font-weight: 600; font-size: 1.4rem; box-shadow: var(--shadow-s); }
.story figcaption h2, .story-end h2 { font-size: 1.5rem; margin: 18px 0 8px; }
.story-text { font-size: 1.14rem; line-height: 1.55; }
.story-text .tx .hu { font-size: .92em; margin-top: 6px; } .story-text .tx .en { font-size: .86em; margin-top: 4px; }
.story-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.dots { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.dots button { width: 14px; height: 14px; border-radius: 50%; border: 0; background: #E8DFC9; padding: 0; transition: transform .15s, background .15s; }
.dots button.on { background: var(--forest); transform: scale(1.35); }
.story-end { text-align: center; }
.end-pic { display: flex; justify-content: center; align-items: flex-end; gap: 10px; height: 170px; }
.end-pic img { height: 170px; width: auto; animation: bob 3s ease-in-out infinite; }
.end-pic img + img { animation-delay: .5s; height: 150px; }

/* ---------- characters + instruments ---------- */
.pairs { display: grid; gap: 12px; }
.pairc { border: 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 18px; display: grid; grid-template-columns: 84px 1.1fr 28px 84px 1.1fr; gap: 14px; align-items: center; text-align: left; transition: transform .16s; }
.pairc:hover { transform: translateY(-3px); }
.pp { width: 84px; height: 84px; border-radius: 50%; background: var(--s); display: grid; place-items: center; }
/* Picture boxes: the image fills a positioned box, so tall or wide art can never push the layout. */
.pp, .inp, .gpic, .qpic, .opt .opic, .mpic, .duo-a, .duo-b, .solo, .ph-pic { position: relative; }
.pp img, .inp img, .gpic img, .qpic img, .opt .opic img, .mpic img, .duo-a img, .duo-b img, .solo img, .ph-pic img { position: absolute; inset: var(--pad, 12%); width: calc(100% - 2 * var(--pad, 12%)); height: calc(100% - 2 * var(--pad, 12%)); max-width: none; max-height: none; object-fit: contain; }
.pp { --pad: 14%; } .inp, .qpic { --pad: 0%; } .opt .opic, .mpic, .duo-a, .duo-b { --pad: 4%; } .solo { --pad: 18px; } .ph-pic { --pad: 13%; }
.pp.tall, .gpic.tall { --pad: 3%; }
.pp.ins { border-radius: 22px; }
.pp.tall img, .inp.tall img, .gpic.tall img, .opic.tall img, .mpic.tall img, .qpic.tall img, .duo-b.tall img, .solo.tall img { transform: rotate(40deg); }
.pn { font-family: var(--font-d); font-weight: 600; font-size: 1.14rem; line-height: 1.15; }
.pn .hu, .pn .en { font-family: var(--font-b); }
.arrow { color: var(--c); }
.fams { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.famc { background: var(--s); border-radius: var(--r); padding: 18px; }
.famc h3 { font-size: 1.24rem; margin-bottom: 6px; } .famc h3 .hu, .famc h3 .en { font-family: var(--font-b); }
.famc p { font-size: .95rem; margin-bottom: 12px; }
.fam-items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.inb { border: 0; background: #fff; border-radius: 18px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; text-align: left; font-family: var(--font-d); font-weight: 600; box-shadow: var(--shadow-s); transition: transform .14s; line-height: 1.15; }
.inb .hu, .inb .en { font-family: var(--font-b); }
.inb:hover { transform: translateY(-2px) rotate(-.6deg); }
.inp { width: 58px; height: 58px; flex: none; display: grid; place-items: center; }
.strings-strip { margin-bottom: 14px; }
.inb.wide { width: 100%; flex-direction: column; padding: 18px; text-align: center; }
.inb.wide img { max-height: 150px; width: auto; }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(31, 39, 71, .5); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .18s; }
.sheet-backdrop[hidden] { display: none; }
.sheet-backdrop.open { opacity: 1; }
.sheet { position: relative; background: var(--bg); width: min(680px, 100%); max-height: 92vh; overflow: auto; border-radius: 28px 28px 0 0; padding: 22px clamp(18px, 4vw, 30px) calc(28px + var(--safe-b)); transform: translateY(30px); transition: transform .26s cubic-bezier(.2, .9, .3, 1); }
.sheet-backdrop.open .sheet { transform: none; }
.sheet-close { position: sticky; top: 0; float: right; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow-s); display: grid; place-items: center; margin: -6px -6px 0 8px; }
.sheet-h { font-size: 1.7rem; margin: 10px 0 6px; } .sheet-h .hu, .sheet-h .en { font-family: var(--font-b); }
.sheet h3 { font-size: 1.1rem; margin: 18px 0 8px; } .sheet h3 .hu, .sheet h3 .en { font-family: var(--font-b); }
.duo { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; background: var(--s); border-radius: 24px; padding: 16px; margin-top: 8px; clear: both; }
.duo-a, .duo-b { height: 160px; display: grid; place-items: center; }
.duo-a img { animation: bob 3s ease-in-out infinite; }
.duo-eq { color: var(--c); } .duo-eq svg { width: 32px; height: 32px; animation: bob 2s ease-in-out infinite; }
.solo { background: var(--s); border-radius: 24px; padding: 18px; height: 200px; display: grid; place-items: center; clear: both; }
.pairline { font-family: var(--font-d); font-weight: 600; font-size: 1.14rem; } .pairline .hu, .pairline .en { font-family: var(--font-b); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.chip { background: var(--s); border-radius: 999px; padding: 7px 16px; font-family: var(--font-d); font-weight: 600; line-height: 1.15; }
.chip .hu, .chip .en { font-family: var(--font-b); }
.why { background: #fff; border-radius: 18px; padding: 14px 16px; font-weight: 700; }
.player { aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #000; margin: 12px 0 16px; clear: both; }
.player iframe { width: 100%; height: 100%; border: 0; }

/* ---------- practice hub ---------- */
.games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gcard { position: relative; display: grid; grid-template-columns: 76px 1fr; grid-template-areas: "p t" "p d" "p s"; column-gap: 14px; row-gap: 2px; align-items: center; text-decoration: none; background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); transition: transform .16s; }
.gcard:hover { transform: translateY(-3px); }
.gpic { grid-area: p; width: 76px; height: 76px; border-radius: 22px; background: var(--cream2); display: grid; place-items: center; overflow: hidden; }
.gpic img { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.gpic.photo { --pad: 0%; } .gpic.photo img { object-fit: cover; }
.gcard:hover .gpic img { transform: scale(1.12) rotate(-5deg); } .gcard:hover .gpic.tall img { transform: rotate(40deg) scale(1.1); }
.gt { grid-area: t; font-family: var(--font-d); font-weight: 600; font-size: 1.08rem; line-height: 1.15; } .gt .hu, .gt .en { font-family: var(--font-b); }
.gd { grid-area: d; color: var(--soft); font-size: .86rem; line-height: 1.3; }
.gcard .stars { grid-area: s; margin-top: 4px; }
.stars { display: inline-flex; gap: 2px; color: #E7DDC6; }
.stars svg { width: 20px; height: 20px; } .stars .on { color: var(--sun); }

/* ---------- game shell + quiz ---------- */
.gamebar { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; margin-top: 4px; }
.gtitle { font-family: var(--font-d); font-weight: 600; font-size: 1.2rem; line-height: 1.15; } .gtitle .hu, .gtitle .en { font-family: var(--font-b); }
.gcount { font-family: var(--font-d); font-weight: 600; color: var(--soft); }
.bar { height: 10px; border-radius: 10px; background: #EFE6D0; margin: 12px 0 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--forest); border-radius: 10px; transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.quiz { text-align: center; }
.qpic { height: 150px; display: grid; place-items: center; margin-bottom: 10px; }
.qpic img { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.qpic.large { height: 190px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.qpic.tall img { animation: none; }
.prompt { font-family: var(--font-d); font-weight: 600; font-size: clamp(1.2rem, 3.6vw, 1.5rem); line-height: 1.25; margin: 4px auto 18px; max-width: 34rem; }
.prompt .hu, .prompt .en { font-family: var(--font-b); margin-top: 4px; }
.prompt .quote .de { font-family: var(--font-b); font-weight: 700; font-size: .9em; line-height: 1.45; }
.prompt .vq { display: block; font-size: 1.6em; } .art { color: var(--soft); font-weight: 500; } .pl { color: var(--soft); font-weight: 500; font-size: .8em; }
.opts { display: grid; gap: 12px; }
.opts.list { grid-template-columns: 1fr; max-width: 34rem; margin: 0 auto; }
.opts.two, .opts.pics { grid-template-columns: 1fr 1fr; }
.opt { border: 0; background: #FBF4E4; border-radius: 20px; padding: 14px 16px; min-height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 1.04rem; line-height: 1.25;
  box-shadow: 0 4px 0 #E4D9BF; transition: transform .1s, box-shadow .1s, background .15s; }
.opts.list .opt { text-align: left; align-items: flex-start; }
.opt:hover { background: #FFF0CC; } .opt:active { transform: translateY(3px); box-shadow: 0 1px 0 #E4D9BF; }
.opt .opic { height: 96px; display: grid; place-items: center; width: 100%; }
.opt.good { background: #D8F3E4; box-shadow: 0 4px 0 #9FD9BC; animation: yes .45s; }
.opt.bad { background: #FDE0DA; box-shadow: 0 4px 0 #F2B3A8; animation: shake .4s; }
.opt:disabled { cursor: default; } .opt:disabled:not(.good):not(.bad) { opacity: .55; }
@keyframes yes { 40% { transform: scale(1.04); } }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.shake { animation: shake .4s; }
.feedback { margin-top: 18px; display: grid; gap: 14px; justify-items: center; }
.fbbox { border-radius: 18px; padding: 12px 18px; text-align: left; width: 100%; max-width: 34rem; }
.fbbox.center { text-align: center; }
.fbbox.good { background: #D8F3E4; } .fbbox.bad { background: #FFF0CC; }
.fbbox b { font-family: var(--font-d); font-weight: 600; font-size: 1.14rem; display: block; }
.fbbox .fbline { display: block; margin-top: 4px; font-weight: 700; font-size: .98rem; }

.result { text-align: center; }
.res-pic { height: 170px; display: grid; place-items: center; }
.res-pic img { height: 170px; width: auto; animation: dance 1.1s ease-in-out infinite alternate; }
@keyframes dance { from { transform: rotate(-5deg) translateY(0); } to { transform: rotate(5deg) translateY(-8px); } }
.bigstars { display: flex; justify-content: center; gap: 8px; margin: 12px 0 4px; color: #E7DDC6; }
.bigstars svg { width: 58px; height: 58px; }
.bigstars .on { color: var(--sun); animation: starpop .5s cubic-bezier(.3, 1.8, .5, 1) both; animation-delay: calc(var(--i) * .16s + .15s); }
@keyframes starpop { from { transform: scale(0) rotate(-40deg); } to { transform: none; } }
.score { font-family: var(--font-d); font-weight: 600; font-size: 2.2rem; margin: 4px 0; }
.res-msg { font-size: 1.1rem; font-weight: 700; }

/* memory */
.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; perspective: 1000px; }
.mcard { position: relative; aspect-ratio: 3 / 4; border: 0; background: none; padding: 0; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.3, 1.3, .5, 1); }
.mface { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mback { background: var(--forest); color: #fff; box-shadow: 0 4px 0 #14784F; background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .16) 0 18%, transparent 19%), radial-gradient(circle at 82% 78%, rgba(255, 255, 255, .12) 0 22%, transparent 23%); }
.mback svg { width: 38%; height: auto; }
.mfront { background: var(--s); transform: rotateY(180deg); padding: 6px; gap: 4px; box-shadow: 0 4px 0 rgba(31, 39, 71, .12); }
.mpic { flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; }
.mt { font-family: var(--font-d); font-weight: 600; font-size: .82rem; line-height: 1.1; text-align: center; } .mt .hu, .mt .en { font-family: var(--font-b); font-size: .82em; }
.mcard.open, .mcard.done { transform: rotateY(180deg); }
.mcard.done .mfront { outline: 4px solid var(--forest); outline-offset: -4px; }

/* order */
.ordergrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ocard { position: relative; border: 0; padding: 0; background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-s); text-align: left; transition: transform .15s; }
.ocard img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ocard:hover { transform: translateY(-3px); }
.onum { position: absolute; left: 8px; top: 8px; width: 38px; height: 38px; border-radius: 50%; background: #fff; display: none; place-items: center; font-family: var(--font-d); font-weight: 600; font-size: 1.2rem; }
.ocap { display: none; padding: 8px 10px 10px; font-weight: 800; font-size: .86rem; line-height: 1.25; }
.ocard.done { outline: 4px solid var(--forest); outline-offset: -4px; } .ocard.done .onum { display: grid; background: var(--forest); color: #fff; animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); } .ocard.done .ocap { display: block; }

/* cloze */
.bankw { display: flex; flex-wrap: wrap; gap: 8px; background: var(--cream2); border-radius: 18px; padding: 12px; margin: 10px 0 16px; min-height: 64px; }
.cword { border: 0; background: #fff; border-radius: 999px; padding: 8px 16px; font-family: var(--font-d); font-weight: 600; font-size: 1.04rem; box-shadow: 0 3px 0 #E4D9BF; transition: transform .1s, opacity .15s; }
.cword:active { transform: translateY(2px); } .cword.used { opacity: .25; box-shadow: none; }
.ctext { font-size: 1.16rem; line-height: 2.35; }
.gap { border: 0; min-width: 92px; min-height: 40px; border-radius: 12px; background: #F3EAD4; padding: 2px 12px; font-family: var(--font-d); font-weight: 600; font-size: 1.04rem; vertical-align: middle; box-shadow: inset 0 -3px 0 #E0D5BB; }
.gap.full { background: #E0F2FC; box-shadow: inset 0 -3px 0 #B5DCF4; } .gap.good { background: #D8F3E4; box-shadow: none; } .gap.bad { background: #FDE0DA; box-shadow: none; text-decoration: line-through; }
.fix { font-family: var(--font-d); font-weight: 600; color: var(--forest-d); margin-left: 6px; }
.chelp { margin-top: 12px; line-height: 1.5; }

/* ---------- words ---------- */
.catbar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 -2px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.cat { flex: none; border: 0; background: var(--s); border-radius: 18px; padding: 10px 16px 10px 10px; display: flex; align-items: center; gap: 10px; text-align: left; font-family: var(--font-d); font-weight: 600; font-size: .96rem; line-height: 1.15; max-width: 240px; scroll-snap-align: start; transition: transform .14s; }
.cat .hu, .cat .en { font-family: var(--font-b); }
.cat b { flex: none; width: 30px; height: 30px; border-radius: 10px; background: var(--c); color: #fff; display: grid; place-items: center; }
.cat.on { background: var(--ink); color: #fff; } .cat.on .tx .hu { color: #BFE8D2; } .cat.on .tx .en { color: #C9CEDD; }
.vhead { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.vhead h2 { font-size: 1.4rem; } .vhead h2 .hu, .vhead h2 .en { font-family: var(--font-b); }
.vlist { list-style: none; margin: 8px 0 0; padding: 0; }
.vlist li { display: grid; grid-template-columns: 44px 1fr 44px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1.500px solid var(--line); }
.know { width: 40px; height: 40px; border-radius: 50%; border: 2.500px solid #DDD3BC; background: #fff; color: transparent; display: grid; place-items: center; transition: transform .14s, background .15s; }
.know svg { width: 20px; height: 20px; }
.vlist li.known .know { background: var(--forest); border-color: var(--forest); color: #fff; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.vw { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 4px 16px; align-items: baseline; }
.vde { font-weight: 800; font-size: 1.1rem; }
.vw .hu, .vw .en { font-size: 1rem; }

/* ---------- discover ---------- */
.themes { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(6px, 1.6vw, 14px); }
.thm { position: relative; border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-family: var(--font-d); font-weight: 600; font-size: .95rem; line-height: 1.15; }
.thm .hu, .thm .en { font-family: var(--font-b); font-size: .8em; }
.thm .vplay.small { position: absolute; right: 0; top: 0; width: 34px; height: 34px; }
.thm:hover .bubble { transform: scale(1.07) rotate(3deg); }
.vplay { flex: none; width: 54px; height: 54px; border-radius: 50%; background: var(--coral); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 0 #C2412D; }
.vplay svg { width: 24px; height: 24px; margin-left: 3px; } .vplay.small svg { width: 16px; height: 16px; margin-left: 2px; }
.vlistc, .alist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.vcard, .acard { border: 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; text-align: left; text-decoration: none; transition: transform .16s; }
.acard { grid-template-columns: 1fr auto; }
.vcard:hover, .acard:hover { transform: translateY(-3px); }
.vmeta { display: grid; gap: 2px; min-width: 0; }
.vt { font-family: var(--font-d); font-weight: 600; font-size: 1.06rem; line-height: 1.2; }
.vby { font-size: .8rem; font-weight: 800; color: var(--soft); letter-spacing: .02em; }
.vn { font-size: .9rem; line-height: 1.35; margin-top: 2px; }
.vtags { display: grid; gap: 6px; justify-items: end; color: var(--soft); }
.vtags svg { width: 20px; height: 20px; }
.lang { border-radius: 999px; padding: 2px 10px; font-size: .74rem; font-weight: 800; letter-spacing: .04em; background: #E0F2FC; color: #17638F; white-space: nowrap; }
.lang.l-hu { background: #DDF3E8; color: var(--forest-d); } .lang.l-en { background: #EDE5FA; color: #5A36A0; }
.mins { font-size: .78rem; font-weight: 800; white-space: nowrap; }

/* ---------- fx ---------- */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.fx i { position: absolute; top: 62%; width: 11px; height: 11px; animation: burst 1.5s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes burst { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 55vh)) rotate(var(--r)); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, 1fr); } .games { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; } .hero-copy { text-align: left; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand .word { font-size: 1.2rem; } .brand img { width: 36px; height: 36px; }
  .pill { height: 38px; min-width: 40px; padding: 0 10px; } .pill.icon { width: 38px; }
  .cast, .themes { grid-template-columns: repeat(4, 1fr); row-gap: 16px; }
  .games, .vlistc, .alist, .fams { grid-template-columns: 1fr; }
  .progress { grid-template-columns: auto 1fr; } .progress .btn { grid-column: 1 / -1; }
  .timeline { grid-template-columns: 1fr 1fr; row-gap: 16px; } .timeline::before { display: none; }
  .flips { grid-template-columns: 1fr 1fr; }
  .pairc { grid-template-columns: 60px 1fr 20px 60px 1fr; gap: 8px; padding: 10px 12px; } .pp { width: 60px; height: 60px; } .pn { font-size: .98rem; }
  .ordergrid { grid-template-columns: 1fr 1fr; }
  .memory { gap: 7px; } .mt { font-size: .7rem; }
  .vw { grid-template-columns: 1fr; gap: 0; }
  .opt .opic { height: 78px; } .qpic { height: 120px; }
  .duo-a, .duo-b { height: 120px; }
  .pagehead { min-height: 108px; border-radius: 24px; }
  .tabs a { font-size: .7rem; }
}
@media (min-width: 900px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 28px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
