@font-face { font-family: Nunito; src: url('assets/Nunito.ttf'); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: Lilita; src: url('assets/LilitaOne-Regular.ttf'); font-weight: 400; font-display: swap; }

/* Shared app colors: BRANDING.md and game/godot/scripts/ui/ui_theme.gd. */
:root {
  --navy: #0b1b2e;
  --navy-solid: #11243b;
  --border: rgb(43% 68% 79% / .42);
  --cyan: #5cdbff;
  --gold: #ffc933;
  --gold-edge: #d98f0d;
  --ink: #291c08;
  --muted: #bdcced;
  --green: #80eb6b;
  --tile: #1a3b52;
  --secondary: #21405c;
  --secondary-edge: #3d6b87;
  --secondary-text: #e8f5ff;
  --paper: #faf8f0;
  --text: #123c4c;
  --measure: min(90%, 1200px);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--text); font: 17px/1.65 Nunito, system-ui, sans-serif; }
html { scroll-behavior: smooth; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; }
h1, h2, h3, h4 { margin: 0; font: 400 1em/1.08 Lilita, system-ui, sans-serif; }
h1 { font-size: clamp(3rem, 6vw, 5.8rem); letter-spacing: -.025em; }
h2 { font-size: clamp(2.15rem, 4vw, 3.3rem); letter-spacing: -.02em; text-wrap: balance; }
h3 { font-size: clamp(1.3rem, 2vw, 1.65rem); }
p { margin: 1em 0 0; }
figure { min-width: 0; margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #13798b; outline-offset: 4px; }
.hero :focus-visible, .rule-experiment :focus-visible { outline-color: var(--cyan); }
.skip { position: absolute; top: -100px; left: 16px; z-index: 9; padding: 10px 14px; background: white; }
.skip:focus { top: 10px; }

.header { display: flex; min-height: 84px; padding: 6px 5%; gap: 24px; align-items: center; justify-content: space-between; }
.brand img { width: 172px; }
.header nav { display: flex; gap: clamp(12px, 3vw, 35px); }
.header nav a { text-decoration: none; font-weight: 850; font-size: .95rem; }
.header nav a:hover, .footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.button, .rule-game button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px;
  border: 1px solid var(--gold-edge); border-bottom-width: 5px; border-radius: 18px;
  background: var(--gold); color: var(--ink); padding: 12px 21px; text-decoration: none;
  font: 400 1.06rem/1.2 Lilita, sans-serif; cursor: pointer;
}
.button:hover, .rule-game .start-wave:hover:not(:disabled) { background: color-mix(in srgb, var(--gold), white 8%); }
.button:active, .rule-game .start-wave:active:not(:disabled) { background: color-mix(in srgb, var(--gold), black 6%); }
.button.small { padding: 9px 14px; font-size: .95rem; white-space: nowrap; }

.hero {
  position: relative; isolation: isolate; display: grid; align-items: center; overflow: hidden;
  background: #09344c; color: #fff; min-height: clamp(565px, 51vw, 760px);
}
.hero-art { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 58% 51%; }
.hero::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg,#082b42 0%,#082b42cb 22%,#082b4260 43%,transparent 68%); }
.hero-inner { width: var(--measure); margin: 0 auto; padding: 60px 0; }
.hero h1 { max-width: 11ch; }
.hero-inner > p { max-width: min(42%, 390px); font-size: 1.13rem; color: #e4f2fa; }
.hero .hero-tagline { margin: 0 0 15px; color: #b6f0f4; font-weight: 850; font-size: .92rem; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 11px 20px; margin-top: 26px; }
.hero-actions > a:not(.button) { font-size: .96rem; font-weight: 800; text-underline-offset: 4px; }
.hero .hero-meta { margin-top: 24px; color: #c3dce8; font-size: .88rem; }

.section { padding: clamp(52px, 7vw, 98px) max(5%, calc((100% - 1200px) / 2)); }
.section-heading { max-width: 655px; margin: 0 0 30px; }
.section-heading h2, .split h2, .parents h2 { text-wrap: wrap; }
.section-heading p, .split p, .parents p { max-width: 62ch; }
.game-frame { overflow: hidden; border-radius: 19px; background: var(--navy-solid); color: #dce9f4; box-shadow: 0 12px 30px #0c2d4026; }
.game-frame img { width: 100%; }
.game-frame figcaption { padding: 12px 17px; font-size: .88rem; line-height: 1.45; }
.game-frame figcaption strong { color: white; }
.intro .game-frame { max-width: 1000px; }
.three-up { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 31px; }
.three-up article { border-top: 2px solid #c9d9d1; padding-top: 17px; }
.three-up p, .field-guide article p { margin-top: .55em; font-size: .96rem; }

.campaign { background: #e7efe8; }
.campaign-grid, .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.16fr); gap: clamp(26px, 5vw, 65px); align-items: center; }
.campaign-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.season-list { list-style: none; counter-reset: season; margin: 0; padding: 0; }
.season-list li { position: relative; counter-increment: season; padding: 10px 0 10px 46px; border-bottom: 1px solid #c8d8cd; }
.season-list li:first-child { padding-top: 0; }
.season-list li::before {
  content: counter(season); position: absolute; left: 0; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; background: var(--navy-solid); color: var(--gold); font: 17px Lilita, sans-serif;
}
.season-list h3 { font-size: 1.23rem; }
.season-list p { margin: .3em 0 0; font-size: .92rem; line-height: 1.4; }
.feature-shots { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 22px; margin-top: 34px; align-items: start; }
.rule-example { list-style: none; margin: 23px 0 0; background: var(--navy-solid); border-radius: 14px; padding: 9px 14px; color: #fff; }
.rule-example li { display: flex; align-items: center; gap: 11px; padding: 6px 0; font-size: .96rem; }
.rule-example b, .rule-row b { min-width: 61px; padding: 5px 7px; border-radius: 7px; background: var(--gold); color: var(--ink); text-align: center; font: .9rem Lilita, sans-serif; }
.rule-example li:nth-child(2) b, .rule-row:nth-child(2) b { background: var(--cyan); }
.rule-example li:nth-child(3) b, .rule-row:nth-child(3) b { background: #bc9af5; }

.rule-experiment { background: #123e4e; color: #fff; }
.experiment-title { max-width: 615px; margin: 0 0 25px; }
.experiment-title h2 { text-wrap: wrap; }
.sim-note { color: #c7dfe4; font-size: .88rem; }
.rule-game { background: var(--navy); border: 1px solid var(--border); border-top-width: 2px; border-radius: 22px; overflow: hidden; box-shadow: 0 18px 50px #031c3460; }
.rule-game button { background: var(--secondary); color: var(--secondary-text); border-color: var(--secondary-edge); border-bottom-width: 4px; padding: 8px 12px; font-size: .99rem; }
.rule-game button:hover:not(:disabled) { background: color-mix(in srgb, var(--secondary), white 8%); }
.rule-game button:disabled { cursor: default; opacity: .60; }
.game-glyph { display: block; width: 1.15em; height: 1.15em; flex: none; }
.mission-hud { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 14px 17px 8px; background: var(--navy-solid); }
.mission-hud > div:first-child { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.mission-hud strong { font: clamp(1.3rem, 3vw, 1.8rem) Lilita, sans-serif; }
#sim-phase { color: var(--cyan); font-size: .85rem; font-weight: 850; }
.hud-actions { display: flex; gap: 6px; }
.mission-counters { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 17px 13px; background: var(--navy-solid); }
.mission-counters > span { display: flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 20px; padding: 6px 12px; background: var(--navy); font: .9rem Lilita, sans-serif; }
.rule-field { display: grid; align-items: start; grid-template-columns: minmax(0,1fr) minmax(285px,33%); gap: 12px; padding: 12px; background: #153d50; }
.rule-field:has(.tower-inspector[hidden]) { grid-template-columns: minmax(0,1fr); }
.map-stage { position: relative; width: 100%; max-width: 840px; margin: 0 auto; }
.map-stage > svg { display: block; width: 100%; border-radius: 12px; overflow: hidden; }
.map-stage text { font-family: Lilita, sans-serif; }
.rule-game .field-tower {
  position: absolute; top: 48.57%; transform: translate(-50%,-50%); width: max(44px, 10.8%); height: max(44px, 18.57%);
  border-radius: 50%; border: 2px solid transparent; padding: 0; background: transparent;
}
.rule-game .field-tower:hover, .rule-game .field-tower:focus-visible { border-color: var(--cyan); background: #8befff22; }
.blaster-pick { left: 50%; }
.laser-pick { left: 74.17%; }
.wave-preview {
  position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 5px; padding: 3px 9px;
  background: #0b1b30ed; border: 1px solid var(--border); border-radius: 14px; font: 1rem Lilita, sans-serif; pointer-events: none;
}
.wave-preview img { width: 27px; height: 27px; }
.wave-preview img:nth-of-type(2) { margin-left: 7px; }
.tower-inspector { position: relative; background: var(--navy); border: 1px solid var(--border); border-radius: 16px; padding: 12px; }
.inspector-heading { display: flex; align-items: center; gap: 8px; }
.inspector-heading > img { width: 55px; height: 55px; background: var(--tile); border: 1px solid var(--border); border-radius: 12px; }
.inspector-heading button { margin-left: auto; min-width: 44px; }
.inspector-heading p, #sim-edit-status { margin: .2em 0 0; color: var(--muted); font-size: .77rem; }
.tower-meters { margin: 10px 0; }
.tower-meters > div { display: grid; grid-template-columns: 45px minmax(0,1fr) 64px; align-items: center; gap: 7px; margin: 5px 0; color: var(--muted); font-size: .77rem; }
.tower-meters i { height: 8px; overflow: hidden; border-radius: 8px; background: #051120; }
.tower-meters b { display: block; height: 100%; border-radius: inherit; background: var(--cyan); }
.tower-meters strong { text-align: right; color: white; font: .78rem Lilita, sans-serif; }
.tower-inspector h4 { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 1.16rem; }
.rule-game .rule-row { display: flex; justify-content: flex-start; width: 100%; gap: 6px; margin-top: 6px; padding: 6px; border-radius: 11px; background: #061423; text-align: left; font-size: .91rem; }
.rule-row > span:not(.rule-icon) { flex: 1; }
.rule-row b { min-width: 48px; font-size: .8rem; }
.rule-row > i { color: var(--gold); font-style: normal; }
.rule-inactive > i { visibility: hidden; }
.rule-icon { width: 31px; height: 31px; flex: 0 0 31px; object-fit: contain; pointer-events: none; }
.no-shell-icon { position: relative; display: block; }
.no-shell-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.no-shell-icon img:first-child { width: 78%; height: 78%; top: 22%; }
#sim-choice-menu { position: absolute; z-index: 1; inset: 7px; padding: 9px; overflow: auto; background: var(--navy-solid); border: 1px solid var(--border); border-radius: 13px; }
.choice-heading, #sim-choice-options button { display: flex; align-items: center; gap: 8px; }
.choice-heading { margin-bottom: 10px; }
.choice-heading strong, #sim-choice-options button > span { flex: 1; text-align: left; }
#sim-choice-options { display: grid; gap: 6px; }
#sim-choice-options button[aria-pressed=true] { border-color: var(--cyan); background: #1a536f; }
#sim-laser-description { font-size: .88rem; color: #dce9fb; }
.mission-bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 17px; }
.robot-report { display: flex; align-items: center; gap: 10px; }
.robot-report img { width: 50px; flex-shrink: 0; }
.robot-report strong { font: 1.15rem Lilita, sans-serif; color: var(--cyan); }
#sim-result { font-size: .86rem; color: #dce9fb; margin: .25em 0 0; }
.rule-game .start-wave { color: var(--ink); background: var(--gold); border-color: var(--gold-edge); border-bottom-width: 5px; white-space: nowrap; font-size: 1.21rem; padding: 9px 15px; }
.mission-review { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; padding: 7px 17px 12px; background: #081626; color: var(--muted); font-size: .8rem; }
.mission-review b { font: 1.1rem Lilita, sans-serif; color: white; }
.mission-review button { margin-left: auto; font-size: .88rem; }
.comparison { margin: 0; background: #081626; color: #c2d6ed; font-size: .8rem; }
.comparison:not(:empty) { padding: 0 17px 13px; }
.rule-game noscript { display: block; padding: 0 17px 13px; }

.field-guide { background: #eaf0e8; }
.creature-row, .field-pairs { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.field-guide article { padding: 15px 16px 18px; background: var(--paper); border-radius: 14px; }
.creature-row img { width: 124px; margin: 0 auto 7px; }
.creature-count { font-size: .94rem; }
.field-pairs { grid-template-columns: repeat(3, minmax(0,1fr)); margin-top: 23px; }
.tool-pair { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center; gap: 20px; margin: 0 0 8px; }
.tool-pair img { width: min(43%,110px); }
.tool-pair.powered::before, .tool-pair.wired::before { content: ""; position: absolute; z-index: -1; left: 36%; right: 36%; top: 51%; height: 4px; background: #2099c2; box-shadow: 0 0 7px #5cdbff; }
.tool-pair.wired::before { border-top: 3px dashed #248574; height: 0; background: none; box-shadow: none; }
.parents { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.45fr); gap: clamp(24px,6vw,84px); }
.parents img { width: 158px; }
.parent-details { border-top: 1px solid #cad6ce; }
details { border-bottom: 1px solid #cad6ce; padding: 15px 0; }
summary { font-weight: 850; cursor: pointer; }
details p { margin: .55em 0 0; font-size: .98rem; color: #3d5b64; }

.site-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 25px; border-top: 1px solid #cad6ce; padding: 24px 5%; }
.footer-brand img { width: 140px; }
.footer-tagline { flex: 1; min-width: 160px; font-size: .85rem; margin: 0; }
.footer-links { display: flex; gap: 7px 15px; flex-wrap: wrap; font-size: .85rem; }
.footer-links a { text-decoration: none; }
.footer-publisher { display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.footer-publisher span { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; }
.footer-publisher img { width: 153px; }
.privacy-policy { width: min(90%, 710px); margin: 0 auto; padding: 48px 0 72px; }
.privacy-policy h1 { font-size: clamp(2rem,6vw,3.25rem); }
.privacy-policy h2 { margin-top: 1.6em; font-size: 1.55rem; text-wrap: wrap; }
.privacy-policy a { overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .rule-field { grid-template-columns: minmax(0,1fr) minmax(255px,40%); gap: 8px; }
  .field-guide article { padding: 12px; }
}
@media (max-width: 700px) {
  .header { min-height: 69px; gap: 9px; }
  .brand img { width: 126px; }
  .header nav { display: none; }
  .hero { min-height: 0; }
  .hero::before { display: none; }
  .hero-inner { padding: 32px 0 24px; }
  .hero h1 { font-size: clamp(2.7rem, 10vw, 4.5rem); max-width: 18ch; }
  .hero-inner > p { max-width: 40ch; font-size: 1.02rem; }
  .hero-art { position: static; width: 100%; height: auto; aspect-ratio: 1.65; object-position: right 47%; z-index: auto; }
  .hero .hero-meta { margin-top: 15px; }
  .hero-actions { margin-top: 18px; }
  .three-up, .split, .campaign-grid, .feature-shots, .parents, .field-pairs { grid-template-columns: minmax(0,1fr); }
  .three-up { gap: 17px; }
  .creature-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .field-pairs article { text-align: center; }
  .parents img { display: none; }
  .rule-field { grid-template-columns: minmax(0,1fr); padding: 8px; }
  .mission-hud > div:first-child { display: grid; gap: 2px; }
  .mission-bottom { display: grid; gap: 9px; }
  .mission-hud, .mission-bottom, .mission-review { padding-inline: 10px; }
  .mission-counters { padding-inline: 10px; }
  .mission-counters > span { font-size: .8rem; padding: 5px 8px; }
  .footer-publisher { margin-top: 4px; }
}
@media (max-width: 410px) {
  .hero-art { aspect-ratio: 1.45; }
  .hero h1 { max-width: 12ch; }
  .hud-actions button { padding-inline: 7px; gap: 3px; }
  .mission-review button { margin: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
