/* 裂包者 · 琥珀像素风
   琥珀底 + 纸张颗粒、等宽小字、像素标题、阶梯像素描边、细黑线网格、蓝紫 CRT 战斗屏。 */

:root {
  --amber: #f6aa28;
  --amber-deep: #e5861b;
  --amber-shade: #c96d12;
  --paper: #fff6df;
  --ink: rgba(0, 0, 0, 0.82);
  --ink-soft: rgba(0, 0, 0, 0.55);
  --line: #000;
  --white: #fffdf6;
  --screen-a: #2b2c8f;
  --screen-b: #3a1f7a;
  --magenta: #ff2f8e;
  --cyan: #61e7ff;
  --hp: #ff2f6d;
  --good: #1f7a3a;
  --bad: #b3261e;
  --px: 3px;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, "PingFang SC", "Microsoft YaHei", monospace;
  --pixel: "Press Start 2P", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--amber); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--amber);
  color: var(--ink);
  font: 13px/1.5 var(--mono);
  display: flex;
  flex-direction: column;
}
/* 纸张颗粒 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.14;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1.2 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
::selection { background: #000; color: var(--amber); }
a { color: inherit; }

/* ---------- 顶栏 / 底栏 ---------- */
.topbar, .footbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 16px; font-size: 11px; letter-spacing: 0.02em;
}
.topbar { border-bottom: 1px solid var(--line); }
.topbar b { font-family: var(--pixel); font-size: 10px; font-weight: 400; letter-spacing: 0; }
.footbar { justify-content: center; border-top: 1px solid var(--line); margin-top: auto; }
#app { width: 100%; max-width: 1160px; margin: 0 auto; padding: 20px 16px 40px; }

/* ---------- 文字 ---------- */
h1, h2, h3, .pxtitle { font-family: var(--pixel); font-weight: 400; color: #000; letter-spacing: 0.02em; }
h1 { font-size: 34px; line-height: 1.2; margin: 0; }
h2 { font-size: 18px; line-height: 1.4; margin: 6px 0; }
h3 { font-size: 12px; margin: 22px 0 10px; }
p { margin: 6px 0; }
.sub, .hint { color: var(--ink-soft); }
.hint { font-size: 12px; min-height: 18px; }
.msg { color: var(--bad); font-weight: 600; }
.ok { color: var(--good); font-weight: 600; }
.center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
label { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.tag { font-family: var(--pixel); font-size: 8px; padding: 3px 5px; background: #000; color: var(--amber); }

/* ---------- 像素描边（阶梯角） ---------- */
.panel, .ch, .node, .enemy, .player, input {
  box-shadow:
    calc(-1 * var(--px)) 0 0 0 var(--line), var(--px) 0 0 0 var(--line),
    0 calc(-1 * var(--px)) 0 0 var(--line), 0 var(--px) 0 0 var(--line);
}

/* ---------- 按钮 ---------- */
button {
  font-family: var(--pixel); font-size: 11px; line-height: 1.6; color: #000;
  background: var(--amber); border: 0; padding: 9px 14px; margin: 6px; cursor: pointer;
  text-transform: uppercase;
  /* 内圈黑色阶梯描边 + 外圈白色阶梯描边 */
  box-shadow:
    -3px 0 0 0 #000, 3px 0 0 0 #000, 0 -3px 0 0 #000, 0 3px 0 0 #000,
    -6px 0 0 0 var(--white), 6px 0 0 0 var(--white), 0 -6px 0 0 var(--white), 0 6px 0 0 var(--white),
    -3px -3px 0 0 var(--white), 3px -3px 0 0 var(--white), -3px 3px 0 0 var(--white), 3px 3px 0 0 var(--white);
  transition: transform 0.06s;
}
button:hover:not(:disabled) { background: #ffc24d; }
button:active:not(:disabled) { transform: translateY(2px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost {
  background: transparent; margin: 3px;
  box-shadow: -3px 0 0 0 #000, 3px 0 0 0 #000, 0 -3px 0 0 #000, 0 3px 0 0 #000;
}
button.ghost:hover:not(:disabled) { background: rgba(0, 0, 0, 0.08); }
button.link {
  font-family: var(--mono); font-size: 12px; text-transform: none; background: none; box-shadow: none;
  padding: 0; margin: 0 0 0 6px; text-decoration: underline;
}
button.link:hover { background: none !important; }
.pxbtn span { display: inline-block; }

input {
  flex: 1; min-width: 0; background: var(--paper); border: 0; color: #000;
  padding: 10px; font: 13px var(--mono); margin: 3px;
}
input:focus { outline: 3px solid #000; outline-offset: 3px; }

/* ---------- 首页 ---------- */
.hero-cols {
  display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 28px; align-items: start;
  padding-bottom: 18px;
}
.hero-text b { display: block; font-weight: 600; }
.hero-text p { margin: 2px 0 0; font-size: 12px; }
.hero-play { text-align: right; }
.logo { font-size: 44px; }
.logo-en { font-family: var(--pixel); font-size: 12px; margin-top: 10px; letter-spacing: 0.08em; }
.panel {
  background: var(--paper); padding: 18px; margin: 8px 3px 24px;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.panel.center { align-items: center; }
.panel.login { max-width: 560px; }
.panel .row { width: 100%; }
.peek { width: 100%; }
.peek summary { cursor: pointer; font-size: 12px; color: var(--ink-soft); margin: 4px 0; }
.peek[open] summary { margin-bottom: 8px; }

.egrid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.ecell {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 26px 12px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.eglyph { color: #000; height: 120px; display: grid; place-items: center; }
.eglyph svg { width: min(120px, 70%); height: auto; }
.ename2 b { font-family: var(--pixel); font-weight: 400; font-size: 13px; }
.etypes { font-size: 11px; color: var(--ink-soft); }

/* ---------- 页面头 ---------- */
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.runhead {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center; align-self: stretch;
  font-size: 12px; padding: 4px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; width: 100%;
}
.runhead span { display: inline-flex; align-items: center; gap: 6px; }
.runhead span:nth-child(3) { font-family: var(--pixel); font-size: 10px; }

/* ---------- 卡牌 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px; width: 100%; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.grid.offer { grid-template-columns: repeat(3, minmax(0, 200px)); justify-content: center; margin: 12px 0 18px; }
.card {
  position: relative; background: var(--paper); padding: 8px 8px 7px; margin: 3px;
  min-height: 170px; display: flex; flex-direction: column; gap: 3px; text-align: left;
  cursor: pointer; user-select: none; transition: transform 0.08s;
  box-shadow:
    -3px 0 0 0 var(--rc), 3px 0 0 0 var(--rc), 0 -3px 0 0 var(--rc), 0 3px 0 0 var(--rc);
}
.card .cost {
  position: absolute; top: -9px; left: -9px; z-index: 2; width: 26px; height: 26px;
  background: #000; color: var(--amber); font-family: var(--pixel); font-size: 11px;
  display: grid; place-items: center;
}
.card .cname { font-weight: 600; font-size: 13px; color: #000; line-height: 1.3; }
.card .ctype { font-size: 11px; color: var(--ink-soft); display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.card .ctype .px { color: var(--rc); }
.card .rtag { color: var(--rc); font-weight: 600; }
.card .ctext { font-size: 12px; flex: 1; color: var(--ink); }
.card .cen { font-size: 10px; color: var(--ink-soft); line-height: 1.3; }
.card .corigin { font-size: 10px; color: var(--ink-soft); border-top: 1px dashed rgba(0,0,0,.35); padding-top: 4px; }
.card .cart { position: relative; aspect-ratio: 1; margin: -2px -2px 3px; overflow: hidden; background: #111; }
.card .cart img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); }
.card .cart.empty {
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.06) 0 6px, transparent 6px 12px), var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  outline: 1px dashed rgba(0,0,0,.4); outline-offset: -1px; color: var(--rc);
}
.card .cart.empty span { font-size: 10px; color: var(--ink-soft); text-align: center; padding: 0 8px; }
.card .cart.base { color: #000; }
.hand .card .cart.base, .grid.small .card .cart.base { aspect-ratio: 4 / 3; }
/* 稀有度光效 */
.card.r-SR { box-shadow: -3px 0 0 0 var(--rc), 3px 0 0 0 var(--rc), 0 -3px 0 0 var(--rc), 0 3px 0 0 var(--rc), 0 0 0 7px rgba(196, 22, 124, 0.18); }
.card.r-UR { background: linear-gradient(135deg, #fff6df 0%, #f3e6ff 40%, #e3fbff 70%, #fff6df 100%); background-size: 300% 300%; animation: holo 6s linear infinite; }
@keyframes holo { to { background-position: 300% 300%; } }
.card.chosen { outline: 3px solid #000; outline-offset: 7px; }
.card.chosen::after {
  content: "✓"; position: absolute; top: -9px; right: -9px; width: 22px; height: 22px;
  background: #000; color: var(--amber); display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.card.playable:hover { transform: translateY(-6px); }
.card.disabled { opacity: 0.5; cursor: not-allowed; }
.card.sel { transform: translateY(-14px); outline: 3px solid var(--magenta); outline-offset: 5px; }
.card.flip { animation: flip 0.45s both; }
@keyframes flip { from { transform: rotateY(90deg) scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 地图 / 篝火 ---------- */
.nodes { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; margin: 22px 0; }
.node {
  width: 150px; height: 140px; margin: 3px; background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-transform: none;
}
.node span { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.node:hover:not(:disabled) { background: #fff; transform: translateY(-3px); }
.n-elite { color: var(--bad); }
.n-pack { color: #5b1fd6; }
.n-boss { width: 220px; background: #000; color: var(--amber); }
.n-boss span { color: var(--amber); }
.n-boss:hover:not(:disabled) { background: #1a1a1a; }
.deck { margin-top: 22px; width: 100%; text-align: left; }
.deck summary { cursor: pointer; color: var(--ink-soft); margin-bottom: 14px; }

/* ---------- 战斗：CRT 屏 ---------- */
.battle { display: flex; flex-direction: column; }
.stage {
  padding: 14px;
  background: var(--amber-deep);
  box-shadow: inset 4px 4px 0 #ffc75c, inset -4px -4px 0 var(--amber-shade), 0 0 0 1px #000;
}
.screen {
  position: relative; padding: 18px; min-height: 300px; overflow: hidden; color: #fff;
  background: linear-gradient(180deg, var(--screen-a) 0%, var(--screen-b) 100%);
  box-shadow: inset 0 0 0 2px #000, inset 0 0 40px rgba(0,0,0,.45);
}
.screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.06) 0 1px, transparent 1px 4px);
}
.enemies { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; min-height: 150px; }
.enemy {
  --line: var(--magenta);
  background: rgba(0, 0, 0, 0.28); padding: 12px; width: 200px; text-align: center; margin: 3px;
}
.enemy.targetable { cursor: crosshair; --line: var(--cyan); animation: blink 0.9s steps(2) infinite; }
@keyframes blink { 50% { background: rgba(97, 231, 255, 0.18); } }
.enemy.dead { opacity: 0.35; }
.intent { font-size: 12px; color: var(--cyan); margin-bottom: 4px; font-weight: 600; }
.intent small { color: #fff; }
.ename { font-weight: 600; margin-bottom: 6px; }
.bar { position: relative; height: 14px; background: rgba(0,0,0,.55); box-shadow: 0 0 0 2px #000; }
.bar i {
  position: absolute; inset: 0 auto 0 0; background: var(--hp);
  background-image: repeating-linear-gradient(90deg, transparent 0 8px, rgba(0,0,0,.35) 8px 10px);
}
.bar span { position: relative; display: block; font-family: var(--pixel); font-size: 8px; line-height: 14px; text-align: center; color: #fff; text-shadow: 1px 1px 0 #000; }
.status { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin-top: 7px; min-height: 18px; }
.status b { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 11px; background: rgba(0,0,0,.45); padding: 0 6px; }
.player {
  --line: var(--cyan);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.3); padding: 10px 14px; margin: 18px 3px 10px;
}
.pinfo { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 230px; }
.pinfo .bar { flex: 1; max-width: 260px; }
.you { font-family: var(--pixel); font-weight: 400; font-size: 10px; color: var(--cyan); }
.energy { font-family: var(--pixel); font-size: 14px; color: var(--cyan); display: inline-flex; gap: 6px; align-items: center; }
.piles { font-size: 12px; color: rgba(255,255,255,.75); }
.log { position: relative; z-index: 1; font-size: 11px; color: rgba(255,255,255,.7); min-height: 64px; }
.handbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0 6px; }
.hand { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; padding: 12px 0 8px; }
.hand .card { width: 150px; min-height: 165px; }
.hand .card .cart { aspect-ratio: 4 / 3; }
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(43, 44, 143, 0.55); display: grid; place-items: center; }
.overlay .panel { min-width: 280px; }

/* ---------- 结算 ---------- */
.score { font-family: var(--pixel); font-size: 40px; color: #000; margin: 8px 0; }
.score small { font-family: var(--mono); font-size: 14px; color: var(--ink-soft); }

/* ---------- 挑战大厅 ---------- */
.rooms { display: flex; gap: 6px; flex-wrap: wrap; }
.rooms button { display: flex; flex-direction: column; align-items: center; min-width: 88px; }
.rooms button small { font-family: var(--mono); text-transform: none; font-size: 10px; opacity: 0.8; }
.rooms button.over { opacity: 0.5; }
.chlist { display: flex; flex-direction: column; gap: 14px; }
.ch {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--paper); padding: 10px 12px; margin: 3px;
}
.ch.won { --line: var(--good); }
.ch.lost { --line: var(--bad); }
.mini { display: flex; gap: 6px; margin-top: 6px; }
.mini i { width: 28px; height: 28px; overflow: hidden; background: #111; box-shadow: 0 0 0 2px var(--rc); }
.mini img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.6); }

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  .hero-cols { grid-template-columns: 1fr; gap: 14px; }
  .hero-play { text-align: left; order: -1; }
  .egrid { grid-template-columns: repeat(2, 1fr); }
  .ecell:last-child { grid-column: span 2; }
  .topbar-quote { display: none; }
}
@media (max-width: 600px) {
  #app { padding: 14px 12px 32px; }
  .logo { font-size: 32px; }
  h2 { font-size: 15px; }
  .topbar { font-size: 10px; padding: 6px 12px; }
  .topbar > span:first-child { display: none; }
  .topbar-mid { margin: 0 auto; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .grid.offer { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hand { gap: 10px; }
  .hand .card { width: calc((100% - 2 * 10px - 3 * 6px) / 3); min-height: 150px; padding: 6px; }
  .hand .card .ctext { font-size: 11px; }
  .enemy { width: 44%; }
  .node { width: 100px; height: 110px; }
  .n-boss { width: 160px; }
  .stage { padding: 8px; }
  .screen { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- 规则页 ---------- */
.topbar-right { display: inline-flex; gap: 18px; align-items: center; }
.topbar a, .rules-link { color: #000; text-decoration: underline; text-underline-offset: 2px; }
.rules-link { display: inline-block; margin-top: 14px; font-size: 12px; font-weight: 600; }
.rules { max-width: 860px; margin: 0 auto; }
.rules h1 { font-size: 26px; }
.rtoc { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.rtoc a { color: #000; }
.rsec { padding: 18px 0 14px; border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
.rsec h2 { font-size: 14px; margin: 0 0 10px; }
.rsec h3 { margin: 0 0 6px; font-size: 11px; }
.rsec p, .rsec li { font-size: 13px; }
.rsec ol, .rsec ul { margin: 6px 0; padding-left: 20px; }
.rsec li { margin: 4px 0; }
.rsec table { border-collapse: collapse; width: 100%; margin: 8px 0; background: var(--paper); font-size: 12px; }
.rsec td, .rsec th { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.rsec th { font-weight: 600; background: rgba(0,0,0,.06); }
.rsec td:first-child { white-space: nowrap; }
.rsec td .px, .elist .px { vertical-align: -3px; margin-right: 4px; }
.rooms-t { width: auto !important; margin-top: 6px !important; }
.rgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.elist { list-style: none; padding: 0 !important; }
.elist b { margin-right: 6px; }
.formula { font-family: var(--pixel); font-size: 10px; line-height: 2; background: #000; color: var(--amber); padding: 12px 14px; margin: 6px 0 10px; }
.rfoot { display: flex; justify-content: center; padding: 24px 0 8px; }
@media (max-width: 700px) {
  .rgrid { grid-template-columns: 1fr; }
  .topbar-quote { display: none; }
  .rsec td, .rsec th { padding: 6px; }
}
.rooms button small + small { margin-top: 2px; }
.ch > button, .ch > span { flex-shrink: 0; }

/* ---------- 每周排行赛 ---------- */
.weekly h1 { font-size: 26px; }
.wgrid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
.wgrid .panel { margin: 3px; }
.wgrid h3 { margin: 4px 0 6px; }
.wrules, .prizes { margin: 0; padding-left: 18px; font-size: 12px; }
.wrules li, .prizes li { margin: 3px 0; }
.board { width: 100%; border-collapse: collapse; background: var(--paper); font-size: 12px; }
.board th, .board td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: middle; }
.board th { background: rgba(0,0,0,.06); font-weight: 600; }
.board .num { font-family: var(--pixel); font-size: 10px; text-align: right; }
.board .rk { width: 48px; text-align: center; font-family: var(--pixel); font-size: 10px; }
.board tr.me td { background: #fff0c2; }
.board .mini { margin: 0; }
@media (max-width: 700px) {
  .wgrid { grid-template-columns: 1fr; }
  .board th:nth-child(5), .board td:nth-child(5) { display: none; }
}

/* ---------- 导航栏 CA / X ---------- */
.topbar-right { flex-wrap: wrap; justify-content: flex-end; }
.topbar .ca { font-family: var(--mono); white-space: nowrap; }
.topbar .ca-copy { font-size: 11px; margin: 0; }
.topbar .xlink { display: inline-flex; align-items: center; color: #000; }
.topbar .xlink[hidden] { display: none; }

/* ---------- 管理页面 ---------- */
.admin { max-width: 860px; margin: 0 auto; }
.admin h1 { font-size: 26px; }
.admin .panel { margin: 3px 3px 22px; align-items: stretch; }
.admin h3 { margin: 14px 0 4px; }
.af { display: flex; flex-direction: column; gap: 4px; text-transform: none; font-weight: 400; font-size: 12px; flex: 1; min-width: 140px; }
.af > span { font-weight: 600; }
.af input { margin: 3px; }
.af small { color: var(--ink-soft); font-size: 11px; }
.arow { display: flex; gap: 12px; flex-wrap: wrap; }
.astatus { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.prow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prow input:first-child { flex: 0 0 140px; }
.asave { margin-top: 10px; }
@media (max-width: 600px) {
  .topbar .ca { font-size: 10px; }
  .prow input:first-child { flex: 1 1 100%; }
}

/* ---------- 导航栏（首页导航 + CA / X / 语言） ---------- */
.topbar.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px; flex-wrap: nowrap;
  padding: 8px 16px; background: var(--amber); border-bottom: 2px solid #000;
}
.nav-brand {
  background: none; box-shadow: none; padding: 0; margin: 0 8px 0 0; text-transform: none;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; line-height: 1.1;
}
.nav-brand:hover:not(:disabled) { background: none; }
.nav-brand b { font-family: var(--pixel); font-weight: 400; font-size: 12px; }
.nav-brand span { font-family: var(--mono); font-size: 10px; color: var(--ink-soft); }
.nav-links { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav-link {
  background: none; box-shadow: none; margin: 0; padding: 6px 10px; text-transform: none;
  font-family: var(--mono); font-size: 12px; font-weight: 600; color: #000;
}
.nav-link:hover:not(:disabled) { background: rgba(0, 0, 0, 0.08); }
.nav-link.active { background: #000; color: var(--amber); }
.nav-link.active:hover { background: #000; }
.nav-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav .ca { font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.nav .ca-copy { font-size: 11px; margin: 0; }
.nav .xlink { display: inline-flex; align-items: center; color: #000; }
.nav-lang select {
  font: 600 11px var(--mono); color: #000; background: var(--paper); border: 0; padding: 5px 6px; cursor: pointer;
  box-shadow: -2px 0 0 0 #000, 2px 0 0 0 #000, 0 -2px 0 0 #000, 0 2px 0 0 #000;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .topbar.nav { flex-wrap: wrap; gap: 8px; }
  .nav-toggle {
    display: block; margin: 0 0 0 auto; padding: 4px 10px; font-size: 16px; line-height: 1;
    background: var(--paper); text-transform: none;
    box-shadow: -2px 0 0 0 #000, 2px 0 0 0 #000, 0 -2px 0 0 #000, 0 2px 0 0 #000;
  }
  .nav-links, .nav-right { display: none; width: 100%; }
  .nav.open .nav-links { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; border-top: 1px solid #000; }
  .nav.open .nav-link { text-align: left; padding: 10px 8px; font-size: 14px; }
  .nav.open .nav-right { display: flex; justify-content: space-between; padding: 8px 0 4px; border-top: 1px dashed rgba(0,0,0,.4); }
}
