/* ==========================================================================
   THE DAILY PICKLE — Modern Design System & Global Styles
   By loafpickle
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Ultra-Dark Cyber Emerald & Neon Green Foundation */
  --bg-deep: #050d0a;
  --bg-surface: #0a1813;
  --bg-card: rgba(10, 28, 22, 0.88);
  --bg-card-hover: rgba(14, 38, 30, 0.95);
  --border-subtle: rgba(0, 255, 102, 0.22);
  --border-glow: rgba(0, 255, 102, 0.45);

  /* Intense Neon Green Palette */
  --pickle-neon: #00ff66;
  --pickle-green: #00ff66;
  --pickle-dill: #00e65c;
  --pickle-brine: #39ff14;
  --toast-gold: #ffbe0b;
  --mustard-pop: #ffcc00;
  --poppy-coral: #ff3366;
  --accent-cyan: #00f0ff;
  --accent-blue: #38bdf8;
  --accent-berry: #f43f5e;
  --danger-red: #ef4444;

  /* Text & Elements */
  --text-main: #ffffff;
  --text-muted: #6ee7b7;
  --text-subtle: #a7f3d0;
  --text-dim: #94a3b8;
  --text-dark: #050d0a;

  /* Crossword Specifics */
  --cell-bg: #0e1e19;
  --cell-text: #ffffff;
  --cell-blocked: #040907;
  --cell-active: #00ff66;
  --cell-word: rgba(0, 255, 102, 0.22);
  --cell-special-bg: #fef08a;
  --cell-special-border: #f59e0b;
  --cell-error: #fecaca;

  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Elevation & Shadows */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 26px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.7);
  --shadow-neon: 0 0 20px rgba(0, 255, 102, 0.45), 0 0 40px rgba(0, 255, 102, 0.2);
  --shadow-toast: 0 0 24px rgba(255, 190, 11, 0.4);
  --shadow-coral: 0 0 24px rgba(255, 51, 102, 0.4);

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Overrides (Optional / Toggleable) */
[data-theme="light"] {
  --bg-deep: #f2fbf5;
  --bg-surface: #e6f7ec;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --border-subtle: rgba(22, 101, 52, 0.15);
  --border-glow: rgba(22, 101, 52, 0.35);
  --text-main: #052e16;
  --text-muted: #166534;
  --text-subtle: #15803d;
  --text-dim: #374151;
  --cell-bg: #ffffff;
  --cell-text: #0f172a;
  --cell-blocked: #1e293b;
  --cell-active: #a7f3d0;
  --cell-word: #d1fae5;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(34, 197, 94, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(245, 158, 11, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Container */
.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 80px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.brand-mascot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 255, 102, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.brand-section:hover .brand-mascot {
  transform: scale(1.05);
}

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

.brand-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.15;
}

.brand-tagline {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Control Buttons & Pills */
.btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(0, 255, 102, 0.4);
  color: var(--pickle-neon);
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 6px 11px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--toast-gold);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

.streak-pill:hover {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.4);
}

.btn-account-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

#header-auth-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
  display: inline-block;
  vertical-align: middle;
}

.btn-account-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-account-pill.logged-in {
  background: rgba(0, 255, 102, 0.12);
  border-color: rgba(0, 255, 102, 0.35);
  color: var(--pickle-neon);
}

/* Mode Switcher Segmented Control */
.mode-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  background: rgba(10, 24, 18, 0.8);
  backdrop-filter: blur(10px);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin: 0 auto 20px auto;
  max-width: 480px;
  width: 100%;
}

.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.mode-tab.active {
  background: var(--pickle-neon);
  color: #041209;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(0, 255, 102, 0.35);
}

.mode-tab .badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  font-weight: 600;
}

.mode-tab.active .badge {
  background: rgba(4, 18, 9, 0.2);
  color: #041209;
  font-weight: 700;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--pickle-neon);
  color: var(--text-main);
  padding: 12px 22px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: var(--shadow-neon);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1), toastOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) 2.7s forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

/* Responsive Layout & Header */
@media (max-width: 768px) {
  .app-container {
    padding: 8px 12px 24px;
    min-height: 100dvh;
  }
  .app-header {
    padding: 8px 12px;
    border-radius: 14px;
    margin-bottom: 10px;
    gap: 8px;
  }
  .brand-mascot {
    width: 34px;
    height: 34px;
  }
  .brand-name {
    font-size: 1.2rem;
  }
  .brand-tagline {
    font-size: 0.6rem;
    letter-spacing: 0.05em;
  }
  .header-controls {
    gap: 6px;
  }
  .btn-icon {
    width: 30px;
    height: 30px;
  }
  .streak-pill {
    padding: 5px 9px;
    font-size: 0.76rem;
  }
  .btn-account-pill {
    padding: 5px 10px;
    font-size: 0.76rem;
  }
  .mode-nav {
    margin: 0 auto 8px auto;
    padding: 3px;
    max-width: 360px;
    gap: 4px;
  }
  .mode-tab {
    padding: 5px 8px;
    font-size: 0.8rem;
    gap: 4px;
  }
  .mode-tab .badge {
    font-size: 0.62rem;
    padding: 1px 4px;
  }
}

@media (max-width: 520px) {
  .app-container {
    padding: 6px 8px 24px;
  }
  .app-header {
    padding: 6px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
    gap: 6px;
  }
  .brand-section {
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
  }
  .brand-mascot {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
  .brand-name {
    font-size: 1.08rem;
    white-space: nowrap;
    line-height: 1;
  }
  .brand-tagline {
    display: none !important;
  }
  .header-controls {
    gap: 4px;
    flex-shrink: 0;
  }
  .streak-pill {
    padding: 4px 7px;
    font-size: 0.72rem;
    gap: 3px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .streak-pill .streak-unit {
    display: none;
  }
  .btn-account-pill {
    padding: 4px 7px;
    font-size: 0.72rem;
    gap: 4px;
    max-width: 82px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  #header-auth-label {
    max-width: 60px;
  }
  .btn-icon {
    width: 27px;
    height: 27px;
    border-radius: 7px;
    flex-shrink: 0;
    position: relative;
  }
  .btn-icon::after {
    content: '';
    position: absolute;
    top: -8px;
    bottom: -8px;
    left: -8px;
    right: -8px;
  }
  .btn-icon svg {
    width: 13px;
    height: 13px;
  }
  .mode-nav {
    max-width: 100%;
    margin: 0 auto 8px auto;
    padding: 3px;
    gap: 3px;
  }
  .mode-tab {
    padding: 5px 4px;
    font-size: 0.76rem;
    gap: 3px;
  }
  .mode-tab .badge {
    font-size: 0.58rem;
    padding: 1px 3px;
  }
}

@media (max-width: 380px) {
  .app-container {
    padding: 4px 6px 20px;
  }
  .app-header {
    padding: 5px 8px;
    gap: 4px;
    border-radius: 10px;
  }
  .brand-section {
    gap: 5px;
  }
  .brand-mascot {
    width: 24px;
    height: 24px;
  }
  .brand-name {
    font-size: 0.98rem;
  }
  .header-controls {
    gap: 3px;
  }
  .btn-icon {
    width: 25px;
    height: 25px;
    border-radius: 6px;
  }
  .btn-icon svg {
    width: 12px;
    height: 12px;
  }
  .streak-pill {
    padding: 3px 5px;
    font-size: 0.68rem;
    gap: 2px;
  }
  .btn-account-pill {
    padding: 3px 5px;
    font-size: 0.68rem;
    gap: 3px;
    max-width: 72px;
  }
  #header-auth-label {
    max-width: 50px;
  }
}

/* --------------------------------------------------------------------------
   App Footer & Legal Links
   -------------------------------------------------------------------------- */
.app-footer {
  margin-top: 48px;
  padding: 24px 16px 20px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
}

.footer-attribution {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.footer-link-highlight {
  color: var(--pickle-neon);
  text-decoration: none;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.footer-link-highlight:hover {
  text-decoration: underline;
  text-shadow: 0 0 10px rgba(0, 255, 102, 0.45);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-modal-link {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition-fast);
  padding: 3px 6px;
}

.footer-modal-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-divider {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
}

.footer-subtext {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.04em;
}

/* Legal Documents Modal Overrides */
.modal-content.modal-legal {
  max-width: 680px;
  padding: 32px 28px;
}

.legal-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.legal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.legal-title .highlight {
  color: var(--pickle-neon);
}

.legal-updated {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.legal-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.6;
}

.legal-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.legal-body p {
  color: rgba(255, 255, 255, 0.82);
}

.legal-body strong {
  color: #ffffff;
}

.legal-list {
  list-style: disc;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: rgba(255, 255, 255, 0.8);
}

.legal-footer-action {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
}



/* Nickname chip buttons */
.nick-chip-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nick-chip-btn:hover {
  background: rgba(0, 255, 102, 0.15);
  border-color: var(--pickle-neon);
  color: #fff;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Multi-Game Homepage Portal & Arcade Hub
   -------------------------------------------------------------------------- */
.portal-section {
  width: 100%;
  max-width: 860px;
  margin: 36px auto 16px auto;
}

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

.portal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-tagline {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.game-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.game-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-md);
}

.game-card.card-featured {
  border-color: rgba(0, 255, 102, 0.4);
  box-shadow: 0 4px 18px rgba(0, 255, 102, 0.1);
}

.game-card.card-crumble {
  border-color: rgba(255, 190, 11, 0.35);
}

.game-card.card-crumble:hover {
  border-color: var(--toast-gold);
  box-shadow: 0 6px 20px rgba(255, 190, 11, 0.2);
}

.game-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-card-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.card-status-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-playing {
  background: rgba(0, 255, 102, 0.15);
  color: var(--pickle-neon);
  border: 1px solid rgba(0, 255, 102, 0.3);
}

.badge-new {
  background: rgba(255, 190, 11, 0.15);
  color: var(--toast-gold);
  border: 1px solid rgba(255, 190, 11, 0.35);
}

.game-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.game-card-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.45;
  flex: 1;
  margin: 0;
}

.game-card-action {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--pickle-neon);
  margin-top: 4px;
}

.game-card.card-crumble .game-card-action {
  color: var(--toast-gold);
}



