/* css/style.css - DigiGlobals Snake Game Mobile-First Arcade Styles */

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

:root {
  --primary: #8b5cf6;
  --primary-glow: rgba(139, 92, 246, 0.4);
  --accent-purple: #9333ea;
  --accent-indigo: #6366f1;
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.4);
  --warning: #f59e0b;
  --danger: #ef4444;
  --tile-light: #1e1b4b;
  --tile-dark: #17133b;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #05060e;
  color: #f8fafc;
  user-select: none;
  touch-action: manipulation;
}

/* Glassmorphic Cards with Purple Glow Border */
.glass-card {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(139, 92, 246, 0.08);
}

.glass-card-hover {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-card-hover:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.25);
}

/* Dedicated Arcade Game Mode Overrides */
body.view-mode-play {
  overflow: hidden !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  touch-action: none !important;
}

body.view-mode-play #app-main-header,
body.view-mode-play #app-bottom-nav,
body.view-mode-auth #app-main-header,
body.view-mode-auth #app-bottom-nav {
  display: none !important;
}

body.view-mode-auth #app-shell-container {
  padding-bottom: 1rem !important;
}

body.view-mode-play #app-shell-container {
  height: 100dvh !important;
  max-height: 100dvh !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
  justify-content: space-between !important;
}

body.view-mode-play #app-main-content {
  padding: 0.75rem !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

body.view-mode-play #view-play {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  flex: 1 1 0% !important;
  justify-content: space-between !important;
  overflow: hidden !important;
  gap: 0.5rem !important;
}

/* Snake Game Board Container (Cyber Purple Arcade Board) */
.game-viewport {
  position: relative;
  width: 100%;
  max-width: 380px;
  flex: 1 1 0%;
  min-height: 200px;
  max-height: 52vh;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.9), 0 0 25px rgba(168, 85, 247, 0.35);
  border: 3px solid rgba(168, 85, 247, 0.5);
  touch-action: none;
  background-color: var(--tile-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Pulsing Cash Out Button */
.cashout-btn {
  background: linear-gradient(135deg, #9333ea 0%, #6366f1 100%);
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 0 25px rgba(147, 51, 234, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  transition: all 0.15s ease;
  animation: pulse-glow 1.5s infinite;
}
.cashout-btn:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.9), inset 0 1px 2px rgba(255, 255, 255, 0.6);
}
.cashout-btn:active:not(:disabled) {
  transform: scale(0.97);
}
.cashout-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  animation: none;
  background: #1e1b4b;
  color: #64748b;
  box-shadow: none;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 18px rgba(147, 51, 234, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.85), inset 0 1px 2px rgba(255, 255, 255, 0.7);
  }
}

/* Ergonomic Virtual D-Pad for Mobile Touch */
.dpad-container {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(3, 40px);
  gap: 4px;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.dpad-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #f8fafc;
  border-radius: 0.75rem;
  width: 100%;
  height: 100%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.08s ease;
  user-select: none;
}
.dpad-btn:active {
  transform: scale(0.90);
  background: linear-gradient(180deg, #7c3aed 0%, #6366f1 100%);
  border-color: #c084fc;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.8);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: #090a16;
}
::-webkit-scrollbar-thumb {
  background: #4c1d95;
  border-radius: 9999px;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 90%;
  max-width: 380px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.1rem;
  border-radius: 0.85rem;
  background: #0f172a;
  border: 1px solid rgba(168, 85, 247, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7), 0 0 15px rgba(139, 92, 246, 0.25);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
