﻿:root {
  --bg-0: #02040a;
  --bg-1: #050b18;
  --bg-2: #071425;
  --ink: #dff7ff;
  --muted: #8ab8cd;
  --line: rgba(87, 191, 238, 0.26);
  --panel: rgba(2, 12, 26, 0.74);
  --about: #00d2ff;
  --projects: #2dff8e;
  --contact: #ff8a2b;
  --accent: #f6ff66;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: 'Rajdhani', sans-serif;
}

body {
  overflow: hidden;
  background: radial-gradient(circle at 20% 15%, #0f2a50 0%, var(--bg-2) 35%, var(--bg-0) 86%);
}

.background-layers {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(76, 178, 255, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(76, 178, 255, 0.12) 1px, transparent 1px);
  background-size: 54px 54px;
  opacity: 0.54;
}

.bg-glow {
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(86px);
  opacity: 0.5;
}

.bg-glow-a {
  background: #0d6fe0;
  top: -12vw;
  left: -8vw;
}

.bg-glow-b {
  background: #02d3c0;
  bottom: -16vw;
  right: -8vw;
}

.layout {
  width: min(1400px, 95vw);
  margin: 18px auto;
  display: grid;
  gap: 14px;
}

.glass-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.topbar,
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
}

.kicker {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 2px 0 0;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  letter-spacing: 0.06em;
  font-size: clamp(1.2rem, 3vw, 2rem);
  text-shadow: 0 0 18px rgba(0, 210, 255, 0.35);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid rgba(45, 255, 142, 0.52);
  border-radius: 999px;
  background: rgba(5, 45, 33, 0.45);
  font-size: 0.9rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #46ffb1;
  box-shadow: 0 0 13px #46ffb1;
}

.tiny {
  margin: 3px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.stage-wrap { padding: 10px; }

.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
  padding: 6px 8px 10px;
}

.stage-title {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.legend {
  display: flex;
  gap: 12px;
  font-size: 0.9rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.swatch.about { background: var(--about); }
.swatch.projects { background: var(--projects); }
.swatch.contact { background: var(--contact); }

.canvas-shell {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(73, 180, 238, 0.46);
  box-shadow: inset 0 0 60px rgba(0, 114, 184, 0.2);
}

#gameCanvas {
  width: 100%;
  height: auto;
  display: block;
  max-height: 72vh;
  background: #040d18;
}

.interaction-prompt {
  position: absolute;
  transform: translate(-50%, -145%);
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid rgba(246, 255, 102, 0.75);
  background: rgba(8, 12, 18, 0.95);
  color: var(--accent);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: bob 0.9s ease-in-out infinite alternate;
  pointer-events: none;
  box-shadow: 0 0 16px rgba(246, 255, 102, 0.2);
}

.hidden { display: none !important; }

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 9, 16, 0.78);
  backdrop-filter: blur(8px);
  z-index: 30;
}

.modal-card {
  width: min(860px, 95vw);
  max-height: min(88vh, 900px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(111, 213, 255, 0.43);
  background: linear-gradient(160deg, rgba(4, 15, 28, 0.97), rgba(5, 25, 43, 0.97));
  box-shadow: 0 26px 52px rgba(0, 0, 0, 0.5);
  padding: 24px;
  position: relative;
}

#modal-title {
  margin: 0 0 16px;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.04em;
  color: #e8fbff;
}

#modal-body { line-height: 1.55; }
#modal-body .intro { color: #c0deec; }

#modal-body .about-wrap {
  display: grid;
  grid-template-columns: 122px 1fr;
  gap: 14px;
  align-items: start;
}

#modal-body .avatar {
  width: 122px;
  height: 122px;
  border-radius: 14px;
  border: 2px solid rgba(46, 199, 255, 0.8);
  object-fit: cover;
  box-shadow: 0 0 18px rgba(46, 199, 255, 0.45);
}

#modal-body .chip-grid,
#modal-body .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

#modal-body .chip,
#modal-body .tag {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.86rem;
  border: 1px solid;
}

#modal-body .chip { border-color: rgba(77, 187, 245, 0.55); color: #a4e3ff; background: rgba(5, 33, 55, 0.55); }
#modal-body .tag { border-color: rgba(105, 204, 255, 0.42); color: #e2f3fb; background: rgba(4, 38, 60, 0.5); }

#modal-body .project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

#modal-body .project-card {
  border-radius: 12px;
  border: 1px solid rgba(129, 198, 236, 0.38);
  background: rgba(5, 24, 41, 0.76);
  padding: 12px;
}

#modal-body .project-card h3 { margin: 0 0 6px; font-size: 1rem; }
#modal-body .project-card p { margin: 0; color: #c1ddea; font-size: 0.95rem; }

#modal-body .project-link {
  display: inline-block;
  margin-top: 9px;
  color: #ffd35c;
  text-decoration: none;
}

#modal-body .project-link:hover { text-decoration: underline; }

.close-btn {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(111, 213, 255, 0.42);
  background: rgba(9, 22, 35, 0.86);
  color: #d7f0ff;
  cursor: pointer;
}

.contact-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(111, 213, 255, 0.23);
  display: grid;
  gap: 10px;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(126, 208, 255, 0.42);
  background: rgba(6, 22, 38, 0.94);
  color: #e4f6ff;
  font: inherit;
  padding: 10px;
}

.contact-form button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #112132;
  background: linear-gradient(120deg, #6ce7ff, #56ffa8);
  cursor: pointer;
}

.contact-status {
  margin: 10px 0 0;
  color: #8ad7ff;
  min-height: 1.2em;
}

.footer-row {
  font-size: 0.95rem;
  color: #c4dbe8;
}

.mobile-joystick {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 20;
  display: none;
  user-select: none;
}

.mobile-stick {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  border: 1px solid rgba(120, 214, 255, 0.6);
  background: radial-gradient(circle at 50% 50%, rgba(49, 132, 175, 0.45), rgba(6, 24, 40, 0.8));
  box-shadow: inset 0 0 18px rgba(87, 210, 255, 0.2), 0 0 24px rgba(0, 132, 214, 0.28);
  position: relative;
  touch-action: none;
}

.mobile-thumb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(192, 240, 255, 0.85);
  background: radial-gradient(circle at 35% 35%, rgba(216, 250, 255, 0.95), rgba(48, 139, 186, 0.9));
  box-shadow: 0 0 20px rgba(106, 223, 255, 0.55);
  position: absolute;
  left: 35px;
  top: 35px;
}

@keyframes bob {
  from { transform: translate(-50%, -145%); }
  to { transform: translate(-50%, -160%); }
}

@media (max-width: 840px) {
  body { overflow: auto; }
  .layout {
    width: min(100%, 96vw);
    margin: 10px auto 16px;
  }

  .topbar,
  .footer-row,
  .stage-head {
    flex-direction: column;
    align-items: flex-start;
  }

  #gameCanvas { max-height: none; }

  #modal-body .about-wrap,
  .row-2 { grid-template-columns: 1fr; }
}

@media (hover: none) and (pointer: coarse) {
  .mobile-joystick {
    display: block;
  }
}

@media (max-width: 900px) {
  .mobile-joystick {
    display: block;
    right: 10px;
    bottom: 10px;
  }

  .mobile-stick {
    width: 104px;
    height: 104px;
  }

  .mobile-thumb {
    width: 42px;
    height: 42px;
    left: 31px;
    top: 31px;
  }
}
