:root {
  --cyan: #28e0ff;
  --mag: #ff3bd0;
  --amber: #ffb020;
  --green: #3dffb4;
  --red: #ff4545;
  --ink: #cfe6ff;
  --dim: #7f93a8;
  --bg: rgba(6, 10, 16, 0.84);
  --line: rgba(40, 224, 255, 0.35);
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #04060a; color: var(--ink); font: 13px/1.45 var(--mono); overflow: hidden; }
body.game { user-select: none; -webkit-user-select: none; cursor: default; }
canvas#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
button { font: inherit; color: inherit; }

.panel {
  background: var(--bg);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  padding: 10px 14px;
  backdrop-filter: blur(3px);
}

/* ------------------------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud .panel, #hud button, #skills { pointer-events: auto; }

#objectives { position: absolute; left: 14px; top: 14px; max-width: 360px; }
#objectives .mission { display: flex; flex-direction: column; margin-bottom: 6px; }
#m-title { color: var(--cyan); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 14px; }
#m-source { color: var(--mag); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
#obj-list { list-style: none; margin: 0; padding: 0; }
#obj-list li { padding-left: 18px; position: relative; color: var(--ink); }
#obj-list li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 8px; height: 8px; border: 1px solid var(--cyan); transform: rotate(45deg); }
#obj-list li.done { color: var(--dim); text-decoration: line-through; }
#obj-list li.done::before { background: var(--green); border-color: var(--green); }
#obj-list li.locked { color: var(--dim); }
#obj-list li.bonus { font-size: 11px; color: var(--dim); }
#obj-list li.bonus::before { border-color: var(--amber); border-radius: 50%; transform: none; }
#obj-list li.bonus.fail { text-decoration: line-through; opacity: 0.6; }

#topright { position: absolute; right: 14px; top: 14px; display: flex; gap: 8px; align-items: stretch; }
#doom { min-width: 150px; padding: 6px 12px; }
#doom .lbl { color: var(--dim); font-size: 10px; letter-spacing: 0.14em; margin-right: 8px; }
#doom-val { font-weight: 700; color: var(--amber); }
#doom .bar { height: 3px; background: rgba(255, 255, 255, 0.1); margin-top: 4px; }
#doom .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), var(--red)); transition: width 0.4s; }
#clock { padding: 6px 12px; display: flex; align-items: center; font-weight: 700; letter-spacing: 0.08em; }
.btns { display: flex; gap: 4px; }
.btns button {
  background: var(--bg); border: 1px solid var(--line); color: var(--dim); font-size: 10px; letter-spacing: 0.1em;
  padding: 0 9px; cursor: pointer;
}
.btns button:hover, .btns button.on { color: var(--cyan); border-color: var(--cyan); }

#alarm {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); color: var(--red); font-weight: 700; font-size: 18px;
  letter-spacing: 0.5em; padding: 4px 18px 4px 26px; border: 1px solid var(--red); background: rgba(40, 0, 0, 0.6);
  opacity: 0; transition: opacity 0.2s;
}
#alarm.on { opacity: 1; animation: blink 0.5s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

#subtitles { position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%); width: min(760px, 70vw); display: flex; flex-direction: column; gap: 6px; align-items: center; }
#subtitles .line {
  background: rgba(4, 8, 13, 0.86); border-left: 3px solid var(--cyan); padding: 7px 14px; font-size: 13px; max-width: 100%;
  animation: rise 0.25s ease-out; text-shadow: 0 1px 2px #000;
}
#subtitles .line.hint { border-left-color: var(--amber); color: #f3e3c0; }
#subtitles .line.hint::before { content: "HOW  "; color: var(--amber); font-size: 10px; letter-spacing: 0.14em; }
#subtitles .line.eliezer::before { content: attr(data-who) "  "; color: var(--cyan); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
#subtitles .line.out { opacity: 0; transition: opacity 0.6s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

#toast { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); color: var(--green); letter-spacing: 0.2em; font-size: 12px; opacity: 0; transition: opacity 0.3s; text-transform: uppercase; text-shadow: 0 0 8px #000; }
#toast.on { opacity: 1; }

#bottom { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; align-items: flex-end; gap: 12px; }
#hero { display: flex; gap: 12px; padding: 8px 14px 8px 8px; align-items: center; }
.portrait { width: 84px; height: 84px; position: relative; border: 1px solid var(--line); overflow: hidden; background: #0a0f15; cursor: pointer; pointer-events: auto; }
.portrait:hover { border-color: var(--cyan); }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
#stance { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--cyan); }
#hero.crouch #stance { background: var(--green); }
#hero.carry #stance { background: var(--amber); }
#hero.hurt .portrait { box-shadow: inset 0 0 0 2px var(--red); }
.who .name { font-weight: 700; letter-spacing: 0.2em; color: var(--cyan); text-transform: uppercase; }
.hp { display: flex; gap: 4px; margin: 6px 0; }
.hp i { width: 20px; height: 7px; background: var(--green); clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.hp i.lost { background: rgba(255, 255, 255, 0.12); }
.who .state { color: var(--dim); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }

#skills { display: flex; gap: 8px; align-items: flex-end; }
.skill {
  position: relative; width: 72px; height: 70px; background: var(--bg); border: 1px solid var(--line); cursor: pointer; padding: 0;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink);
}
.skill.small { width: 54px; height: 54px; }
.skill svg { width: 30px; height: 30px; stroke: var(--cyan); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skill.small svg { width: 22px; height: 22px; }
.skill .key { position: absolute; left: 4px; top: 2px; font-size: 10px; color: var(--amber); font-weight: 700; }
.skill .nm { font-size: 8.5px; letter-spacing: 0.06em; color: var(--dim); text-transform: uppercase; white-space: nowrap; }
.skill .count { position: absolute; right: 5px; top: 11px; font-size: 10px; color: var(--ink); }
.skill .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255, 59, 208, 0.25); height: 0; pointer-events: none; }
.skill:hover { border-color: var(--cyan); }
.skill.active { border-color: var(--amber); background: rgba(60, 40, 0, 0.8); }
.skill.active svg { stroke: var(--amber); }
.skill.on { border-color: var(--green); }
.skill.on svg { stroke: var(--green); }
.skill.off { opacity: 0.42; cursor: default; }
.skill .tip {
  display: none; position: absolute; bottom: calc(100% + 10px); left: 0; width: 250px; text-align: left; white-space: normal;
  background: rgba(4, 8, 13, 0.96); border: 1px solid var(--line); padding: 8px 10px; font-size: 11px; color: var(--ink); z-index: 5; text-transform: none; letter-spacing: 0;
}
.skill .tip b { color: var(--cyan); display: block; margin-bottom: 3px; letter-spacing: 0.1em; text-transform: uppercase; }
.skill:hover .tip { display: block; }
#keys { margin-left: auto; font-size: 10.5px; color: var(--dim); padding: 8px 12px; }
#keys b { color: var(--ink); font-weight: 600; }

/* --------------------------------------------------------------- screens */
#screen { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(2, 4, 8, 0.72); z-index: 10; }
#screen.on { display: flex; }
#screen.title { background: #04060a center/cover no-repeat; }
.sheet { width: min(920px, 92vw); max-height: 95vh; overflow: auto; background: rgba(5, 9, 14, 0.93); border: 1px solid var(--line); padding: 26px 30px; clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px)); }
.sheet h1 { margin: 0; font-size: 30px; letter-spacing: 0.14em; color: var(--cyan); text-transform: uppercase; text-shadow: 0 0 18px rgba(40, 224, 255, 0.5); }
.sheet h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: 0.12em; color: var(--cyan); text-transform: uppercase; }
.sheet .src { color: var(--mag); letter-spacing: 0.18em; font-size: 11px; text-transform: uppercase; margin-bottom: 14px; }
.sheet p { margin: 0 0 10px; color: #c5d6e8; font-size: 13.5px; line-height: 1.6; }
.sheet .art { width: 100%; aspect-ratio: 3 / 1.25; max-height: 25vh; object-fit: cover; border: 1px solid var(--line); margin-bottom: 16px; display: block; }
.sheet .art[src$="/brief_steal.jpg"] { object-position: 50% 28%; }
.sheet .row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.btn {
  background: rgba(40, 224, 255, 0.1); border: 1px solid var(--cyan); color: var(--cyan); padding: 9px 20px; letter-spacing: 0.16em; cursor: pointer;
  text-transform: uppercase; font-weight: 700; font-size: 12px; text-decoration: none; display: inline-block;
}
.btn:hover { background: rgba(40, 224, 255, 0.25); }
.btn.alt { border-color: var(--line); color: var(--dim); background: none; }
.btn.alt:hover { color: var(--cyan); border-color: var(--cyan); }
.tagline { color: var(--dim); letter-spacing: 0.08em; margin: 6px 0 20px; }

#loading .box img { width: 280px; height: auto; display: block; margin: 0 auto 6px; }
/* ---- The landing page: navigation, the way in, the trailer, the missions, the small print. ---- */
#screen.title.on { display: block; overflow-y: auto; overflow-x: hidden; }
.title-page { min-height: 100%; max-width: 1480px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 76px); display: flex; flex-direction: column; }
.title-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 0; }
.title-nav .mark { width: 30px; height: 30px; opacity: 0.9; }
.title-nav nav { display: flex; gap: 6px; }
.navlink {
  background: none; border: 1px solid transparent; color: #a9bccf; padding: 7px 14px; letter-spacing: 0.18em; font-size: 11px; font-weight: 700;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.navlink:hover, .navlink:focus-visible { color: var(--cyan); border-color: var(--line); background: rgba(5, 9, 14, 0.6); outline: none; }

.title-main { flex: 1 0 auto; display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr); gap: clamp(24px, 4.5vw, 72px); align-items: center; padding: clamp(10px, 2.6vh, 36px) 0 clamp(14px, 3vh, 34px); }
.title-wrap h1 { margin: 0; }
.title-wrap h1.logo { margin: 0 0 6px -22px; line-height: 0; }
.title-wrap h1.logo img { width: min(470px, 82vw); height: auto; display: block; filter: drop-shadow(0 0 28px rgba(40, 224, 255, 0.18)); }
.title-wrap .tagline { color: #eaf7ff; font-size: 16px; letter-spacing: 0.06em; margin: 4px 0 10px; text-shadow: 0 1px 6px #000; }
.title-wrap .pitch { color: #a9bccf; font-size: 13px; line-height: 1.65; max-width: 54ch; margin: 0 0 22px; text-shadow: 0 1px 4px #000; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn.big { padding: 13px 26px; font-size: 13px; }
.cta .btn:first-child { background: var(--cyan); color: #04121a; box-shadow: 0 0 26px rgba(40, 224, 255, 0.35); }
.cta .btn:first-child:hover { background: #7cecff; }
.cta .btn.alt { background: rgba(5, 9, 14, 0.55); color: var(--ink); }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 20px; color: var(--dim); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; }
.facts span::before { content: "· "; color: var(--mag); }

.trailer-tile {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 1px solid var(--line); background: #04060a; cursor: pointer; overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}
.trailer-tile img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.86; transition: opacity 0.2s, transform 0.5s; }
.trailer-tile:hover img, .trailer-tile:focus-visible img { opacity: 1; transform: scale(1.025); }
.trailer-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 6, 10, 0) 55%, rgba(4, 6, 10, 0.8) 100%); pointer-events: none; }
.trailer-tile .play {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; border: 2px solid var(--cyan);
  background: rgba(4, 12, 18, 0.72); box-shadow: 0 0 30px rgba(40, 224, 255, 0.45); z-index: 1; transition: transform 0.2s, background 0.2s;
}
.trailer-tile .play::after { content: ""; position: absolute; left: 29px; top: 22px; border-style: solid; border-width: 15px 0 15px 24px; border-color: transparent transparent transparent var(--cyan); }
.trailer-tile:hover .play { transform: scale(1.08); background: rgba(10, 40, 52, 0.85); }
.trailer-tile .cap { position: absolute; left: 16px; bottom: 12px; z-index: 1; color: #eaf7ff; font-size: 11px; font-weight: 700; letter-spacing: 0.2em; }

.missions-band { padding-bottom: 10px; }
.band-head { display: flex; align-items: center; gap: 14px; color: var(--mag); font-size: 11px; font-weight: 700; letter-spacing: 0.24em; margin-bottom: 12px; }
.band-head i { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), rgba(40, 224, 255, 0)); }
.missions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.mission { display: flex; flex-direction: column; min-width: 0; }
.mission-card {
  text-align: left; background: rgba(5, 9, 14, 0.9); border: 1px solid var(--line); padding: 0; cursor: pointer; color: var(--ink);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); display: flex; flex-direction: column; width: 100%; flex: 1;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.mission-card:hover, .mission-card:focus-visible { border-color: var(--cyan); background: rgba(8, 24, 32, 0.96); transform: translateY(-3px); outline: none; }
.mission-card .art { position: relative; width: 100%; aspect-ratio: 16 / 7; background: #0a1118 center 35% / cover no-repeat; border-bottom: 1px solid var(--line); }
.mission-card .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 9, 14, 0) 45%, rgba(5, 9, 14, 0.85) 100%); }
.mission-card .who { position: absolute; left: 12px; bottom: -16px; width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--cyan); background: #04060a; z-index: 1; clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%); }
.mission-card .done { position: absolute; right: 16px; top: 8px; z-index: 1; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-shadow: 0 1px 4px #000; }
.mission-card .body { padding: 12px 14px 13px; display: block; }
.mission-card .who + * { }
.mission-card .n { color: var(--dim); font-size: 10px; letter-spacing: 0.16em; padding-left: 50px; min-height: 15px; }
.mission-card .t { color: var(--cyan); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 14px; margin-top: 8px; line-height: 1.3; }
.mission-card .s { color: var(--mag); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 2px; }
.mission-card .b { color: #a9bccf; font-size: 11.5px; margin-top: 6px; line-height: 1.5; }
.mission .watch { align-self: flex-start; margin-top: 6px; color: var(--dim); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; }
.mission .watch:hover { color: var(--cyan); }
.soon { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--dim); font-size: 10.5px; }
.soon b { color: var(--dim); letter-spacing: 0.2em; font-size: 10px; margin-right: 6px; }
.soon span { border: 1px dashed rgba(127, 147, 168, 0.4); padding: 3px 9px; letter-spacing: 0.06em; }
.foot { padding: 18px 0 22px; color: var(--dim); font-size: 10.5px; text-shadow: 0 1px 3px #000; }
.foot a { color: var(--cyan); }

.overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(2, 4, 8, 0.86); backdrop-filter: blur(4px); padding: 3vh 4vw; }
.overlay[hidden] { display: none; }
.player { width: min(1180px, 100%); }
.player video { width: 100%; max-height: 80vh; aspect-ratio: 16 / 9; display: block; background: #000; border: 1px solid var(--line); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7); }
.player .row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.player .note { color: var(--dim); font-size: 11px; }
.sheet.about { width: min(640px, 94vw); }
.sheet.about a { color: var(--cyan); }
.sheet.about .small { color: var(--dim); font-size: 11.5px; }
.sheet.about .btn { text-transform: none; letter-spacing: 0.06em; }

@media (max-width: 900px) {
  .title-main { grid-template-columns: 1fr; }
  .title-wrap h1.logo { margin-left: -12px; }
  .title-nav nav { gap: 0; }
  .navlink { padding: 7px 8px; letter-spacing: 0.1em; }
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.stats div { border: 1px solid var(--line); padding: 8px 10px; }
.stats b { display: block; font-size: 20px; color: var(--cyan); }
.stats span { font-size: 10px; color: var(--dim); letter-spacing: 0.12em; text-transform: uppercase; }
.badges { display: flex; flex-direction: column; gap: 4px; }
.badge { color: var(--dim); }
.badge.ok { color: var(--green); }
.badge::before { content: "○  "; }
.badge.ok::before { content: "●  "; }
.lost h2 { color: var(--red); }

#loading { position: fixed; inset: 0; background: #04060a; display: flex; align-items: center; justify-content: center; z-index: 20; }
#loading .t { letter-spacing: 0.4em; color: var(--cyan); margin-bottom: 14px; }
#loading .bar { width: 280px; height: 3px; background: rgba(255, 255, 255, 0.12); }
#loading .bar i { display: block; height: 100%; width: 0; background: var(--cyan); transition: width 0.15s; }

/* ------------------------------------------------------------ field notes */
#note { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(2, 4, 8, 0.55); z-index: 9; }
#note.on { display: flex; }
#note.on:not(.panel) { background: rgba(2, 4, 8, 0.32); }
.note-box {
  position: relative; display: grid; grid-template-columns: 300px 1fr; gap: 22px; width: min(900px, 94vw); max-height: 92vh; overflow: auto;
  background: rgba(5, 9, 14, 0.96); border: 1px solid var(--line); padding: 22px 26px 64px;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.note-box.weapon { border-color: rgba(255, 176, 32, 0.45); }
.note-pic { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.note-pic canvas { width: 100%; height: auto; display: block; }
.note-pic canvas:first-child { background: radial-gradient(ellipse at 50% 70%, #101a24, #070b10 70%); border: 1px solid rgba(40, 224, 255, 0.18); }
.note-pic img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid rgba(255, 176, 32, 0.35); display: block; }
.note-bigicon { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 176, 32, 0.35); background: #0a0f15; }
.note-bigicon svg { width: 55%; height: 55%; stroke: var(--amber); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.note-cap { font-size: 10px; color: var(--dim); text-align: center; line-height: 1.4; }
.note-cap .red { color: #ff7a7a; }
.note-tag { display: inline-block; font-size: 10px; letter-spacing: 0.24em; color: #04060a; background: var(--cyan); padding: 2px 8px; margin-bottom: 8px; font-weight: 700; }
.note-box.weapon .note-tag { background: var(--amber); }
.note-body h3 { margin: 0; font-size: 26px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); }
.note-box.weapon .note-body h3 { color: var(--amber); }
.note-body kbd { font: inherit; font-size: 14px; border: 1px solid var(--amber); color: var(--amber); padding: 1px 8px; margin-left: 8px; vertical-align: middle; letter-spacing: 0; }
.note-kind { color: var(--mag); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; margin: 2px 0 10px; }
.note-line { margin: 0 0 12px; color: #c5d6e8; font-size: 13px; line-height: 1.55; }
.note-line.quote { font-style: italic; color: #a9bccf; border-left: 2px solid var(--amber); padding-left: 10px; margin-top: 10px; }
.note-how { margin: 0 0 10px; color: #eaf3fb; font-size: 13.5px; line-height: 1.55; }
.note-rules { margin: 0 0 6px; padding-left: 18px; color: #c5d6e8; font-size: 12.5px; line-height: 1.5; }
.note-rules li { margin-bottom: 4px; }
.note-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 12px; }
.note-stats div { border: 1px solid rgba(40, 224, 255, 0.22); padding: 5px 8px; }
.note-stats b { display: block; font-size: 17px; color: var(--cyan); }
.note-stats span { font-size: 9px; color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; }
.note-stats.three { grid-template-columns: repeat(3, 1fr); width: 100%; margin: 4px 0 0; }
.note-box.weapon .note-stats div { border-color: rgba(255, 176, 32, 0.25); }
.note-box.weapon .note-stats b { color: var(--amber); font-size: 15px; }
.note-sub { font-size: 9.5px; letter-spacing: 0.2em; color: var(--dim); margin: 12px 0 5px; }
.note-row { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; font-size: 12.5px; line-height: 1.5; color: #c5d6e8; margin-bottom: 5px; }
.note-row b { color: var(--ink); font-weight: 700; margin-right: 4px; }
.note-row .ico svg { width: 20px; height: 20px; stroke: var(--cyan); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; margin-top: 1px; }
.note-row.vs .ico svg { stroke: var(--amber); }
.note-row.who { grid-template-columns: 84px 1fr; }
.note-row.who > span { color: var(--cyan); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 1px; }
.note-row.danger { color: #ffc9c9; margin-top: 8px; }
.note-row.danger .ico svg { stroke: var(--red); }
.note-row.danger b { color: var(--red); }
.mark { font-style: normal; font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; padding: 1px 6px; margin-right: 6px; border: 1px solid; white-space: nowrap; }
.mark.yes { color: var(--green); border-color: rgba(61, 255, 180, 0.5); }
.mark.part { color: var(--amber); border-color: rgba(255, 176, 32, 0.5); }
.mark.no { color: #ff8a8a; border-color: rgba(255, 69, 69, 0.5); }
.note-advice { margin: 12px 0 0; color: var(--green); font-size: 13px; }
.note-advice::before { content: "▸ "; }
.note-foot { position: absolute; left: 26px; right: 26px; bottom: 16px; display: flex; align-items: center; justify-content: space-between; color: var(--dim); font-size: 10.5px; letter-spacing: 0.08em; }
#note.panel .note-panel { display: grid; grid-template-columns: 190px 1fr; gap: 14px; width: min(1120px, 96vw); max-height: 94vh; }
.note-list { display: flex; flex-direction: column; gap: 5px; background: rgba(5, 9, 14, 0.96); border: 1px solid var(--line); padding: 14px; align-self: start; }
.note-list .note-sub:first-child { margin-top: 0; }
.note-list button:not(.btn) { text-align: left; background: #0d141c; border: 1px solid #1c2833; color: var(--ink); font: inherit; font-size: 12px; padding: 6px 9px; cursor: pointer; letter-spacing: 0.06em; }
.note-list button:not(.btn):hover:not(:disabled) { border-color: var(--cyan); }
.note-list button.on { border-color: var(--amber); color: var(--amber); }
.note-list button:disabled { color: #40505f; cursor: default; }
.note-list .btn { margin-top: 12px; }
#note.panel .note-box { width: auto; padding-bottom: 24px; }
.skill.locked { display: none; }
.kit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 4px 0 16px; font-size: 12px; color: #c5d6e8; }
.kit b { font-size: 9.5px; letter-spacing: 0.2em; color: var(--dim); font-weight: 400; }
.kit span { display: inline-flex; align-items: center; gap: 6px; }
.kit svg { width: 16px; height: 16px; stroke: var(--cyan); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kit .new { color: var(--amber); }
.kit .new svg { stroke: var(--amber); }
.kit i { font-style: normal; font-size: 9px; letter-spacing: 0.14em; background: var(--amber); color: #04060a; padding: 0 5px; font-weight: 700; }
.skill.fresh { animation: fresh 1.6s ease-out 2; }
@keyframes fresh { 0% { box-shadow: 0 0 0 0 rgba(255, 176, 32, 0.9); border-color: var(--amber); } 100% { box-shadow: 0 0 0 16px rgba(255, 176, 32, 0); } }
#inspect {
  position: fixed; left: 14px; bottom: 122px; width: 330px; background: var(--bg); border: 1px solid var(--line); padding: 9px 12px; font-size: 11.5px;
  line-height: 1.45; color: #c5d6e8; z-index: 3; pointer-events: none;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}
#inspect b { color: var(--cyan); letter-spacing: 0.12em; text-transform: uppercase; }
#inspect .v { display: block; margin-top: 3px; }
#inspect .v svg { width: 13px; height: 13px; stroke: var(--amber); fill: none; stroke-width: 2; vertical-align: -2px; margin-right: 5px; }
#inspect .adv { color: var(--green); display: block; margin-top: 4px; }

/* ---------------------------------------------------------------- editor */
body.editor { cursor: default; }
body.editor canvas#view { left: 232px; top: 42px; width: calc(100vw - 232px - 320px); height: calc(100vh - 42px); }
#ed-top {
  position: fixed; left: 0; right: 0; top: 0; height: 42px; display: flex; align-items: center; gap: 6px; padding: 0 10px;
  background: #080c12; border-bottom: 1px solid var(--line); z-index: 5; white-space: nowrap; overflow: hidden;
}
#ed-top .logo { color: var(--ink); text-decoration: none; letter-spacing: 0.12em; margin-right: 8px; }
#ed-top select { max-width: 250px; }
#ed-top button { padding: 4px 8px; }
#ed-top .logo b { color: var(--mag); }
#ed-top button, #ed-top select, .ed-btn {
  background: #0d141c; color: var(--ink); border: 1px solid #24323f; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer;
}
#ed-top button:hover, .ed-btn:hover { border-color: var(--cyan); color: var(--cyan); }
#ed-top button.on { border-color: var(--amber); color: var(--amber); }
#ed-top button.go { border-color: var(--green); color: var(--green); }
#ed-top button.dirty { border-color: var(--amber); color: var(--amber); }
#ed-top .sep { width: 1px; height: 22px; background: #24323f; margin: 0 4px; }
#ed-top label { font-size: 11px; color: var(--dim); display: flex; align-items: center; gap: 3px; }
#status { margin-left: auto; color: var(--dim); font-size: 11px; }
#status b { color: var(--cyan); font-weight: 400; }

#ed-left, #ed-right { position: fixed; top: 42px; bottom: 0; background: #080c12; overflow-y: auto; padding: 8px; z-index: 4; }
#ed-left { left: 0; width: 232px; border-right: 1px solid var(--line); }
#ed-right { right: 0; width: 320px; border-left: 1px solid var(--line); }
.ed-h { color: var(--mag); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; margin: 10px 0 5px; }
.ed-h:first-child { margin-top: 2px; }
.pal { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.pal button {
  display: flex; align-items: center; gap: 6px; background: #0d141c; border: 1px solid #1c2833; color: var(--ink); font: inherit; font-size: 10.5px;
  padding: 3px 5px; cursor: pointer; text-align: left; min-height: 32px; overflow: hidden;
}
.pal button:hover { border-color: var(--cyan); }
.pal button.on { border-color: var(--amber); background: #1d1708; }
.pal .sw { width: 26px; height: 26px; flex: none; background: #111 center/cover; border: 1px solid #000; display: flex; align-items: center; justify-content: center; }
.pal .sw canvas { max-width: 26px; max-height: 26px; }
.pal .sw.dot { border-radius: 50%; width: 14px; height: 14px; margin: 0 6px; }
.pal.one { grid-template-columns: 1fr; }

.form { display: grid; grid-template-columns: 1fr; gap: 6px; }
.form label { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); }
.form label.wide { grid-template-columns: 1fr; }
.form input, .form select, .form textarea {
  background: #0d141c; border: 1px solid #24323f; color: var(--ink); font: inherit; font-size: 11.5px; padding: 3px 6px; width: 100%; min-width: 0;
}
.form input[type="checkbox"] { width: auto; justify-self: start; }
.form textarea { min-height: 70px; resize: vertical; font-size: 11px; line-height: 1.4; }
.form textarea.bad, .form input.bad { border-color: var(--red); }
.form .hint { font-size: 10px; color: #5f7285; line-height: 1.4; }
.route { display: flex; flex-direction: column; gap: 3px; }
.route .wp { display: grid; grid-template-columns: 18px 1fr 48px 48px 20px; gap: 3px; align-items: center; font-size: 10.5px; color: var(--dim); }
.route .wp input { padding: 2px 4px; }
.route .wp button { background: none; border: none; color: var(--red); cursor: pointer; font: inherit; }
.ed-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
#problems { margin-top: 14px; font-size: 11px; }
#problems .err { color: #ff8a8a; margin-bottom: 3px; }
#problems .warn { color: #ffd98a; margin-bottom: 3px; }
#problems .ok { color: var(--green); }
#ed-new { position: fixed; inset: 0; background: rgba(2, 4, 8, 0.75); z-index: 30; display: flex; align-items: center; justify-content: center; }
#ed-new[hidden] { display: none; }
