/* ==========================================================================
   PAPA SQUID: MEME MAYHEM — MAIN DESIGN SYSTEM & STYLESHEET
   Brand Colors:
     - Squid Purple: #7C3AED
     - Lime Pop:     #C7F464
     - Meme Coral:   #FF6B4A
     - Cream:        #FFF4D6
     - Sky Blue:     #67C8FF
     - Deep Navy:    #202044
     - White:        #FFFFFF
   ========================================================================== */

:root {
  --squid-purple: #7C3AED;
  --squid-purple-dark: #5B21B6;
  --squid-purple-light: #A78BFA;
  --lime-pop: #C7F464;
  --lime-pop-dark: #A3D834;
  --meme-coral: #FF6B4A;
  --meme-coral-dark: #E04E2D;
  --cream: #FFF4D6;
  --sky-blue: #67C8FF;
  --sky-blue-dark: #38BDF8;
  --deep-navy: #15152A;
  --navy-surface: #202044;
  --navy-card: #282855;
  --navy-border: #3A3A75;
  --white: #FFFFFF;
  --text-muted: #94A3B8;
  --gold-glow: #FCD34D;

  --font-heading: 'Fredoka', cursive, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-squid: 0 8px 0 var(--squid-purple-dark);
  --shadow-lime: 0 8px 0 var(--lime-pop-dark);
  --shadow-coral: 0 8px 0 var(--meme-coral-dark);
}

/* Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  font-family: var(--font-body);
  background-color: var(--deep-navy);
  color: var(--cream);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .brand-font {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.5px;
}

a {
  color: var(--sky-blue);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--lime-pop);
}

/* Background Atmosphere */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 15% 20%, rgba(124, 58, 237, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(199, 244, 100, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(255, 107, 74, 0.08) 0%, transparent 60%),
    linear-gradient(to bottom, #121224 0%, #1a1a36 100%);
  z-index: -2;
  pointer-events: none;
}

/* Subtle Cartoon Grid Overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  z-index: -1;
  pointer-events: none;
}

/* Header & Navigation Bar */
.game-navbar {
  background: rgba(32, 32, 68, 0.95);
  border-bottom: 3px solid var(--navy-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.65rem 1rem;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  cursor: pointer;
}

.brand-icon-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--squid-purple) 0%, var(--meme-coral) 100%);
  border-radius: 14px;
  border: 3px solid var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.5);
  transform: rotate(-4deg);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-logo-wrap:hover .brand-icon-badge {
  transform: rotate(0deg) scale(1.08);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--white);
  text-shadow: 2px 2px 0px var(--squid-purple-dark);
  margin: 0;
}

.brand-tagline {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--lime-pop);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Currency & Player HUD in Navbar */
.nav-player-pill {
  background: var(--navy-surface);
  border: 2px solid var(--navy-border);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-player-pill:hover {
  border-color: var(--squid-purple-light);
  transform: translateY(-1px);
}

.nav-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--squid-purple);
  border: 2px solid var(--lime-pop);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.currency-badge {
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--navy-border);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.currency-badge.coins {
  border-color: #EAB308;
  color: #FEF08A;
}

.currency-badge.gems {
  border-color: var(--sky-blue);
  color: #BAE6FD;
}

/* Navigation Links */
.nav-tabs-squid {
  display: flex;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs-squid::-webkit-scrollbar {
  display: none;
}

.nav-tabs-squid .nav-link {
  color: var(--cream);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.45rem 0.85rem;
  border-radius: 12px;
  border: 2px solid transparent;
  transition: all 0.18s ease-out;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.nav-tabs-squid .nav-link:hover {
  background: rgba(124, 58, 237, 0.2);
  color: var(--white);
  border-color: rgba(124, 58, 237, 0.4);
}

.nav-tabs-squid .nav-link.active {
  background: var(--squid-purple);
  color: var(--white);
  border-color: var(--cream);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.5);
}

a[data-screen],
[role="button"] {
  cursor: pointer;
}

a[data-screen]:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--lime-pop);
  outline-offset: 3px;
}

/* App Main Container */
#app-container {
  min-height: calc(100vh - 72px);
  min-height: calc(100dvh - 72px);
  position: relative;
}

/* Screen Management */
.screen {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  padding: 1.5rem 0 3.5rem;
}

.screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.min-vh-75 {
  min-height: 75vh;
  min-height: 75dvh;
}

/* Section Header Typography */
.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--white);
  text-shadow: 3px 3px 0 var(--squid-purple-dark);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

/* Footer */
.game-footer {
  background: #101020;
  border-top: 2px solid var(--navy-border);
  padding: 2.5rem 1rem 2rem;
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-link {
  color: var(--text-muted);
  transition: color 0.15s;
}

.footer-link:hover {
  color: var(--lime-pop);
}

/* Helper utility classes */
.bg-navy-surface { background-color: var(--navy-surface) !important; }
.bg-navy-card { background-color: var(--navy-card) !important; }
.border-navy { border-color: var(--navy-border) !important; }
.text-squid { color: var(--squid-purple) !important; }
.text-lime { color: var(--lime-pop) !important; }
.text-coral { color: var(--meme-coral) !important; }
.text-cream { color: var(--cream) !important; }
.text-sky { color: var(--sky-blue) !important; }

/* Bootstrap's default muted gray and purple are too dark on navy surfaces. */
body .text-muted {
  color: #B7C2D3 !important;
}

body .text-squid {
  color: var(--squid-purple-light) !important;
}

body .btn-action-touch {
  appearance: none;
  padding: 0;
}

::selection {
  color: var(--deep-navy);
  background: var(--lime-pop);
}

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