/* Riftrunner game styles, moved out of index.html for the site CSP (style-src 'self'). */
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0a1e; }
body { font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif; user-select: none; }
#game { display: block; width: 100%; height: 100%; cursor: crosshair; }

.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  color: #e8e4ff; z-index: 10; cursor: pointer;
  background: radial-gradient(ellipse at center, rgba(13,10,30,0.55) 0%, rgba(13,10,30,0.92) 100%);
}
.hidden { display: none !important; }
h1 {
  font-size: clamp(42px, 8vw, 96px); margin: 0; letter-spacing: 0.18em;
  color: #6fe0b8; text-shadow: 0 0 24px rgba(111,224,184,0.5);
  font-weight: 800; font-style: italic;
}
.sub { color: #b8aef0; letter-spacing: 0.3em; font-size: 14px; margin: 6px 0 30px; }
.controls {
  display: grid; grid-template-columns: auto auto; gap: 6px 18px;
  font-size: 15px; text-align: left; margin-bottom: 34px;
}
.controls b { color: #ffc93a; font-weight: 700; text-align: right; }
.cta { font-size: 18px; color: #6fe0b8; letter-spacing: 0.2em; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
#death-reason { color: #ff6a5e; font-size: 22px; letter-spacing: 0.1em; margin: 8px 0; }
#death-score { font-size: 17px; color: #b8aef0; margin-bottom: 26px; }
#loading-msg { color: #b8aef0; font-size: 14px; letter-spacing: 0.2em; margin-top: 18px; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; color: #e8e4ff; }
#crosshair {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 22px; height: 22px;
}
#crosshair::before, #crosshair::after {
  content: ""; position: absolute; background: #6fe0b8;
  box-shadow: 0 0 6px rgba(111,224,184,0.8);
}
#crosshair::before { left: 50%; top: 0; width: 2px; height: 100%; transform: translateX(-50%); clip-path: polygon(0 0, 100% 0, 100% 32%, 0 32%, 0 68%, 100% 68%, 100% 100%, 0 100%); }
#crosshair::after { top: 50%; left: 0; height: 2px; width: 100%; transform: translateY(-50%); clip-path: polygon(0 0, 32% 0, 32% 100%, 0 100%, 68% 0, 100% 0, 100% 100%, 68% 100%); }
#grapple-dot {
  position: absolute; left: 50%; top: calc(50% + 26px); transform: translateX(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: #4de8c2;
  box-shadow: 0 0 8px #4de8c2; transition: opacity 0.15s;
}

#bottom-left { position: absolute; left: 26px; bottom: 22px; }
#health-bar { width: 220px; height: 10px; background: rgba(255,255,255,0.12); border-radius: 5px; overflow: hidden; }
#health-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff5a26, #6fe0b8 60%); border-radius: 5px; transition: width 0.15s; }
#boost-pips { margin-top: 8px; display: flex; gap: 6px; }
.pip { width: 34px; height: 7px; border-radius: 3px; background: rgba(255,255,255,0.14); }
.pip.on { background: #ffc93a; box-shadow: 0 0 8px rgba(255,201,58,0.7); }
#speed { margin-top: 8px; font-size: 13px; letter-spacing: 0.15em; color: #b8aef0; }

#bottom-right { position: absolute; right: 26px; bottom: 22px; text-align: right; }
#ammo { font-size: 30px; font-weight: 800; color: #e8e4ff; letter-spacing: 0.04em; }
#ammo .mag { font-size: 15px; color: #8a80c0; font-weight: 600; }
#ammo.low { color: #ff6a5e; }
#reloading { font-size: 13px; letter-spacing: 0.25em; color: #ffc93a; margin-top: 4px; height: 15px; }

#top-right { position: absolute; right: 26px; top: 20px; text-align: right; }
#score { font-size: 34px; font-weight: 800; color: #ffc93a; text-shadow: 0 0 12px rgba(255,201,58,0.4); }
#kills { font-size: 13px; letter-spacing: 0.15em; color: #b8aef0; }
#objective { font-size: 13px; letter-spacing: 0.15em; color: #ffd24a; margin-top: 6px; }

#waypoint-marker {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: #ffd24a; font-size: 11px; letter-spacing: 0.12em; font-weight: 700;
  text-shadow: 0 0 6px rgba(0,0,0,0.8); will-change: left, top; transition: opacity 0.2s;
}
#waypoint-marker .chevron {
  width: 15px; height: 15px; border: 2.5px solid #ffd24a; border-bottom: none; border-right: none;
  transform: rotate(45deg); box-shadow: 0 0 8px rgba(255,210,74,0.5);
}
#waypoint-marker.behind .chevron { transform: rotate(225deg); }

#feed {
  position: absolute; left: 50%; top: 58%; transform: translateX(-50%);
  text-align: center; font-weight: 800; font-size: 20px;
}
.feed-item { animation: feedup 0.9s forwards; color: #ffc93a; text-shadow: 0 0 10px rgba(255,201,58,0.6); }
@keyframes feedup { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-34px); } }

#vignette {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.1s;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(255,20,20,0.55) 100%);
}
/* speed tunnel — streaks the screen edges the faster you move */
#speedlines {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(120,200,255,0.16) 72%, rgba(150,220,255,0.36) 100%),
    repeating-conic-gradient(from 0deg at 50% 50%,
      rgba(255,255,255,0.13) 0deg 1.1deg, transparent 1.1deg 5deg);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 34%, #000 78%);
  mask-image: radial-gradient(ellipse at center, transparent 34%, #000 78%);
}
#hint { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  font-size: 12px; letter-spacing: 0.2em; color: rgba(184,174,240,0.75); }

/* was an inline style="" on the death-screen heading */
.death-title { color: #ff6a5e; text-shadow: 0 0 24px rgba(255,106,94,0.5); }

/* site addition: small link back to the projects page. Sits above the start /
   death screens (z-index 10) so clicking it navigates instead of requesting
   pointer lock; while the game holds pointer lock, clicks never reach it. */
.back-link {
  position: fixed; top: 14px; left: 16px; z-index: 20;
  padding: 5px 10px; border-radius: 6px;
  font-size: 12px; letter-spacing: 0.12em; text-decoration: none;
  color: rgba(184,174,240,0.7); background: rgba(13,10,30,0.45);
  border: 1px solid rgba(184,174,240,0.18);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.back-link:hover, .back-link:focus-visible {
  color: #6fe0b8; border-color: rgba(111,224,184,0.5); background: rgba(13,10,30,0.75);
}
.back-link:focus-visible { outline: 2px solid #6fe0b8; outline-offset: 2px; }
