/* KopfKinoX.lol – neon brain theme */
:root {
  --bg: #07051a;
  --bg2: #110a2e;
  --panel: rgba(255, 255, 255, .055);
  --panel-2: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .13);
  --ink: #f5f2ff;
  --muted: #aaa3cc;
  --yellow: #ffd600;
  --pink: #ff2e88;
  --cyan: #00e5ff;
  --green: #26de6e;
  --red: #ff3b50;
  --purple: #965aff;
  --orange: #ff9100;
  --radius: 22px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --font: "Segoe UI", system-ui, -apple-system, "SF Pro Display", Roboto, "Helvetica Neue", Arial, sans-serif;
  --emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  color-scheme: dark;
}

@property --ang {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}
body::before { /* ambient glow */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(150, 90, 255, .28), transparent 60%),
    radial-gradient(800px 600px at 110% 20%, rgba(255, 46, 136, .18), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(0, 229, 255, .14), transparent 60%),
    linear-gradient(180deg, #0b0724, var(--bg));
}
#bg3d { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: .55; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg, canvas { max-width: 100%; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 900; }
h1 { font-size: clamp(2.4rem, 7vw, 5.2rem); }
h2 { font-size: clamp(1.8rem, 4.5vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }
p { margin: 0 0 1em; }
.emoji { font-family: var(--emoji); font-style: normal; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(820px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grad {
  background: linear-gradient(90deg, var(--yellow), var(--orange) 35%, var(--pink) 70%, var(--purple));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.grad-cool {
  background: linear-gradient(90deg, var(--cyan), var(--purple) 60%, var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 999; background: var(--yellow); color: #000; padding: 8px 14px; border-radius: 10px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: rgba(7, 5, 26, .62);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 900; font-size: 1.35rem; letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo svg { width: 38px; height: 38px; filter: drop-shadow(0 0 10px rgba(255, 46, 136, .6)); }
.logo b { color: var(--pink); }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--panel-2); text-decoration: none; }
.nav-links .btn { padding: 9px 18px; }
.burger { display: none; background: none; border: 1px solid var(--line); color: var(--ink); width: 44px; height: 44px; border-radius: 12px; font-size: 1.3rem; cursor: pointer; }
@media (max-width: 860px) {
  .burger { display: block; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: rgba(9, 6, 30, .97); border-bottom: 1px solid var(--line); padding: 12px 16px 20px;
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .25s;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { display: block; padding: 12px 14px; }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  --c1: var(--yellow); --c2: var(--orange);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 28px; border-radius: 999px; border: 0; cursor: pointer;
  font: 800 1.05rem/1 var(--font); color: #120a00;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 10px 30px rgba(255, 145, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform .15s, box-shadow .2s, filter .2s;
  text-decoration: none !important;
}
.btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 16px 40px rgba(255, 145, 0, .5); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.pink { --c1: #ff5aa5; --c2: var(--pink); color: #fff; box-shadow: 0 10px 30px rgba(255, 46, 136, .4); }
.btn.cyan { --c1: #6ff3ff; --c2: var(--cyan); color: #00161a; box-shadow: 0 10px 30px rgba(0, 229, 255, .35); }
.btn.ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.small { padding: 10px 18px; font-size: .92rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; min-height: calc(100vh - 68px); min-height: calc(100svh - 68px); display: grid; place-items: center; overflow: hidden; isolation: isolate; }
#brain3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; background: linear-gradient(transparent, var(--bg)); z-index: -1; pointer-events: none; }
.hero-inner { text-align: center; padding: 48px 0 90px; }
.hero-copy { max-width: 760px; margin: 0 auto; position: relative; }
.hero-copy::before { content: ""; position: absolute; inset: -40px -60px; z-index: -1; background: radial-gradient(closest-side, rgba(7, 5, 26, .6), transparent); pointer-events: none; }
@media (min-width: 1000px) {
  .hero-inner { text-align: left; }
  .hero-copy { margin: 0; max-width: 620px; }
  .hero-copy::before { inset: -60px -80px; }
  .hero .lead { margin-left: 0; }
  .hero .hero-cta, .hero .chips { justify-content: flex-start; }
}
.hero h1 { text-shadow: 0 0 40px rgba(150, 90, 255, .35); }
.hero h1 .line2 { display: block; }
.hero .lead { font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: #d8d2f5; max-width: 640px; margin: 0 auto 28px; }
.hero-bio { display: inline-flex; flex-direction: column; gap: 4px; text-align: left; margin: 0 auto 30px; padding: 16px 22px; border-radius: 18px; background: rgba(10, 6, 30, .55); border: 1px solid var(--line); backdrop-filter: blur(8px); font-weight: 700; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; background: rgba(0, 229, 255, .12); border: 1px solid rgba(0, 229, 255, .45); color: var(--cyan); font-weight: 800; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 20px; }
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: .9rem; animation: floaty 6s ease-in-out infinite; }
.chip:nth-child(2) { animation-delay: -2s; }
.chip:nth-child(3) { animation-delay: -4s; }
@keyframes floaty { 50% { transform: translateY(-8px); } }
.scroll-hint { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: .8rem; letter-spacing: .15em; text-transform: uppercase; animation: bob 2s infinite; }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* ---------------------------------------------------------------- sections */
section { padding: 90px 0; position: relative; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.kicker { color: var(--pink); font-weight: 900; letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; margin-bottom: 10px; display: block; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(40px) scale(.98); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- 3D tilt cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 22px; perspective: 1200px; }
.card3d {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  position: relative; border-radius: var(--radius); padding: 2px; color: var(--ink);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d;
  transition: transform .25s ease-out; text-decoration: none !important;
  background: conic-gradient(from var(--ang), var(--cyan), var(--purple), var(--pink), var(--yellow), var(--cyan));
  animation: spin-border 6s linear infinite;
  box-shadow: var(--shadow);
}
@keyframes spin-border { to { --ang: 360deg; } }
.card3d .inner {
  position: relative; border-radius: calc(var(--radius) - 2px); padding: 26px 24px 24px; height: 100%;
  background: linear-gradient(160deg, #1a1042, #0c0826 70%);
  transform-style: preserve-3d; overflow: hidden;
}
.card3d .inner::after { /* glare */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx) var(--my), rgba(255, 255, 255, .16), transparent 45%);
  opacity: 0; transition: opacity .3s;
}
.card3d:hover .inner::after { opacity: 1; }
.card3d .icon { font-size: 4rem; line-height: 1; display: block; margin-bottom: 16px; transform: translateZ(60px); filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .5)); font-family: var(--emoji); }
.card3d h3 { transform: translateZ(40px); }
.card3d p { color: var(--muted); transform: translateZ(25px); font-size: .97rem; }
.card3d .badge { position: absolute; top: 18px; right: 18px; transform: translateZ(50px); }
.card3d .go { display: inline-flex; gap: 8px; font-weight: 800; color: var(--yellow); transform: translateZ(35px); }
.badge { display: inline-block; padding: 5px 11px; border-radius: 999px; font-size: .75rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; background: var(--pink); color: #fff; }
.badge.cyan { background: var(--cyan); color: #00161a; }
.badge.yellow { background: var(--yellow); color: #1a1200; }
.badge.green { background: var(--green); color: #00190a; }
.diff { display: flex; gap: 5px; margin: 6px 0 14px; transform: translateZ(30px); }
.diff i { width: 22px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .15); }
.diff i.on { background: linear-gradient(90deg, var(--yellow), var(--pink)); }

/* ---------------------------------------------------------------- IQ banner + cube */
.iq-banner {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center;
  padding: 50px; border-radius: 32px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, rgba(150, 90, 255, .25), rgba(255, 46, 136, .18) 60%, rgba(0, 229, 255, .12));
  border: 1px solid rgba(255, 255, 255, .16); box-shadow: var(--shadow);
}
@media (max-width: 820px) { .iq-banner { grid-template-columns: 1fr; padding: 34px 22px; text-align: center; } }
.cube-wrap { height: 260px; display: grid; place-items: center; perspective: 900px; }
.cube { width: 150px; height: 150px; position: relative; transform-style: preserve-3d; animation: cube 14s linear infinite; }
.cube div {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 3.6rem; font-weight: 900;
  border-radius: 22px; border: 2px solid rgba(255, 255, 255, .55);
  background: linear-gradient(135deg, rgba(0, 229, 255, .35), rgba(150, 90, 255, .35));
  box-shadow: inset 0 0 40px rgba(255, 255, 255, .15), 0 0 30px rgba(0, 229, 255, .25);
  backface-visibility: visible; font-family: var(--font), var(--emoji);
}
.cube .f1 { transform: translateZ(75px); }
.cube .f2 { transform: rotateY(180deg) translateZ(75px); }
.cube .f3 { transform: rotateY(90deg) translateZ(75px); background: linear-gradient(135deg, rgba(255, 46, 136, .45), rgba(255, 214, 0, .3)); }
.cube .f4 { transform: rotateY(-90deg) translateZ(75px); background: linear-gradient(135deg, rgba(255, 46, 136, .45), rgba(255, 214, 0, .3)); }
.cube .f5 { transform: rotateX(90deg) translateZ(75px); }
.cube .f6 { transform: rotateX(-90deg) translateZ(75px); }
@keyframes cube { from { transform: rotateX(-20deg) rotateY(0); } to { transform: rotateX(-20deg) rotateY(360deg); } }

/* ---------------------------------------------------------------- panels / misc */
.glass { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(10px); }
.pad { padding: 28px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; text-align: center; }
.stat b { display: block; font-size: 2.6rem; font-weight: 900; }
.daily { max-width: 760px; margin: 0 auto; text-align: center; }
.daily .q { font-size: clamp(1.25rem, 3vw, 1.7rem); font-weight: 800; margin: 10px 0 22px; }
.daily .answer { margin-top: 20px; padding: 18px; border-radius: 16px; background: rgba(38, 222, 110, .12); border: 1px solid rgba(38, 222, 110, .5); display: none; }
.daily .answer.show { display: block; animation: pop .4s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }

.tiktok-cta { text-align: center; padding: 60px 24px; border-radius: 32px; background: radial-gradient(600px 300px at 50% 0, rgba(255, 46, 136, .25), transparent), var(--panel); border: 1px solid var(--line); }
.tiktok-cta .handle { font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 900; }

/* ---------------------------------------------------------------- ads + affiliate */
.ad { margin: 34px auto; min-height: 0; text-align: center; }
.ad.placeholder {
  min-height: 120px; display: grid; place-items: center; border-radius: 16px;
  border: 2px dashed rgba(255, 214, 0, .45); color: rgba(255, 214, 0, .8); font-weight: 700; font-size: .9rem;
  background: repeating-linear-gradient(45deg, rgba(255, 214, 0, .04) 0 12px, transparent 12px 24px);
}
.ad-label { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.affiliate { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.aff-item { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); transition: transform .2s, border-color .2s; }
.aff-item:hover { transform: translateY(-4px); border-color: var(--yellow); text-decoration: none; }
.aff-item .emoji { font-size: 2.4rem; }
.aff-item small { color: var(--muted); }
.aff-note { font-size: .78rem; color: var(--muted); margin-top: 12px; }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 60px; margin-top: 60px; color: var(--muted); font-size: .92rem; }
.site-footer .row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.site-footer nav a { color: var(--muted); margin-right: 18px; }
.site-footer nav a:hover { color: var(--ink); }

/* ================================================================ GAME UI */
.page-hero { padding: 60px 0 20px; text-align: center; }
.page-hero h1 { font-size: clamp(2.1rem, 6vw, 4rem); }
.game {
  scroll-margin-top: 84px;
  position: relative; max-width: 760px; margin: 0 auto; padding: 26px; border-radius: 28px;
  background: linear-gradient(170deg, rgba(30, 18, 72, .85), rgba(10, 6, 30, .92));
  border: 1px solid rgba(255, 255, 255, .14); box-shadow: var(--shadow), 0 0 0 1px rgba(150, 90, 255, .15) inset;
  overflow: hidden;
}
.game-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.game-top .lvl { font-weight: 900; color: var(--yellow); letter-spacing: .04em; }
.game-top .score { font-weight: 800; }
.progress { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-bottom: 18px; }
.progress > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--yellow), var(--orange), var(--pink)); transition: width .4s; box-shadow: 0 0 16px rgba(255, 145, 0, .6); }
.timer { position: relative; width: 74px; height: 74px; flex: none; }
.timer svg { transform: rotate(-90deg); width: 74px; height: 74px; }
.timer circle { fill: none; stroke-width: 8; }
.timer .track { stroke: rgba(255, 255, 255, .12); }
.timer .bar { stroke: var(--yellow); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.timer.urgent .bar { stroke: var(--red); }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; font-weight: 900; }
.timer.urgent b { color: #ffb3bd; animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.15); } }
.prompt { text-align: center; font-size: clamp(1.25rem, 3.4vw, 1.75rem); font-weight: 900; margin: 6px 0 18px; }
.screen { text-align: center; padding: 24px 6px; }
.screen .big { font-size: clamp(3rem, 12vw, 6rem); line-height: 1; margin: 6px 0 12px; font-family: var(--emoji); }
.screen h2 { font-size: clamp(1.7rem, 5vw, 2.6rem); }
.result-num { font-size: clamp(3.5rem, 14vw, 7rem); font-weight: 900; line-height: 1; }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.flash-ok { animation: flashok .6s; }
@keyframes flashok { from { box-shadow: 0 0 0 0 rgba(38, 222, 110, .9) inset; } to { box-shadow: 0 0 0 30px rgba(38, 222, 110, 0) inset; } }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(120px); background: #fff; color: #120a2e; padding: 12px 20px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.2, 1.3, .4, 1); z-index: 200; }
.toast.show { transform: translateX(-50%); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; }

/* odd-one-out grid */
.odd-grid { display: grid; gap: 2px; padding: 12px; border-radius: 20px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); user-select: none; }
.odd-grid button { aspect-ratio: 1; border: 0; background: transparent; color: #fff; cursor: pointer; border-radius: 10px; font-family: var(--font), var(--emoji); display: grid; place-items: center; padding: 0; transition: transform .1s, background .15s; line-height: 1; }
.odd-grid button:hover { background: rgba(255, 255, 255, .08); transform: scale(1.12); }
.odd-grid button.found { background: rgba(38, 222, 110, .25); box-shadow: 0 0 0 3px var(--green), 0 0 30px var(--green); transform: scale(1.3); z-index: 2; }
.odd-grid button.miss { background: rgba(255, 59, 80, .3); }
.odd-grid.dim button:not(.found) { opacity: .25; }

/* quiz */
.quiz-q { font-size: clamp(1.2rem, 3.2vw, 1.6rem); font-weight: 800; text-align: center; padding: 22px; border-radius: 20px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); margin-bottom: 18px; }
.quiz-q .big { display: block; color: var(--yellow); font-size: 1.5em; font-weight: 900; margin-top: 8px; font-family: var(--font), var(--emoji); }
.grade { display: block; margin: 0 auto 12px; width: max-content; }
.opts { display: grid; gap: 12px; }
.opt { display: flex; align-items: center; gap: 16px; width: 100%; padding: 14px 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); color: var(--ink); font: 800 1.15rem var(--font); cursor: pointer; text-align: left; transition: transform .12s, background .2s, opacity .3s; }
.opt:hover:not(:disabled) { background: rgba(255, 255, 255, .12); transform: translateX(4px); }
.opt .l { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #000; font-weight: 900; flex: none; }
.opt:nth-child(1) .l { background: var(--cyan); }
.opt:nth-child(2) .l { background: var(--yellow); }
.opt:nth-child(3) .l { background: var(--pink); }
.opt:nth-child(4) .l { background: var(--green); }
.opt.ok { background: var(--green); color: #00190a; border-color: transparent; transform: scale(1.03); }
.opt.bad { background: rgba(255, 59, 80, .35); border-color: var(--red); }
.opt.fade { opacity: .38; }
.explain { margin-top: 16px; padding: 16px 18px; border-radius: 16px; background: #fff; color: #170f35; font-weight: 700; display: none; }
.explain.show { display: block; animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); }

/* memory */
.mem-grid { display: grid; gap: 12px; margin: 0 auto; perspective: 900px; }
.mcard { aspect-ratio: 1; position: relative; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, 1.3, .5, 1); cursor: default; border: 0; padding: 0; background: none; }
.mcard.flipped { transform: rotateY(180deg); }
.mcard .face { position: absolute; inset: 0; border-radius: 18%; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; font-family: var(--emoji); box-shadow: 0 10px 22px rgba(0, 0, 0, .35); }
.mcard .front { background: #f6f4ff; }
.mcard .back { background: linear-gradient(135deg, var(--purple), var(--pink)); transform: rotateY(180deg); color: #fff; font-weight: 900; font-family: var(--font); }
.mcard .back.q { background: var(--yellow); color: #000; }
.mcard.ok .front { box-shadow: 0 0 0 4px var(--green), 0 0 30px var(--green); }
.mcard.clickable { cursor: pointer; }
.mcard.clickable:hover { transform: scale(1.06); }
.mem-opts { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.mem-opts button { font-family: var(--emoji); font-size: 2.4rem; width: 84px; height: 84px; border-radius: 20px; border: 2px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); cursor: pointer; transition: transform .15s; }
.mem-opts button:hover { transform: translateY(-4px) scale(1.06); border-color: var(--yellow); }
.mem-opts button.ok { background: var(--green); border-color: var(--green); }
.mem-opts button.bad { background: rgba(255, 59, 80, .5); border-color: var(--red); }
.membar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .12); overflow: hidden; margin: 14px 0; }
.membar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--purple)); width: 100%; }

/* illusions */
.illusion { margin-bottom: 40px; }
.ill-stage { border-radius: 20px; overflow: hidden; background: #0d0a24; border: 1px solid var(--line); }
.ill-stage svg { display: block; width: 100%; height: auto; max-height: 62vh; margin: 0 auto; }
.ill-stage svg * { transition: all 1s cubic-bezier(.4, 0, .2, 1); }
.ill-answers { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0 6px; }
.ill-answers .btn { min-width: 110px; }
.ill-answers .btn.picked-ok { --c1: #6ff7a6; --c2: var(--green); color: #00190a; }
.ill-answers .btn.picked-bad { --c1: #ff7d8c; --c2: var(--red); color: #fff; }
.ill-fact { display: none; margin-top: 14px; padding: 16px 18px; border-radius: 16px; background: rgba(0, 229, 255, .1); border: 1px solid rgba(0, 229, 255, .4); }
.ill-fact.show { display: block; animation: pop .4s cubic-bezier(.2, 1.4, .4, 1); }

/* iq test */
.iq-intro ul { text-align: left; max-width: 520px; margin: 0 auto 20px; }
.cat-bars { display: grid; gap: 10px; text-align: left; max-width: 520px; margin: 20px auto; }
.cat-bars .row { display: grid; grid-template-columns: 140px 1fr 50px; gap: 10px; align-items: center; font-weight: 700; font-size: .92rem; }
.cat-bars .bar { height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.cat-bars .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); }
.iq-scale { position: relative; height: 16px; border-radius: 8px; background: linear-gradient(90deg, #3b2f7a, var(--cyan), var(--green), var(--yellow), var(--pink)); margin: 26px auto 8px; max-width: 520px; }
.iq-scale i { position: absolute; top: -8px; width: 6px; height: 32px; border-radius: 3px; background: #fff; box-shadow: 0 0 14px #fff; transform: translateX(-50%); transition: left 1.2s cubic-bezier(.2, 1, .3, 1); }
.disclaimer { font-size: .82rem; color: var(--muted); max-width: 560px; margin: 16px auto 0; }

/* content */
.prose { color: #d9d4f2; }
.prose h2 { margin-top: 1.6em; font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
.prose h3 { margin-top: 1.4em; }
.prose li { margin-bottom: .4em; }
.more { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.more a { display: flex; gap: 12px; align-items: center; padding: 16px 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); font-weight: 800; }
.more a:hover { border-color: var(--pink); text-decoration: none; transform: translateY(-2px); }
.more .emoji { font-size: 1.8rem; }

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

/* ================================================================ v2: logo, languages, new games */
.logo img { width: 42px; height: 42px; filter: drop-shadow(0 0 10px rgba(150, 90, 255, .55)); }
.lang-switch { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.lang-switch a { padding: 6px 10px !important; font-size: .82rem !important; font-weight: 900; letter-spacing: .04em; color: var(--muted) !important; }
.lang-switch a[aria-current] { background: linear-gradient(135deg, var(--cyan), var(--purple)); color: #fff !important; }
@media (max-width: 860px) { .lang-switch { justify-content: center; margin-top: 8px; } }
.footer-links { margin-top: 18px; font-size: .88rem; line-height: 2; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }
.lang-hint { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 120; display: flex; align-items: center; gap: 6px;
  max-width: calc(100% - 32px); padding: 8px 8px 8px 18px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); animation: pop .4s cubic-bezier(.2, 1.4, .4, 1); }
.lang-hint a { color: #1a1040; font-weight: 800; font-size: .92rem; }
.lang-hint button { border: 0; background: #eee; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; color: #333; flex: none; }
.badge.new { background: var(--green); color: #00190a; }
.game-top-right { display: flex; gap: 10px; align-items: center; }
.iq-scale-labels { display: flex; justify-content: space-between; max-width: 520px; margin: 0 auto; font-size: .8rem; }
.iq-review { text-align: left; margin-top: 26px; }
.iq-review summary { cursor: pointer; font-weight: 800; }

/* counting test */
.cnt-stage { max-width: min(520px, calc(100vh - 330px)); min-width: 240px; margin: 0 auto; border-radius: 20px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.cnt-stage svg { display: block; width: 100%; height: auto; }
.cnt-stage .fig line { stroke: #fff; stroke-width: 6; stroke-linecap: round; }
.cnt-let { fill: #fff; font: 900 46px var(--font); }
.cnt-ring { fill: none; stroke: var(--yellow); stroke-width: 5; filter: drop-shadow(0 0 6px var(--yellow)); animation: pop .25s; transform-box: fill-box; transform-origin: center; }
.cnt-badge { fill: var(--pink); }
.cnt-badge-t { fill: #fff; font: 900 16px var(--font); }
.cnt-shape { fill: rgba(255, 214, 0, .38); stroke: var(--yellow); stroke-width: 6; stroke-linejoin: round; }
.cnt-input { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.cnt-input .btn.ghost { width: 52px; height: 52px; padding: 0; font-size: 1.6rem; }
.cnt-input input { width: 90px; height: 52px; border-radius: 14px; border: 2px solid var(--line); background: rgba(255, 255, 255, .08); color: #fff;
  font: 900 1.6rem var(--font); text-align: center; }

/* color chaos */
.stroop-card { display: grid; place-items: center; height: 180px; margin: 6px auto 0; max-width: 520px; border-radius: 24px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.stroop-card span { font: 900 clamp(2.6rem, 9vw, 4.4rem) var(--font); letter-spacing: .02em; -webkit-text-stroke: 2px rgba(10, 6, 24, .7); paint-order: stroke fill; }
.stroop-rule { font-size: clamp(1rem, 2.6vw, 1.25rem); }
.stroop-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 520px; margin: 0 auto; }
.stroop-btn { aspect-ratio: 1; border-radius: 22px; border: 3px solid rgba(255, 255, 255, .35); cursor: pointer; transition: transform .1s, box-shadow .2s; }
.stroop-btn:hover { transform: scale(1.06); }
.stroop-btn.ok { box-shadow: 0 0 0 5px #fff, 0 0 30px #fff; }
.stroop-btn.bad { opacity: .35; }

/* emoji words */
.emoji-eq { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 22px); margin: 10px 0 14px; flex-wrap: wrap; }
.emoji-eq .emoji { font-size: clamp(3.4rem, 13vw, 5.6rem); line-height: 1; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5)); animation: floaty 4s ease-in-out infinite; }
.emoji-eq b { font-size: clamp(2rem, 7vw, 3rem); color: var(--yellow); }
.emoji-eq .q { min-width: 70px; padding: 6px 16px; border-radius: 16px; border: 2px dashed rgba(255, 255, 255, .4); font: 900 clamp(1.4rem, 5vw, 2.2rem) var(--font); text-align: center; }
.emoji-eq.solved .q { border: 0; background: var(--green); color: #00190a; animation: pop .4s cubic-bezier(.2, 1.4, .4, 1); }

/* true or false */
.fact-card { position: relative; text-align: center; padding: 26px 22px 30px; border-radius: 24px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); overflow: hidden; }
.fact-emoji { display: block; font-size: clamp(3.6rem, 12vw, 5.2rem); line-height: 1.1; animation: floaty 4s ease-in-out infinite; }
.fact-card p { font-size: clamp(1.25rem, 3.6vw, 1.7rem); font-weight: 800; margin: 12px 0 0; }
.stamp { position: absolute; left: 50%; top: 38%; padding: 6px 22px; border: 6px solid; border-radius: 16px; font: 900 clamp(2.2rem, 8vw, 3.6rem) var(--font);
  opacity: 0; pointer-events: none; transform: translate(-50%, -50%) rotate(-12deg) scale(2.6); background: rgba(10, 6, 30, .55); }
.stamp.show { animation: stamp .28s cubic-bezier(.2, .8, .3, 1.2) forwards; }
.stamp.is-true { color: var(--green); border-color: var(--green); }
.stamp.is-false { color: var(--red); border-color: var(--red); transform: translate(-50%, -50%) rotate(10deg) scale(2.6); }
@keyframes stamp { to { opacity: 1; transform: translate(-50%, -50%) rotate(-10deg) scale(1); } }
.fact-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.fact-btns .btn { font-size: 1.15rem; padding: 18px 10px; }
.fact-t { --c1: #6ff7a6; --c2: var(--green); color: #00190a; }
.fact-f { --c1: #ff7d8c; --c2: var(--red); color: #fff; }
.fact-btns .btn.picked-ok { box-shadow: 0 0 0 4px #fff, 0 0 30px rgba(255, 255, 255, .6); transform: scale(1.03); }
.fact-btns .btn.fade-out { opacity: .3; }

/* ================================================================ v3: matches, gears, shadows, paths */
/* matchsticks */
.mt-stage { border-radius: 20px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); padding: 6px; }
.mt-stage svg { display: block; width: 100%; height: auto; }
.mt .wood { fill: #ecc480; stroke: #a0702f; stroke-width: 2; }
.mt .head { fill: #cd1e28; stroke: #780a14; stroke-width: 2; }
.mt.can { cursor: pointer; }
.mt.can:hover .wood { fill: #ffd99a; }
.mt.sel .wood { fill: #ffe9b0; filter: drop-shadow(0 0 8px #ffd600); }
.mt.sel { animation: mt-lift .6s ease-in-out infinite alternate; }
@keyframes mt-lift { to { opacity: .55; } }
.mt.hl .wood { filter: drop-shadow(0 0 10px #26de6e); }
.mt.slot { cursor: pointer; }
.mt.slot .wood { fill: rgba(255, 214, 0, .08); stroke: #ffd600; stroke-dasharray: 6 6; }
.mt.slot .head { fill: transparent; stroke: rgba(255, 214, 0, .5); stroke-dasharray: 4 4; }
.mt.slot:hover .wood { fill: rgba(255, 214, 0, .3); }

/* gears */
.gear-stage { border-radius: 20px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.gear-stage svg { display: block; width: 100%; height: auto; max-height: 52vh; margin: 0 auto; }
.gear-stage .belt { stroke: #1e1e28; stroke-width: 12; stroke-linecap: round; }
.gear-stage .drv-arrow { fill: none; stroke: #26de6e; stroke-width: 9; stroke-linecap: round; }
.gear-stage .tgt-ring { fill: none; stroke: #ffd600; stroke-width: 5; stroke-dasharray: 14 10; opacity: .85; }
.gear-stage.jammed .gear polygon { stroke: #ff3b50; stroke-width: 8; }
.gear-opts { margin-top: 14px; }

/* shadows */
.sh-hero { text-align: center; font-size: clamp(4.5rem, 16vw, 7.5rem); line-height: 1.1; margin: 4px 0 10px; animation: floaty 4s ease-in-out infinite; transition: opacity .5s, transform .5s; }
.sh-hero.flown { opacity: .25; transform: scale(.7); }
.sh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; margin: 0 auto; }
.sh-card { position: relative; aspect-ratio: 4 / 3; border-radius: 20px; border: 3px solid transparent; background: #f0ecfa; cursor: pointer;
  display: grid; place-items: center; transition: transform .15s, opacity .3s, border-color .3s; padding: 0; }
.sh-card:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--yellow); }
.sh-card .l { position: absolute; top: 10px; left: 10px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font: 900 1rem var(--font); color: #000; background: var(--cyan); }
.sh-card:nth-child(2) .l { background: var(--yellow); }
.sh-card:nth-child(3) .l { background: var(--pink); }
.sh-card:nth-child(4) .l { background: var(--green); }
.sh-card .sil { font-size: clamp(3.4rem, 12vw, 5rem); line-height: 1; filter: brightness(0) opacity(.9); transition: filter .6s; display: inline-block; }
.sh-card .sil.colored { filter: none; }
.sh-card.ok { border-color: var(--green); box-shadow: 0 0 0 4px var(--green), 0 0 30px rgba(38, 222, 110, .6); }
.sh-card.bad { border-color: var(--red); }
.sh-card.fade, .sh-card.bad { opacity: .45; }
.sh-lab { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); font: 800 .8rem var(--font); color: #fff;
  background: #2a1e46; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.sh-lab:empty { display: none; }

/* paths */
.pl-letters { display: grid; gap: 8px; max-width: 640px; margin: 0 auto 6px; }
.pl-btn { height: 46px; border-radius: 14px; border: 0; font: 900 1.2rem var(--font); cursor: pointer; color: #000; background: var(--cyan); transition: transform .1s, opacity .3s; }
.pl-btn:nth-child(2) { background: var(--yellow); }
.pl-btn:nth-child(3) { background: var(--pink); }
.pl-btn:nth-child(4) { background: var(--green); }
.pl-btn:nth-child(5) { background: var(--orange); }
.pl-btn:nth-child(6) { background: var(--purple); color: #fff; }
.pl-btn:hover:not(:disabled) { transform: translateY(-2px); }
.pl-btn.ok { box-shadow: 0 0 0 4px #fff, 0 0 24px #fff; }
.pl-btn.fade, .pl-btn.bad { opacity: .35; }
.pl-stage { max-width: 640px; margin: 0 auto; border-radius: 20px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.pl-stage svg { display: block; width: 100%; height: auto; max-height: 62vh; margin: 0 auto; }
.pl-bg { fill: none; stroke: #0a0618; stroke-width: 17; stroke-linecap: round; }
.pl { fill: none; stroke-width: 9; stroke-linecap: round; transition: opacity .5s; }
.pl-win { fill: none; stroke: #ffd600; stroke-width: 14; stroke-linecap: round; opacity: 0; filter: drop-shadow(0 0 8px #ffd600); }
.pl-stage.revealed .pl { opacity: .25; }
.pl-stage.revealed .pl-win { opacity: 1; }
.pl-end { fill: rgba(255, 255, 255, .08); stroke: rgba(255, 255, 255, .3); stroke-width: 3; }
.pl-stage.arrived .pl-end { transition: fill .3s; }
.pl-emo { font-size: 58px; font-family: var(--emoji); }
.pl-who { cursor: pointer; transition: opacity .3s; }
