/* SYMMETRA — Order From Chaos · Vishkar hard-light UI
   Palette: photon cyan #6fe3f2 · white #f4f1e6 · gold #cfa63f · slate #11151d */

:root {
  --cyan: #6fe3f2;
  --cyan-dim: rgba(111, 227, 242, 0.55);
  --white: #f4f1e6;
  --gold: #cfa63f;
  --gold-dim: rgba(207, 166, 63, 0.45);
  --slate: #11151d;
  --slate-glass: rgba(13, 17, 24, 0.72);
  --hairline: rgba(244, 241, 230, 0.28);
  --font: "Avenir Next", Futura, "Century Gothic", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--slate);
  font-family: var(--font);
  color: var(--white);
  -webkit-user-select: none; user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}

#app, #app canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ui button, #ui .title-begin, #ui .overlay { pointer-events: auto; }

.hidden { display: none !important; }

/* ─── overlays (title / end) ─── */
.overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 42%, rgba(17, 21, 29, 0.25) 0%, rgba(17, 21, 29, 0.88) 100%);
  text-align: center;
  padding: 4vmin;
}

.title-frame { max-width: 620px; width: 100%; }

.rule {
  height: 1px; margin: 14px auto;
  background: linear-gradient(90deg, transparent, var(--gold-dim) 20%, var(--gold) 50%, var(--gold-dim) 80%, transparent);
}
.rule:first-child, .rule:last-child { width: 100%; }

.title-eyebrow {
  font-size: 10px; letter-spacing: 0.42em; color: var(--gold);
  margin-bottom: 18px;
}

.title-name {
  font-size: clamp(44px, 9vw, 84px);
  font-weight: 300; letter-spacing: 0.34em; text-indent: 0.34em;
  color: var(--white);
  text-shadow: 0 0 34px rgba(111, 227, 242, 0.35);
}

.title-sub {
  font-size: clamp(12px, 2vw, 16px);
  letter-spacing: 0.62em; text-indent: 0.62em;
  color: var(--cyan); margin-top: 10px;
}

.title-brief {
  font-size: 13px; line-height: 1.9; letter-spacing: 0.12em;
  color: rgba(244, 241, 230, 0.78); margin: 6px 0 18px;
}

.title-controls {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px 26px;
  font-size: 11px; letter-spacing: 0.14em; color: rgba(244, 241, 230, 0.66);
  margin-bottom: 22px; text-align: left;
}
.title-controls div { border-bottom: 1px solid rgba(244, 241, 230, 0.1); padding-bottom: 6px; }

.key {
  display: inline-block; padding: 2px 7px; margin-right: 6px;
  border: 1px solid var(--hairline); border-radius: 2px;
  font-size: 10px; color: var(--cyan); letter-spacing: 0.1em;
}
.key-alt { color: rgba(244,241,230,0.45); margin-right: 6px; }

.title-begin {
  display: inline-block; margin: 4px 0 6px; padding: 13px 42px;
  border: 1px solid var(--gold); color: var(--gold);
  font-size: 13px; letter-spacing: 0.42em; text-indent: 0.42em;
  cursor: pointer; transition: all 0.25s ease;
  animation: beginPulse 2.6s ease-in-out infinite;
}
.title-begin:hover { background: var(--gold); color: var(--slate); box-shadow: 0 0 30px rgba(207, 166, 63, 0.45); }
@keyframes beginPulse { 0%,100% { box-shadow: 0 0 0 rgba(207,166,63,0); } 50% { box-shadow: 0 0 22px rgba(207,166,63,0.28); } }

/* ─── HUD ─── */
#hud { position: absolute; inset: 0; }
.hud-label { font-size: 9px; letter-spacing: 0.34em; color: rgba(244, 241, 230, 0.55); }
.hud-dim { font-size: 9px; letter-spacing: 0.22em; color: rgba(244, 241, 230, 0.45); }

#hud-topleft {
  position: absolute; top: 16px; left: 18px;
  padding: 10px 14px; background: var(--slate-glass);
  border-left: 1px solid var(--gold);
}
#core-bar { width: 190px; height: 5px; background: rgba(244,241,230,0.12); margin: 7px 0 8px; }
#core-fill {
  width: 100%; height: 100%;
  background: linear-gradient(90deg, var(--cyan), #aef3fb);
  box-shadow: 0 0 8px var(--cyan-dim);
  transition: width 0.3s ease, background 0.3s ease;
}
#core-fill.hurt { background: linear-gradient(90deg, #e0684e, #f0a04e); }
#wave-label { font-size: 11px; letter-spacing: 0.3em; color: var(--white); }

#hud-topright { position: absolute; top: 16px; right: 18px; display: flex; gap: 12px; align-items: flex-start; }
#score-box {
  padding: 10px 14px; background: var(--slate-glass);
  border-right: 1px solid var(--gold); text-align: right;
}
#score-val { display: block; font-size: 20px; font-weight: 300; letter-spacing: 0.12em; color: var(--white); margin-top: 3px; }
#mute-btn {
  width: 34px; height: 34px; background: var(--slate-glass);
  border: 1px solid var(--hairline); color: var(--white);
  font-size: 15px; cursor: pointer;
}
#mute-btn.muted { color: rgba(244,241,230,0.3); text-decoration: line-through; }

#banner {
  position: absolute; top: 16%; left: 50%; transform: translateX(-50%);
  font-size: clamp(15px, 2.6vw, 24px); font-weight: 300;
  letter-spacing: 0.5em; text-indent: 0.5em; color: var(--white);
  text-shadow: 0 0 24px rgba(111, 227, 242, 0.5);
  white-space: nowrap; text-align: center;
  opacity: 0; transition: opacity 0.4s ease;
}
#banner.show { opacity: 1; }
#banner .banner-sub { display: block; font-size: 10px; letter-spacing: 0.4em; color: var(--gold); margin-top: 8px; }

#popups { position: absolute; inset: 0; overflow: hidden; }
.popup {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 13px; letter-spacing: 0.28em; white-space: nowrap;
  color: var(--cyan); text-shadow: 0 0 12px rgba(111, 227, 242, 0.7);
  animation: popupRise 1.5s ease-out forwards;
}
.popup.gold { color: var(--gold); text-shadow: 0 0 12px rgba(207, 166, 63, 0.7); }
.popup.big { font-size: 17px; }
@keyframes popupRise {
  0% { opacity: 0; margin-top: 0; }
  12% { opacity: 1; }
  100% { opacity: 0; margin-top: -46px; }
}

#hud-bottomleft { position: absolute; left: 18px; bottom: 16px; padding: 10px 14px; background: var(--slate-glass); border-left: 1px solid var(--cyan-dim); }
#photons-box { display: flex; align-items: baseline; gap: 8px; }
.photon-gem {
  width: 9px; height: 9px; background: var(--cyan);
  transform: rotate(45deg); box-shadow: 0 0 9px var(--cyan);
  align-self: center;
}
#photons-val { font-size: 20px; font-weight: 300; color: var(--cyan); }
#turret-pips { display: flex; gap: 6px; margin: 8px 0 6px; }
.pip {
  width: 22px; height: 8px; border: 1px solid var(--hairline);
  transform: skewX(-18deg);
}
.pip.on { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 8px var(--cyan-dim); }
.pip.linked { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 8px var(--gold-dim); }

#hud-bottomright { position: absolute; right: 18px; bottom: 16px; text-align: right; }
.ability {
  display: inline-flex; align-items: center; gap: 9px;
  margin-left: 8px; padding: 9px 13px;
  background: var(--slate-glass); border: 1px solid var(--hairline);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ability.armed { border-color: var(--cyan); box-shadow: 0 0 16px rgba(111, 227, 242, 0.35); }
.ability.ready { border-color: var(--gold); box-shadow: 0 0 16px rgba(207, 166, 63, 0.4); animation: beginPulse 2s infinite; }
.ability.poor { opacity: 0.42; }
.ab-key { font-size: 11px; color: var(--cyan); border: 1px solid var(--hairline); padding: 1px 6px; }
.ab-name { font-size: 10px; letter-spacing: 0.26em; }
.ab-cost { font-size: 10px; color: var(--gold); }
.ability-hint { margin-top: 8px; font-size: 9px; letter-spacing: 0.2em; color: rgba(244,241,230,0.4); }

/* ─── end screen ─── */
#end-title { font-size: clamp(30px, 6vw, 58px); font-weight: 300; letter-spacing: 0.3em; text-indent: 0.3em; }
#end-screen.won #end-title { color: var(--cyan); text-shadow: 0 0 40px rgba(111, 227, 242, 0.55); }
#end-screen.lost #end-title { color: #d98a75; }
#end-breakdown {
  margin: 10px auto 6px; font-size: 11px; letter-spacing: 0.22em; line-height: 2.2;
  color: rgba(244, 241, 230, 0.72);
}
#end-breakdown .bd-row { display: flex; justify-content: space-between; max-width: 380px; margin: 0 auto; border-bottom: 1px solid rgba(244,241,230,0.1); }
#end-breakdown .bd-val { color: var(--cyan); }
#end-score { font-size: 26px; font-weight: 300; letter-spacing: 0.2em; color: var(--gold); margin: 12px 0 16px; }

/* ─── touch controls ─── */
#touch-controls { position: absolute; inset: 0; }
#joystick {
  position: absolute; left: 26px; bottom: 90px;
  width: 118px; height: 118px; border-radius: 50%;
  border: 1px solid var(--cyan-dim); background: rgba(17, 21, 29, 0.4);
  pointer-events: auto;
}
#joystick-knob {
  position: absolute; left: 50%; top: 50%;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(111, 227, 242, 0.3); border: 1px solid var(--cyan);
  transform: translate(-50%, -50%);
}
#touch-buttons {
  position: absolute; right: 20px; bottom: 196px;
  display: flex; flex-direction: column; gap: 10px;
}
.tbtn {
  width: 74px; height: 44px;
  background: var(--slate-glass); border: 1px solid var(--hairline);
  color: var(--white); font-family: var(--font);
  font-size: 10px; letter-spacing: 0.18em; cursor: pointer;
}
.tbtn.armed { border-color: var(--cyan); color: var(--cyan); }
.tbtn.ready { border-color: var(--gold); color: var(--gold); }
#tb-fire {
  position: absolute; right: 30px; bottom: 92px;
  width: 92px; height: 92px; border-radius: 50%;
  background: rgba(111, 227, 242, 0.12); border: 1px solid var(--cyan);
  color: var(--cyan); font-family: var(--font);
  font-size: 11px; letter-spacing: 0.24em; cursor: pointer;
}
#tb-fire.active { background: rgba(111, 227, 242, 0.4); }

/* ─── small screens ─── */
@media (max-width: 720px) {
  #hud-topleft { top: 10px; left: 10px; padding: 8px 10px; }
  #core-bar { width: 130px; }
  #hud-topright { top: 10px; right: 10px; }
  #hud-bottomleft { display: none; }
  #hud-bottomright { display: none; }
  .title-controls { grid-template-columns: 1fr; }
  #banner { top: 12%; white-space: normal; max-width: 92vw; letter-spacing: 0.3em; text-indent: 0.3em; }
}
@media (pointer: fine) {
  /* keyboard/mouse players never see touch chrome */
}
