/* ========================================
   MISSION STUDY - Military HUD Theme
   Gundam / Battleship / Fighter Jet Aesthetic
   ======================================== */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&display=swap');

/* --- CSS Variables --- */
:root {
  --bg-dark: #060d18;
  --bg-panel: #0b1424;
  --bg-card: #0f1d30;
  --hud-green: #00ff88;
  --hud-green-dim: #00cc6a;
  --hud-green-glow: rgba(0, 255, 136, 0.3);
  --hud-green-subtle: rgba(0, 255, 136, 0.08);
  --accent: #ff6a00;
  --accent-hover: #ff8833;
  --accent-glow: rgba(255, 106, 0, 0.4);
  --text-main: #d8e8f0;
  --text-sub: #5a7a8a;
  --gold: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.4);
  --silver: #b8c8d8;
  --bronze: #cd7f32;
  --star5: #ff2244;
  --star4: #ffd700;
  --star3: #b8c8d8;
  --star2: #cd7f32;
  --star1: #5a6a7a;
  --danger: #ff2244;
  --success: #00ff88;
  --radius: 4px;
  --radius-lg: 8px;
  --nav-height: 72px;
  --border-hud: 1px solid rgba(0, 255, 136, 0.25);
  --font-display: 'Orbitron', 'Helvetica Neue', sans-serif;
  --font-mono: 'Share Tech Mono', 'Courier New', monospace;
  --font-body: 'Helvetica Neue', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --scanline: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 136, 0.03) 2px,
    rgba(0, 255, 136, 0.03) 4px
  );
}

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

/* --- Base Body --- */
body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  font-size: 16px;
  line-height: 1.6;
}

/* Scan-line overlay on the entire app */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9999;
  background: var(--scanline);
  opacity: 0.5;
}

/* --- Ruby / Furigana --- */
ruby {
  ruby-align: center;
}

rt {
  font-size: 0.55em;
  color: var(--text-sub);
}

/* ========================================
   Screen Management
   ======================================== */

.screen {
  display: none;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 20px);
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ========================================
   Splash Screen - System Boot Sequence
   ======================================== */

#screen-splash {
  justify-content: center;
  align-items: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(0, 255, 136, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at center, #0b1424 0%, #060d18 70%);
  position: relative;
  overflow: hidden;
}

/* Grid overlay on splash */
#screen-splash::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(0, 255, 136, 0.04) 40px, rgba(0, 255, 136, 0.04) 41px),
    repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(0, 255, 136, 0.04) 40px, rgba(0, 255, 136, 0.04) 41px);
  pointer-events: none;
}

/* Radar sweep on splash */
#screen-splash::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  margin: -300px 0 0 -300px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(0, 255, 136, 0.08) 30deg,
    transparent 60deg
  );
  animation: radarSweep 4s linear infinite;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  animation: bootSequence 0.8s ease;
  position: relative;
  z-index: 1;
}

.splash-icon {
  font-size: 72px;
  color: var(--hud-green);
  margin-bottom: 20px;
  animation: pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px var(--hud-green-glow));
}

.splash-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--hud-green);
  text-shadow:
    0 0 10px var(--hud-green-glow),
    0 0 40px rgba(0, 255, 136, 0.15);
}

.splash-subtitle {
  font-size: 16px;
  color: var(--text-sub);
  margin-top: 12px;
  letter-spacing: 4px;
}

.splash-loading {
  margin-top: 48px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--hud-green-dim);
  letter-spacing: 4px;
  animation: blink 1s ease-in-out infinite;
}

.splash-start-btn {
  margin-top: 32px;
}

.splash-start-btn.hidden {
  display: none;
}

/* ========================================
   Status Bar - Command Console Header
   ======================================== */

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(0, 255, 136, 0.06), transparent);
  border-bottom: var(--border-hud);
  font-size: 18px;
  font-weight: 700;
  position: relative;
}

.status-bar::before {
  content: '[ STATUS ]';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(0, 255, 136, 0.25);
  letter-spacing: 3px;
}

.status-rank {
  color: var(--gold);
  text-shadow: 0 0 8px var(--gold-glow);
}

.status-resources {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 18px;
  text-shadow: 0 0 8px var(--accent-glow);
}

/* ========================================
   Base View (Home) - Command Center
   ======================================== */

.base-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px;
}

.base-visual {
  width: 100%;
  max-width: 360px;
  height: 200px;
  background:
    radial-gradient(ellipse at 50% 80%, rgba(0, 255, 136, 0.05) 0%, transparent 70%),
    linear-gradient(135deg, #0f1d30, #080e1a);
  border: 1px solid rgba(0, 255, 136, 0.35);
  border-radius: var(--radius);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 15px rgba(0, 255, 136, 0.08),
    inset 0 0 30px rgba(0, 255, 136, 0.03);
}

/* Tactical grid */
.base-visual::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(0, 255, 136, 0.06) 20px, rgba(0, 255, 136, 0.06) 21px),
    repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(0, 255, 136, 0.06) 20px, rgba(0, 255, 136, 0.06) 21px);
}

/* Corner brackets */
.base-visual::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 1px solid rgba(0, 255, 136, 0.15);
  border-radius: 2px;
  pointer-events: none;
}

.base-label {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--hud-green);
  z-index: 1;
  letter-spacing: 3px;
  text-shadow: 0 0 12px var(--hud-green-glow);
}

.streak-display {
  font-size: 18px;
  color: var(--text-main);
  text-align: center;
}

.streak-display span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 28px;
  text-shadow: 0 0 10px var(--accent-glow);
}

/* ========================================
   Bottom Navigation - Command Console
   ======================================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: linear-gradient(0deg, var(--bg-panel) 0%, rgba(11, 20, 36, 0.97) 100%);
  border-top: 1px solid rgba(0, 255, 136, 0.2);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 16px;
  transition: all 0.25s ease;
  min-width: 64px;
  position: relative;
}

.nav-btn .nav-icon {
  font-size: 28px;
  transition: all 0.25s ease;
}

.nav-btn .nav-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.nav-btn.active,
.nav-btn:hover {
  color: var(--hud-green);
  text-shadow: 0 0 8px var(--hud-green-glow);
}

.nav-btn.active .nav-icon {
  filter: drop-shadow(0 0 6px var(--hud-green-glow));
  transform: scale(1.1);
}

/* Active indicator line */
.nav-btn.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: var(--hud-green);
  box-shadow: 0 0 8px var(--hud-green-glow);
}

/* ========================================
   Screen Header
   ======================================== */

.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(0, 255, 136, 0.04), transparent);
  border-bottom: var(--border-hud);
}

.back-btn {
  background: none;
  border: 1px solid rgba(0, 255, 136, 0.2);
  color: var(--hud-green-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  transition: all 0.2s;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
}

.back-btn:hover {
  color: var(--hud-green);
  background: rgba(0, 255, 136, 0.08);
  border-color: rgba(0, 255, 136, 0.4);
}

.header-resources {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  text-shadow: 0 0 6px var(--accent-glow);
}

/* ========================================
   Buttons - Military Console Style
   ======================================== */

.btn {
  border: none;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  padding: 16px 36px;
  transition: all 0.2s;
  letter-spacing: 2px;
  font-family: var(--font-body);
  text-transform: uppercase;
  position: relative;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

.btn-primary {
  background: linear-gradient(135deg, #006644, #004d33);
  color: var(--hud-green);
  border: 1px solid rgba(0, 255, 136, 0.3);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.1);
  text-shadow: 0 0 6px var(--hud-green-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #008855, #006644);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

.btn-primary:disabled {
  background: #1a2233;
  color: #3a4a5a;
  border-color: #2a3a4a;
  box-shadow: none;
  text-shadow: none;
  cursor: not-allowed;
}

.btn-accent {
  background: linear-gradient(135deg, #cc5500, #993300);
  color: #ffe0c0;
  border: 1px solid rgba(255, 106, 0, 0.4);
  box-shadow: 0 0 12px rgba(255, 106, 0, 0.15);
  text-shadow: 0 0 6px var(--accent-glow);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #dd6600, #bb4400);
  box-shadow: 0 0 20px rgba(255, 106, 0, 0.25);
}

.btn-accent:active {
  transform: scale(0.97);
  box-shadow: 0 0 30px rgba(255, 106, 0, 0.35);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid rgba(0, 255, 136, 0.15);
}

.btn-secondary:hover {
  background: #162440;
  border-color: rgba(0, 255, 136, 0.3);
}

.btn-secondary:active {
  transform: scale(0.97);
}

.btn-large {
  display: block;
  width: 85%;
  max-width: 320px;
  margin: 28px auto;
  padding: 22px;
  font-size: 22px;
  border-radius: var(--radius);
}

/* ========================================
   Overlay / Popup
   ======================================== */

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(4px);
}

.overlay.hidden {
  display: none;
}

.popup {
  background: linear-gradient(180deg, #0f1d30, #0b1424);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  position: relative;
  box-shadow:
    0 0 30px rgba(0, 255, 136, 0.08),
    inset 0 1px 0 rgba(0, 255, 136, 0.15);
  animation: popupAppear 0.4s ease;
}

/* Corner decorations on popup */
.popup::before,
.popup::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--hud-green);
  border-style: solid;
}

.popup::before {
  top: 6px;
  left: 6px;
  border-width: 2px 0 0 2px;
}

.popup::after {
  bottom: 6px;
  right: 6px;
  border-width: 0 2px 2px 0;
}

.popup-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold);
  margin-bottom: 28px;
  letter-spacing: 3px;
  text-shadow: 0 0 12px var(--gold-glow);
}

.popup .btn {
  font-size: 20px;
  padding: 16px 40px;
}

/* ========================================
   Login Bonus
   ======================================== */

.bonus-days {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}

.bonus-day {
  background: rgba(15, 29, 48, 0.8);
  border-radius: var(--radius);
  padding: 12px 6px;
  font-size: 14px;
  text-align: center;
  border: 1px solid rgba(0, 255, 136, 0.1);
  transition: all 0.3s;
}

.bonus-day .day-label {
  color: var(--text-sub);
  font-size: 12px;
  font-family: var(--font-mono);
}

.bonus-day .day-reward {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  margin: 6px 0;
  text-shadow: 0 0 6px var(--accent-glow);
}

.bonus-day.claimed {
  border-color: rgba(0, 255, 136, 0.3);
  opacity: 0.5;
}

.bonus-day.claimed .day-label::after {
  content: ' \2713';
  color: var(--success);
}

.bonus-day.today {
  border-color: var(--gold);
  background: rgba(255, 215, 0, 0.08);
  animation: hudPulse 2s ease-in-out infinite;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.bonus-day.future {
  opacity: 0.3;
}

/* ========================================
   Mission Screen
   ======================================== */

.mission-phase {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px;
}

.mission-phase.hidden {
  display: none;
}

.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--hud-green);
  margin-bottom: 32px;
  text-align: center;
  letter-spacing: 3px;
  text-shadow: 0 0 12px var(--hud-green-glow);
  position: relative;
}

/* Decorative lines around section title */
.section-title::before,
.section-title::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hud-green));
}

.section-title::before {
  right: calc(100% + 12px);
}

.section-title::after {
  left: calc(100% + 12px);
  background: linear-gradient(90deg, var(--hud-green), transparent);
}

.form-group {
  width: 90%;
  max-width: 340px;
  margin-bottom: 8px;
}

.form-group label {
  display: block;
  font-size: 16px;
  color: var(--text-sub);
  margin-bottom: 12px;
  letter-spacing: 1px;
}

/* Challenge Section */
.challenge-section {
  width: 90%;
  max-width: 340px;
  margin-top: 16px;
}

.challenge-toggle {
  display: block;
  cursor: pointer;
}

.challenge-toggle input[type="checkbox"] {
  display: none;
}

.challenge-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px dashed rgba(255, 106, 0, 0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.challenge-toggle input:checked + .challenge-banner {
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.12), rgba(255, 215, 0, 0.06));
  border: 1px solid var(--accent);
  box-shadow:
    0 0 20px rgba(255, 106, 0, 0.15),
    inset 0 0 20px rgba(255, 106, 0, 0.05);
  animation: challengeActivate 0.4s ease;
}

/* Glowing sweep on checked challenge */
.challenge-toggle input:checked + .challenge-banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 106, 0, 0.1), transparent);
  animation: sweepGlow 2s ease-in-out infinite;
}

.challenge-icon {
  font-size: 24px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px var(--accent-glow));
}

.challenge-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
}

.challenge-pts {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  text-shadow: 0 0 6px var(--accent-glow);
}

.form-hint {
  font-size: 14px;
  color: var(--accent);
  text-align: center;
  margin-top: 10px;
  min-height: 20px;
}

/* Subject Checkboxes - Tactical Chips */
.subject-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.subject-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.subject-chip input[type="checkbox"] {
  display: none;
}

.subject-chip span {
  display: inline-block;
  padding: 12px 20px;
  background: var(--bg-card);
  color: var(--text-sub);
  border: 1px solid rgba(0, 255, 136, 0.12);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  transition: all 0.25s ease;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.subject-chip input[type="checkbox"]:checked + span {
  background: linear-gradient(135deg, #005533, #003d24);
  color: var(--hud-green);
  border-color: var(--hud-green);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.15);
  text-shadow: 0 0 6px var(--hud-green-glow);
}

.mission-status {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--hud-green);
  letter-spacing: 3px;
  margin-bottom: 24px;
  text-shadow: 0 0 10px var(--hud-green-glow);
  animation: blink 2s ease-in-out infinite;
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 72px;
  font-weight: 700;
  color: var(--hud-green);
  text-shadow:
    0 0 20px var(--hud-green-glow),
    0 0 60px rgba(0, 255, 136, 0.1);
  margin-bottom: 16px;
  letter-spacing: 4px;
}

.timer-hint {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-sub);
}

/* ========================================
   Result
   ======================================== */

.result-message {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  margin-bottom: 20px;
  text-shadow: 0 0 12px var(--gold-glow);
  animation: resultReveal 0.6s ease;
}

.result-streak {
  font-size: 16px;
  color: var(--hud-green-dim);
  text-align: center;
  margin-bottom: 20px;
  min-height: 24px;
}

.result-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 255, 136, 0.15);
  padding: 28px;
  width: 85%;
  max-width: 320px;
  margin-bottom: 28px;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 255, 136, 0.03);
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 16px;
}

.result-row span:last-child {
  font-family: var(--font-mono);
}

.result-row.bonus {
  color: var(--hud-green-dim);
}

.result-row.bonus-detail {
  justify-content: flex-end;
  padding: 0 0 4px;
  font-size: 13px;
  color: var(--text-sub);
}

.result-row.total {
  border-top: 1px solid rgba(0, 255, 136, 0.2);
  margin-top: 8px;
  padding-top: 16px;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 85%;
  max-width: 320px;
}

.result-actions .btn {
  width: 100%;
  padding: 18px;
  font-size: 18px;
}

/* ========================================
   Gacha Screen - Development Lab
   ======================================== */

.gacha-result-area {
  width: 90%;
  max-width: 380px;
  min-height: 200px;
  margin: 20px auto;
  background:
    radial-gradient(ellipse at center, rgba(0, 255, 136, 0.03), transparent),
    var(--bg-card);
  border-radius: var(--radius);
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(0, 255, 136, 0.2);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 20px rgba(0, 255, 136, 0.05),
    inset 0 0 40px rgba(0, 0, 0, 0.3);
}

/* Dramatic corner brackets */
.gacha-result-area::before,
.gacha-result-area::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: rgba(0, 255, 136, 0.3);
  border-style: solid;
  z-index: 1;
}

.gacha-result-area::before {
  top: 8px;
  left: 8px;
  border-width: 2px 0 0 2px;
}

.gacha-result-area::after {
  bottom: 8px;
  right: 8px;
  border-width: 0 2px 2px 0;
}

.gacha-placeholder {
  color: var(--text-sub);
  font-size: 16px;
  letter-spacing: 3px;
  font-family: var(--font-mono);
}

.gacha-result-display {
  text-align: center;
  padding: 20px;
  width: 100%;
  animation: gachaReveal 0.8s ease;
}

.gacha-weapon-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 0 8px currentColor;
}

.gacha-weapon-type {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.gacha-weapon-stars {
  font-size: 28px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 4px currentColor);
}

.gacha-weapon-icon {
  font-size: 56px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.2));
  animation: iconFloat 3s ease-in-out infinite;
}

.gacha-new-badge {
  display: inline-block;
  background: var(--danger);
  color: white;
  padding: 4px 14px;
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(255, 34, 68, 0.5);
  box-shadow: 0 0 10px rgba(255, 34, 68, 0.3);
  animation: newBadgePulse 1.5s ease-in-out infinite;
}

.gacha-multi-results {
  display: flex;
  gap: 14px;
  justify-content: center;
  padding: 20px;
  width: 100%;
}

.gacha-multi-item {
  text-align: center;
  flex: 1;
  animation: gachaReveal 0.8s ease backwards;
}

.gacha-multi-item:nth-child(2) { animation-delay: 0.15s; }
.gacha-multi-item:nth-child(3) { animation-delay: 0.3s; }

.gacha-multi-item .gacha-weapon-icon {
  font-size: 40px;
}

.gacha-multi-item .gacha-weapon-name {
  font-size: 13px;
}

.gacha-multi-item .gacha-weapon-stars {
  font-size: 18px;
}

.gacha-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 20px 0;
  padding: 0 16px;
}

.gacha-buttons .btn {
  padding: 18px 28px;
  font-size: 16px;
  line-height: 1.5;
  flex: 1;
  max-width: 170px;
}

.gacha-buttons .btn small {
  font-family: var(--font-mono);
  opacity: 0.8;
}

.gacha-history {
  padding: 20px;
}

.gacha-history h3 {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.gacha-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 16px;
  border-left: 2px solid rgba(0, 255, 136, 0.2);
  transition: all 0.2s;
}

.gacha-history-item:hover {
  border-left-color: var(--hud-green);
  background: rgba(0, 255, 136, 0.04);
}

/* ========================================
   History Screen
   ======================================== */

.history-profile {
  padding: 28px 20px;
  text-align: center;
}

.history-profile h2 {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--gold);
  letter-spacing: 3px;
  text-shadow: 0 0 10px var(--gold-glow);
}

.profile-stats {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

.stat-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 12px;
  flex: 1;
  border: 1px solid rgba(0, 255, 136, 0.1);
  position: relative;
  overflow: hidden;
}

/* Subtle scan-line on stat panels */
.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--scanline);
  pointer-events: none;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--hud-green);
  text-shadow: 0 0 6px var(--hud-green-glow);
}

/* Calendar */
.history-calendar {
  padding: 20px;
}

.history-calendar h3 {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 14px;
  letter-spacing: 2px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.cal-nav {
  background: none;
  border: 1px solid rgba(0, 255, 136, 0.15);
  color: var(--hud-green-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.cal-nav:hover {
  color: var(--hud-green);
  border-color: rgba(0, 255, 136, 0.4);
  background: rgba(0, 255, 136, 0.05);
}

#cal-month {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-day-header {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-sub);
  padding: 6px;
}

.cal-day {
  text-align: center;
  padding: 10px 4px;
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font-mono);
  color: var(--text-sub);
  transition: all 0.2s;
}

.cal-day.has-mission {
  background: rgba(0, 255, 136, 0.15);
  color: var(--hud-green);
  font-weight: 600;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.15);
  border: 1px solid rgba(0, 255, 136, 0.3);
  text-shadow: 0 0 6px var(--hud-green-glow);
}

.cal-day.has-challenge {
  background: rgba(255, 106, 0, 0.2);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 106, 0, 0.2);
  border: 1px solid rgba(255, 106, 0, 0.4);
  text-shadow: 0 0 6px var(--accent-glow);
}

.cal-day.today {
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.cal-day.empty {
  visibility: hidden;
}

/* Collection - Hangar */
.history-collection {
  padding: 20px;
}

.history-collection h3 {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 14px;
  letter-spacing: 2px;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.collection-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  border: 1px solid rgba(0, 255, 136, 0.1);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

/* Rarity glow effects */
.collection-item.rarity-5 {
  border-color: var(--star5);
  box-shadow:
    0 0 15px rgba(255, 34, 68, 0.25),
    inset 0 0 20px rgba(255, 34, 68, 0.05);
  animation: legendaryGlow 3s ease-in-out infinite;
}

.collection-item.rarity-4 {
  border-color: var(--star4);
  box-shadow:
    0 0 12px rgba(255, 215, 0, 0.2),
    inset 0 0 15px rgba(255, 215, 0, 0.03);
}

.collection-item.rarity-3 {
  border-color: var(--star3);
  box-shadow: 0 0 8px rgba(184, 200, 216, 0.1);
}

/* Shimmer on rarity-5 items */
.collection-item.rarity-5::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 34, 68, 0.06) 50%,
    transparent 60%
  );
  animation: shimmer 4s linear infinite;
}

.collection-item .weapon-icon {
  font-size: 36px;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.collection-item .weapon-name {
  font-size: 12px;
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.collection-item .weapon-stars {
  font-size: 13px;
  position: relative;
  z-index: 1;
}

/* ========================================
   Coming Soon
   ======================================== */

.coming-soon {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px;
  text-align: center;
}

.coming-soon h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin-bottom: 20px;
  color: var(--text-sub);
  letter-spacing: 4px;
}

.coming-soon p {
  color: var(--text-sub);
  font-size: 18px;
}

.coming-soon-sub {
  margin-top: 12px;
  color: var(--hud-green-dim) !important;
  letter-spacing: 2px;
  text-shadow: 0 0 8px var(--hud-green-glow);
}

/* ========================================
   Star Colors
   ======================================== */

.stars-5 { color: var(--star5); text-shadow: 0 0 8px rgba(255, 34, 68, 0.5); }
.stars-4 { color: var(--star4); text-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
.stars-3 { color: var(--star3); text-shadow: 0 0 6px rgba(184, 200, 216, 0.3); }
.stars-2 { color: var(--star2); }
.stars-1 { color: var(--star1); }

/* ========================================
   Utility
   ======================================== */

.hidden {
  display: none !important;
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes hudPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
  }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.slide-up {
  animation: slideUp 0.4s ease;
}

@keyframes bootSequence {
  0% {
    opacity: 0;
    transform: scale(0.95);
    filter: brightness(2);
  }
  30% {
    opacity: 1;
    filter: brightness(1.5);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes radarSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes sweepGlow {
  0% { left: -100%; }
  100% { left: 200%; }
}

@keyframes challengeActivate {
  0% { transform: scale(1); }
  30% { transform: scale(1.03); }
  60% { transform: scale(0.99); }
  100% { transform: scale(1); }
}

@keyframes gachaReveal {
  0% {
    opacity: 0;
    transform: scale(0.5);
    filter: brightness(3);
  }
  40% {
    opacity: 1;
    filter: brightness(1.8);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes resultReveal {
  0% {
    opacity: 0;
    transform: translateY(-10px);
    text-shadow: 0 0 40px var(--gold-glow);
  }
  50% {
    text-shadow: 0 0 30px var(--gold-glow);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    text-shadow: 0 0 12px var(--gold-glow);
  }
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes legendaryGlow {
  0%, 100% {
    box-shadow:
      0 0 10px rgba(255, 34, 68, 0.2),
      inset 0 0 15px rgba(255, 34, 68, 0.03);
  }
  50% {
    box-shadow:
      0 0 25px rgba(255, 34, 68, 0.35),
      inset 0 0 25px rgba(255, 34, 68, 0.06);
  }
}

@keyframes shimmer {
  0% { transform: translate(-30%, -30%) rotate(0deg); }
  100% { transform: translate(30%, 30%) rotate(360deg); }
}

@keyframes newBadgePulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 34, 68, 0.3); }
  50% { box-shadow: 0 0 20px rgba(255, 34, 68, 0.5); }
}

@keyframes popupAppear {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ========================================
   Responsive
   ======================================== */

@media (min-width: 480px) {
  .screen {
    max-width: 480px;
    margin: 0 auto;
  }

  .bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
}
