/* Crater Relay website. Colors follow the game's Study A palette. */
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0e1b22;
  --bg-2: #132530;
  --panel: #1b3039;
  --panel-2: #2a4652;
  --line: rgba(240, 239, 223, .12);
  --cream: #f0efdf;
  --text: #dfe5e3;
  --muted: #a3b4ba;
  --gold: #e7c65a;
  --gold-dark: #a88b38;
  --ink: #1b2329;
  --rare: #6fb7d6;
  --epic: #b58ae0;
  --radius: 14px;
  --wrap: 1160px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 18px/1.6 "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #f3da86; }
h1, h2, h3 { color: var(--cream); line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(40px, 7vw, 76px); font-weight: 700; }
h2 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 700; }
h3 { font-size: 22px; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 16px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(14, 27, 34, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; font-weight: 700; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; border-radius: 10px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--panel); color: var(--gold); }
.menu-btn { display: none; margin-left: auto; background: var(--panel); color: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font: 700 15px "Barlow", sans-serif; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
@media (max-width: 820px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 24px; border-radius: 12px; font: 700 17px "Barlow", sans-serif; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; border: 0; cursor: pointer; }
.btn-gold { background: linear-gradient(#efd277, var(--gold)); color: var(--ink); box-shadow: 0 4px 0 var(--gold-dark), 0 10px 24px rgba(0, 0, 0, .35); }
.btn-gold:hover { color: var(--ink); filter: brightness(1.05); }
.btn-slate { background: var(--panel-2); color: var(--cream); box-shadow: 0 4px 0 #142731; }
.btn-slate:hover { color: var(--cream); filter: brightness(1.1); }
.btn[aria-disabled="true"] { cursor: default; }
.btn svg { width: 22px; height: 22px; flex: none; }
/* Google's badge image has clear space built in; the negative margin lines its black shape up with the 52 px buttons. */
.play-badge { display: inline-flex; margin: -13px -14px; border-radius: 12px; }
.play-badge img { display: block; height: 78px; width: auto; }
.play-badge:hover { filter: brightness(1.15); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 56px 0 72px; background:
  radial-gradient(1200px 500px at 80% 0%, rgba(231, 198, 90, .14), transparent 60%),
  linear-gradient(180deg, #13252f 0%, var(--bg) 100%); }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 44px; align-items: center; }
.hero-logo { width: min(420px, 100%); margin: 0 0 8px -12px; }
.eyebrow { color: var(--gold); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 15px; margin-bottom: 10px; }
.lead { font-size: 21px; color: var(--text); max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 18px; }
.fine { color: var(--muted); font-size: 15px; }
.hills { position: absolute; left: 0; right: 0; bottom: -1px; height: 90px; width: 100%; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } .hero-logo { margin-left: -8px; } }

/* Landscape phone frame */
.device { position: relative; border-radius: 30px; padding: 12px; background: linear-gradient(145deg, #2b3a42, #0b1418); box-shadow: 0 30px 60px rgba(0, 0, 0, .5), inset 0 0 0 2px rgba(255, 255, 255, .06); }
.device img { border-radius: 20px; width: 100%; aspect-ratio: 20 / 9; object-fit: cover; }
.device::after { content: ""; position: absolute; left: 4px; top: 50%; width: 4px; height: 52px; transform: translateY(-50%); border-radius: 4px; background: #0b1418; }
.tilt { transform: perspective(1400px) rotateY(-9deg) rotateX(3deg); }
@media (max-width: 900px) { .tilt { transform: none; } .device { border-radius: 22px; padding: 8px; } .device img { border-radius: 15px; } }

/* Sections */
section { padding: 84px 0; }
.alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 20px; }

/* Stats strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -36px; position: relative; z-index: 2; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-align: center; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
.stat b { display: block; font-size: 38px; line-height: 1.1; color: var(--gold); }
.stat span { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 14px; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* Feature cards */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card p { color: var(--muted); margin: 0; }
.card .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: rgba(231, 198, 90, .14); color: var(--gold); margin-bottom: 14px; }
.card .ico svg { width: 26px; height: 26px; }

/* Split rows with screenshots */
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: center; }
.split + .split { margin-top: 72px; }
.split.flip > :first-child { order: 2; }
.split ul { padding-left: 1.1em; margin: 0; color: var(--text); }
.split li { margin: .35em 0; }
.split li::marker { color: var(--gold); }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 24px; } .split.flip > :first-child { order: 0; } }
.shot { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, .4); background: #0b1418; cursor: zoom-in; padding: 0; display: block; width: 100%; }
.shot img { width: 100%; }

/* Worlds carousel */
.worlds { display: grid; grid-auto-flow: column; grid-auto-columns: min(560px, 82%); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 14px; scrollbar-color: var(--panel-2) transparent; }
.world { scroll-snap-align: start; margin: 0; }
.world figcaption { margin-top: 10px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 16px; }
.world figcaption b { color: var(--cream); font-size: 19px; text-transform: uppercase; letter-spacing: .06em; }

/* Tanks */
.tanks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .tanks { grid-template-columns: repeat(2, 1fr); } }
.tank { background: #182e39; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 18px; }
.tank img { width: 100%; aspect-ratio: 204 / 132; object-fit: contain; }
.tank h3 { margin: 6px 0 2px; font-size: 20px; text-transform: uppercase; letter-spacing: .06em; }
.tank p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.rarity { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.r-common { color: var(--muted); } .r-rare { color: var(--rare); } .r-epic { color: var(--epic); } .r-legendary { color: var(--gold); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.chips li { background: var(--panel-2); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 15px; color: var(--cream); }

/* FAQ */
.faq { max-width: 860px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
.faq summary { cursor: pointer; padding: 18px 22px; font-weight: 700; color: var(--cream); font-size: 19px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: "-"; }
.faq details > div { padding: 0 22px 18px; color: var(--muted); }

/* Final call */
.final { text-align: center; background: radial-gradient(700px 300px at 50% 100%, rgba(231, 198, 90, .16), transparent 70%), var(--bg-2); border-top: 1px solid var(--line); }
.final .cta { justify-content: center; }

/* Footer */
.site-foot { background: #0a151b; border-top: 1px solid var(--line); padding: 40px 0 28px; color: var(--muted); font-size: 15px; }
.site-foot .cols { display: flex; flex-wrap: wrap; gap: 28px 48px; justify-content: space-between; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-foot a { color: var(--text); text-decoration: none; }
.site-foot a:hover { color: var(--gold); }
.site-foot .credits { margin-top: 24px; font-size: 14px; }

/* Legal and help pages */
.doc { padding: 56px 0 80px; }
.doc .wrap { max-width: 860px; }
.doc h1 { font-size: clamp(34px, 5vw, 52px); }
.doc h2 { font-size: 28px; margin-top: 1.8em; }
.doc h3 { margin-top: 1.4em; }
.doc ul, .doc ol { padding-left: 1.2em; }
.doc li { margin: .3em 0; }
.doc .meta { color: var(--muted); }
.doc .note { background: var(--panel); border-left: 4px solid var(--gold); border-radius: 10px; padding: 16px 20px; margin: 24px 0; }
.doc .note p:last-child { margin: 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: 16px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { color: var(--cream); background: var(--panel); }
.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; margin: 28px 0; }
.toc ol { margin: 0; columns: 2; column-gap: 32px; }
@media (max-width: 620px) { .toc ol { columns: 1; } }

/* Image viewer */
dialog.viewer { padding: 0; border: 0; background: transparent; max-width: min(1400px, 96vw); }
dialog.viewer::backdrop { background: rgba(5, 10, 13, .88); }
dialog.viewer img { border-radius: 12px; max-height: 88vh; width: auto; margin: auto; }
dialog.viewer button { position: absolute; right: 8px; top: 8px; }

.center { text-align: center; }
.mt { margin-top: 28px; }
@media (max-width: 420px) { .btn { font-size: 15px; letter-spacing: .03em; padding: 12px 18px; } }
code { font-size: .88em; overflow-wrap: anywhere; }

/* B8c: invite link page */
.join-card { display: inline-block; text-align: center; margin: 18px 0 6px; padding: 18px 36px; }
.join-card[hidden] { display: none; }
.join-card .join-code { font: 800 56px/1.1 "Barlow", sans-serif; letter-spacing: .14em; color: var(--gold); margin: 6px 0 0 !important; }
