/* ==========================================================================
   Nokia Snake — Custom Styles
   Pairs with Tailwind via CDN. Brings the LCD nostalgia.
   ========================================================================== */

:root {
  --lcd-bg: #9bbc0f;
  --lcd-bg-soft: #aed142;
  --lcd-ink: #0f380f;
  --lcd-shadow: #306230;
  --phone-body: #2a2a28;
  --phone-body-2: #1a1a18;
  --phone-key: #3a3a38;
  --phone-key-active: #1d1d1b;
}

html, body {
  background-color: #0a0a0a;
}

.font-pixel {
  font-family: 'Press Start 2P', system-ui, monospace;
  letter-spacing: 0.02em;
}

.font-inter {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.font-lcd {
  font-family: 'VT323', monospace;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: 'VT323', monospace;
  font-size: 0.95rem;
  line-height: 1;
  color: #d4d4d8;
  background: #1f1f1f;
  border: 1px solid #3f3f46;
  border-bottom-width: 2px;
  border-radius: 4px;
  margin: 0 1px;
}

/* ==========================================================================
   Background atmosphere
   ========================================================================== */

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(255, 255, 255, 0.1) 2px,
    rgba(255, 255, 255, 0.1) 3px
  );
  mix-blend-mode: overlay;
}

.bg-grid {
  background-image:
    linear-gradient(to right, #ffffff 1px, transparent 1px),
    linear-gradient(to bottom, #ffffff 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ==========================================================================
   Feature cards (landing page)
   ========================================================================== */

.feature-card {
  position: relative;
  padding: 1.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  transition: all 0.3s ease;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(155, 188, 15, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover {
  border-color: rgba(155, 188, 15, 0.3);
  transform: translateY(-4px);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(155, 188, 15, 0.12);
  color: #9bbc0f;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

/* ==========================================================================
   How-to-play steps
   ========================================================================== */

.step-card {
  position: relative;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.015);
}

.step-number {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  color: #9bbc0f;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   Timeline
   ========================================================================== */

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.4rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(155, 188, 15, 0.4) 15%, rgba(155, 188, 15, 0.4) 85%, transparent);
}

.timeline-item {
  position: relative;
  padding: 0.75rem 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.7rem;
  top: 1.05rem;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #9bbc0f;
  box-shadow: 0 0 12px rgba(155, 188, 15, 0.6);
}

.timeline-year {
  font-size: 0.7rem;
  color: rgba(155, 188, 15, 0.8);
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.timeline-text {
  color: #a1a1aa;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ==========================================================================
   FAQ
   ========================================================================== */

.faq-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
  transition: all 0.2s;
}

.faq-item[open] {
  border-color: rgba(155, 188, 15, 0.3);
  background: rgba(155, 188, 15, 0.04);
}

.faq-summary {
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  font-weight: 500;
  color: #e4e4e7;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-summary::-webkit-details-marker { display: none; }

.faq-summary::after {
  content: '+';
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  color: #9bbc0f;
  transition: transform 0.2s;
  line-height: 1;
}

.faq-item[open] .faq-summary::after {
  transform: rotate(45deg);
}

.faq-content {
  padding: 0 1.25rem 1.25rem;
  color: #a1a1aa;
  line-height: 1.6;
}

.faq-content code {
  font-family: 'VT323', monospace;
  font-size: 0.95em;
  padding: 1px 6px;
  background: rgba(155, 188, 15, 0.12);
  color: #9bbc0f;
  border-radius: 4px;
}

/* ==========================================================================
   Phone mockup (landing page hero)
   ========================================================================== */

.phone-mockup {
  position: relative;
  width: 280px;
  perspective: 1200px;
}

.phone-shadow {
  position: absolute;
  bottom: -30px;
  left: 10%;
  right: 10%;
  height: 40px;
  background: radial-gradient(ellipse at center, rgba(155, 188, 15, 0.3), transparent 70%);
  filter: blur(20px);
  z-index: -1;
}

.phone-frame {
  position: relative;
  width: 100%;
  padding: 14px 16px 16px;
  background: linear-gradient(160deg, #3a3a38 0%, #1f1f1d 100%);
  border-radius: 36px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    0 30px 60px -15px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: rotate(-4deg);
  transition: transform 0.5s ease;
}

.phone-mockup:hover .phone-frame {
  transform: rotate(-2deg) translateY(-4px);
}

.phone-speaker {
  width: 50px;
  height: 5px;
  background: #0a0a0a;
  border-radius: 3px;
  margin: 0 auto 8px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.phone-brand {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 0.65rem;
  color: #9a9a98;
  letter-spacing: 0.25em;
  margin-bottom: 8px;
}

.phone-screen-area {
  background: #1a1a18;
  border-radius: 8px;
  padding: 10px 10px 6px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  margin-bottom: 12px;
}

.phone-screen-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: #6a6a68;
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: 0.1em;
}

.phone-screen {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #9bbc0f 0%, #8eaf0d 100%);
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 2px #0a0a0a,
    inset 0 0 20px rgba(15, 56, 15, 0.3),
    0 0 30px rgba(155, 188, 15, 0.4);
}

.phone-screen-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, rgba(255, 255, 255, 0.25), transparent 60%);
  pointer-events: none;
  z-index: 2;
}

.phone-screen-grid {
  position: relative;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(to right, rgba(15, 56, 15, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 56, 15, 0.06) 1px, transparent 1px);
  background-size: 10% 10%;
}

.snake-preview {
  position: absolute;
  inset: 0;
}

.snake-cell {
  position: absolute;
  width: 10%;
  height: 10%;
  background: #0f380f;
  box-shadow: inset 0 0 0 1px #9bbc0f;
}

.food-cell {
  position: absolute;
  width: 10%;
  height: 10%;
  background: #0f380f;
  border-radius: 2px;
  animation: foodBlink 1.2s ease-in-out infinite;
}

@keyframes foodBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.85); }
}

.screen-score {
  position: absolute;
  top: 4px;
  right: 6px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: #0f380f;
  letter-spacing: 0.05em;
}

.phone-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.phone-key {
  aspect-ratio: 2 / 1;
  background: linear-gradient(180deg, #4a4a48, #2a2a28);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: #a0a0a0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 1px 2px rgba(0, 0, 0, 0.4);
}

.key-active {
  background: linear-gradient(180deg, #1d1d1b, #0a0a0a);
  color: #9bbc0f;
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.6),
    0 0 8px rgba(155, 188, 15, 0.3);
}

/* ==========================================================================
   Phone mockup LARGE (gameplay page)
   ========================================================================== */

.phone-mockup-large {
  position: relative;
  width: min(380px, 100%);
}

.phone-frame-large {
  position: relative;
  width: 100%;
  padding: 18px 22px 22px;
  background: linear-gradient(160deg, #3a3a38 0%, #1f1f1d 100%);
  border-radius: 40px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    0 40px 80px -20px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 100px rgba(155, 188, 15, 0.08);
}

.phone-screen-area-large {
  background: #1a1a18;
  border-radius: 10px;
  padding: 12px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  margin-bottom: 18px;
}

.phone-screen-large {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #9bbc0f 0%, #8eaf0d 100%);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 2px #0a0a0a,
    inset 0 0 30px rgba(15, 56, 15, 0.25),
    0 0 40px rgba(155, 188, 15, 0.4);
}

.screen-status {
  position: absolute;
  top: 6px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  z-index: 3;
  pointer-events: none;
}

.screen-status-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: #0f380f;
  letter-spacing: 0.08em;
}

.game-canvas {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 1;
}

/* Game overlay (start / pause / game over) */
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 56, 15, 0.55);
  backdrop-filter: blur(1px);
  display: grid;
  place-items: center;
  z-index: 4;
  transition: opacity 0.2s;
}

.game-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-content {
  text-align: center;
  color: #0f380f;
  padding: 1rem;
}

.overlay-btn {
  display: inline-block;
  padding: 8px 14px;
  background: #0f380f;
  color: #9bbc0f;
  border: 2px solid #0f380f;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Press Start 2P', monospace;
  letter-spacing: 0.05em;
  transition: all 0.15s;
}

.overlay-btn:hover {
  background: #9bbc0f;
  color: #0f380f;
  transform: scale(1.05);
}

.overlay-btn:active {
  transform: scale(0.96);
}

/* Phone keypad - large version (D-pad style) */
.phone-keypad-large {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.phone-key-large {
  position: relative;
  aspect-ratio: 1.6 / 1;
  background: linear-gradient(180deg, #4a4a48, #2a2a28);
  border: none;
  border-radius: 10px;
  color: #c8c8c8;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: 'Press Start 2P', monospace;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.4);
  transition: all 0.06s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.phone-key-large:hover {
  background: linear-gradient(180deg, #555553, #353533);
  color: #e8e8e8;
}

.phone-key-large:active,
.phone-key-large.pressed {
  background: linear-gradient(180deg, #1a1a18, #0a0a08);
  color: #9bbc0f;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(155, 188, 15, 0.3);
  transform: translateY(1px);
}

.phone-key-large .key-label {
  font-size: 0.45rem;
  letter-spacing: 0.05em;
  color: #707070;
}

.phone-key-large:active .key-label,
.phone-key-large.pressed .key-label {
  color: #9bbc0f;
}

.key-center {
  background: linear-gradient(180deg, #5a5a58, #3a3a38);
}

.key-center-dot {
  width: 14px;
  height: 14px;
  background: #1a1a18;
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Side info cards (gameplay page)
   ========================================================================== */

.info-card {
  padding: 1rem 1.25rem;
  border-radius: 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(155, 188, 15, 0.04), rgba(255, 255, 255, 0.01));
}

.info-label {
  font-size: 0.55rem;
  color: #71717a;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.info-value {
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  text-shadow: 0 0 18px rgba(155, 188, 15, 0.5);
}

.speed-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.speed-btn {
  padding: 8px 4px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #a1a1aa;
  cursor: pointer;
  transition: all 0.15s;
}

.speed-btn:hover {
  border-color: rgba(155, 188, 15, 0.3);
  color: #d4d4d8;
}

.speed-btn.active {
  background: rgba(155, 188, 15, 0.15);
  border-color: rgba(155, 188, 15, 0.5);
  color: #9bbc0f;
  box-shadow: inset 0 0 8px rgba(155, 188, 15, 0.15);
}

/* ==========================================================================
   Responsive tweaks
   ========================================================================== */

@media (max-width: 640px) {
  .phone-mockup {
    width: 240px;
    margin: 0 auto;
  }

  .phone-mockup-large {
    width: min(340px, 100%);
  }

  .info-value {
    font-size: 1.25rem;
  }
}

@media (max-width: 1024px) {
  .phone-mockup-large {
    margin: 0 auto;
  }
}

/* Animations */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(155, 188, 15, 0.4); }
  50% { box-shadow: 0 0 35px rgba(155, 188, 15, 0.7); }
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes screen-flash {
  0%, 100% { background: linear-gradient(135deg, #9bbc0f 0%, #8eaf0d 100%); }
  50% { background: linear-gradient(135deg, #ffaaaa 0%, #ff8888 100%); }
}

.screen-flash {
  animation: screen-flash 0.15s ease-in-out 2;
}
