:root {
  --bg: #05010f;
  --ink: #eef3ff;
  --dim: #a9b0d0;
  --cyan: #00f0ff;
  --pink: #ff3df2;
  --orange: #ff7a00;
  --gold: #ffd23d;
  --red: #ff2d55;
  --green: #7dffb0;
  --panel: rgba(10, 4, 28, 0.82);
  --line: rgba(0, 240, 255, 0.28);
  --display: 'Orbitron', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --game-x: 0px; --game-y: 0px; --game-w: 100vw; --game-h: 100vh;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, a { font: inherit; color: inherit; }
kbd {
  font-family: var(--mono); font-size: 0.72em; padding: 2px 6px; border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.06);
}

#view { position: fixed; image-rendering: auto; display: block; }
#touch-layer {
  position: fixed; left: var(--game-x); top: var(--game-y); width: var(--game-w); height: var(--game-h);
  touch-action: none; display: none; cursor: crosshair;
}
body.playing #touch-layer { display: block; }

.scanlines {
  pointer-events: none; position: fixed; inset: 0; z-index: 50; opacity: 0.25;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.25) 0 1px, transparent 1px 3px);
}

/* ---------------- Buttons */
.btn {
  --c: var(--cyan);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--display); font-weight: 800; letter-spacing: 0.12em; font-size: 14px;
  padding: 14px 24px; min-height: 48px; border-radius: 4px; cursor: pointer; text-decoration: none;
  background: rgba(0, 240, 255, 0.06); border: 1px solid var(--c); color: var(--c);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s;
}
.btn:hover, .btn:focus-visible { background: var(--c); color: #04010c; transform: translateY(-2px); box-shadow: 0 0 30px var(--c); }
.btn.primary {
  --c: var(--pink); background: linear-gradient(180deg, #ff6af6, var(--pink)); color: #14001a; border-color: #ffb3fa;
  animation: pulse 1.6s ease-in-out infinite;
}
.btn.primary:hover, .btn.primary:focus-visible { background: linear-gradient(180deg, #ffd1fc, #ff8cf7); color: #14001a; }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.btn.ghost { --c: #d4d8ee; border-color: transparent; background: transparent; font-family: var(--mono); letter-spacing: 0.04em; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(212, 216, 238, 0.4); }
.btn.ghost:hover, .btn.ghost:focus-visible { --c: var(--ink); color: #04010c; text-decoration: none; }
@keyframes pulse { 50% { box-shadow: 0 0 26px rgba(255, 61, 242, 0.55); } }

.chip-btn {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  padding: 8px 12px; min-height: 34px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.04); color: var(--dim);
  transition: all 0.15s;
}
.chip-btn:hover, .chip-btn:focus-visible { color: var(--ink); border-color: var(--cyan); outline: none; }
.chip-btn[aria-pressed="true"] { color: var(--cyan); border-color: var(--cyan); background: rgba(0, 240, 255, 0.08); }

/* ---------------- Overlays */
.overlay {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px;
  opacity: 0; visibility: hidden; transition: opacity 0.5s, visibility 0.5s;
  overflow-y: auto;
}
.overlay.on { opacity: 1; visibility: visible; }
.overlay.small { background: rgba(4, 1, 12, 0.72); backdrop-filter: blur(6px); z-index: 35; }
.panel {
  background: var(--panel); border: 1px solid var(--line); padding: 32px; min-width: min(420px, 100%);
  display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center;
  box-shadow: 0 0 80px rgba(0, 240, 255, 0.12);
}
.panel h2 { font-family: var(--display); letter-spacing: 0.2em; margin: 0 0 8px; font-size: 28px; }
.panel p { margin: 0; color: var(--dim); font-size: 14px; }
.panel .tiny { font-size: 12px; }

/* ---------------- Title */
#title { background: radial-gradient(ellipse at 50% 40%, rgba(5, 1, 15, 0.1), rgba(5, 1, 15, 0.75) 70%); }
.title-inner { max-width: 880px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 0; }
.title-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--cyan);
  padding: 6px 12px; border: 1px solid var(--line); background: rgba(0, 240, 255, 0.05);
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
}
.title-tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.glitch {
  position: relative; margin: 0; font-family: var(--display); font-weight: 900; letter-spacing: 0.06em;
  font-size: clamp(40px, 9vw, 104px); line-height: 0.95;
  background: linear-gradient(180deg, #ffffff 0%, #bfe9ff 45%, #ff3df2 52%, #7a2cff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(255, 61, 242, 0.45));
  animation: title-in 1.4s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; background: inherit;
  -webkit-background-clip: text; background-clip: text; color: transparent; pointer-events: none;
}
.glitch::before { filter: hue-rotate(90deg); opacity: 0; animation: glitch 3.2s infinite steps(1); }
.glitch::after { filter: hue-rotate(-90deg); opacity: 0; animation: glitch 2.7s 0.6s infinite steps(1); }
@keyframes glitch {
  0%, 88%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
  90% { opacity: 0.85; transform: translate(6px, -2px); clip-path: inset(10% 0 60% 0); }
  93% { opacity: 0.85; transform: translate(-6px, 2px); clip-path: inset(55% 0 20% 0); }
  96% { opacity: 0.85; transform: translate(3px, 0); clip-path: inset(30% 0 40% 0); }
}
@keyframes title-in {
  0% { opacity: 0; letter-spacing: 0.6em; filter: blur(12px); }
  100% { opacity: 1; letter-spacing: 0.06em; }
}
.title-sub { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: 0.22em; font-size: clamp(11px, 1.8vw, 16px); color: var(--cyan); text-transform: uppercase; animation: fade-up 1s 0.6s both; }
.title-pitch { margin: 0; color: #c9cde6; font-size: clamp(14px, 1.8vw, 18px); line-height: 1.55; animation: fade-up 1s 0.9s both; }
.title-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; animation: fade-up 1s 1.1s both; }
.title-progress { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; color: var(--dim); display: flex; gap: 10px; align-items: baseline; }
.title-progress b { color: var(--green); font-size: 16px; }
.title-progress.konami::after { content: attr(data-konami); color: var(--gold); text-shadow: 0 0 12px var(--gold); animation: pop 0.4s; }
.title-settings { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.title-controls { display: flex; gap: 8px 22px; flex-wrap: wrap; justify-content: center; font-family: var(--mono); font-size: 12px; color: var(--dim); max-width: 760px; }
.touch-only { display: none; }
@media (pointer: coarse) { .touch-only { display: block; color: var(--cyan); } }
.title-howto { max-width: 640px; text-align: left; font-size: 14px; color: #c9cde6; border: 1px solid rgba(255, 255, 255, 0.1); padding: 10px 16px; background: rgba(5, 1, 15, 0.6); }
.title-howto summary { cursor: pointer; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--ink); }
.title-howto ul { margin: 10px 0 4px; padding-left: 18px; line-height: 1.6; }
.c-cyan { color: var(--cyan); } .c-orange { color: var(--orange); } .c-pink { color: var(--pink); } .c-gold { color: var(--gold); }
.rotate-hint { display: none; font-family: var(--mono); font-size: 12px; color: var(--gold); }
@media (orientation: portrait) and (max-width: 760px) { .rotate-hint { display: block; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------------- HUD */
#hud {
  position: fixed; left: var(--game-x); top: var(--game-y); width: var(--game-w); height: var(--game-h);
  z-index: 10; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  font-family: var(--mono); text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
}
#hud.on { opacity: 1; }
#hud .k { display: block; font-size: 9px; letter-spacing: 0.2em; color: var(--dim); }
#hud b { font-weight: 800; }
.hud-top { position: absolute; top: 10px; left: 12px; right: 12px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; }
.hud-score { display: flex; gap: 18px; align-items: flex-start; }
.hud-score b { font-size: clamp(13px, 1.7vw, 18px); color: var(--ink); letter-spacing: 0.08em; }
#hud-combo { font-family: var(--display); font-weight: 900; font-size: 20px; color: var(--gold); align-self: center; }
#hud-combo.hot { color: var(--pink); animation: pop 0.3s; text-shadow: 0 0 16px var(--pink); }
@keyframes pop { from { transform: scale(1.5); } }
.hud-mid { text-align: center; min-width: 200px; }
#hud-stage { font-family: var(--display); font-size: 11px; letter-spacing: 0.25em; color: var(--cyan); }
#boss-bar { margin-top: 6px; opacity: 0; transition: opacity 0.4s; }
#boss-bar.on { opacity: 1; }
#boss-name { font-family: var(--display); font-weight: 800; font-size: 12px; letter-spacing: 0.2em; color: var(--red); }
.boss-track { margin-top: 4px; width: clamp(180px, 34vw, 380px); height: 8px; border: 1px solid var(--red); background: rgba(255, 45, 85, 0.1); }
#boss-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); box-shadow: 0 0 12px var(--red); transition: width 0.15s; }
.hud-right { display: flex; justify-content: flex-end; align-items: flex-start; gap: 8px; }
.hud-pct { text-align: right; min-width: 110px; }
.hud-pct b { color: var(--green); font-size: 18px; }
#hud-pct-bar { --p: 0%; margin-top: 3px; height: 3px; background: rgba(125, 255, 176, 0.15); position: relative; }
#hud-pct-bar::after { content: ''; position: absolute; inset: 0; width: var(--p); background: var(--green); box-shadow: 0 0 8px var(--green); transition: width 0.6s; }
.hud-btn {
  pointer-events: auto; cursor: pointer; font-family: var(--mono); font-size: 10px; font-weight: 800; letter-spacing: 0.12em;
  padding: 8px 10px; min-height: 34px; border: 1px solid var(--line); background: rgba(5, 1, 15, 0.6); color: var(--cyan);
}
.hud-btn:hover, .hud-btn:focus-visible { background: var(--cyan); color: #04010c; outline: none; }

.hud-bottom { position: absolute; bottom: 10px; left: 12px; right: 12px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; }
#hud-lives { color: var(--cyan); letter-spacing: 0.2em; font-size: 14px; }
.hud-intel { text-align: right; }
#hud-intel { color: #00ffd5; font-size: 18px; }
#power-bar { display: flex; gap: 3px; }
.pw {
  width: clamp(54px, 8vw, 88px); padding: 4px 2px; text-align: center; border: 1px solid rgba(255, 122, 0, 0.5);
  background: rgba(20, 6, 0, 0.55); transition: background 0.12s, transform 0.12s;
}
.pw b { display: block; font-family: var(--display); font-size: clamp(9px, 1.1vw, 12px); letter-spacing: 0.08em; color: #ffb36b; }
.pw i { display: block; font-style: normal; font-size: 8px; letter-spacing: 0.06em; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw.sel { background: var(--orange); transform: translateY(-4px); box-shadow: 0 0 18px var(--orange); }
.pw.sel b, .pw.sel i { color: #1a0600; }
.pw.max { opacity: 0.35; }
.pw.max.sel { opacity: 1; background: #555; box-shadow: none; }

#btn-power {
  display: none; pointer-events: auto; position: absolute; right: 16px; bottom: 64px; width: 76px; height: 76px; border-radius: 50%;
  font-family: var(--display); font-weight: 800; font-size: 11px; letter-spacing: 0.08em; line-height: 1.2;
  border: 2px solid var(--orange); background: rgba(255, 122, 0, 0.18); color: var(--orange); touch-action: manipulation;
}
@media (pointer: coarse) { #btn-power { display: block; } }

#feed { position: absolute; left: 12px; top: 58px; width: min(420px, 60%); display: flex; flex-direction: column; gap: 6px; }
.feed-line {
  display: flex; gap: 8px; align-items: flex-start; font-size: 11px; line-height: 1.4; padding: 6px 10px;
  background: linear-gradient(90deg, rgba(0, 20, 16, 0.85), rgba(0, 20, 16, 0.2)); border-left: 2px solid var(--green);
  animation: feed-in 0.35s cubic-bezier(0.2, 0.9, 0.2, 1); transition: opacity 0.6s, transform 0.6s;
}
.feed-line.out { opacity: 0; transform: translateX(-20px); }
.feed-tag { color: #04010c; background: var(--green); padding: 0 5px; font-weight: 800; font-size: 9px; letter-spacing: 0.1em; flex: none; margin-top: 2px; }
.feed-text { color: #d8ffe9; }
@keyframes feed-in { from { opacity: 0; transform: translateX(-30px); } }

/* ---------------- Cinematics */
.letterbox { position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 20; transition: height 0.6s cubic-bezier(0.7, 0, 0.3, 1); pointer-events: none; }
.letterbox.top { top: 0; } .letterbox.bottom { bottom: 0; }
body.cinema .letterbox { height: 12vh; }

#stage-card {
  --accent: var(--cyan);
  position: fixed; inset: 0; z-index: 21; display: grid; place-content: center; text-align: center; pointer-events: none;
  opacity: 0; transition: opacity 0.4s;
}
#stage-card.on { opacity: 1; }
.sc-stage { font-family: var(--mono); font-size: 12px; letter-spacing: 0.4em; color: var(--dim); }
.sc-year {
  font-family: var(--display); font-weight: 900; font-size: clamp(80px, 18vw, 200px); line-height: 0.9; color: transparent;
  -webkit-text-stroke: 2px var(--accent); filter: drop-shadow(0 0 30px var(--accent));
}
#stage-card.on .sc-year { animation: slam 0.7s cubic-bezier(0.2, 1.4, 0.3, 1) both; }
.sc-company { font-family: var(--display); font-weight: 800; font-size: clamp(22px, 4vw, 44px); letter-spacing: 0.12em; color: #fff; text-transform: uppercase; }
#stage-card.on .sc-company { animation: fade-up 0.6s 0.25s both; }
.sc-role { font-family: var(--mono); font-size: clamp(13px, 1.8vw, 18px); letter-spacing: 0.2em; color: var(--accent); min-height: 1.4em; margin-top: 8px; }
.sc-meta { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-top: 6px; letter-spacing: 0.1em; }
@keyframes slam { from { transform: scale(2.6); opacity: 0; filter: blur(10px); } }

#warning { position: fixed; inset: 0; z-index: 21; display: grid; place-content: center; gap: 22px; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
#warning.on { opacity: 1; animation: warn-bg 0.6s steps(2) infinite; }
@keyframes warn-bg { 50% { background: rgba(255, 45, 85, 0.1); } }
.warn-strip { width: 100vw; overflow: hidden; background: var(--red); color: #1a0006; font-family: var(--display); font-weight: 900; letter-spacing: 0.3em; font-size: 16px; padding: 4px 0; white-space: nowrap; }
.warn-strip span { display: inline-block; animation: marquee 6s linear infinite; }
.warn-strip.rev span { animation-direction: reverse; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.warn-core { text-align: center; }
.warn-k { font-family: var(--mono); color: var(--red); letter-spacing: 0.3em; font-size: 12px; }
#warning-name { font-family: var(--display); font-weight: 900; font-size: clamp(28px, 6vw, 64px); color: #fff; letter-spacing: 0.1em; text-shadow: 0 0 30px var(--red); }

#clear-card {
  --accent: var(--cyan);
  position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; padding: 16px; overflow-y: auto;
  background: radial-gradient(ellipse at center, rgba(5, 1, 15, 0.7), rgba(5, 1, 15, 0.95));
  opacity: 0; visibility: hidden; transition: opacity 0.6s, visibility 0.6s;
}
#clear-card.on { opacity: 1; visibility: visible; }
.cc-inner { max-width: 860px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 0; }
.cc-k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.25em; color: var(--accent); }
.cc-role { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(20px, 3.4vw, 34px); letter-spacing: 0.06em; }
.cc-role span { color: var(--dim); font-weight: 600; }
.cc-win { font-family: var(--mono); font-size: 13px; color: var(--gold); letter-spacing: 0.08em; }
.cc-big {
  font-family: var(--display); font-weight: 900; font-size: clamp(56px, 12vw, 132px); line-height: 1; color: #fff;
  text-shadow: 0 0 40px var(--accent); display: flex; align-items: baseline; gap: 0.18em; animation: slam 0.8s 0.2s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}
.cc-big small { font-size: 0.3em; color: var(--accent); letter-spacing: 0.1em; }
.cc-from { color: var(--dim); font-size: 0.55em; text-decoration: line-through; text-decoration-color: var(--red); }
.cc-arrow { font-size: 0.4em; color: var(--accent); }
.cc-label { font-family: var(--mono); letter-spacing: 0.18em; font-size: 12px; color: var(--dim); text-transform: uppercase; }
.cc-points { list-style: none; padding: 0; margin: 12px 0 0; text-align: left; display: grid; gap: 8px; }
.cc-points li { font-size: 14px; line-height: 1.5; color: #d9dcf0; padding: 8px 12px 8px 30px; position: relative; background: rgba(255, 255, 255, 0.03); border-left: 2px solid var(--accent); animation: fade-up 0.5s both; }
.cc-points li::before { content: '▸'; position: absolute; left: 12px; color: var(--accent); }
.cc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; margin: 10px 0; }
.cc-stats div { border: 1px solid rgba(255, 255, 255, 0.1); padding: 10px; }
.cc-stats b { display: block; font-family: var(--display); font-size: 20px; color: var(--accent); }
.cc-stats span { font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: 0.08em; }
@media (max-width: 640px) { .cc-stats { grid-template-columns: repeat(2, 1fr); } }

#toasts { position: fixed; right: 16px; top: 76px; z-index: 40; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; gap: 12px; align-items: center; min-width: 260px; padding: 10px 14px;
  background: linear-gradient(90deg, rgba(40, 28, 0, 0.92), rgba(10, 4, 28, 0.92)); border: 1px solid var(--gold);
  box-shadow: 0 0 24px rgba(255, 210, 61, 0.3); animation: toast-in 0.5s cubic-bezier(0.2, 1.3, 0.3, 1); transition: opacity 0.6s, transform 0.6s;
}
.toast.out { opacity: 0; transform: translateX(40px); }
.toast-icon { font-size: 26px; color: var(--gold); text-shadow: 0 0 12px var(--gold); }
.toast-k { font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; color: var(--gold); }
.toast-n { font-family: var(--display); font-weight: 800; font-size: 14px; }
.toast-d { font-size: 12px; color: var(--dim); }
@keyframes toast-in { from { opacity: 0; transform: translateX(60px) scale(0.9); } }

/* ---------------- Ending */
#ending { background: radial-gradient(ellipse at center, rgba(5, 1, 15, 0.2), rgba(5, 1, 15, 0.85)); }
.end-inner { max-width: 900px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 0; }
.end-inner .glitch { font-size: clamp(34px, 7vw, 84px); }
.end-lede { margin: 0; color: #c9cde6; font-size: 17px; max-width: 640px; line-height: 1.55; }
.end-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; }
.end-stats div { border: 1px solid var(--line); padding: 16px 10px; background: rgba(0, 240, 255, 0.04); }
.end-stats b { display: block; font-family: var(--display); font-weight: 900; font-size: clamp(18px, 2.6vw, 28px); color: var(--cyan); }
.end-stats span { font-size: 12px; color: var(--dim); }
@media (max-width: 640px) { .end-stats { grid-template-columns: repeat(2, 1fr); } }
.end-q { margin: 0; font-style: italic; color: var(--pink); max-width: 620px; }

/* ---------------- Dossier */
#dossier {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); z-index: 45;
  background: rgba(6, 3, 18, 0.96); border-left: 1px solid var(--line); backdrop-filter: blur(10px);
  display: flex; flex-direction: column; transform: translateX(105%); transition: transform 0.45s cubic-bezier(0.7, 0, 0.2, 1);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.6);
}
#dossier.on { transform: none; }
.dossier-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dossier-title { font-family: var(--display); font-weight: 800; letter-spacing: 0.2em; font-size: 14px; }
.dossier-pct { font-family: var(--mono); font-size: 11px; color: var(--green); letter-spacing: 0.14em; }
.dossier-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn.close { font-size: 14px; width: 34px; padding: 0; }
#dossier-body { overflow-y: auto; padding: 8px 24px 40px; overscroll-behavior: contain; }
.d-sec { padding: 20px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.d-sec h3 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.25em; color: var(--cyan); text-transform: uppercase; margin: 0 0 12px; }
.d-sec p { margin: 0; line-height: 1.65; color: #d4d7ea; font-size: 15px; }
.d-head { display: flex; gap: 18px; align-items: center; }
.d-head h2 { margin: 0; font-family: var(--display); font-size: 26px; letter-spacing: 0.06em; }
.d-title { color: var(--pink) !important; font-weight: 600; }
.d-contact { font-size: 13px !important; color: var(--dim) !important; }
.d-contact a { color: var(--cyan); }
.d-avatar {
  flex: none; width: 64px; height: 64px; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 22px;
  border: 2px solid var(--cyan); color: var(--cyan); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: rgba(0, 240, 255, 0.08);
}
.d-impact { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.d-impact div { border: 1px solid rgba(255, 255, 255, 0.1); padding: 10px; }
.d-impact b { display: block; font-family: var(--display); font-size: 18px; color: var(--green); }
.d-impact span { font-size: 11px; color: var(--dim); }
@media (max-width: 560px) { .d-impact { grid-template-columns: repeat(2, 1fr); } .d-head { align-items: flex-start; } }
.d-job { margin: 0 0 20px; padding-left: 14px; border-left: 2px solid var(--accent); }
.d-job h4 { margin: 0; font-size: 16px; font-weight: 700; }
.d-job h4 span { color: var(--accent); font-weight: 600; }
.d-dates { font-family: var(--mono); font-size: 11px; color: var(--dim); margin: 4px 0 8px; }
.d-job ul, .d-certs { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.d-job li, .d-certs li { font-size: 14px; line-height: 1.55; color: #d4d7ea; }
.d-hint { font-family: var(--mono); font-size: 10px; color: rgba(143, 150, 184, 0.7); margin-top: 8px; letter-spacing: 0.06em; }
.d-job:not(:has(.locked)) .d-hint, .d-sec:not(:has(.locked)) > .d-hint, .d-two > div:not(:has(.locked)) .d-hint { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 6px 10px; border: 1px solid rgba(0, 240, 255, 0.3); background: rgba(0, 240, 255, 0.05); color: #d4f9ff; }
.d-two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 560px) { .d-two { grid-template-columns: 1fr; } }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ach { padding: 8px 10px; border: 1px solid rgba(255, 255, 255, 0.08); opacity: 0.45; }
.ach.got { opacity: 1; border-color: rgba(255, 210, 61, 0.5); background: rgba(255, 210, 61, 0.05); }
.ach b { display: block; font-size: 13px; color: var(--gold); }
.ach span { font-size: 11px; color: var(--dim); }

/* Redacted (still readable by assistive tech and search engines). */
.r { transition: color 0.6s, background 0.6s; }
.r.locked {
  color: transparent !important; user-select: none; border-color: rgba(255, 255, 255, 0.06) !important;
  background: repeating-linear-gradient(90deg, #1b1830 0 14px, #141126 14px 18px) !important;
  background-clip: content-box !important;
}
.r.locked * { color: transparent !important; }
li.r.locked::marker { color: #3a3560; }
.r.fresh { animation: decrypt 1.6s ease-out; }
@keyframes decrypt { 0% { background: rgba(125, 255, 176, 0.35); box-shadow: 0 0 20px rgba(125, 255, 176, 0.5); } 100% { background: transparent; } }

/* ---------------- Plain fallback */
.plain-cv { position: relative; z-index: 60; max-width: 760px; margin: 0 auto; padding: 32px 16px; background: var(--bg); height: 100%; overflow: auto; line-height: 1.6; }
.plain-cv a { color: var(--cyan); }

@media (max-width: 700px) {
  .hud-score > div:nth-child(2) { display: none; }
  .hud-mid { min-width: 0; }
  .hud-pct { min-width: 0; }
  .hud-pct .k { display: none !important; }
  #feed { top: 50px; width: 70%; }
  .feed-line { font-size: 10px; padding: 4px 8px; }
  .title-inner { gap: 12px; }
  .title-controls { font-size: 11px; }
}
@media (max-height: 460px) {
  .title-howto, .title-controls { display: none; }
  .title-inner { gap: 10px; }
  .glitch { font-size: clamp(32px, 7vw, 64px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media print {
  body { overflow: visible; background: #fff; color: #000; }
  body > *:not(#dossier) { display: none !important; }
  #dossier { position: static; transform: none; width: auto; background: #fff; box-shadow: none; border: 0; backdrop-filter: none; }
  .dossier-bar, .d-hint, .ach-grid, .d-sec:last-child { display: none !important; }
  #dossier-body { overflow: visible; padding: 0; }
  .d-sec p, .d-job li, .d-certs li, .chip, .d-head h2 { color: #000 !important; }
  .r.locked { color: #000 !important; background: none !important; }
  .r.locked * { color: #000 !important; }
}
