/* ProfGid — styles */
:root {
  --bg: #FBF8F3;
  --surface: #FFFFFF;
  --surface-2: #F3EFE7;
  --ink: #16163A;
  --ink-2: #4A4A6A;
  --ink-3: #8A8AA3;
  --line: #E7E1D6;
  --brand: #3B3BF5;
  --brand-ink: #FFFFFF;
  --brand-soft: #E8E8FF;
  --sun: #FFC93C;
  --coral: #FF6B4A;
  --mint: #2EC4A0;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(22, 22, 58, .04), 0 8px 24px rgba(22, 22, 58, .06);
  --font-head: "Montserrat", "Arial Black", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 800; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 6vw, 60px); }
h2 { font-size: clamp(24px, 3.6vw, 36px); }
h3 { font-size: 18px; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
}

/* Header */
.header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.header.scrolled { border-bottom-color: var(--line); }
.header .wrap { display: flex; align-items: center; gap: 16px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-head); font-weight: 800; font-size: 20px; }
.logo-mark { width: 34px; height: 34px; flex: none; display: block; }
.logo b { color: var(--brand); }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  text-decoration: none; font-weight: 700; padding: 8px 14px; border-radius: 999px; color: var(--ink-2);
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.nav .lbl-short { display: none; }
.lang {
  display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); margin-left: 8px; flex: none;
}
.lang button {
  border: 0; background: transparent; padding: 6px 11px; border-radius: 999px; font-weight: 800; font-size: 13px; cursor: pointer; color: var(--ink-2);
}
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 800; font-size: 17px; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 18px rgba(59, 59, 245, .28); }
.btn-primary:hover { background: #2E2EDB; }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.btn-sm { padding: 10px 18px; font-size: 15px; }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(3px); }

/* Hero */
.hero { padding: 56px 0 40px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero h1 .hl { color: var(--brand); }
.hero-lead { font-size: 19px; color: var(--ink-2); margin: 20px 0 30px; max-width: 34ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; color: var(--ink-2); font-weight: 700; font-size: 15px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); display: inline-block; }

.orbit { position: relative; aspect-ratio: 1; width: 100%; max-width: 440px; margin-left: auto; }
.orbit-ring { position: absolute; inset: 8%; border-radius: 50%; border: 2px dashed var(--line); }
.orbit-core {
  position: absolute; inset: 31%; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; text-align: center; padding: 10px;
  font-family: var(--font-head); font-size: clamp(14px, 2vw, 18px); line-height: 1.2;
}
.orbit-core small { display: block; font-family: var(--font-body); font-weight: 700; font-size: 12px; color: #B9B9D6; margin-top: 4px; }
.chip-dot {
  position: absolute; transform: translate(-50%, -50%);
  background: var(--surface); border-radius: 999px; padding: 7px 12px 7px 8px; box-shadow: var(--shadow);
  font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  animation: float 6s ease-in-out infinite;
}
.chip-dot i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
@keyframes float { 0%, 100% { margin-top: 0; } 50% { margin-top: -6px; } }

/* Sections */
.section { padding: 64px 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head p { max-width: 52ch; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--surface); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.step-n {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 800; margin-bottom: 18px;
}
.step h3 { margin-bottom: 8px; }

.scales-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.scale-tile {
  border-radius: var(--radius-sm); padding: 16px; background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px; min-height: 108px;
}
.scale-tile .sw { width: 28px; height: 28px; border-radius: 9px; }
.scale-tile b { font-size: 15px; line-height: 1.25; }

.banner {
  background: var(--ink); color: #fff; border-radius: 28px; padding: 40px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  position: relative; overflow: hidden;
}
.banner::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--sun); opacity: .9;
}
.banner > * { position: relative; z-index: 1; }
.banner p { color: #C9C9E3; margin-top: 10px; }
.banner .btn-primary { background: #fff; color: var(--ink); box-shadow: none; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; margin-top: 40px; color: var(--ink-2); font-size: 15px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.footer nav { display: flex; gap: 18px; }
.footer a { text-decoration: none; font-weight: 700; }
.footer a:hover { color: var(--ink); }

/* Test */
.test-shell { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; }
.progress-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 14px; color: var(--ink-2); margin-bottom: 10px; }
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; width: 0; transition: width .3s ease; }
.q-card { margin-top: 26px; padding: 34px; }
.q-tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; color: var(--ink-2); margin-bottom: 14px; }
.q-tag i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.q-text { font-family: var(--font-head); font-weight: 700; font-size: clamp(20px, 3vw, 26px); line-height: 1.3; min-height: 3.9em; }
.answers { display: grid; gap: 10px; margin-top: 26px; }
.answer {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 15px 18px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface);
  cursor: pointer; font-weight: 700; font-size: 17px; transition: border-color .12s, background .12s, transform .12s;
}
.answer:hover { border-color: var(--ink-3); }
.answer .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink-3); flex: none; display: grid; place-items: center; }
.answer .key { margin-left: auto; font-size: 12px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; }
.answer[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.answer[aria-pressed="true"] .dot { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 4px var(--brand-soft); }
.q-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; gap: 12px; }
.link-btn { background: none; border: 0; cursor: pointer; font-weight: 800; color: var(--ink-2); padding: 10px 4px; }
.link-btn:hover { color: var(--ink); }
.link-btn:disabled { opacity: .35; cursor: default; }
.q-enter { animation: qin .28s ease; }
@keyframes qin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.intro { text-align: center; padding: 30px 0; }
.intro h1 { font-size: clamp(28px, 5vw, 44px); }
.intro p.muted { margin: 16px auto 26px; max-width: 52ch; }
.intro-facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 15px; }
.intro-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

/* Results */
.res-hero { padding: 40px 0 10px; }
.res-hero h1 { font-size: clamp(28px, 5vw, 48px); }
.res-hero p { margin-top: 12px; max-width: 60ch; }
.res-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.top3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.top-card { position: relative; overflow: hidden; }
.top-card .rank { font-family: var(--font-head); font-weight: 800; font-size: 14px; color: var(--ink-3); }
.top-card h3 { font-size: 20px; margin: 10px 0 6px; }
.top-card .pct { font-family: var(--font-head); font-size: 40px; font-weight: 800; }
.top-card .sw-bar { position: absolute; left: 0; top: 0; height: 6px; width: 100%; }
.top-card p { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.subjects { margin-top: 14px; font-size: 14px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.subjects b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 2px; }

.scale-bars { display: grid; gap: 12px; }
.scale-row { display: grid; grid-template-columns: 220px 1fr 52px; gap: 14px; align-items: center; font-weight: 700; }
.scale-row .bar { height: 14px; }
.scale-row .v { text-align: right; font-variant-numeric: tabular-nums; }

.sphere-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.sphere-res { display: flex; gap: 14px; align-items: center; text-decoration: none; padding: 18px; }
.sphere-res:hover { border-color: var(--ink-3); }
.sphere-res .ico { font-size: 28px; width: 52px; height: 52px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.sphere-res b { display: block; line-height: 1.25; }
.sphere-res .pct-chip { margin-left: auto; font-weight: 800; color: var(--brand); }

.prof-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; counter-reset: prof; }
.prof-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 18px; }
.prof-item::before {
  counter-increment: prof; content: counter(prof);
  font-family: var(--font-head); font-weight: 800; width: 34px; height: 34px; border-radius: 11px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 14px;
}
.prof-item b { display: block; line-height: 1.3; }
.prof-item .meta { font-size: 13px; color: var(--ink-3); font-weight: 700; margin-top: 2px; }
.prof-item p { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.prof-item .pct-chip { font-weight: 800; color: var(--brand); }
.note { margin-top: 24px; font-size: 14px; color: var(--ink-2); background: var(--surface-2); border-radius: 16px; padding: 14px 16px; }

/* Map */
.map-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.search {
  flex: 1 1 320px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 0 18px; height: 54px;
}
.search:focus-within { border-color: var(--brand); }
.search input { border: 0; outline: 0; background: transparent; font: inherit; font-weight: 700; flex: 1; min-width: 0; color: var(--ink); }
.search svg { color: var(--ink-3); flex: none; }
.sphere-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 26px; }
.sphere-card {
  text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 12px; padding: 22px; min-height: 170px;
  transition: transform .15s, border-color .15s;
}
.sphere-card:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.sphere-card .ico { font-size: 30px; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); }
.sphere-card b { font-size: 17px; line-height: 1.3; }
.sphere-card .cnt { margin-top: auto; font-size: 14px; color: var(--ink-3); font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.match-chip { background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: 13px; }

.search-results { display: grid; gap: 10px; margin-top: 22px; }
.search-results .prof-row { padding: 16px 18px; }
.empty { text-align: center; padding: 40px 0; color: var(--ink-2); }

dialog.sheet {
  border: 0; padding: 0; border-radius: 28px; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--bg); color: var(--ink); box-shadow: 0 30px 80px rgba(22, 22, 58, .3);
}
dialog.sheet::backdrop { background: rgba(22, 22, 58, .45); backdrop-filter: blur(3px); }
.sheet-head { position: sticky; top: 0; background: var(--bg); padding: 26px 26px 18px; border-bottom: 1px solid var(--line); z-index: 1; }
.sheet-head .row { display: flex; gap: 16px; align-items: center; }
.sheet-head .ico { font-size: 34px; width: 64px; height: 64px; border-radius: 20px; background: var(--surface); display: grid; place-items: center; flex: none; box-shadow: var(--shadow); }
.sheet-head p { margin-top: 12px; color: var(--ink-2); font-size: 15px; }
.close {
  margin-left: auto; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; font-size: 22px; line-height: 1; flex: none;
}
.close:hover { background: var(--line); }
.sheet-body { padding: 18px 26px 28px; display: grid; gap: 10px; }
.prof-row { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.prof-row b { display: block; }
.prof-row .meta { font-size: 13px; color: var(--ink-3); font-weight: 700; }
.prof-row p { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); display: inline-flex; align-items: center; gap: 6px; }
.tag i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .orbit { max-width: 360px; margin: 10px auto 0; }
  .scales-grid { grid-template-columns: repeat(2, 1fr); }
  .top3 { grid-template-columns: 1fr; }
  .prof-list { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav a.hide-sm { display: none; }
  .nav a { padding: 8px 10px; white-space: nowrap; }
  .nav .lbl-full { display: none; }
  .nav .lbl-short { display: inline; }
  .lang { margin-left: 4px; }
  .lang button { padding: 6px 9px; }
  .sphere-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sphere-card { padding: 14px; min-height: 0; gap: 10px; border-radius: 18px; }
  .sphere-card .ico { width: 44px; height: 44px; font-size: 24px; border-radius: 14px; }
  .sphere-card b { font-size: 15px; }
  .sphere-card .cnt { font-size: 12px; flex-wrap: wrap; }
  .steps { grid-template-columns: 1fr; }
  .banner { grid-template-columns: 1fr; padding: 28px; }
  .section { padding: 44px 0; }
  .q-card { padding: 22px; }
  .answer .key { display: none; }
  .scale-row { grid-template-columns: 1fr 44px; }
  .scale-row .bar { grid-column: 1 / -1; grid-row: 2; }
  dialog.sheet { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
}
@media (max-width: 420px) {
  .header .wrap { gap: 8px; }
  .logo span.txt { display: none; }
  .chip-dot { font-size: 11px; padding: 5px 9px 5px 6px; }
}

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

@media print {
  .header, .footer, .res-actions, .no-print { display: none !important; }
  body { background: #fff; font-size: 13px; }
  .card { box-shadow: none; break-inside: avoid; }
  .section { padding: 18px 0; }
  .top3 { grid-template-columns: repeat(3, 1fr); }
  .prof-list { grid-template-columns: 1fr 1fr; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Game: play the profession map ---------- */
.nav a.nav-play { background: var(--sun); color: var(--ink); }
.nav a.nav-play:hover { background: #FFBE14; }
.nav a.nav-play[aria-current="page"] { background: var(--ink); color: #fff; box-shadow: none; }

.game { padding-top: 22px; padding-bottom: 130px; }
.game-head { margin: 18px 0 18px; }
.game-head h1 { font-size: clamp(22px, 3.4vw, 32px); }
.game-head p { margin-top: 8px; max-width: 70ch; font-size: 16px; }

.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.stepper li {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-3); font-weight: 800; font-size: 13px;
}
.stepper li span {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: 12px;
}
.stepper li.done { color: var(--ink-2); }
.stepper li.done span { background: var(--mint); color: #fff; }
.stepper li.cur { background: var(--ink); color: #fff; }
.stepper li.cur span { background: var(--sun); color: var(--ink); }

/* Stage 1: all 24 spheres on one screen */
.g-spheres { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.g-sphere {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 14px 8px; min-height: 104px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface);
  cursor: pointer; transition: transform .12s, border-color .12s, background .12s;
}
.g-sphere:hover { border-color: var(--ink-3); }
.g-sphere:active { transform: scale(.97); }
.g-emoji { font-size: 28px; line-height: 1; }
.g-name { font-weight: 800; font-size: 13.5px; line-height: 1.2; }
.g-check {
  position: absolute; top: 7px; right: 7px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 800; display: grid; place-items: center; transform: scale(0); transition: transform .15s;
}
.g-sphere[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.g-sphere[aria-pressed="true"] .g-check { transform: scale(1); }

/* Stage 2: compact chips grouped by sphere */
.g-groups { columns: 2 440px; column-gap: 12px; }
.g-group {
  break-inside: avoid; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 12px;
}
.g-group h3 { font-family: var(--font-body); font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.g-group h3 small { margin-left: auto; color: var(--brand); font-size: 13px; white-space: nowrap; }
.g-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.g-chip {
  display: inline-flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); overflow: hidden;
  transition: border-color .12s, background .12s;
}
.g-chip button { border: 0; background: transparent; cursor: pointer; font: inherit; color: inherit; }
.g-like { display: inline-flex; align-items: center; gap: 5px; padding: 5px 2px 5px 9px; font-weight: 700; font-size: 13px; line-height: 1.2; text-align: left; }
.g-like .h { display: none; color: var(--brand); font-weight: 800; font-size: 13px; }
.g-like { padding-left: 12px; }
.g-chip .g-i {
  align-self: center; flex: none; width: 20px; height: 20px; margin: 0 6px 0 4px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; background: transparent; color: var(--ink-2); border: 1.5px solid currentColor;
  font-family: var(--font-body); font-style: normal; font-weight: 800; font-size: 12px; line-height: 1;
  transition: background .12s, color .12s;
}
.g-chip .g-i:hover { color: var(--brand); }
.g-chip:hover { border-color: var(--ink-3); }
.g-chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.g-chip.on .h { display: inline; }
.g-chip.on .g-i { background: transparent; color: var(--brand); }
.g-chip.pop .h { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.6); } 100% { transform: scale(1); } }

/* Stage 3: elimination cards */
.g-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.g-card {
  position: relative; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
  padding: 14px 14px 12px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface);
  transition: opacity .18s, transform .18s, border-color .12s, background .18s; font: inherit; color: inherit;
}
.g-card:hover { border-color: var(--ink-3); }
.g-card-top { display: flex; gap: 8px; align-items: flex-start; padding-right: 22px; }
.g-card-top b { font-size: 15px; line-height: 1.25; }
.g-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.g-x {
  position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: var(--ink-3); background: var(--surface-2);
}
.g-out-label { display: none; font-size: 12px; font-weight: 800; color: var(--coral); text-transform: uppercase; letter-spacing: .04em; }
.g-card.out { background: var(--surface-2); border-style: dashed; transform: scale(.97); }
.g-card.out .g-card-top, .g-card.out .g-desc { opacity: .4; }
.g-card.out .g-card-top b { text-decoration: line-through; }
.g-card.out .g-x { background: var(--coral); color: #fff; }
.g-card.out .g-out-label { display: block; }

/* Stage 4: final three */
.g-path { text-align: center; font-weight: 800; color: var(--ink-2); margin-bottom: 18px; }
.g-final { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.g-win { text-align: center; animation: rise .5s ease both; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.g-win h3 { font-size: 20px; }
.g-win .meta { color: var(--ink-3); font-weight: 700; font-size: 14px; }
.g-win p { color: var(--ink-2); font-size: 15px; }
.g-win .tags { justify-content: center; }
.g-medal { font-size: 44px; line-height: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

/* Sticky action bar */
.game-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(22, 22, 58, .06);
  padding-bottom: env(safe-area-inset-bottom);
}
.game-bar-in { display: flex; align-items: center; gap: 12px; min-height: 72px; }
.game-status { display: flex; flex-direction: column; min-width: 0; }
.game-status b { font-family: var(--font-head); font-size: 17px; }
.game-status span { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.game-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.game-actions .btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
body.game-final .game-bar { display: none; }
body.game-final .game { padding-bottom: 40px; }

@media (max-width: 960px) {
  .g-spheres { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .g-final { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
}
@media (max-width: 720px) {
  .nav a.nav-play { padding: 8px 10px; }
  .g-spheres { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .g-sphere { min-height: 74px; padding: 7px 3px; gap: 4px; border-radius: 12px; border-width: 1.5px; }
  .g-emoji { font-size: 20px; }
  .g-name { font-size: 11.5px; line-height: 1.15; }
  .g-check { width: 18px; height: 18px; font-size: 11px; top: 4px; right: 4px; }
  .g-group { padding: 12px; }
  .g-like { font-size: 13px; }
  .g-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .g-card-top b { overflow-wrap: break-word; hyphens: auto; font-size: 13px; }
  .g-card-top { padding-right: 18px; gap: 6px; }
  .g-x { top: 8px; right: 8px; width: 20px; height: 20px; }
  .game-status { flex: 1 1 auto; }
  .game-status b { white-space: normal; line-height: 1.2; overflow-wrap: break-word; }
  .g-card { padding: 11px 10px 10px; }
  .g-card-top b { font-size: 13.5px; }
  .g-desc { font-size: 12.5px; -webkit-line-clamp: 3; }
  .stepper li { padding: 4px 10px 4px 4px; font-size: 12px; }
  .game-head { margin: 12px 0 14px; }
  .game-head p { font-size: 14.5px; }
  .game-bar-in { min-height: 64px; gap: 8px; }
  .game-status b { font-size: 15px; }
  .game-status span { font-size: 12px; }
}
@media (max-width: 420px) {
  .stepper li:not(.cur) { font-size: 0; gap: 0; padding: 4px; }
  .game-actions .btn { padding: 10px 14px; }
}
@media print {
  .game-bar, .stepper { display: none !important; }
  .g-final { grid-template-columns: repeat(3, 1fr); }
}

/* Game entry points */
.btn-play { background: var(--sun); color: var(--ink); box-shadow: 0 6px 18px rgba(255, 201, 60, .35); }
.btn-play:hover { background: #FFBE14; }
.map-tools .btn-play { height: 54px; }
.banner-play { background: var(--brand); }
.banner-play::after { background: var(--coral); }
.banner-play p { color: #DCDCFF; }
.play-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; font-family: var(--font-head); font-weight: 700; font-size: 14px; }
.play-steps span { background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 5px 11px; }
.play-steps span.win { background: var(--sun); color: var(--ink); }
.play-steps i { font-style: normal; opacity: .7; }
@media (max-width: 720px) {
  .map-tools .btn-play { width: 100%; }
}
@media (max-width: 440px) {
  .nav { gap: 2px; }
  .nav a { padding: 8px 8px; font-size: 15px; }
  .nav .lbl-play { display: none; }
  .lang button { padding: 6px 7px; font-size: 12px; }
}
@media (max-width: 600px) {
  .nav .lbl-play { display: none; }
  .nav a.nav-play { padding: 8px 10px; }
}

/* Compact elimination round (more than 10 professions) */
.g-tap { display: inline-flex; align-items: center; gap: 5px; padding: 5px 2px 5px 12px; font-weight: 700; font-size: 13px; line-height: 1.2; text-align: left; }
.g-tap .x { display: none; font-size: 11px; font-weight: 800; }
.g-rm.out { border-style: dashed; border-color: var(--coral); background: var(--surface-2); color: var(--ink-3); }
.g-rm.out .g-tap { text-decoration: line-through; }
.g-rm.out .x { display: inline; color: var(--coral); text-decoration: none; }

.g-rm.out .g-i { background: transparent; color: var(--ink-3); }


/* Long press on a sphere tile shows its professions */
.g-sphere { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.g-sphere.pressing { transform: scale(.95); border-color: var(--brand); transition: transform .45s ease, border-color .2s; }
.info-profs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.info-prof { font-size: 14px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }

/* Question explanation (ⓘ) */
.q-head { display: flex; align-items: flex-start; gap: 12px; }
.q-head .q-text { flex: 1; }
.q-info {
  flex: none; width: 30px; height: 30px; margin-top: 2px; border-radius: 50%; padding: 0; cursor: pointer;
  background: transparent; border: 2px solid var(--ink-2); color: var(--ink-2);
  font-family: var(--font-body); font-weight: 800; font-size: 16px; line-height: 1; display: grid; place-items: center;
}
.q-info:hover, .q-info[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); }
.q-hint {
  margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--brand-soft); color: var(--ink);
  font-size: 16px; line-height: 1.5; font-weight: 600;
}

/* Paywall */
.locked-card { filter: blur(5px); opacity: .55; user-select: none; pointer-events: none; }
.paywall { max-width: 620px; margin: 0 auto; text-align: center; padding: 34px 28px; border: 2px solid var(--brand); }
.paywall-ico { font-size: 38px; }
.paywall h2 { margin: 8px 0 14px; }
.paywall-list { list-style: none; padding: 0; margin: 0 auto 22px; text-align: left; display: inline-grid; gap: 8px; }
.paywall-list li { padding-left: 28px; position: relative; font-weight: 700; }
.paywall-list li::before { content: "✓"; position: absolute; left: 0; color: var(--mint); font-weight: 800; }
.paywall-btn { width: 100%; max-width: 380px; font-size: 18px; }
.paywall-btn:disabled { opacity: .6; cursor: wait; }
.paywall-safe { margin: 12px auto 8px; max-width: 46ch; }
.pay-notice { margin: 0 auto 16px; max-width: 46ch; padding: 10px 14px; border-radius: 12px; font-weight: 700; font-size: 15px; }
.pay-checking { background: var(--brand-soft); color: var(--brand); }
.pay-fail, .pay-error { background: #FFEDE8; color: #B3361B; }
.pay-pending { background: #FFF6DA; color: #7A5600; }

/* Legal / info pages */
.doc { max-width: 820px; padding-top: 40px; padding-bottom: 30px; }
.doc h1 { font-size: clamp(28px, 4.5vw, 40px); }
.doc-meta { color: var(--ink-3); font-size: 14px; font-weight: 700; margin: 10px 0 24px; }
.doc h2 { font-size: 20px; margin: 28px 0 10px; }
.doc p, .doc li { line-height: 1.65; margin: 0 0 10px; }
.doc ul { padding-left: 22px; margin: 0 0 12px; }
.doc a { color: var(--brand); }
.doc-req { margin-top: 30px; }
.doc-req h2 { margin-top: 0; }
.doc-req dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 0; }
.doc-req dt { color: var(--ink-3); font-weight: 700; }
.doc-req dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.footer-docs { margin-top: 12px; }
.footer-docs nav { flex-wrap: wrap; gap: 6px 18px; }
.footer-docs a { font-size: 14px; font-weight: 600; }
.paywall-consent { margin: 0 auto 8px; max-width: 46ch; }
.paywall-consent a { color: var(--brand); }
@media (max-width: 520px) { .doc-req dl { grid-template-columns: 1fr; } .doc-req dt { margin-top: 6px; } }

/* Payment acceptance marks and consent */
.pay-logos { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 12px 0; }
.pay-logos img { display: block; }
.footer .pay-logos { margin: 0; }
.doc .pay-logos { justify-content: flex-start; }
.doc h3 { font-size: 17px; margin: 18px 0 8px; }
.doc ol { padding-left: 22px; margin: 0 0 12px; }
.paywall-consent { display: flex; gap: 10px; align-items: flex-start; text-align: left; max-width: 420px; margin: 0 auto 14px; font-size: 14px; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.paywall-consent input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--brand); }
.paywall-consent a { color: var(--brand); }
.pay-agree-hint { color: #B3361B; font-weight: 700; margin: 8px 0 0; }
.paywall-btn { white-space: normal; line-height: 1.25; }

/* ===== Game layer: HUD, XP, toasts, intro, duels, podium ===== */
.g-hud {
  display: flex; align-items: center; gap: 14px; background: var(--ink); color: #fff;
  border-radius: 18px; padding: 10px 14px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.g-lvl {
  position: relative; width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--sun);
  display: grid; place-items: center; font-size: 22px; box-shadow: 0 0 0 4px rgba(255, 201, 60, .22);
}
.g-lvl i {
  position: absolute; right: -4px; bottom: -4px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 99px;
  background: var(--brand); color: #fff; font: 800 11px/20px var(--font-head); text-align: center; font-style: normal;
}
.g-hud.bump .g-lvl { animation: pop .5s ease; }
.g-hud.bump .g-xp { animation: pop .5s ease; }
.g-hud-main { flex: 1; min-width: 0; }
.g-hud-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 800; font-size: 14px; }
.g-hud-top b { font-family: var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-xp { color: var(--sun); white-space: nowrap; display: inline-block; }
.g-xpbar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .14); margin-top: 6px; overflow: hidden; }
.g-xpbar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sun), var(--coral)); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.g-hud-sub { font-size: 12px; font-weight: 700; opacity: .65; margin-top: 4px; }
.g-badges { display: flex; gap: 5px; flex: none; }
.g-badge {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 16px;
  background: rgba(255, 255, 255, .07); filter: grayscale(1); opacity: .35; transition: .3s;
}
.g-badge.on { filter: none; opacity: 1; background: rgba(255, 255, 255, .16); }

.xp-pop {
  position: fixed; z-index: 80; pointer-events: none; transform: translateX(-50%);
  font: 800 18px/1 var(--font-head); color: var(--brand); text-shadow: 0 2px 0 #fff, 0 0 8px #fff;
  animation: xpfly 1s ease-out forwards;
}
@keyframes xpfly {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(.7); }
  20% { opacity: 1; transform: translate(-50%, -8px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -54px) scale(1); }
}
.g-toast {
  position: fixed; left: 50%; top: 84px; z-index: 90; transform: translate(-50%, -16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px; font-weight: 800; font-size: 15px;
  box-shadow: 0 10px 30px rgba(22, 22, 58, .25); transition: opacity .3s, transform .3s; max-width: calc(100% - 32px); text-align: center;
}
.g-toast.show { opacity: 1; transform: translate(-50%, 0); }
.g-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 85; }

/* Intro */
.g-intro { text-align: center; padding: 6px 0 10px; }
.g-intro-hero { font-size: 64px; line-height: 1; animation: float 3s ease-in-out infinite; }
.g-intro h1 { font-size: clamp(28px, 5vw, 46px); margin-top: 14px; }
.g-intro-lead { max-width: 62ch; margin: 14px auto 0; color: var(--ink-2); font-size: 18px; }
.g-quest { list-style: none; padding: 0; margin: 28px 0 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.g-quest li {
  background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 16px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; line-height: 1.25;
  animation: rise .5s both;
}
.g-quest .n { font-size: 11.5px; color: var(--brand); text-transform: uppercase; letter-spacing: .08em; }
.g-quest .e { font-size: 36px; line-height: 1; }
.g-intro-rewards { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 26px; flex-wrap: wrap; }
.g-intro-rewards i { font-style: normal; font-size: 14px; color: var(--ink-3); }
.g-intro-meta { color: var(--ink-3); font-weight: 700; margin-top: 10px; font-size: 15px; }
.g-start { margin-top: 22px; font-size: 19px; padding: 16px 34px; }

/* Duels */
.duel, .g-sum { max-width: 880px; margin: 0 auto; }
.duel-dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 16px; }
.duel-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: .3s; }
.duel-dots i.done { background: var(--mint); }
.duel-dots i.cur { background: var(--brand); transform: scale(1.35); }
.duel-arena { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: stretch; }
.duel-card {
  appearance: none; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: 22px;
  padding: 22px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow);
  transition: transform .25s, border-color .2s, opacity .3s, box-shadow .25s; animation: duelin .45s backwards;
}
.duel-card.r { animation-name: duelinR; }
@media (hover: hover) { .duel-card:hover { border-color: var(--brand); transform: translateY(-3px); } }
.duel-card:active { transform: scale(.98); }
.duel-card .ic { font-size: 42px; line-height: 1; }
.duel-card .sp { font-size: 13px; font-weight: 800; color: var(--ink-3); }
.duel-card h3 { font-size: clamp(18px, 2.4vw, 23px); }
.duel-card p { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.duel-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.duel-pick {
  margin-top: auto; align-self: flex-start; background: var(--brand); color: #fff;
  font-weight: 800; border-radius: 999px; padding: 8px 18px; font-size: 14px; transition: .2s;
}
@media (hover: hover) { .duel-card:hover .duel-pick { background: var(--brand); color: #fff; } }
.duel-vs {
  align-self: center; width: 58px; height: 58px; border-radius: 50%; background: var(--ink); color: var(--sun);
  display: grid; place-items: center; font: 800 18px/1 var(--font-head); box-shadow: 0 0 0 6px var(--bg), 0 0 0 8px var(--line);
  animation: pop .6s .25s backwards;
}
.duel-card.win { border-color: var(--mint); transform: scale(1.04); box-shadow: 0 0 0 6px rgba(46, 196, 160, .22), var(--shadow); }
.duel-card.win .duel-pick { background: var(--mint); color: #fff; }
.duel-card.lose { opacity: .2; transform: scale(.9) rotate(-2deg); }
.duel-byes { text-align: center; color: var(--ink-3); font-weight: 700; font-size: 14px; margin-top: 18px; }
@keyframes duelin { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
@keyframes duelinR { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }

.g-sum { text-align: center; }
.g-sum-ico { font-size: 60px; line-height: 1; animation: pop .7s ease; }
.g-sum-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.g-sum-list span { background: var(--surface); border: 2px solid var(--mint); border-radius: 999px; padding: 7px 15px; font-weight: 800; font-size: 14.5px; animation: rise .4s both; }
.g-sum-list span.out { border-color: var(--line); color: var(--ink-3); text-decoration: line-through; background: transparent; }

/* Final: choose places */
.g-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; max-width: 980px; margin: 0 auto; }

/* Podium */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; max-width: 640px; margin: 6px auto 26px; }
.pod { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; animation: rise .6s both; }
.pod .m { font-size: 44px; line-height: 1; }
.pod b { font-size: 15px; line-height: 1.2; font-weight: 800; min-height: 2.4em; display: flex; align-items: flex-end; }
.pod .blk { width: 100%; border-radius: 16px 16px 0 0; display: grid; place-items: center; font: 800 30px/1 var(--font-head); color: #fff; }
.pod-1 .blk { height: 140px; background: var(--brand); }
.pod-2 .blk { height: 100px; background: var(--mint); }
.pod-3 .blk { height: 72px; background: var(--coral); }
.g-stats { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 26px; }
.g-stat { background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 9px 15px; font-weight: 800; font-size: 15px; }
.g-sec { text-align: center; font-size: clamp(20px, 3vw, 26px); margin-bottom: 14px; }
.g-badge-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 auto 30px; max-width: 900px; }
.g-badge-card {
  background: var(--surface); border: 2px dashed var(--line); border-radius: 16px; padding: 14px 8px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: .5;
}
.g-badge-card span { font-size: 30px; line-height: 1; filter: grayscale(1); }
.g-badge-card b { font-size: 14px; }
.g-badge-card small { font-size: 12px; color: var(--ink-3); font-weight: 700; line-height: 1.3; }
.g-badge-card.on { opacity: 1; border-style: solid; border-color: var(--sun); background: #FFF8E6; }
.g-badge-card.on span { filter: none; }

@media (max-width: 760px) {
  .g-quest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-badge-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .g-hud { gap: 10px; padding: 8px 10px; border-radius: 14px; }
  .g-lvl { width: 38px; height: 38px; font-size: 18px; }
  .g-hud-sub { display: none; }
  .g-badges { gap: 2px; }
  .g-badge { width: 24px; height: 24px; font-size: 13px; }
  .duel-arena { grid-template-columns: 1fr; gap: 8px; }
  .duel-vs { width: 44px; height: 44px; font-size: 14px; justify-self: center; }
  .duel-card { padding: 16px; gap: 7px; }
  .duel-card .ic { font-size: 32px; }
  .duel-card .tags { display: none; }
  .duel-card p { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .pod b { font-size: 12.5px; }
  .pod .m { font-size: 34px; }
  .pod-1 .blk { height: 110px; } .pod-2 .blk { height: 80px; } .pod-3 .blk { height: 58px; }
  .g-toast { top: 72px; font-size: 14px; }
  .g-intro-hero { font-size: 52px; }
}
@media (max-width: 400px) {
  .g-badges { display: none; }
}
@media print {
  .g-hud, .g-toast, .g-confetti, .g-badge-list, .g-sec, .g-stats { display: none !important; }
}

/* UNT game: combination tiles */
.g-combos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.g-combo { min-height: 128px; gap: 6px; }
.g-combo .g-emoji { font-size: 30px; }
.g-combo .g-name { font-size: 14.5px; }
.g-cnt { font-size: 12.5px; font-weight: 800; color: var(--ink-3); }
.g-combo[aria-pressed="true"] { border-color: var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 12%, #fff); }
.g-combo[aria-pressed="true"] .g-check { background: var(--c, var(--brand)); }
.g-combo[aria-pressed="true"] .g-cnt { color: var(--c, var(--brand)); }
.g-combo.dim { opacity: .55; }
.g-combo.dim:hover { opacity: 1; }
.g-note { margin-top: 16px; font-size: 13.5px; color: var(--ink-3); font-weight: 700; max-width: 80ch; }
.u-line { font-size: 13px; font-weight: 800; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; padding: 6px 10px; display: block; width: 100%; }
#info-tags .u-line { margin-top: 10px; }
.g-other { margin-top: 18px; font-weight: 800; }
.g-other a { color: var(--brand); text-decoration: none; }
.g-other a:hover { text-decoration: underline; }
.banner-unt { margin-top: 16px; background: #0E8A73; }
.banner-unt p { color: rgba(255, 255, 255, .88); }
.banner-unt::after { background: var(--sun); }
@media (max-width: 560px) {
  .g-combos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .g-combo { min-height: 112px; padding: 10px 6px; }
  .g-combo .g-name { font-size: 12.5px; }
  .g-combo .g-emoji { font-size: 24px; }
}

/* Pinned XP bar */
.g-hud-host { max-width: var(--max); margin: 0 auto; padding: 0 20px 8px; }
.g-hud-host:has(.g-hud.hidden) { display: none; }
.g-hud-host .g-hud { margin-bottom: 0; box-shadow: none; }

/* Профгид — guide character */
.gd-overlay {
  position: fixed; inset: 0; z-index: 75; background: rgba(22, 22, 58, .3);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.gd-overlay.show { opacity: 1; pointer-events: auto; }
.gd-panel { display: flex; align-items: flex-end; gap: 10px; width: 100%; max-width: 660px; transform: translateY(40px); transition: transform .4s cubic-bezier(.2, .9, .3, 1.25); }
.gd-overlay.show .gd-panel { transform: none; }
.gd-avatar { width: 116px; flex: none; animation: gdbob 2.6s ease-in-out infinite; }
.gd-svg { display: block; width: 100%; height: auto; overflow: visible; }
.gd-bubble {
  position: relative; flex: 1; min-width: 0; margin-bottom: 34px; background: #fff; border-radius: 22px;
  padding: 16px 18px; box-shadow: 0 16px 44px rgba(22, 22, 58, .24); text-align: left;
}
.gd-bubble::before {
  content: ""; position: absolute; left: -11px; bottom: 24px;
  border-style: solid; border-width: 10px 12px 10px 0; border-color: transparent #fff transparent transparent;
}
.gd-name { display: block; font: 800 12.5px/1 var(--font-head); color: var(--brand); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 7px; }
.gd-text { font-size: 17px; font-weight: 700; line-height: 1.45; color: var(--ink); min-height: 2.9em; }
.gd-ok { margin-top: 12px; }
.gd-eyes { transform-box: fill-box; transform-origin: center; animation: gdblink 4.2s infinite; }
.gd-mouth { transform-box: fill-box; transform-origin: 50% 0; }
.talking .gd-mouth { animation: gdtalk .2s ease-in-out infinite alternate; }
.talking .gd-smile { opacity: 0; }
.talking .gd-brows { animation: gdbrow .45s ease-in-out infinite alternate; }
.gd-needle { transform-box: fill-box; transform-origin: center; animation: gdneedle 3s ease-in-out infinite; }
@keyframes gdblink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes gdtalk { from { transform: scaleY(.3); } to { transform: scaleY(1.25); } }
@keyframes gdbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes gdneedle { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
@keyframes gdbrow { from { transform: translateY(0); } to { transform: translateY(-2px); } }
.gd-dock {
  position: fixed; left: 16px; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 31;
  width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--line); background: #fff; padding: 8px 6px;
  box-shadow: 0 8px 24px rgba(22, 22, 58, .25); cursor: pointer; animation: rise .4s both; transition: transform .2s;
}
.gd-dock:hover { transform: scale(1.07); }
.gd-dock .gd-svg { width: 100%; height: 100%; }
body.game-final .gd-dock { bottom: calc(20px + env(safe-area-inset-bottom)); }
.g-intro-guide { display: flex; align-items: flex-end; justify-content: center; gap: 10px; max-width: 620px; margin: 0 auto 8px; }
.gd-big { width: 132px; }
.gd-static { margin-bottom: 40px; border: 2px solid var(--line); box-shadow: var(--shadow); }
.gd-static::before { left: -12px; }
@media (max-width: 560px) {
  .gd-avatar { width: 86px; }
  .gd-big { width: 92px; }
  .gd-text { font-size: 15.5px; }
  .gd-bubble { padding: 13px 14px; margin-bottom: 24px; }
  .gd-dock { width: 54px; height: 54px; left: 12px; }
  .gd-overlay { padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .gd-avatar, .gd-eyes, .gd-needle, .talking .gd-mouth, .talking .gd-brows { animation: none; }
}
@media print { .gd-overlay, .gd-dock { display: none !important; } }
.gd-snd {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; line-height: 1;
  display: grid; place-items: center; padding: 0;
}
.gd-snd:hover { border-color: var(--brand); }
.gd-snd.on { border-color: var(--brand); background: var(--brand-soft); animation: gdpulse 1.2s ease-in-out infinite; }
@keyframes gdpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(59, 59, 245, .25); } 50% { box-shadow: 0 0 0 6px rgba(59, 59, 245, 0); } }
.gd-bubble .gd-name { display: flex; align-items: center; min-height: 30px; padding-right: 40px; margin-bottom: 6px; }
.gd-bubble { padding-top: 12px; }
.gd-snd { top: 10px; right: 10px; width: 30px; height: 30px; font-size: 14px; }

/* Header XP bar: compact */
.g-hud-host .g-hud { padding: 7px 12px; border-radius: 14px; gap: 12px; }
.g-hud-host .g-lvl { width: 36px; height: 36px; font-size: 17px; }
.g-hud-host .g-hud-sub { display: none; }
.g-hud-host .g-xpbar { margin-top: 5px; }
.g-toast { top: 140px; }
@media (max-width: 640px) {
  .g-hud-host { padding-left: 12px; padding-right: 12px; padding-bottom: 6px; }
  .g-hud-host .g-hud { padding: 6px 10px; gap: 9px; }
  .g-hud-host .g-lvl { width: 30px; height: 30px; font-size: 14px; }
  .g-hud-host .g-lvl i { min-width: 16px; height: 16px; font-size: 10px; line-height: 16px; }
  .g-hud-top { font-size: 13px; }
  .g-toast { top: 124px; }

  /* Duels on phones: two compact cards side by side, no descriptions */
  .duel-arena { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; position: relative; }
  .duel-vs {
    position: absolute; left: calc(50% - 19px); top: calc(50% - 19px); z-index: 2;
    width: 38px; height: 38px; font-size: 12px; box-shadow: 0 0 0 4px var(--bg);
  }
  .duel-card { padding: 16px 10px 12px; gap: 6px; align-items: center; text-align: center; }
  .duel-card .ic { font-size: 34px; }
  .duel-card .sp { font-size: 11px; line-height: 1.25; }
  .duel-card h3 { font-size: 15px; line-height: 1.25; overflow-wrap: break-word; }
  .duel-card p, .duel-card .tags, .duel-card .u-line { display: none; }
  .duel-pick { align-self: stretch; text-align: center; padding: 9px 8px; font-size: 14px; }
  .duel-card.win { transform: scale(1.03); }
  .g-pick { grid-template-columns: 1fr; gap: 8px; }
  .g-pick .duel-card {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ic sp pick" "ic nm pick";
    column-gap: 12px; row-gap: 2px; align-items: center; text-align: left; padding: 12px 12px;
  }
  .g-pick .duel-card .ic { grid-area: ic; font-size: 30px; }
  .g-pick .duel-card .sp { grid-area: sp; }
  .g-pick .duel-card h3 { grid-area: nm; }
  .g-pick .duel-pick { grid-area: pick; align-self: center; font-size: 13px; padding: 9px 12px; white-space: nowrap; }
}

.duel-card:focus { outline: none; }
.duel-card:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* Home: steps, scales, game banners */
.step { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: start; }
.step .step-n { grid-row: span 2; margin-bottom: 0; }
.step h3 { margin-bottom: 4px; }
.scale-tile {
  flex-direction: row; align-items: center; gap: 12px; min-height: 0; padding: 12px 14px;
  background: color-mix(in srgb, var(--c, #888) 9%, #fff); border-color: color-mix(in srgb, var(--c, #888) 22%, #fff);
}
.scale-tile .sw { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; font-size: 21px; }
.scale-tile b { font-size: 14.5px; }
.banner { grid-template-columns: minmax(0, 1fr) auto; }
.banner h2 { overflow-wrap: break-word; }
@media (max-width: 720px) {
  .card.step { padding: 16px 18px; }
  .step .step-n { width: 38px; height: 38px; border-radius: 12px; font-size: 15px; }
  .step h3 { font-size: 16.5px; }
  .step p { font-size: 14.5px; line-height: 1.45; }
  .steps { gap: 10px; }
  .scales-grid { gap: 8px; }
  .scale-tile { padding: 10px; gap: 9px; border-radius: 14px; }
  .scale-tile .sw { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
  .scale-tile b { font-size: 13px; line-height: 1.2; }
  .banner { grid-template-columns: minmax(0, 1fr); padding: 22px 20px; gap: 16px; border-radius: 22px; }
  .banner::after { width: 130px; height: 130px; right: -48px; top: -48px; opacity: .55; }
  .banner h2 { font-size: 21px; line-height: 1.2; }
  .banner p { font-size: 14.5px; line-height: 1.45; margin-top: 8px; }
  .play-steps { margin-top: 12px; font-size: 12.5px; gap: 4px; }
  .play-steps span { padding: 4px 9px; }
  .banner .btn { width: 100%; white-space: normal; text-align: center; padding: 13px 16px; font-size: 15.5px; line-height: 1.25; }
  .banner-unt { margin-top: 12px; }
  .section-head { margin-bottom: 18px; }

  /* Game: more professions visible at once */
  .g-groups { columns: 1; }
  .g-group { padding: 10px 10px 8px; margin-bottom: 8px; border-radius: 14px; }
  .g-group h3 { font-size: 13.5px; margin-bottom: 6px; gap: 6px; }
  .g-chips { gap: 4px; }
  .g-chip .g-like, .g-chip .g-tap { font-size: 13px; padding: 5px 1px 5px 10px; }
  .g-chip .g-i { width: 18px; height: 18px; margin: 0 5px 0 3px; font-size: 10.5px; border-width: 1.3px; }
  .g-chip { border-width: 1.3px; }
  .game-head { margin: 10px 0 10px; }
  .game-head h1 { font-size: 20px; }
  .game-head p { font-size: 14px; margin-top: 4px; line-height: 1.4; }
}

/* Chip buttons use font: inherit, so set their size with enough specificity. */
.g-chip .g-like, .g-chip .g-tap { font-size: 14px; font-weight: 700; line-height: 1.2; }
@media (max-width: 720px) { .g-chip .g-like, .g-chip .g-tap { font-size: 13px; } }
@media (max-width: 560px) { .gd-dock { width: 46px; height: 46px; padding: 6px 4px; left: 10px; } }

/* Next button: glow when the step is complete */
.game-actions .btn-primary:not(:disabled) { animation: readyGlow 1.8s ease-in-out infinite; }
@keyframes readyGlow {
  0%, 100% { box-shadow: 0 6px 18px rgba(59, 59, 245, .35), 0 0 0 0 rgba(59, 59, 245, .45); transform: scale(1); }
  50% { box-shadow: 0 6px 18px rgba(59, 59, 245, .35), 0 0 0 9px rgba(59, 59, 245, 0); transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) { .game-actions .btn-primary:not(:disabled) { animation: none; } }

/* Bottom bar on phones: status text wraps instead of hiding under the buttons */
@media (max-width: 560px) {
  .game-status { flex: 1 1 0; min-width: 0; }
  .game-status span { line-height: 1.25; }
  .game-actions { gap: 6px; }
  .game-actions .btn { padding: 10px 12px; font-size: 14px; }
}

/* Pick buttons: soft by default, taking turns to pulse so it's clear one must be tapped */
.duel-pick {
  background: var(--brand-soft); color: var(--brand);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand) 30%, #fff);
}
/* Subtle shine that sweeps over the pick buttons in turn (no colour change). */
.duel-pick { position: relative; overflow: hidden; }
.duel-pick::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: translateX(-160%); opacity: 0;
}
.duel-arena .duel-card .duel-pick::after { animation: pickShine2 2.6s ease-in-out infinite; }
.duel-arena .duel-card.r .duel-pick::after { animation-delay: 1.3s; }
.g-pick .duel-card .duel-pick::after { animation: pickShine3 3.6s ease-in-out infinite; }
.g-pick .duel-card:nth-child(2) .duel-pick::after { animation-delay: 1.2s; }
.g-pick .duel-card:nth-child(3) .duel-pick::after { animation-delay: 2.4s; }
@keyframes pickShine2 {
  0% { transform: translateX(-160%); opacity: 0; }
  5% { opacity: 1; }
  35% { transform: translateX(260%); opacity: 1; }
  40%, 100% { transform: translateX(260%); opacity: 0; }
}
@keyframes pickShine3 {
  0% { transform: translateX(-160%); opacity: 0; }
  4% { opacity: 1; }
  26% { transform: translateX(260%); opacity: 1; }
  30%, 100% { transform: translateX(260%); opacity: 0; }
}
.duel-card.win .duel-pick::after, .duel-card.lose .duel-pick::after { animation: none; opacity: 0; }
.duel-card.win .duel-pick { background: var(--mint); color: #fff; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .duel-card .duel-pick::after { animation: none !important; } }

/* ===== Design v2: same look as ieltslab.kz — left icon sidebar, soft grey canvas, white 16px cards, Raleway, navy #294273 + yellow ===== */
:root {
  --bg: #F3F4F6; --surface: #FFFFFF; --surface-2: #EEF0F3; --ink: #0F1B33; --ink-2: #56627A; --ink-3: #8A93A6; --line: #E3E6EB;
  --brand: #294273; --brand-ink: #FFFFFF; --brand-soft: #E6EBF5; --sun: #F4B400;
  --radius: 16px; --radius-sm: 12px; --shadow: 0 1px 3px rgba(15, 27, 51, .04);
  --font-head: "Raleway", system-ui, sans-serif; --font-body: "Raleway", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1040px; --grad: linear-gradient(103deg, #1F3766 22%, #2A6E8E 78%);
}
h1, h2, h3 { font-weight: 700; letter-spacing: 0; }
.card, .sphere-card, .prof-item, .sphere-res, .g-card, .g-group, .prof-row { border-color: transparent; }
.btn-primary { box-shadow: none; }
.btn-play { box-shadow: none; }
.banner, .banner-play { background: var(--grad); }
.eyebrow { color: #2A6E8E; }
.fact, .info-prof { border-color: transparent; }

/* sidebar / tab bar */
.side { display: none; }
.side a { text-decoration: none; color: var(--ink-2); }
.side svg { width: 24px; height: 24px; display: block; }
.side a.on { color: var(--ink); }
.side a.on svg { color: var(--brand); }
.side .sb-lang { border: 0; background: none; cursor: pointer; color: var(--ink-2); font: inherit; }
.side a span, .side .sb-lang span { max-width: 100%; letter-spacing: -.01em; }
@media (min-width: 900px) {
  .header { display: none; }
  body { padding-left: 96px; }
  .side { display: flex; flex-direction: column; align-items: stretch; gap: 6px; position: fixed; left: 0; top: 0; bottom: 0; width: 96px; z-index: 40; background: var(--bg); border-right: 1px solid var(--line); padding: 18px 4px; }
  .side a, .side .sb-lang { display: grid; justify-items: center; gap: 6px; padding: 12px 0; border-radius: 12px; font-weight: 600; font-size: 12px; text-align: center; line-height: 1.2; }
  .side a:hover, .side .sb-lang:hover { color: var(--ink); background: var(--surface-2); }
  .side a.on { font-weight: 700; }
  .side .sb-brand { padding: 6px 0 18px; }
  .side .sb-brand:hover { background: none; }
  .side .sb-brand img { width: 48px; height: 48px; }
  .side .sb-lang { margin-top: auto; }
  .game-bar { left: 96px; }
  .hero { padding-top: 40px; }
}
@media (max-width: 899px) {
  .side { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .side a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 6px; font-size: 11px; font-weight: 700; text-align: center; line-height: 1.2; }
  .side svg { width: 22px; height: 22px; }
  .side a.on { color: var(--brand); }
  .side .sb-brand, .side .sb-lang { display: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .header .nav > a { display: none; }
  /* the test and the game have their own bottom bars: no tab bar there */
  body[data-page="test"] .side, body[data-page="play"] .side { display: none; }
  body[data-page="test"], body[data-page="play"] { padding-bottom: 0; }
}

/* Game chooser sheet */
.pc-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(22, 22, 58, .45); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .18s; }
.pc-wrap.in { opacity: 1; }
body.pc-open { overflow: hidden; }
.pc-sheet { width: 100%; max-width: 480px; background: var(--bg); border-radius: 24px; padding: 18px; box-shadow: 0 20px 60px rgba(22, 22, 58, .25); transform: translateY(12px); transition: transform .2s; }
.pc-wrap.in .pc-sheet { transform: none; }
.pc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pc-head h2 { font-size: 20px; }
.pc-x { border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px; color: var(--ink-2); }
.pc-opt { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); border-radius: 18px; padding: 14px; }
.pc-opt + .pc-opt { margin-top: 10px; }
.pc-txt { flex: 1; min-width: 0; display: grid; gap: 3px; }
.pc-txt b { font-family: var(--font-head); font-size: 16px; line-height: 1.25; }
.pc-txt small { font-size: 13.5px; line-height: 1.35; color: var(--ink-2); }
.pc-ic { font-size: 28px; flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--surface); }
.pc-go { font-weight: 800; font-size: 20px; flex: none; }
.pc-main { background: var(--brand); color: #fff; padding: 18px 14px; box-shadow: 0 8px 22px rgba(59, 59, 245, .3); }
.pc-main .pc-txt b { font-size: 18px; }
.pc-main .pc-txt small { color: rgba(255, 255, 255, .85); }
.pc-main .pc-ic { width: 56px; height: 56px; font-size: 32px; background: rgba(255, 255, 255, .16); }
.pc-rec { justify-self: start; background: var(--sun); color: var(--ink); font-weight: 800; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; }
.pc-unt { background: var(--surface); border: 1.5px solid var(--line); }
.pc-unt .pc-ic { background: var(--surface-2); }
@media (hover: hover) {
  .pc-main:hover { background: #2E2EDB; }
  .pc-unt:hover { border-color: var(--ink-3); }
}
@media (max-width: 640px) {
  .pc-wrap { place-items: end stretch; padding: 0; }
  .pc-sheet { max-width: none; border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
}
