/* MOBILE-FIRST BASE STYLES */

/* MOBILE BODY STYLING */
body {
  background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
  margin: 0;
  font-family: 'Exo 2', 'Segoe UI', 'Arial', sans-serif;
  color: var(--secondary);
  min-height: 100vh;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8), 0 0 8px rgba(0, 226, 255, 0.4);
  overflow-x: auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  letter-spacing: 0.02em;
  position: relative;
  padding: 12px 12px 100px 12px; /* Reduced from 180px */
  box-sizing: border-box;
  
  /* MOBILE TOUCH OPTIMIZATIONS */
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  
  /* MOBILE FONT SIZING */
  font-size: 16px;
  line-height: 1.5;
}

/* MOBILE MAIN HEADING */
h1 {
  color: var(--primary);
  margin: 20px 0 15px 0;
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
  font-size: 2.2em;
  font-weight: 700;
  text-shadow: 
    0 0 25px #00e2ff, 
    0 0 60px rgba(0, 226, 255, 0.5);
  letter-spacing: 0.1em;
  filter: drop-shadow(0 0 15px var(--header-glow));
  border-bottom: 3px solid rgba(0, 226, 255, 0.7);
  padding-bottom: 10px;
  margin-bottom: 15px;
  border-radius: 15px;
  background: linear-gradient(90deg, #131a32 0%, #1c2d4d 100%);
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-sizing: border-box;
  padding: 15px 20px 10px 20px;
}

/* MOBILE UTILITY CLASSES */
.hidden {
  display: none !important;
}

/* MOBILE TOUCH TARGETS - GLOBAL */
button, 
.clickable,
.menu-btn,
.back-btn,
.upgrade-btn,
.character-action-btn,
.deployable-character,
.cell,
input,
select,
textarea {
  /* MOBILE TOUCH OPTIMIZATION */
  min-height: 48px;
  min-width: 48px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  
  /* MOBILE FONT SIZE */
  font-size: 16px; /* Prevent zoom on iOS */
}

/* MOBILE INPUT STYLING */
input, textarea, select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 12px;
  border: 2px solid rgba(0, 226, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 15px 20px;
  font-family: 'Exo 2', sans-serif;
  font-size: 16px;
  box-sizing: border-box;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(0, 226, 255, 0.5);
}

/* MOBILE SCROLL IMPROVEMENTS */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 226, 255, 0.5) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 226, 255, 0.4), rgba(0, 100, 255, 0.6));
  border-radius: 12px;
  border: 2px solid transparent;
  background-clip: content-box;
}

/* MOBILE SELECTION STYLING */
::selection {
  background: rgba(0, 226, 255, 0.3);
  color: #fff;
}

::-moz-selection {
  background: rgba(0, 226, 255, 0.3);
  color: #fff;
}

/* MOBILE FOCUS STYLING */
*:focus {
  outline: 2px solid rgba(0, 226, 255, 0.6);
  outline-offset: 2px;
}

/* MOBILE TYPOGRAPHY IMPROVEMENTS */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin-bottom: 15px;
}

p, li {
  line-height: 1.6;
  margin-bottom: 12px;
}

/* MOBILE LINK STYLING */
a {
  color: var(--primary);
  text-decoration: none;
  touch-action: manipulation;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

a:active {
  background: rgba(0, 226, 255, 0.1);
  transform: scale(0.98);
}

/* MOBILE ANIMATION PREFERENCES */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* MOBILE ORIENTATION SUPPORT */
@media (orientation: landscape) {
  body {
    padding: 10px 20px 150px 20px;
  }
  
  h1 {
    font-size: 2em;
    margin: 15px 0 10px 0;
  }
}

@media (orientation: portrait) {
  body {
    padding: 15px 15px 200px 15px;
  }
  
  h1 {
    font-size: 2.2em;
    margin: 20px 0 15px 0;
  }
}

/* MOBILE SMALL SCREEN ADJUSTMENTS */
@media (max-width: 400px) {
  body {
    padding: 12px 12px 100px 12px; /* Reduced from 180px */
    font-size: 15px;
  }
  
  h1 {
    font-size: 2em;
    padding: 12px 15px 8px 15px;
    margin: 15px 0 12px 0;
  }
  
  button, 
  .clickable,
  input,
  select,
  textarea {
    min-height: 46px;
    min-width: 46px;
  }
}

@media (max-width: 350px) {
  body {
    padding: 10px 10px 160px 10px;
    font-size: 14px;
  }
  
  h1 {
    font-size: 1.8em;
    padding: 10px 12px 6px 12px;
    margin: 12px 0 10px 0;
  }
  
  button, 
  .clickable,
  input,
  select,
  textarea {
    min-height: 44px;
    min-width: 44px;
  }
}

/* MOBILE SAFE AREA SUPPORT (for devices with notches) */
@supports (padding: max(0px)) {
  body {
    padding-left: max(15px, env(safe-area-inset-left));
    padding-right: max(15px, env(safe-area-inset-right));
    padding-top: max(15px, env(safe-area-inset-top));
    padding-bottom: max(200px, calc(200px + env(safe-area-inset-bottom)));
  }
}

/* REMOVE ALL DESKTOP-SPECIFIC FEATURES */
/* No hover states, no desktop layouts, no mouse-only features */

/* MOBILE PERFORMANCE OPTIMIZATIONS */
* {
  box-sizing: border-box;
}

img, video {
  max-width: 100%;
  height: auto;
}

/* MOBILE ACCESSIBILITY IMPROVEMENTS */
@media (prefers-contrast: high) {
  body {
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
  }
  
  h1 {
    text-shadow: 
      0 0 30px #00e2ff, 
      0 0 80px rgba(0, 226, 255, 0.8);
  }
}

/* Enhanced 16:9 Mobile Layout Support */
@media (max-width: 768px) and (min-aspect-ratio: 16/9) {
  body {
    padding: 0 !important;
    margin: 0 !important;
    height: 100vh !important;
    overflow: hidden !important;
    background: linear-gradient(135deg, #0c1432 0%, #1d295c 100%) !important;
  }
  
  /* Remove background gradients for cleaner 16:9 layout */
  body::before,
  body::after {
    display: none !important;
  }
  
  /* Main container fills viewport */
  .game-container,
  #game-container {
    width: 100vw !important;
    height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    display: grid !important;
    overflow: hidden !important;
  }
  
  /* Optimize touch targets for landscape */
  button, 
  .clickable,
  .menu-btn,
  .back-btn,
  .upgrade-btn,
  .character-action-btn,
  .deployable-character,
  .cell {
    min-height: 44px !important;
    min-width: 44px !important;
    touch-action: manipulation !important;
  }
  
  /* Enhanced scrolling for sidebar */
  .unified-panel {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(0, 226, 255, 0.4) transparent !important;
  }
  
  /* Menu adjustments for 16:9 landscape */
  #main-menu,
  #deployment-screen,
  #character-selection,
  #upgrade-screen {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100vh !important;
    padding: 20px !important;
    gap: 20px !important;
  }
  
  .menu-content {
    max-width: 50vw !important;
    min-width: 400px !important;
  }
  
  /* Better typography for landscape */
  h1 {
    font-size: 2.5em !important;
    margin: 10px 0 !important;
  }
} 