/* ==========================================================================
   BIT ZORD 16-BIT RETRO STYLESHEET
   ========================================================================== */

/* Global Reset & Colors */
:root {
  --bg-color-main: #0c0817;
  --bg-color-panel: #17112a;
  --bg-color-terminal: #07040d;
  
  --color-neon-purple: #9d4edd;
  --color-neon-purple-bright: #c77dff;
  --color-neon-cyan: #00f0ff;
  --color-neon-cyan-dark: #00b4d8;
  --color-neon-yellow: #ffe600;
  --color-neon-green: #39ff14;
  --color-neon-red: #ff2e2e;
  
  --color-text-light: #e2eafc;
  --color-text-muted: #8a81ad;
  --color-border-dark: #000000;
  --color-border-light: #48397a;
  
  /* Pixel borders */
  --pixel-shadow-in: inset -4px -4px 0px 0px rgba(0,0,0,0.5), inset 4px 4px 0px 0px rgba(255,255,255,0.1);
  --pixel-border: 4px solid var(--color-border-dark);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  image-rendering: pixelated; /* Crucial for retro styling */
}

/* Base Body Styling */
body {
  background-color: var(--bg-color-main);
  color: var(--color-text-light);
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: 80px; /* Space for sticky footer */
  background-image: 
    linear-gradient(rgba(18, 12, 38, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 12, 38, 0.4) 1px, transparent 1px);
  background-size: 32px 32px;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%2300f0ff" stroke="%23000" stroke-width="2" d="M2,2 L2,18 L7,14 L12,22 L15,20 L10,13 L17,13 Z"/></svg>'), auto;
}

h1, h2, h3, h4, h5, h6, .btn-retro, .nav-btn, .menu-option-btn, .plan-price, .plan-badge, .badge, .terminal-title, .modal-title {
  font-family: 'Press Start 2P', cursive;
  text-transform: uppercase;
}

a, button, select, input, textarea {
  font-family: inherit;
  outline: none;
}

/* ==========================================================================
   CRT / SCANLINE EFFECTS
   ========================================================================== */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 4px, 6px 100%;
  z-index: 9999;
  pointer-events: none;
  display: none; /* Controlled by body class */
}

body.scanlines-enabled .crt-overlay {
  display: block;
}

.screen-flicker {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 16, 16, 0.03);
  opacity: 0;
  z-index: 9998;
  pointer-events: none;
  display: none;
}

body.scanlines-enabled .screen-flicker {
  display: block;
  animation: crt-flicker 0.15s infinite;
}

@keyframes crt-flicker {
  0% { opacity: 0.15; }
  50% { opacity: 0.25; }
  100% { opacity: 0.15; }
}

/* ==========================================================================
   RETRO PANEL UTILITIES
   ========================================================================== */
.pixel-panel {
  background-color: var(--bg-color-panel);
  border: var(--pixel-border);
  box-shadow: 
    0 4px 0 -2px var(--color-border-dark), 
    0 -4px 0 -2px var(--color-border-dark), 
    4px 0 0 -2px var(--color-border-dark), 
    -4px 0 0 -2px var(--color-border-dark),
    0 8px 0 -4px var(--color-border-light),
    0 -8px 0 -4px var(--color-border-light),
    8px 0 0 -4px var(--color-border-light),
    -8px 0 0 -4px var(--color-border-light);
  padding: 20px;
  position: relative;
}

/* Retro Buttons */
.btn-retro, .select-plan-btn, .compose-btn, .modal-btn-submit, .modal-btn-cancel, .send-mail-btn, .cancel-compose-btn {
  font-family: 'Press Start 2P', cursive;
  background-color: var(--bg-color-panel);
  color: var(--color-text-light);
  border: 4px solid #000;
  padding: 12px 18px;
  font-size: 11px;
  cursor: pointer;
  position: relative;
  box-shadow: 
    inset -4px -4px 0px 0px rgba(0,0,0,0.4),
    4px 4px 0px 0px rgba(0,0,0,0.5);
  transition: all 0.05s ease;
  user-select: none;
}

.btn-retro:hover, .select-plan-btn:hover, .compose-btn:hover, .modal-btn-submit:hover, .send-mail-btn:hover {
  background-color: var(--color-neon-purple);
  color: #fff;
  text-shadow: 1px 1px 0px #000;
}

.btn-retro:active, .select-plan-btn:active, .compose-btn:active, .modal-btn-submit:active, .send-mail-btn:active {
  box-shadow: 
    inset 4px 4px 0px 0px rgba(0,0,0,0.4),
    1px 1px 0px 0px rgba(0,0,0,0.5);
  transform: translate(3px, 3px);
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.retro-header {
  background-color: var(--bg-color-panel);
  border-bottom: 6px solid #000;
  padding: 15px 30px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  animation: logo-wiggle 4s infinite steps(2);
}

@keyframes logo-wiggle {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(10deg) scale(1.05); }
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.main-title {
  font-size: 20px;
  color: var(--color-neon-purple-bright);
  text-shadow: 3px 3px 0px #000, 0 0 8px rgba(157, 78, 221, 0.4);
  letter-spacing: 1px;
}

.sub-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: var(--color-neon-cyan);
  letter-spacing: 2px;
  font-weight: bold;
}

.retro-nav .nav-list {
  display: flex;
  list-style: none;
  gap: 10px;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 10px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.1s ease;
}

.nav-btn .btn-bullet {
  opacity: 0;
  color: var(--color-neon-cyan);
}

.nav-btn:hover, .nav-btn.active-btn {
  color: var(--color-neon-cyan);
  text-shadow: 0 0 4px rgba(0, 240, 255, 0.5);
}

.nav-btn:hover .btn-bullet, .nav-btn.active-btn .btn-bullet {
  opacity: 1;
  animation: bullet-blink 0.8s infinite steps(2);
}

.nav-btn.highlight {
  color: var(--color-neon-yellow);
}

.nav-btn.highlight:hover {
  color: #fff;
  background-color: rgba(255, 230, 0, 0.15);
  box-shadow: inset 0 0 0 2px var(--color-neon-yellow);
}

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

/* System Audio & CRT controls */
.system-controls {
  display: flex;
  gap: 10px;
}

.control-btn {
  background-color: rgba(0, 0, 0, 0.5);
  border: 2px solid #000;
  color: var(--color-text-light);
  padding: 6px 10px;
  font-size: 11px;
  font-family: 'Share Tech Mono', monospace;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: inset -2px -2px 0px rgba(0, 0, 0, 0.4);
}

.control-btn:hover {
  background-color: var(--bg-color-panel);
  border-color: var(--color-neon-cyan);
  color: var(--color-neon-cyan);
}

.control-btn.sound-off {
  color: var(--color-neon-red);
}

.control-btn.sound-on {
  color: var(--color-neon-green);
}

/* ==========================================================================
   GAME MAIN CONTAINER & SECTIONS (STAGES)
   ========================================================================== */
.game-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
  min-height: calc(100vh - 250px);
  position: relative;
}

.stage-section {
  display: none;
  animation: stage-entry 0.3s ease-out;
}

.stage-section.active-stage {
  display: block;
}

@keyframes stage-entry {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-size: 18px;
  color: var(--color-neon-cyan);
  margin-bottom: 10px;
  text-shadow: 2px 2px 0px #000;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 4px double var(--color-border-light);
  padding-bottom: 10px;
}

.section-intro {
  color: var(--color-text-muted);
  font-size: 15px;
  margin-bottom: 25px;
}

/* ==========================================================================
   STAGE 1: START SCREEN (HERO)
   ========================================================================== */
.hero-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 40px;
  align-items: center;
  padding-top: 20px;
}

@media (max-width: 768px) {
  .hero-wrapper {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.floating-logo {
  max-width: 80%;
  height: auto;
  animation: float-logo 5s infinite ease-in-out;
  filter: drop-shadow(0 0 15px rgba(157, 78, 221, 0.4));
}

@keyframes float-logo {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-15px) scale(1.02); }
}

/* Speech bubble design */
.speech-bubble-container {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  align-items: flex-start;
}

.mascot-thumbnail {
  background-color: #000;
  border: 4px solid var(--color-neon-cyan);
  padding: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.mascot-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
}

.speech-bubble {
  background-color: var(--bg-color-panel);
  border: 4px solid #000;
  padding: 15px;
  position: relative;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
  flex-grow: 1;
}

.bubble-arrow {
  position: absolute;
  left: -12px;
  top: 20px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #000;
}

.speech-bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 20px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid var(--bg-color-panel);
  z-index: 2;
}

.mascot-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 15px;
  color: var(--color-neon-green);
  text-transform: uppercase;
  font-weight: bold;
}

/* RPG Main Option Box */
.menu-box {
  background-color: var(--bg-color-panel);
  border: 6px double var(--color-neon-purple-bright);
  padding: 25px;
  box-shadow: 0 0 0 4px #000, 6px 6px 15px rgba(0,0,0,0.6);
}

.menu-header {
  font-size: 12px;
  color: var(--color-neon-yellow);
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.menu-options {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.menu-option-btn {
  background: none;
  border: none;
  color: var(--color-text-light);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 8px;
  transition: all 0.1s ease;
}

.menu-option-btn .selector-arrow {
  opacity: 0;
  color: var(--color-neon-cyan);
  margin-right: 10px;
}

.menu-option-btn:hover {
  color: var(--color-neon-cyan);
  background-color: rgba(255, 255, 255, 0.03);
}

.menu-option-btn:hover .selector-arrow {
  opacity: 1;
  animation: arrow-blink 0.5s infinite steps(2);
}

.option-desc {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-left: 8px;
}

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

/* ==========================================================================
   STAGE 2: CLASSES / PRICING
   ========================================================================== */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-top: 30px;
}

@media (max-width: 992px) {
  .plans-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }
}

.plan-card {
  background-color: var(--bg-color-panel);
  border: 4px solid #000;
  box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.4);
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: transform 0.15s ease-out;
}

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

.plan-badge {
  background-color: #000;
  border: 2px solid var(--color-text-muted);
  font-size: 9px;
  padding: 4px 8px;
  margin-bottom: 15px;
}

.plan-name {
  font-size: 14px;
  color: #fff;
  margin-bottom: 20px;
  text-align: center;
}

.plan-icon {
  font-size: 40px;
  margin-bottom: 20px;
  color: var(--color-text-muted);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan-price {
  font-size: 24px;
  color: var(--color-neon-yellow);
  margin-bottom: 25px;
  text-shadow: 2px 2px 0px #000;
}

.price-period {
  font-size: 10px;
  font-family: 'Share Tech Mono', monospace;
  color: var(--color-text-muted);
}

.plan-features {
  list-style: none;
  width: 100%;
  margin-bottom: 30px;
  border-top: 2px dashed rgba(255,255,255,0.08);
  padding-top: 20px;
}

.plan-features li {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--color-text-light);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.feature-marker {
  color: var(--color-neon-green);
  font-weight: bold;
}

.select-plan-btn {
  width: 100%;
  margin-top: auto;
  text-align: center;
}

/* Individual plan styling themes */
.squire-card {
  border-color: #7f8c8d;
}
.squire-card .plan-badge { border-color: #7f8c8d; color: #bdc3c7; }
.squire-card .plan-icon { color: #bdc3c7; }

.knight-card {
  border-color: var(--color-neon-cyan);
  box-shadow: 6px 6px 0px rgba(0, 240, 255, 0.2), 0 0 10px rgba(0, 240, 255, 0.1);
}
.knight-card .plan-badge { border-color: var(--color-neon-cyan); color: var(--color-neon-cyan); }
.knight-card .plan-icon { color: var(--color-neon-cyan); }

.paladin-card {
  border-color: var(--color-neon-yellow);
}
.paladin-card .plan-badge { border-color: var(--color-neon-yellow); color: var(--color-neon-yellow); }
.paladin-card .plan-icon { color: var(--color-neon-yellow); }

/* Recommended Knight plan banner */
.featured-ribbon {
  position: absolute;
  top: -15px;
  background-color: var(--color-neon-purple);
  color: #fff;
  border: 2px solid #000;
  font-family: 'Press Start 2P', cursive;
  font-size: 7px;
  padding: 4px 10px;
  letter-spacing: 1px;
  box-shadow: 2px 2px 0px #000;
}

/* ==========================================================================
   STAGE 3: STATS / CHARACTER SHEET
   ========================================================================== */
.stats-container {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  gap: 30px;
  margin-top: 30px;
}

@media (max-width: 768px) {
  .stats-container {
    grid-template-columns: 1fr;
  }
}

.character-sheet-card, .system-status-card {
  background-color: var(--bg-color-panel);
  border: 4px solid #000;
  box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.4);
  padding: 25px;
}

/* RPG stats cards styling */
.character-header {
  display: flex;
  gap: 20px;
  border-bottom: 4px double var(--color-border-light);
  padding-bottom: 20px;
  margin-bottom: 20px;
  align-items: center;
}

.character-avatar-container {
  background-color: #000;
  border: 3px solid var(--color-neon-purple-bright);
  padding: 4px;
}

.character-avatar {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
}

.character-info .character-name {
  font-size: 12px;
  color: #fff;
  margin-bottom: 8px;
}

.character-info .character-class {
  font-size: 13px;
  color: var(--color-neon-yellow);
}

.character-info .character-level {
  font-size: 13px;
  color: var(--color-neon-cyan);
}

.character-stats-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-family: 'Press Start 2P', cursive;
  font-size: 9px;
  color: var(--color-text-light);
}

.stat-progress-bar {
  height: 12px;
  background-color: #000;
  border: 2px solid #555;
  padding: 1px;
}

.progress-fill {
  height: 100%;
}

.hp-fill { background-color: var(--color-neon-red); }
.mp-fill { background-color: var(--color-neon-cyan-dark); }
.security-fill { background-color: var(--color-neon-green); }

/* Right Status Column Card */
.status-header {
  font-size: 11px;
  color: var(--color-neon-yellow);
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.status-bars {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 25px;
}

.bar-item .bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--color-text-muted);
}

.bar-percent {
  font-family: 'Press Start 2P', cursive;
  font-size: 9px;
  color: var(--color-neon-cyan);
}

.pixel-bar {
  height: 20px;
  background-color: #000;
  border: 3px solid #000;
  position: relative;
  box-shadow: inset -2px -2px 0px rgba(255,255,255,0.05);
}

.pixel-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-neon-purple), var(--color-neon-cyan));
  width: 0%;
  transition: width 1.5s ease-out;
}

.retro-textbox {
  background-color: var(--bg-color-terminal);
  border: 3px solid var(--color-border-light);
  padding: 15px;
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: var(--color-neon-green);
  border-radius: 2px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.system-bullet {
  color: var(--color-neon-cyan);
  margin-right: 5px;
  animation: cursor-blink-slow 1s infinite steps(2);
}

@keyframes cursor-blink-slow {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* ==========================================================================
   STAGE 4: WEBMAIL TERMINAL
   ========================================================================== */
.webmail-terminal {
  border: 4px solid #000;
  box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.5);
  background-color: var(--bg-color-panel);
  display: flex;
  flex-direction: column;
  margin-top: 20px;
}

/* Window Header Bar */
.terminal-bar {
  background-color: var(--bg-color-terminal);
  border-bottom: 4px solid #000;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-text-muted);
  user-select: none;
}

.window-buttons {
  display: flex;
  gap: 6px;
}

.win-btn {
  width: 12px;
  height: 12px;
  border: 2px solid #000;
  border-radius: 50%;
}

.win-btn.red { background-color: var(--color-neon-red); }
.win-btn.yellow { background-color: var(--color-neon-yellow); }
.win-btn.green { background-color: var(--color-neon-green); }

.terminal-title {
  font-size: 9px;
  color: var(--color-text-light);
}

.user-display {
  font-size: 13px;
  color: var(--color-neon-cyan);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Terminal Body layout */
.terminal-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 400px;
}

@media (max-width: 768px) {
  .terminal-body {
    grid-template-columns: 1fr;
  }
}

/* Sidebar */
.mail-sidebar {
  border-right: 4px solid #000;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.compose-btn {
  width: 100%;
  background-color: var(--color-neon-purple);
  text-align: center;
}

.folder-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.folder-btn {
  background: none;
  border: none;
  color: var(--color-text-light);
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  border: 2px solid transparent;
  transition: all 0.05s ease;
}

.folder-btn i {
  margin-right: 8px;
  color: var(--color-neon-cyan);
}

.folder-btn:hover {
  background-color: rgba(255,255,255,0.05);
  border-color: rgba(0, 240, 255, 0.3);
}

.folder-btn.active-folder {
  background-color: var(--bg-color-terminal);
  border-color: var(--color-neon-cyan);
  color: var(--color-neon-cyan);
  box-shadow: inset -2px -2px 0px rgba(0, 240, 255, 0.1);
}

.folder-btn.active-folder i {
  color: var(--color-neon-yellow);
}

.folder-btn .badge {
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  background-color: var(--color-neon-red);
  color: #fff;
  padding: 2px 6px;
  border: 1px solid #000;
}

/* Disk Space display */
.disk-space {
  margin-top: auto;
  border-top: 2px dashed rgba(255,255,255,0.05);
  padding-top: 15px;
}

.disk-txt {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.disk-bar {
  height: 8px;
  background-color: #000;
  border: 1px solid #555;
}

.disk-bar-fill {
  height: 100%;
  background-color: var(--color-neon-green);
}

/* Mail Content Panel */
.mail-content-panel {
  background-color: var(--bg-color-terminal);
  display: flex;
  flex-direction: column;
}

/* Inbox Mail Grid / List */
.mail-list-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.list-header {
  display: grid;
  grid-template-columns: 180px 1fr 120px;
  padding: 12px 20px;
  border-bottom: 2px solid #000;
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--color-text-muted);
  font-weight: bold;
  font-size: 13px;
  user-select: none;
}

@media (max-width: 576px) {
  .list-header {
    grid-template-columns: 100px 1fr;
  }
  .col-date { display: none; }
}

.list-body {
  overflow-y: auto;
  max-height: 380px;
}

/* Individual list item */
.mail-item {
  display: grid;
  grid-template-columns: 180px 1fr 120px;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-family: 'Share Tech Mono', monospace;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.05s ease;
}

@media (max-width: 576px) {
  .mail-item {
    grid-template-columns: 100px 1fr;
  }
  .mail-date { display: none; }
}

.mail-item:hover {
  background-color: rgba(157, 78, 221, 0.08);
  color: var(--color-neon-cyan);
}

.mail-item.unread {
  font-weight: bold;
  color: #fff;
  border-left: 4px solid var(--color-neon-purple-bright);
  background-color: rgba(255,255,255,0.01);
}

.mail-sender {
  color: var(--color-neon-purple-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-item.unread .mail-sender {
  color: var(--color-neon-cyan);
}

.mail-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-date {
  color: var(--color-text-muted);
}

/* Empty Mail List message */
.empty-mailbox {
  padding: 50px 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 18px;
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* Read Mail View */
.mail-read-view {
  padding: 25px;
  animation: scan-flicker-intro 0.2s ease-out;
}

.read-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px dashed rgba(255,255,255,0.08);
  padding-bottom: 15px;
}

.back-btn, .delete-btn {
  background-color: rgba(255,255,255,0.03);
  border: 2px solid #000;
  color: var(--color-text-light);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: inset -2px -2px 0px rgba(0, 0, 0, 0.4);
}

.back-btn:hover {
  background-color: var(--bg-color-panel);
  color: var(--color-neon-cyan);
}

.delete-btn:hover {
  background-color: var(--color-neon-red);
  color: #fff;
}

.email-details-header {
  background-color: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--color-border-light);
  padding: 15px;
  margin-bottom: 20px;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-row strong {
  color: var(--color-neon-purple-bright);
}

.email-details-body {
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: var(--color-neon-green);
  min-height: 150px;
  white-space: pre-wrap;
  line-height: 1.4;
  border: 2px solid rgba(255,255,255,0.03);
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.2);
}

/* Compose Mail Form */
.mail-compose-view {
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.compose-header-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compose-field {
  display: flex;
  align-items: center;
  background-color: #000;
  border: 2px solid var(--color-border-light);
  padding: 10px 15px;
}

.compose-field label {
  font-family: 'Press Start 2P', cursive;
  font-size: 9px;
  color: var(--color-neon-cyan);
  width: 100px;
  flex-shrink: 0;
}

.compose-field input {
  background: none;
  border: none;
  color: #fff;
  width: 100%;
  font-size: 15px;
}

.compose-body-field textarea {
  width: 100%;
  height: 200px;
  background-color: #000;
  border: 2px solid var(--color-border-light);
  color: var(--color-neon-green);
  padding: 15px;
  font-family: 'VT323', monospace;
  font-size: 20px;
  resize: none;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.cancel-compose-btn {
  background-color: rgba(255, 255, 255, 0.05);
}
.cancel-compose-btn:hover { background-color: var(--color-neon-red); }

.send-mail-btn {
  background-color: var(--color-neon-green);
  color: #000;
}
.send-mail-btn:hover {
  background-color: #fff;
}

/* ==========================================================================
   MODAL / SIGN UP DIALOG WINDOW
   ========================================================================== */
.retro-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.retro-modal {
  width: 100%;
  max-width: 500px;
  background-color: var(--bg-color-panel);
  border: 4px solid #000;
  box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.modal-bar {
  background-color: var(--color-neon-purple);
  border-bottom: 4px solid #000;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  text-shadow: 1px 1px 0px #000;
}

.modal-title {
  font-size: 8px;
}

.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--color-neon-yellow);
}

.modal-body {
  padding: 25px;
}

.modal-headline {
  font-size: 10px;
  color: var(--color-neon-yellow);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-marker {
  color: var(--color-neon-cyan);
}

.modal-subtxt {
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 25px;
  border-bottom: 2px dashed rgba(255,255,255,0.05);
  padding-bottom: 12px;
}

/* Forms input controls styling */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  color: var(--color-text-muted);
}

.input-wrapper {
  display: flex;
  align-items: center;
  background-color: #000;
  border: 3px solid #000;
  box-shadow: inset -2px -2px 0px rgba(255,255,255,0.05);
  padding: 10px 12px;
}

.input-wrapper input {
  background: none;
  border: none;
  color: #fff;
  width: 100%;
  font-size: 15px;
}

.email-suffix {
  color: var(--color-neon-cyan);
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  margin-left: 8px;
  user-select: none;
}

.form-group input[type="password"] {
  background-color: #000;
  border: 3px solid #000;
  box-shadow: inset -2px -2px 0px rgba(255,255,255,0.05);
  padding: 10px 12px;
  color: #fff;
  font-size: 15px;
}

.retro-select {
  background-color: #000;
  border: 3px solid #000;
  color: #fff;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 0;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23ffe600" stroke-width="3" stroke-linecap="square"><path d="M6 9l6 6 6-6"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 10px;
}

.modal-btn-cancel {
  background-color: rgba(0, 0, 0, 0.4);
}
.modal-btn-cancel:hover { background-color: var(--color-neon-red); }

.modal-btn-submit {
  background-color: var(--color-neon-cyan-dark);
  color: #fff;
}

/* Alert Modal customizations */
.alert-modal {
  max-width: 380px;
}

.alert-modal .modal-bar {
  background-color: var(--color-neon-red);
}

.alert-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.alert-icon-container {
  font-size: 40px;
  color: var(--color-neon-yellow);
  margin-bottom: 15px;
  animation: alert-flash 1s infinite steps(2);
}

@keyframes alert-flash {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.alert-message-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 18px;
  margin-bottom: 20px;
  color: #fff;
}

.alert-actions {
  justify-content: center;
  width: 100%;
}

/* ==========================================================================
   FOOTER SECTION
   ========================================================================== */
.retro-footer {
  background-color: var(--bg-color-panel);
  border-top: 6px solid #000;
  padding: 15px 30px;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 90;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  color: var(--color-text-muted);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.blink-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--color-neon-green);
  border-radius: 50%;
  margin-right: 6px;
  animation: blink-dot-anim 1s infinite steps(2);
}

@keyframes blink-dot-anim {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
