@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Inter:wght@500;600;700&display=swap');

:root {
  --ink: #101615;
  --paper: #eef0e8;
  --acid: #b9ef45;
  --acid-dark: #7eaa27;
  --red: #df3e35;
  --amber: #f0aa36;
  --line: rgba(238, 240, 232, .18);
  font-family: Inter, system-ui, sans-serif;
  color: var(--paper);
  background: #090d0c;
  touch-action: none;
  user-select: none;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; overflow: hidden; }
body { background: #090d0c; }
button { font: inherit; }

#app { width: 100vw; height: 100dvh; display: grid; grid-template-rows: 64px 1fr 34px; background: var(--ink); }
.topbar, .statusbar { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; background: #0d1211; }
.topbar { border-bottom: 1px solid var(--line); }
.statusbar { border-top: 1px solid var(--line); color: rgba(238,240,232,.58); font-family: "Barlow Condensed", sans-serif; font-size: 12px; letter-spacing: 0; }
.statusbar span { display: flex; align-items: center; gap: 8px; }
.status-light { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 10px var(--acid); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: var(--ink); background: var(--acid); font: 800 24px/1 "Barlow Condensed", sans-serif; transform: skew(-8deg); }
.brand strong, .brand small { display: block; font-family: "Barlow Condensed", sans-serif; line-height: .9; }
.brand strong { font-size: 20px; }
.brand small { margin-top: 5px; color: rgba(238,240,232,.48); font-size: 10px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button, .language-button { height: 36px; border: 1px solid var(--line); color: var(--paper); background: transparent; cursor: pointer; }
.icon-button { width: 36px; font-size: 16px; }
.language-button { min-width: 46px; padding: 0 10px; color: var(--acid); font: 700 13px "Barlow Condensed", sans-serif; }
.icon-button:hover, .language-button:hover { border-color: var(--acid); }

.game-shell { position: relative; min-height: 0; overflow: hidden; background: #141c1a; }
canvas { display: block; width: 100%; height: 100%; }
.hud { position: absolute; z-index: 5; inset: 18px 20px auto; display: flex; justify-content: space-between; pointer-events: none; }
.hud-group { width: min(330px, 42vw); display: grid; gap: 9px; }
.meter-block { display: grid; gap: 4px; }
.meter-label { display: flex; justify-content: space-between; color: rgba(238,240,232,.74); font: 700 12px "Barlow Condensed", sans-serif; }
.meter-label strong { color: var(--paper); }
.meter { height: 8px; overflow: hidden; border: 1px solid rgba(238,240,232,.22); background: rgba(5,8,7,.5); }
.meter i { display: block; width: 0; height: 100%; transition: width .12s linear; }
.blood-fill { background: var(--red); }
.alert-fill { background: var(--amber); }
.score-panel { min-width: 118px; padding-left: 14px; border-left: 2px solid var(--acid); text-align: right; font-family: "Barlow Condensed", sans-serif; }
.score-panel > span { display: block; color: rgba(238,240,232,.52); font-size: 11px; }
.score-panel strong { display: block; font-size: 30px; line-height: 1; }
.score-panel small { color: rgba(238,240,232,.62); }
.score-panel b { color: var(--acid); }
.objective-banner { position: absolute; z-index: 5; top: 92px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; padding: 9px 15px; border: 1px solid rgba(185,239,69,.35); color: var(--paper); background: rgba(9,14,12,.78); backdrop-filter: blur(8px); font: 700 12px "Barlow Condensed", sans-serif; pointer-events: none; }
.objective-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 8px var(--acid); }

.overlay { position: absolute; z-index: 15; inset: 0; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(5,8,7,.77); backdrop-filter: blur(6px); }
.overlay.visible { display: flex; }
.overlay-content { width: min(760px, 100%); text-align: center; }
.start-content h1, .overlay-content h2 { margin: 0; text-transform: uppercase; font: 800 clamp(56px, 9vw, 112px)/.82 "Barlow Condensed", sans-serif; }
.overlay-content h2 { font-size: clamp(48px, 7vw, 76px); }
.eyebrow { margin: 0 0 15px; color: var(--acid); font: 700 13px "Barlow Condensed", sans-serif; }
.lead { margin: 18px 0 26px; color: rgba(238,240,232,.72); font: 600 18px "Barlow Condensed", sans-serif; }
.mission-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 28px auto 22px; border: 1px solid var(--line); background: var(--line); }
.mission-row div { min-height: 88px; display: flex; align-items: center; gap: 12px; padding: 16px; text-align: left; background: rgba(13,18,17,.9); }
.mission-row span { color: var(--acid); font: 800 28px "Barlow Condensed", sans-serif; }
.mission-row p { margin: 0; font: 700 13px/1.25 "Barlow Condensed", sans-serif; }
.controls-hint { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px; margin: 16px 0 24px; color: rgba(238,240,232,.62); font: 600 12px "Barlow Condensed", sans-serif; }
.controls-hint span { display: flex; align-items: center; gap: 7px; }
kbd { min-width: 38px; padding: 5px 7px; border: 1px solid rgba(238,240,232,.25); color: var(--paper); background: #171e1c; box-shadow: inset 0 -2px rgba(0,0,0,.35); font: 700 10px Inter, sans-serif; }
.mobile-hint { display: none; }
.primary-button { min-width: 230px; height: 54px; display: inline-flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 18px 0 22px; border: 0; color: var(--ink); background: var(--acid); cursor: pointer; font: 800 16px "Barlow Condensed", sans-serif; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); }
.primary-button:hover { background: #d0ff68; }
.primary-button b { font-size: 22px; }
.compact-content { width: min(420px, 100%); }
.text-button { display: block; margin: 18px auto 0; border: 0; color: rgba(238,240,232,.65); background: transparent; cursor: pointer; font: 700 13px "Barlow Condensed", sans-serif; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; max-width: 430px; margin: 24px auto; border: 1px solid var(--line); background: var(--line); }
.result-stats div { padding: 15px; background: #111715; }
.result-stats span, .result-stats strong { display: block; font-family: "Barlow Condensed", sans-serif; }
.result-stats span { color: rgba(238,240,232,.55); font-size: 11px; }
.result-stats strong { margin-top: 3px; color: var(--acid); font-size: 27px; }

.mobile-controls { position: absolute; z-index: 8; inset: auto 18px 18px; display: none; justify-content: space-between; align-items: end; pointer-events: none; }
.joystick { width: 124px; height: 124px; position: relative; border: 1px solid rgba(238,240,232,.25); border-radius: 50%; background: rgba(8,12,11,.45); pointer-events: auto; }
.joystick::before, .joystick::after { content: ""; position: absolute; background: rgba(238,240,232,.1); }
.joystick::before { width: 1px; inset: 15px auto 15px 50%; }
.joystick::after { height: 1px; inset: 50% 15px auto; }
.joystick i { position: absolute; width: 54px; height: 54px; left: 35px; top: 35px; border: 2px solid var(--acid); border-radius: 50%; background: rgba(185,239,69,.18); box-shadow: 0 0 20px rgba(185,239,69,.15); }
.action-stack { display: flex; gap: 12px; align-items: end; pointer-events: auto; }
.action-button { width: 70px; height: 70px; border: 1px solid rgba(238,240,232,.28); border-radius: 50%; color: var(--paper); background: rgba(8,12,11,.62); }
.action-button span, .action-button small { display: block; }
.action-button span { font-size: 22px; }
.action-button small { font: 700 9px "Barlow Condensed", sans-serif; }
.bite-button { width: 88px; height: 88px; border-color: rgba(223,62,53,.8); background: rgba(104,24,21,.6); }
.action-button:active, .action-button.active { transform: scale(.94); background: rgba(185,239,69,.3); }
.toast { position: absolute; z-index: 10; left: 50%; bottom: 25%; transform: translate(-50%, 12px); opacity: 0; padding: 9px 14px; color: var(--ink); background: var(--paper); font: 800 12px "Barlow Condensed", sans-serif; pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (hover: none), (max-width: 850px) {
  #app { grid-template-rows: 52px 1fr 28px; }
  .topbar { padding: 0 12px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand strong { font-size: 17px; }
  .icon-button, .language-button { height: 32px; }
  .hud { inset: 12px 12px auto; }
  .hud-group { width: 45vw; }
  .objective-banner { top: 79px; max-width: calc(100% - 24px); white-space: nowrap; }
  .mobile-controls { display: flex; }
  .desktop-hint { display: none; }
  .mobile-hint { display: flex; }
  .statusbar { padding: 0 12px; }
  .statusbar span:last-child { display: none; }
}

@media (max-width: 600px) {
  .brand small { display: none; }
  .hud-group { width: 48vw; }
  .score-panel { min-width: 82px; }
  .score-panel strong { font-size: 24px; }
  .objective-banner { top: 72px; font-size: 11px; }
  .overlay { padding: 16px; }
  .start-content h1 { font-size: 56px; }
  .mission-row { margin: 18px auto 14px; }
  .mission-row div { min-height: 66px; display: block; padding: 10px; text-align: center; }
  .mission-row span { font-size: 21px; }
  .mission-row p { margin-top: 3px; font-size: 10px; }
  .lead { margin: 12px 0 16px; font-size: 15px; }
  .controls-hint { margin: 10px 0 15px; }
  .joystick { width: 106px; height: 106px; }
  .joystick i { width: 48px; height: 48px; left: 28px; top: 28px; }
  .action-button { width: 62px; height: 62px; }
  .bite-button { width: 78px; height: 78px; }
  .action-stack { gap: 8px; }
}

@media (max-height: 590px) {
  .mission-row { margin: 12px auto 10px; }
  .mission-row div { min-height: 58px; padding: 8px 12px; }
  .lead { margin: 8px 0 12px; }
  .controls-hint { margin: 8px 0 12px; }
  .start-content h1 { font-size: 50px; }
  .eyebrow { margin-bottom: 8px; }
  .mobile-controls { bottom: 10px; }
}
