@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@600;700&family=Share+Tech+Mono&display=swap');

:root {
  --bg: #040406;
  --neon: #9fe3c0;
  --amber: #ffb43d;
  --blood: #ff3355;
  --ink: #0b0e0c;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Chakra Petch', sans-serif;
  color: var(--neon);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game {
  display: block;
  position: fixed;
  inset: 0;
}

#grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0.05;
  background: repeating-linear-gradient(
    0deg,
    #fff 0,
    #fff 1px,
    transparent 1px,
    transparent 2px
  );
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  padding: 16px 18px;
  background: radial-gradient(
    ellipse at center,
    rgba(14, 10, 10, 0.94),
    rgba(2, 2, 3, 0.99)
  );
}

.screen > :first-child {
  margin-top: auto;
}

.screen > :last-child {
  margin-bottom: auto;
}

.hidden {
  display: none !important;
}

h1 {
  font-size: clamp(28px, 6.5vw, 58px);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #cfe;
  line-height: 0.95;
  text-shadow: 0 0 18px rgba(120, 200, 160, 0.4), 0 2px 0 #000;
}

h1 .b {
  color: var(--blood);
  text-shadow: 0 0 16px #7a0f1f;
}

.sub {
  font-family: 'Share Tech Mono', monospace;
  color: #5f7a6b;
  letter-spacing: 0.25em;
  margin: 8px 0 4px;
  font-size: clamp(10px, 2.4vw, 13px);
  text-transform: uppercase;
}

.maps {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
  max-width: 760px;
}

.mapcard {
  width: 200px;
  max-width: 42vw;
  background: rgba(20, 30, 26, 0.6);
  border: 1px solid #2c4a3a;
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  text-align: left;
  transition: 0.15s;
}

.mapcard:active {
  transform: scale(0.97);
}

.mapcard:hover {
  border-color: #9fe3c0;
  background: rgba(28, 44, 38, 0.8);
}

.mapcard .nm {
  font-weight: 700;
  font-size: 16px;
  color: #cfe;
  letter-spacing: 0.05em;
}

.mapcard .ds {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #8fb3a3;
  margin-top: 6px;
  line-height: 1.5;
}

.mapcard .tag {
  display: inline-block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--amber);
  border: 1px solid #5a4720;
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 8px;
}

.legend {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #9fb8a9;
  line-height: 1.7;
  margin-top: 4px;
}

.legend b {
  color: #cfe;
}

.btn {
  margin-top: 18px;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: clamp(15px, 4vw, 22px);
  letter-spacing: 0.15em;
  color: var(--ink);
  background: #cfe;
  border: none;
  padding: 14px 36px;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  box-shadow: 0 0 24px rgba(150, 220, 180, 0.4);
  text-transform: uppercase;
}

.btn:active {
  transform: translateY(2px);
}

.stat {
  font-family: 'Share Tech Mono', monospace;
  color: var(--amber);
  margin-top: 14px;
  font-size: clamp(15px, 4vw, 22px);
  letter-spacing: 0.1em;
}

.gameover h1 {
  animation: flick 2.4s infinite;
}

@keyframes flick {
  0%,
  97% {
    opacity: 1;
  }
  98% {
    opacity: 0.3;
  }
  99% {
    opacity: 1;
  }
}

#rotate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(2, 2, 3, 0.98);
  color: #cfe;
  font-family: 'Share Tech Mono', monospace;
  text-align: center;
  gap: 18px;
}

#rotate .ph {
  font-size: 60px;
  animation: spin 2s ease-in-out infinite;
}

@keyframes spin {
  0%,
  40% {
    transform: rotate(0);
  }
  60%,
  100% {
    transform: rotate(-90deg);
  }
}

.settings {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  margin: 6px 0 2px;
  font-family: 'Share Tech Mono', monospace;
}

.seg {
  display: flex;
  border: 1px solid #2c4a3a;
  border-radius: 8px;
  overflow: hidden;
}

.seg-b {
  background: transparent;
  color: #8fb3a3;
  border: none;
  padding: 7px 16px;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  font-size: 13px;
}

.seg-b.on {
  background: #9fe3c0;
  color: #0b0e0c;
}

.ctl {
  color: #9fb8a9;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctl input[type='range'] {
  accent-color: #9fe3c0;
}

.tog {
  background: transparent;
  border: 1px solid #2c4a3a;
  color: #9fb8a9;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
}

.ups {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

.upcard {
  width: 190px;
  max-width: 42vw;
  background: rgba(20, 30, 26, 0.7);
  border: 1px solid #2c4a3a;
  border-radius: 10px;
  padding: 16px 12px;
  cursor: pointer;
  transition: 0.15s;
}

.upcard:hover {
  border-color: #9fe3c0;
  background: rgba(28, 44, 38, 0.9);
}

.upcard:active {
  transform: scale(0.97);
}

.upcard .un {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  color: #cfe;
  font-size: 15px;
}

.upcard .ud {
  font-family: 'Share Tech Mono', monospace;
  color: #8fb3a3;
  font-size: 11px;
  margin-top: 6px;
}
