/**
 * Neon Overdrive - Cyberpunk Glassmorphism HUD Styles
 */

:root {
  --neon-cyan: #00f3ff;
  --neon-pink: #f43f5e;
  --neon-gold: #facc15;
  --neon-purple: #a855f7;
  --bg-dark: #060814;
  --panel-bg: rgba(15, 23, 42, 0.78);
  --border-neon: rgba(0, 243, 255, 0.35);
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #f8fafc;
  cursor: crosshair;
}

#canvas-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* 상단 뒤로가기 버튼 */
.back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--panel-bg);
  border: 1px solid var(--border-neon);
  border-radius: 8px;
  color: var(--neon-cyan);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(10px);
  transition: all 0.2s;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.15);
}

.back-btn:hover {
  background: rgba(0, 243, 255, 0.2);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
  transform: translateY(-2px);
}

/* 좌측 상단 상태 패널 */
.status-panel {
  position: absolute;
  top: 64px;
  left: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 240px;
  padding: 14px 16px;
  background: var(--panel-bg);
  border: 1px solid var(--border-neon);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bar-label-group {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.bar-track {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.15s ease-out;
}

.hp-bar {
  background: linear-gradient(90deg, #ef4444 0%, #22c55e 100%);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.shield-bar {
  background: linear-gradient(90deg, #0284c7 0%, #00f3ff 100%);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

/* 우측 상단 섹터 & 크레딧 */
.meta-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  gap: 12px;
}

.meta-chip {
  padding: 8px 16px;
  background: var(--panel-bg);
  border: 1px solid var(--border-neon);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  font-weight: 800;
  font-size: 14px;
  color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.15);
}

.meta-chip.credits {
  color: var(--neon-gold);
  border-color: rgba(250, 204, 21, 0.35);
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.15);
}

/* 좌측 하단 무기 슬롯 */
.weapon-dock {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 10;
  display: flex;
  gap: 12px;
}

.weapon-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--panel-bg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: all 0.2s;
  opacity: 0.6;
}

.weapon-slot.active {
  opacity: 1.0;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.35);
  background: rgba(0, 243, 255, 0.12);
  transform: translateY(-4px);
}

.weapon-key {
  font-size: 11px;
  font-weight: 900;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 243, 255, 0.3);
}

.weapon-icon {
  font-size: 22px;
}

.weapon-name {
  font-size: 13px;
  font-weight: 700;
}

/* 우측 하단 스킬 쿨다운 인디케이터 */
.skills-dock {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 10;
  display: flex;
  gap: 14px;
}

.skill-slot {
  position: relative;
  width: 58px;
  height: 58px;
  background: var(--panel-bg);
  border: 1px solid var(--border-neon);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(0, 243, 255, 0.2);
}

.skill-cd-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: rgba(0, 0, 0, 0.75);
  transition: height 0.05s linear;
}

.skill-icon {
  font-size: 22px;
  z-index: 2;
}

.skill-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--neon-cyan);
  z-index: 2;
  margin-top: 2px;
}

/* 중앙 상단 안내 배너 */
.alert-banner {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 10px 28px;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid var(--neon-cyan);
  border-radius: 99px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 10px var(--neon-cyan);
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.4);
  transition: opacity 0.3s, transform 0.3s;
}

.alert-banner.hidden {
  opacity: 0;
  transform: translate(-50%, -20px);
  pointer-events: none;
}

/* 포탈 근접 상호작용 프롬프트 */
.portal-prompt {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 10px 24px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--neon-gold);
  border-radius: 8px;
  color: var(--neon-gold);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.4);
  animation: promptPulse 1.5s infinite alternate;
}

.portal-prompt.hidden {
  display: none;
}

@keyframes promptPulse {
  0% { transform: translateX(-50%) scale(0.98); }
  100% { transform: translateX(-50%) scale(1.02); }
}

/* 사이버웨어 선택 모달 */
.modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(6, 8, 20, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-header h2 {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 0 16px var(--neon-cyan);
  text-align: center;
}

.modal-header p {
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
  margin-top: 6px;
}

.cards-container {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 900px;
}

.cyber-card {
  width: 240px;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  backdrop-filter: blur(8px);
  transition: all 0.25s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.cyber-card:hover {
  transform: translateY(-8px);
}

.cyber-card.rarity-common {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
}
.cyber-card.rarity-rare {
  border-color: var(--neon-purple);
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.35);
}
.cyber-card.rarity-epic {
  border-color: var(--neon-gold);
  box-shadow: 0 0 30px rgba(250, 204, 21, 0.4);
}

.card-icon {
  font-size: 42px;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.card-rarity {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #94a3b8;
}

.card-desc {
  font-size: 12px;
  line-height: 1.5;
  color: #cbd5e1;
  min-height: 54px;
}

.card-select-btn {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  background: linear-gradient(135deg, #0284c7 0%, #00f3ff 100%);
  border: none;
  border-radius: 8px;
  color: #060814;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

.card-select-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.7);
}

/* 게임오버 스크린 */
.gameover-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(15, 6, 12, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.gameover-overlay.hidden {
  display: none;
}

.gameover-overlay h1 {
  font-size: 42px;
  font-weight: 900;
  color: var(--neon-pink);
  letter-spacing: 4px;
  text-shadow: 0 0 25px rgba(244, 63, 94, 0.7);
}

.restart-btn {
  padding: 12px 32px;
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.5);
  transition: all 0.2s;
}

.restart-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 35px rgba(244, 63, 94, 0.8);
}
