/* PixelWar beta site. Palette and type follow the PixelWar trailer. */
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }
/* Korean, Japanese and Chinese: Noto Sans CJK, cut down to the characters these pages use */
@font-face { font-family: "PW Sans KR"; font-weight: 400; font-display: swap; src: url("/fonts/cjk/kr-400.woff2") format("woff2"); }
@font-face { font-family: "PW Sans KR"; font-weight: 700; font-display: swap; src: url("/fonts/cjk/kr-700.woff2") format("woff2"); }
@font-face { font-family: "PW Sans JP"; font-weight: 400; font-display: swap; src: url("/fonts/cjk/jp-400.woff2") format("woff2"); }
@font-face { font-family: "PW Sans JP"; font-weight: 700; font-display: swap; src: url("/fonts/cjk/jp-700.woff2") format("woff2"); }
@font-face { font-family: "PW Sans SC"; font-weight: 400; font-display: swap; src: url("/fonts/cjk/sc-400.woff2") format("woff2"); }
@font-face { font-family: "PW Sans SC"; font-weight: 700; font-display: swap; src: url("/fonts/cjk/sc-700.woff2") format("woff2"); }

:root {
  --night: #0F1B24;      /* map backdrop */
  --trench: #172733;     /* raised dark surface */
  --line: #26394A;       /* hairlines on dark */
  --cream: #EEE7D6;      /* caption boxes, wordmark cells */
  --paper: #F7F2E7;      /* inputs on the dossier */
  --ink: #39332A;        /* text on cream */
  --ink-soft: #6E6556;
  --fog: #9AA7B1;        /* secondary text on dark */
  --text: #DCE3E6;       /* body text on dark */
  --signal: #35CDD8;     /* status, focus */
  --front: #F75629;      /* primary action */
  --front-deep: #DB4519;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --wrap: 1080px;
  --gutter: clamp(16px, 4vw, 32px);
}
html:lang(ko) {
  --display: "Barlow Condensed", "PW Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: "IBM Plex Mono", "PW Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", monospace;
}
html:lang(ja) {
  --display: "Barlow Condensed", "PW Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --mono: "IBM Plex Mono", "PW Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", monospace;
}
html:lang(zh-CN) {
  --display: "Barlow Condensed", "PW Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", "PW Sans SC", "PingFang SC", "Microsoft YaHei", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--night); color: var(--text);
  font-family: var(--mono); font-size: 0.95rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
html:lang(ko) body { word-break: keep-all; }
html:lang(ko) body, html:lang(ja) body, html:lang(zh-CN) body { line-height: 1.75; }
html:lang(ja) body, html:lang(zh-CN) body { line-break: strict; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
img, video, canvas { display: block; max-width: 100%; }
p { margin: 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- caption boxes: the trailer's on-screen captions ---- */
.caption {
  display: inline; font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: inherit; line-height: 1.12; letter-spacing: 0.005em;
  background: var(--cream); color: var(--ink);
  padding: 0.02em 0.26em 0.04em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.caption-signal { background: var(--signal); color: #0D2A30; }
.caption-front { background: var(--front); color: #FFF6EA; }
.caption-ink { background: var(--ink); color: var(--cream); }
.caption-xl { font-size: clamp(2.4rem, 6.4vw, 3.75rem); margin: 0; }
.caption-stack { margin: 0; font-size: clamp(1.9rem, 4.2vw, 2.6rem); font-weight: 700; }
.caption-stack .caption { display: table; margin-bottom: 0.08em; }
html:lang(ko) .caption, html:lang(ja) .caption, html:lang(zh-CN) .caption { line-height: 1.26; letter-spacing: 0.01em; padding: 0.06em 0.3em 0.1em; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; padding: 0 var(--gutter); max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto;
  position: relative; z-index: 2;
}
.topbar + main .hero, .topbar + .hero { margin-top: -72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cream); }
.brand:hover { color: var(--cream); }
.brand-mark { display: grid; grid-template-columns: repeat(2, 9px); gap: 2px; }
.brand-mark i { width: 9px; height: 9px; background: var(--cream); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: var(--signal); }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.35rem; text-transform: uppercase; letter-spacing: 0.01em; line-height: 1; }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.topbar-link { font-size: 0.82rem; color: var(--fog); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; white-space: nowrap; }
.topbar-link:hover { color: var(--signal); border-color: var(--signal); }
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; position: relative; white-space: nowrap;
  font-size: 0.82rem; line-height: 1.3; color: var(--fog);
  padding: 0 16px 2px 0; border-bottom: 1px solid var(--line);
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after {
  content: ""; position: absolute; right: 2px; top: 45%; width: 5px; height: 5px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-60%) rotate(45deg);
}
.lang[open] summary::after { transform: translateY(-10%) rotate(225deg); }
.lang summary:hover, .lang[open] summary { color: var(--signal); border-color: var(--signal); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 10;
  min-width: 156px; margin: 0; padding: 6px 0; list-style: none;
  background: var(--trench); border: 1px solid var(--line); border-radius: 3px;
  box-shadow: 0 14px 30px rgba(4, 10, 14, 0.45);
}
.lang-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 0.88rem; color: var(--text); text-decoration: none; }
.lang-menu a::before { content: ""; width: 6px; height: 6px; flex: none; background: transparent; }
.lang-menu a:hover { color: var(--signal); }
.lang-menu a[aria-current="page"] { color: var(--cream); }
.lang-menu a[aria-current="page"]::before { background: var(--signal); }

/* ---- hero: the trailer's end card ---- */
.hero {
  position: relative; text-align: center;
  padding: calc(72px + clamp(20px, 6vw, 64px)) var(--gutter) clamp(56px, 9vw, 104px);
  background:
    linear-gradient(180deg, rgba(15,27,36,0.90) 0%, rgba(15,27,36,0.82) 40%, rgba(15,27,36,0.92) 78%, var(--night) 100%),
    url("/media/hero-bg.jpg") center 35% / cover no-repeat;
}
.wordmark { width: min(880px, 100%); height: auto; margin: 0 auto clamp(28px, 5vw, 44px); touch-action: pan-y; cursor: crosshair; }
.wordmark-fallback { font-family: var(--display); font-size: 4rem; color: var(--cream); margin: 0 0 24px; }
.hero-status {
  margin-top: 26px; color: var(--signal); font-weight: 500;
  font-size: clamp(0.9rem, 2vw, 1.15rem); letter-spacing: 0.22em; text-transform: uppercase;
}
.hero-lead { max-width: 46ch; margin: 18px auto 34px; color: var(--text); font-size: 1rem; }
html:lang(ko) .hero-status, html:lang(ja) .hero-status, html:lang(zh-CN) .hero-status { letter-spacing: 0.12em; }

/* ---- buttons ---- */
.button {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: 1.5rem; line-height: 1; letter-spacing: 0.01em;
  background: var(--front); color: #FFF6EA; padding: 14px 26px 15px;
  transition: background-color 120ms ease;
}
.button:hover { background: var(--front-deep); color: #FFF6EA; }
.button:active { transform: translateY(1px); }
.button[disabled] { opacity: 0.6; cursor: progress; }
.button-block { display: block; width: 100%; }
.button-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); font-size: 1.25rem; padding: 11px 20px 12px; }
.button-ghost:hover { background: var(--ink); color: var(--cream); }

/* ---- sections ---- */
.trailer, .build, .rules, .join, .board, .faq, .closing {
  max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter);
}
.trailer { padding-top: 8px; }
.trailer-frame { border: 1px solid var(--line); background: #000; aspect-ratio: 16 / 9; }
.trailer-frame video { width: 100%; height: 100%; }
.fine { font-size: 0.78rem; color: var(--fog); margin-top: 10px; }

/* ---- screenshots from the actual build ---- */
.build { padding-top: clamp(72px, 11vw, 128px); }
.build-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.6vw, 28px); margin-top: 24px; }
.shot { margin: 0; min-width: 0; }
.shot-frame { aspect-ratio: 16 / 10; max-width: 100%; border: 1px solid var(--line); background: #000; overflow: hidden; }
.shot-frame img { width: 100%; height: 100%; object-fit: cover; }
.shot figcaption { margin-top: 8px; font-size: 0.8rem; color: var(--fog); }
.build > .fine { margin-top: 18px; }

/* ---- rules of the war: six cards on one hairline grid ---- */
.rules { padding-top: clamp(80px, 12vw, 136px); }
.rules-lead { margin-top: 18px; max-width: 52ch; color: var(--text); }
.rule-grid {
  list-style: none; margin: clamp(28px, 4vw, 40px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.rule {
  display: flex; flex-direction: column; min-width: 0; padding-bottom: 26px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(23, 39, 51, 0.38);
}
.rule-fig { aspect-ratio: 2 / 1; background: #0B151D; border-bottom: 1px solid var(--line); overflow: hidden; }
.rule-fig .fig { display: block; width: 100%; height: 100%; }
.rule-fig text { font-family: var(--mono); letter-spacing: 0.06em; }
.rule-tag {
  margin: 18px 22px 0; font-size: 0.72rem; line-height: 1.4; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--signal);
}
.rule-tag b { color: var(--cream); font-weight: 600; }
.rule-title {
  margin: 10px 22px 0; font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: 1.62rem; line-height: 1.04; letter-spacing: 0.005em; color: var(--cream);
}
.rule-text { margin: 10px 22px 0; font-size: 0.86rem; line-height: 1.62; color: var(--fog); }
html:lang(ko) .rule-title, html:lang(ja) .rule-title, html:lang(zh-CN) .rule-title {
  text-transform: none; font-size: 1.2rem; line-height: 1.42; letter-spacing: -0.01em;
}
/* CJK card text in one sans face, game terms included, so Latin words don't switch to the mono */
html:lang(ko) :is(.rule-text, .rules-lead) { font-family: "PW Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
html:lang(ja) :is(.rule-text, .rules-lead) { font-family: "PW Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif; }
html:lang(zh-CN) :is(.rule-text, .rules-lead) { font-family: "PW Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
html:lang(ko) .rule-text { font-size: 0.9rem; line-height: 1.72; }
html:lang(ja) .rule-text, html:lang(zh-CN) .rule-text { font-size: 0.88rem; line-height: 1.78; }
html:lang(ko) .rules-lead, html:lang(ja) .rules-lead, html:lang(zh-CN) .rules-lead { font-size: 1rem; }
@media (max-width: 980px) { .rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .rule-grid { grid-template-columns: minmax(0, 1fr); } .rule-title { font-size: 1.5rem; } }

/* ---- join ---- */
.join {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(36px, 6vw, 72px); align-items: start;
  padding-top: clamp(88px, 12vw, 144px);
}
.join-intro p { margin-top: 20px; max-width: 44ch; }
.pixel-list { list-style: none; margin: 24px 0 0; padding: 0; max-width: 44ch; }
.pixel-list li { position: relative; padding-left: 22px; margin-top: 10px; }
.pixel-list li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 8px; height: 8px; background: var(--signal); }

.dossier { background: var(--cream); color: var(--ink); padding: clamp(22px, 4vw, 34px); border-radius: 3px; }
.dossier a:hover { color: var(--front-deep); }
.dossier :focus-visible { outline-color: var(--night); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--ink-soft); margin-left: 6px; }
.field input[type="email"], .field input[type="text"], .field input[type="password"], .field select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid #B9AE97; border-radius: 3px;
  padding: 11px 12px; min-height: 46px;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field input:focus, .field select:focus { border-color: var(--ink); outline: 2px solid var(--night); outline-offset: 1px; }
.field input::placeholder { color: #A29880; }
.field-help { font-size: 0.78rem; color: var(--ink-soft); margin-top: 6px; }
.field-error, .form-error { font-size: 0.82rem; color: #B3300C; font-weight: 600; margin-top: 6px; }
.field.has-error input, .field.has-error select { border-color: #B3300C; }
.field-check { display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; align-items: start; margin-top: 4px; }
.field-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); }
.field-check label { font-weight: 400; font-size: 0.86rem; margin: 0; }
.field-check .field-error { grid-column: 2; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.signup .button { margin-top: 22px; }
.form-error { margin-top: 12px; }
.form-note { font-size: 0.78rem; color: var(--ink-soft); margin-top: 14px; }

.joined { outline: none; }
.joined .caption { font-size: clamp(2rem, 4vw, 2.6rem); }
.joined-rank { margin-top: 18px; font-size: 1.15rem; font-weight: 600; line-height: 1.45; }
.joined-detail { margin-top: 8px; color: var(--ink-soft); overflow-wrap: anywhere; }
.joined-share { margin-top: 26px; padding-top: 20px; border-top: 1.5px solid #D3C9B3; }
.joined-share p { margin-bottom: 12px; }

/* ---- board ---- */
.board { padding-top: clamp(88px, 12vw, 136px); }
.board-note { color: var(--fog); margin-top: 14px; }
.board-list { list-style: none; margin: 24px 0 0; padding: 0; max-width: 720px; }
.board-list li { display: grid; grid-template-columns: 2.2em minmax(0, 12em) minmax(0, 1fr) 4em; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.board-rank { color: var(--fog); }
.board-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-bar { height: 10px; background: var(--trench); }
.board-bar i { display: block; height: 100%; background: var(--signal); }
.board-count { text-align: right; }

/* ---- faq ---- */
.faq { padding-top: clamp(88px, 12vw, 136px); max-width: calc(760px + 2 * var(--gutter)); margin-left: max(0px, calc((100% - var(--wrap) - 2 * var(--gutter)) / 2)); }
.faq .caption-stack { margin-bottom: 18px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 28px 16px 0; font-weight: 500; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 2px; top: 14px; color: var(--signal); font-size: 1.1rem; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 18px; color: var(--fog); max-width: 60ch; }

/* ---- closing call to action ---- */
.closing { text-align: center; padding-top: clamp(96px, 13vw, 152px); }
.closing .caption-stack .caption { margin-left: auto; margin-right: auto; }
.closing .button { margin-top: 30px; }

/* ---- footer ---- */
.footer {
  max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: clamp(96px, 12vw, 144px) auto 0;
  padding: 28px var(--gutter) 40px; border-top: 1px solid var(--line); color: var(--fog); font-size: 0.85rem;
}
.footer p + p { margin-top: 6px; }
.footer span { margin: 0 8px; color: var(--line); }

/* ---- simple text pages (privacy, admin) ---- */
.page { max-width: calc(720px + 2 * var(--gutter)); margin: 0 auto; padding: 24px var(--gutter) 40px; }
.page h1 { margin: 24px 0 28px; font-size: clamp(2rem, 5vw, 2.8rem); }
.page h2 { font-family: var(--mono); font-size: 1rem; font-weight: 600; color: var(--cream); margin: 32px 0 10px; }
.page p, .page li { color: var(--text); }
.page ul { padding-left: 1.2em; }
.page .dossier { margin-top: 24px; }
.page li + li { margin-top: 6px; }

@media (max-width: 760px) {
  .join, .build-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar-right { gap: 16px; }
  .board-list li { grid-template-columns: 2em minmax(0, 9em) minmax(0, 1fr) 3.2em; gap: 8px; }
  .hero-status { letter-spacing: 0.16em; }
  .button { font-size: 1.35rem; }
}
