:root {
  --black: #090909;
  --black-soft: #101011;
  --panel: rgba(17, 17, 18, .86);
  --white: #fffdfc;
  --muted: #a7a2a3;
  --pink: #d7a6b3;
  --pink-light: #f2dfe4;
  --gold: #c5a45d;
  --line: rgba(255, 253, 252, .11);
  --mono: "DM Mono", monospace;
  --sans: "Manrope", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--black);
  background-size: 48px 48px;
  font-family: var(--sans);
  overflow-x: hidden;
}

button, a { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(120px);
  opacity: .12;
  z-index: -1;
}
.ambient-one { width: 440px; height: 440px; background: var(--pink); top: 10%; right: -180px; }
.ambient-two { width: 360px; height: 360px; background: var(--gold); bottom: 5%; left: -200px; opacity: .07; }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  height: 84px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  color: var(--black);
  background: var(--pink);
  border: 1px solid var(--gold);
  font-family: var(--sans);
  font-weight: 800;
}

.system-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--pink);
  box-shadow: 0 0 0 0 rgba(215,166,179,.6);
  animation: pulse 2s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(215,166,179,0); } 100% { box-shadow: 0 0 0 0 rgba(215,166,179,0); } }

.github-link {
  justify-self: end;
  display: flex;
  gap: 8px;
  color: var(--white);
  text-decoration: none;
  transition: color .2s ease;
}
.github-link:hover { color: var(--pink); }

.hero { padding: 105px 0 80px; text-align: center; }
.eyebrow {
  margin: 0 0 25px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .19em;
}
.hero h1 {
  margin: 0 auto;
  max-width: 900px;
  font-size: clamp(45px, 7vw, 85px);
  font-weight: 500;
  letter-spacing: -.065em;
  line-height: .98;
}
.hero h1 em { color: var(--pink); font-style: normal; }
.intro {
  max-width: 640px;
  margin: 32px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.015);
}
.metric {
  min-height: 145px;
  padding: 24px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.metric:last-child { border-right: 0; }
.metric > span, .metric small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
}
.metric strong {
  margin: auto 0 13px;
  font-family: var(--mono);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 400;
  color: var(--white);
}
.metric:first-child strong { color: var(--pink); font-size: clamp(20px, 2.4vw, 29px); }
.metric small { display: flex; align-items: center; gap: 8px; }
.dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; }
.dot.pink { background: var(--pink); }

.operations-grid {
  display: grid;
  grid-template-columns: 1.18fr .82fr;
  gap: 18px;
  margin-top: 18px;
}

.panel { border: 1px solid var(--line); background: var(--panel); }

.panel-heading {
  height: 74px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.panel-heading > div { display: flex; align-items: center; gap: 14px; }
.panel-index { color: var(--gold); font-family: var(--mono); font-size: 10px; }
.panel-heading h2 { margin: 0; font-size: 14px; font-weight: 600; }
.secure-label, .clear-log {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
}
.secure-label { padding: 7px 9px; color: var(--pink); border: 1px solid rgba(215,166,179,.35); }
.clear-log {
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}
.clear-log:hover { color: var(--white); }

.button-zone {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  display: grid;
  place-items: center;
  isolation: isolate;
  touch-action: manipulation;
}
.button-zone::before, .button-zone::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
}
.button-zone::before { width: 290px; height: 290px; }
.button-zone::after { width: 190px; height: 190px; }

.target-ring {
  position: absolute;
  left: 50%; top: 50%;
  width: 110px; height: 110px;
  border: 1px dashed rgba(197,164,93,.22);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
}

#escape-button {
  position: absolute;
  left: 50%; top: 48%;
  width: 158px;
  height: 50px;
  transform: translate(-50%, -50%);
  color: var(--black);
  background: var(--pink);
  border: 1px solid var(--gold);
  box-shadow: 0 9px 35px rgba(215,166,179,.15);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  cursor: pointer;
  transition: left .16s cubic-bezier(.2,.8,.2,1), top .16s cubic-bezier(.2,.8,.2,1), transform .2s ease, background .2s ease;
  z-index: 3;
}
#escape-button:hover { background: var(--pink-light); }
#escape-button.compromised { background: var(--gold); }

#instruction {
  position: absolute;
  left: 0; right: 0; bottom: 24px;
  margin: 0;
  color: #777274;
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
}

.terminal-window {
  height: 440px;
  padding: 21px 22px;
  overflow: hidden;
  background: #0b0b0c;
  font-family: var(--mono);
}
.log-line {
  display: grid;
  grid-template-columns: 70px 42px 1fr;
  gap: 8px;
  margin-bottom: 15px;
  font-size: 10px;
  line-height: 1.5;
  animation: log-in .25s ease;
}
@keyframes log-in { from { opacity: 0; transform: translateY(5px); } }
.log-line time { color: #5f5b5c; }
.log-line span { font-size: 8px; letter-spacing: .06em; }
.log-line p { margin: 0; color: #b5b0b1; }
.log-info { color: var(--gold); }
.log-ok { color: var(--pink); }
.log-warn { color: #e0bd73; }
.log-critical { color: #e58e9e; }

.activity { margin-top: 18px; }
.activity-heading { border-bottom: 0; }
.legend { color: var(--muted); font-family: var(--mono); font-size: 8px; }
.level { width: 11px; height: 11px; display: inline-block; }
.l0 { background: #19191a; }
.l1 { background: rgba(215,166,179,.35); }
.l2 { background: var(--pink); }
.l3 { background: var(--gold); }

.incident-grid {
  display: grid;
  grid-template-columns: repeat(26, 1fr);
  gap: 5px;
  padding: 7px 24px 26px;
}
.incident-cell {
  aspect-ratio: 1;
  min-width: 0;
  background: #181819;
  border: 1px solid rgba(255,255,255,.025);
  transition: background .25s ease, transform .25s ease;
}
.incident-cell.active-1 { background: rgba(215,166,179,.38); }
.incident-cell.active-2 { background: var(--pink); }
.incident-cell.active-3 { background: var(--gold); transform: scale(1.08); }

.activity-footer {
  min-height: 57px;
  padding: 0 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #777274;
  font-family: var(--mono);
  font-size: 9px;
}
.activity-footer button {
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.activity-footer button:hover { color: var(--pink); }

footer {
  min-height: 105px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #625e60;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
}

.result-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5,5,5,.86);
  backdrop-filter: blur(14px);
}
.result-modal[hidden] { display: none; }
.modal-card {
  width: min(520px, 100%);
  padding: 48px;
  text-align: center;
  background: var(--black-soft);
  border: 1px solid var(--gold);
  box-shadow: 0 30px 100px rgba(0,0,0,.65);
  animation: modal-in .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes modal-in { from { opacity: 0; transform: scale(.96) translateY(10px); } }
.modal-code { color: var(--gold); font-family: var(--mono); font-size: 9px; letter-spacing: .16em; }
.modal-card h2 { margin: 22px 0; color: var(--pink); font-size: 48px; line-height: 1.04; letter-spacing: -.055em; }
.modal-card > p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.modal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 31px 0;
  border: 1px solid var(--line);
}
.modal-stats span {
  padding: 17px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  border-right: 1px solid var(--line);
}
.modal-stats span:last-child { border: 0; }
.modal-stats strong { display: block; margin-top: 8px; color: var(--white); font-size: 18px; }
#restart {
  width: 100%;
  height: 51px;
  color: var(--black);
  background: var(--pink);
  border: 1px solid var(--gold);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  cursor: pointer;
}

@media (max-width: 850px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .operations-grid { grid-template-columns: 1fr; }
  .incident-grid { grid-template-columns: repeat(18, 1fr); }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1180px); }
  .topbar { grid-template-columns: 1fr auto; }
  .system-pill { display: none; }
  .hero { padding: 76px 0 58px; }
  .hero h1 { font-size: 47px; }
  .intro { font-size: 13px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 120px; padding: 17px; }
  .metric strong { font-size: 25px; }
  .metric:first-child strong { font-size: 18px; }
  .button-zone { min-height: 390px; }
  .terminal-window { height: 350px; }
  .panel-heading { padding: 0 17px; }
  .activity-heading { align-items: flex-start; height: auto; padding-top: 20px; padding-bottom: 18px; gap: 15px; flex-direction: column; }
  .legend { align-self: flex-start; }
  .incident-grid { grid-template-columns: repeat(13, 1fr); padding: 7px 17px 22px; }
  .activity-footer { padding: 14px 17px; gap: 14px; align-items: flex-start; }
  .activity-footer span { line-height: 1.5; }
  footer { min-height: 90px; gap: 15px; }
  footer p:first-child { display: none; }
  .modal-card { padding: 35px 24px; }
  .modal-card h2 { font-size: 39px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}


/* YUKI-bad sausage heist */
.game-field { display:block; padding:30px 28px 62px; min-height:520px; }
.game-field::before,.game-field::after,.target-ring { display:none; }
.holes { height:100%; display:grid; grid-template-columns:repeat(3,1fr); gap:24px 34px; align-items:center; }
.hole { position:relative; min-height:118px; display:grid; place-items:end center; overflow:hidden; }
.hole::after { content:""; position:absolute; bottom:4px; width:88%; height:30px; border-radius:50%; background:radial-gradient(ellipse at center,#050505 0 48%,#262123 52%,#0d0d0e 72%); border:1px solid rgba(197,164,93,.3); box-shadow:inset 0 8px 12px #000,0 5px 18px rgba(0,0,0,.7); z-index:1; }
.yorkie-button { --sausage-scale:1; position:relative; z-index:2; width:124px; height:112px; padding:0; margin-bottom:-76px; border:0; background:none; cursor:pointer; opacity:0; transform:translateY(55px) scale(.82); transition:transform .18s cubic-bezier(.2,.9,.3,1.25),opacity .12s; filter:drop-shadow(0 8px 9px rgba(0,0,0,.55)); }
.yorkie-button.active { opacity:1; transform:translateY(0) scale(1); }
.yorkie-button.retreat { opacity:0; transform:translateY(58px) scale(.86); }
.yorkie-button svg { width:100%; height:100%; overflow:visible; pointer-events:none; }
.yorkie-button .sausage { transform-box:fill-box; transform-origin:left center; transform:scaleX(var(--sausage-scale)); }
.yorkie-button:hover .head { transform-box:fill-box; transform-origin:center; transform:rotate(-3deg); }
.hole-number { position:absolute; top:5px; left:8px; color:#4f4b4c; font:8px var(--mono); }
#instruction { bottom:23px; }
.metric:nth-child(4) strong { color:var(--gold); }
.theft-flash { animation:theft .35s ease; }
@keyframes theft { 50% { color:var(--pink-light); text-shadow:0 0 14px var(--pink); } }
@media(max-width:560px){
 .game-field{min-height:470px;padding:22px 10px 58px}
 .holes{gap:16px 5px}
 .hole{min-height:105px}
 .yorkie-button{width:102px;height:94px;margin-bottom:-63px}
 .hole::after{height:24px}
}


/* Endless game corrections */
.hole{min-height:145px;overflow:hidden}
.yorkie-button{margin-bottom:8px;z-index:2;transform:translateY(125px) scale(.9)}
.yorkie-button.active{transform:translateY(0) scale(1)}
.yorkie-button.retreat{transform:translateY(125px) scale(.9)}
.hole::after{z-index:3;bottom:0}
.incident-cell.miss{background:#fffdfc;border-color:#fffdfc}
.incident-cell.hit{background:#d7a6b3;border-color:#d7a6b3;transform:scale(1.08)}
.l0{background:#fffdfc}.l1,.l2,.l3{background:#d7a6b3}
@media(max-width:560px){
 .hole{min-height:125px}
 .yorkie-button{margin-bottom:5px;transform:translateY(110px) scale(.88)}
 .yorkie-button.active{transform:translateY(0) scale(1)}
 .yorkie-button.retreat{transform:translateY(110px) scale(.88)}
}
