/* Magic Bomb website (built like the Magic Marble site). Same look as the Companion site: design-system tokens (tokens.css), bundled fonts,
   and the Companion's site.css building blocks, plus the game's own parts (backdrop, world cards). */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--night-900); color: var(--text-body);
  font-family: var(--font-body); font-size: var(--fs-body); line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--gold-400); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--gold-200); }
:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 3px; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--gold-400); color: var(--night-900); padding: 8px 14px; font-family: var(--font-ui); font-weight: 700; }
.skip:focus { top: 12px; color: var(--night-900); }

.wrap { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--gutter); }
.icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Typography */
.eyebrow { font-family: var(--font-heading); font-size: 13px; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--gold-400); margin: 0 0 12px; }
.display { font-family: var(--font-display); font-weight: 700; color: var(--text-strong); letter-spacing: var(--tracking-display); line-height: var(--lh-tight); margin: 0; text-wrap: balance; }
h2.display { font-size: clamp(30px, 4.4vw, var(--fs-display-l)); }
h3 { font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-h3); letter-spacing: .03em; color: var(--text-strong); line-height: var(--lh-heading); margin: 0 0 6px; }
.lede { font-size: var(--fs-body-l); color: var(--text-muted); max-width: 62ch; margin: 16px 0 0; text-wrap: pretty; }
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }
.divider { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 18px auto 0; width: min(320px, 70%); }
.divider::before, .divider::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--gold-600)); }
.divider::after { transform: scaleX(-1); }
.divider i { width: 9px; height: 9px; background: var(--gold-300); transform: rotate(45deg); box-shadow: var(--glow-gold); }

/* Buttons (design system: square, 2px gold) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--control-h-m); padding: 0 22px; border: 2px solid var(--gold-400); background: transparent; color: var(--gold-400);
  font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .02em; white-space: nowrap;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.btn:hover { background: var(--accent-soft); color: var(--gold-200); box-shadow: var(--glow-gold); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 19px; height: 19px; }
.btn-solid { background: var(--gold-400); color: var(--night-900); border-color: transparent; }
.btn-solid:hover { background: var(--gold-300); color: var(--night-900); box-shadow: var(--glow-gold-strong); }
.btn-l { height: var(--control-h-l); padding: 0 30px; font-size: 19px; }
.btn-s { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-quiet { border-color: transparent; color: var(--text-body); font-family: var(--font-ui); font-weight: 500; font-size: 17px; }
.btn-quiet:hover { background: none; box-shadow: none; color: var(--gold-200); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(4,11,18,.78); backdrop-filter: var(--blur-overlay); -webkit-backdrop-filter: var(--blur-overlay); border-bottom: 1px solid var(--border-faint); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text-strong); margin-right: auto; min-width: 0; }
.brand:hover { color: var(--text-strong); }
.brand img { height: 42px; width: auto; filter: var(--glow-logo); }
.brand span { font-family: var(--font-heading); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; line-height: 1.15; }
.brand b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: .02em; text-transform: none; color: var(--gold-300); }
.site-nav { display: flex; gap: 26px; font-family: var(--font-ui); font-size: 16px; }
.site-nav a { color: var(--text-muted); }
.site-nav a:hover { color: var(--gold-200); }
.lang { font-family: var(--font-ui); font-size: 15px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.lang .icon { width: 17px; height: 17px; }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--gradient-night); padding: 72px 0 0; }
.hero-backdrop { position: absolute; inset: 0; background: center 30% / cover no-repeat; opacity: .8; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 85%); mask-image: linear-gradient(180deg, #000 30%, transparent 85%); }
.hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 40%; background: var(--gradient-protect-bottom); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-crest { width: 128px; height: auto; filter: drop-shadow(0 0 26px rgba(232,200,103,.42)); margin-bottom: 26px; }
.hero h1 { font-size: clamp(38px, 7vw, 76px); }
.hero h1 small { display: block; font-family: var(--font-heading); font-weight: 600; font-size: clamp(14px, 1.6vw, 18px); letter-spacing: .3em; text-transform: uppercase; color: var(--gold-400); margin-bottom: 14px; }
.hero-tagline { font-family: var(--font-heading); font-weight: 500; font-size: clamp(19px, 2.4vw, 26px); color: var(--gold-200); letter-spacing: .04em; margin: 14px 0 0; }
.hero .lede { max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; margin-top: 34px; }
.hero-actions.left { justify-content: flex-start; margin-top: 28px; }
.hero-meta { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; padding: 0; margin: 22px 0 0; font-family: var(--font-ui); font-size: 15px; color: var(--text-faint); }
.hero-meta li { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta .icon { color: var(--gold-500); width: 16px; height: 16px; }
.hero-shot { margin-top: 56px; width: 100%; max-width: 1120px; }

.hero-magic { display: inline-flex; align-items: flex-start; gap: 10px; max-width: 60ch; margin: 18px 0 0; font-style: italic; font-size: var(--fs-body-l); color: var(--gold-200); text-wrap: pretty; }
.hero-magic .icon { width: 20px; height: 20px; margin-top: 6px; color: var(--gold-400); }

/* Why the Companion is different */
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.why-card { padding: 26px 24px 28px; }
.why-card > .icon { width: 30px; height: 30px; color: var(--gold-300); margin-bottom: 16px; filter: drop-shadow(0 0 10px rgba(212,175,55,.35)); }
.why-card h3 { font-size: 19px; }

/* Small chips (mechanics of a world) */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 4px 0 12px; }
.chips li { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); background: var(--accent-soft); font-family: var(--font-ui); font-size: 13px; font-weight: 500; color: var(--gold-200); white-space: nowrap; }
.chips li .icon { width: 13px; height: 13px; color: var(--success); }

/* Framed screenshots */
.shot { position: relative; margin: 0; border: 1px solid var(--border-subtle); background: var(--night-950); box-shadow: var(--shadow-3), 0 0 60px rgba(212,175,55,.08); }
.shot::before { content: ''; position: absolute; inset: -6px; border: 1px solid rgba(212,175,55,.12); pointer-events: none; }
.shot img { width: 100%; height: auto; }

/* Sections */
.section { position: relative; padding: 112px 0; }
.section.alt { background: linear-gradient(180deg, var(--night-950), var(--night-900)); border-top: 1px solid var(--border-faint); border-bottom: 1px solid var(--border-faint); }
.section-head { margin-bottom: 52px; }

/* Cards */
.card { background: var(--surface-card); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-1); transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.card:hover { transform: translateY(-3px); border-color: var(--gold-400); box-shadow: var(--shadow-2), var(--glow-gold); }
.card-body { padding: 20px 22px 24px; }
.card .tag { font-family: var(--font-heading); font-size: 12px; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--gold-400); margin: 0 0 10px; }
.card p { margin: 0; color: var(--text-muted); font-size: 16px; line-height: 1.55; }

/* World cards: screenshot on top, each world's own light as a thin glow on hover */
.worlds { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.world { grid-column: span 2; overflow: hidden; }
.world:nth-child(-n+2), .world:nth-child(n+6) { grid-column: span 3; }
.world .media { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--border-subtle); }
.world h3 { font-size: 22px; }
.world::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--glow); box-shadow: 0 0 14px var(--glow); opacity: .75; }
.world { position: relative; }
.world:hover { border-color: var(--glow); box-shadow: var(--shadow-2), 0 0 22px color-mix(in srgb, var(--glow) 40%, transparent); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 64px; align-items: center; }
.split.flip { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.split.flip > :first-child { order: 2; }
.split + .split { margin-top: 96px; }

.spells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.spell { display: flex; gap: 16px; padding: 20px; }
.spell .badge { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border-subtle); color: var(--gold-300); background: var(--accent-soft); }
.spell .badge .icon { width: 22px; height: 22px; }
.spell h3 { font-size: 18px; }

.promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 40px; }
.promise { display: flex; gap: 16px; }
.promise > .icon { width: 28px; height: 28px; color: var(--gold-400); margin-top: 2px; }
.promise h3 { font-size: 18px; }
.promise p { margin: 0; color: var(--text-muted); font-size: 16px; line-height: 1.55; }
.honest { margin-top: 20px; padding: 24px 28px; border: 1px solid var(--border-subtle); border-left: 3px solid var(--gold-400); background: rgba(212,175,55,.05); display: flex; gap: 18px; }
.honest > .icon { width: 26px; height: 26px; color: var(--gold-300); margin-top: 3px; }
.honest p { margin: 0; color: var(--text-body); }
.honest strong { color: var(--gold-200); }

.steps-title { margin: 64px 0 20px; font-size: 24px; text-align: center; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 30px 26px 28px; }
.step .num { font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1; color: var(--gold-400); text-shadow: 0 0 24px rgba(212,175,55,.35); display: block; margin-bottom: 14px; }

.costs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cost { padding: 28px; }
.cost .value { font-family: var(--font-display); font-weight: 700; font-size: 30px; color: var(--gold-300); line-height: 1.15; margin: 4px 0 12px; }
/* "Made of code": big numbers, a faint scanline glow as a nod to the eighties */
.stats .stat { text-align: center; }
.stats .value { font-size: clamp(40px, 5vw, 56px); margin: 0 0 6px; text-shadow: 0 0 28px rgba(212,175,55,.35); }
.stats .tag { margin-bottom: 12px; }
.proc { background: repeating-linear-gradient(180deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px), var(--night-900); }
.season-badge { margin: 0 0 8px; font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--glow); }
/* Top 100: teaser on the home page and the boards page */
.top-teaser { background: var(--gradient-night); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.top-teaser-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px; }
.top-teaser-inner > div { flex: 1 1 520px; }
.top-note { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; font-family: var(--font-ui); font-size: 15px; color: var(--text-faint); }
.top-note .icon { width: 17px; height: 17px; color: var(--success); }
.top-hero { padding-bottom: 48px; }
.board-chips { justify-content: center; margin-top: 24px; }
.board-chips a { color: inherit; }
.boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.board { position: relative; padding: 22px 22px 18px; }
.board::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--glow); box-shadow: 0 0 14px var(--glow); opacity: .75; }
.board:hover { transform: none; }
.board-title { font-family: var(--font-heading); font-size: 22px; letter-spacing: .03em; color: var(--text-strong); margin: 0 0 12px; }
.board-empty { color: var(--text-muted); font-style: italic; margin: 0; }
.board-list { list-style: none; margin: 0; padding: 0; font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.board-list li { display: grid; grid-template-columns: 2.6ch minmax(0, 1fr) auto 6.2em; gap: 12px; align-items: baseline; padding: 6px 4px; border-bottom: 1px solid var(--border-faint); }
.board-list .r { color: var(--text-faint); text-align: right; }
/* Gold only for the podium, not for ranks 11-13 in the unfolded part */
.board > .board-list li:nth-child(-n+3) .r { color: var(--gold-300); font-weight: 700; }
.board-list .n { font-family: var(--font-heading); font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .t { color: var(--gold-200); }
.board-list .d { color: var(--text-faint); font-size: 13px; text-align: right; }
.board-more summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; margin-top: 10px; font-family: var(--font-ui); font-size: 15px; color: var(--gold-400); }
.board-more summary::-webkit-details-marker { display: none; }
.board-more summary .icon { width: 17px; height: 17px; transition: transform var(--dur-base) var(--ease-out); }
.board-more[open] summary .icon { transform: rotate(180deg); }
.top-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 48px; }
.top-actions .more { font-family: var(--font-ui); }
.support { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; padding: 24px 28px; border: 1px dashed var(--border-subtle); }
.support > div { flex: 1 1 360px; }
.support h3 { display: flex; align-items: center; gap: 10px; }
.support h3 .icon { color: var(--gold-400); width: 22px; height: 22px; }
.support p { margin: 0; color: var(--text-muted); font-size: 16px; }

.faq { max-width: 820px; margin: 0 auto; border-top: 1px solid var(--border-faint); }
.faq details { border-bottom: 1px solid var(--border-faint); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 4px; font-family: var(--font-heading); font-weight: 600; font-size: 19px; letter-spacing: .02em; color: var(--text-strong); transition: color var(--dur-fast) var(--ease-out); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--gold-200); }
.faq summary .icon { width: 20px; height: 20px; color: var(--gold-400); transition: transform var(--dur-base) var(--ease-out); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details p { margin: 0; padding: 0 4px 22px; color: var(--text-muted); max-width: 70ch; }

.download { position: relative; overflow: hidden; background: var(--gradient-night); border-top: 1px solid var(--border-subtle); }
.download .hero-backdrop { opacity: .55; -webkit-mask-image: none; mask-image: none; }
.download-inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.download-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 30px; }
.download-actions a.more { font-family: var(--font-ui); font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.download-actions a.more .icon { width: 17px; height: 17px; }
.req { padding: 28px; }
.req ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.req li { display: flex; gap: 12px; color: var(--text-body); font-size: 16px; line-height: 1.45; }
.req li .icon { color: var(--success); width: 20px; height: 20px; margin-top: 1px; }

.site-footer { border-top: 1px solid var(--border-subtle); background: var(--night-950); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-top: 32px; padding-bottom: 32px; font-family: var(--font-ui); font-size: 14px; color: var(--text-faint); }
.site-footer .who { display: flex; align-items: center; gap: 12px; }
.site-footer .who img { height: 40px; width: auto; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer nav a { color: var(--text-muted); }
.site-footer nav a:hover { color: var(--gold-200); }

/* Gentle entrance, only where motion is welcome */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * { animation: rise var(--dur-slow) var(--ease-out) both; }
  .hero-inner > :nth-child(2) { animation-delay: 60ms; } .hero-inner > :nth-child(3) { animation-delay: 120ms; }
  .hero-inner > :nth-child(4) { animation-delay: 180ms; } .hero-inner > :nth-child(5) { animation-delay: 240ms; }
  .hero-inner > :nth-child(6) { animation-delay: 300ms; } .hero-inner > :nth-child(7) { animation-delay: 380ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* Tablet */
@media (max-width: 1020px) {
  .site-nav { display: none; }
  .worlds { grid-template-columns: repeat(2, 1fr); }
  .world, .world:nth-child(-n+2), .world:nth-child(n+6) { grid-column: span 1; }
  .world:first-child { grid-column: span 2; }
  .costs { grid-template-columns: 1fr; }
  .split, .split.flip { grid-template-columns: 1fr; gap: 36px; }
  .split.flip > :first-child { order: 0; }
  .spells, .promises, .why { grid-template-columns: repeat(2, 1fr); }
  .boards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .download-inner { grid-template-columns: 1fr; gap: 36px; }
  .section { padding: 88px 0; }
}
/* Phone */
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .site-header .wrap { gap: 12px; height: 60px; }
  .brand img { height: 34px; }
  .brand span { font-size: 10px; }
  .brand b { font-size: 17px; }
  .site-header .btn-s { padding: 0 12px; font-size: 13px; }
  .site-header .btn-s .icon { display: none; }
  .lang span { display: none; }
  .hero { padding-top: 48px; }
  .hero-crest { width: 96px; }
  .hero-actions .btn { width: 100%; }
  .btn-l { height: auto; min-height: var(--control-h-l); padding: 10px 20px; font-size: 17px; white-space: normal; text-align: center; }
  .hero-shot { margin-top: 40px; }
  .worlds, .spells, .promises, .costs, .why { grid-template-columns: 1fr; }
  .world:first-child { grid-column: span 1; }
  .hero-actions.left .btn { width: 100%; }
  .hero-magic { font-size: 17px; text-align: left; }
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 36px; }
  .honest, .support, .cost, .req { padding: 20px; }
  .faq summary { font-size: 17px; }
  .download-actions .btn { width: 100%; }
}

/* Magic Bomb: six game modes, three per row (two on tablets, one on phones). */
.worlds.six .world { grid-column: span 2; }
@media (max-width: 1020px) { .worlds.six .world { grid-column: span 1; } }
