/* ============================================
   CSS IMPORTS
   These bring in the shared styling framework
   ============================================ */

@import url('./css/variables.css');
@import url('./css/reset.css');
@import url('./css/utilities.css');
@import url('./css/header.css');
@import url('./css/layout.css');
@import url('./css/ads.css');
@import url('./css/modal.css');
@import url('./css/sections.css');
@import url('./css/responsive.css');


/* ============================================
   MASH GAME VARIABLES
   ============================================ */

:root {
  --mash-purple: #8B5CF6;
  --mash-pink: #EC4899;
  --mash-purple-light: #A78BFA;
  --fortune-gold: #F59E0B;
  --fortune-gold-light: #FCD34D;
  --eliminated: #9CA3AF;
  --winner-green: #10B981;
}


/* ============================================
   PHASE INDICATOR (replaces counter)
   ============================================ */

.phase-indicator {
  line-height: 1;
}

.phase-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--mash-purple);
  letter-spacing: -0.01em;
}


/* ============================================
   INPUT PHASE - CATEGORY CARDS
   ============================================ */

.category {
  background: var(--header-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  transition: border-color 0.2s ease;
}

.category:hover {
  border-color: var(--mash-purple-light);
}

.category h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--mash-purple);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.option-input {
  padding: 12px 14px;
  font-size: 0.95rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--page-bg);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.option-input:focus {
  outline: none;
  border-color: var(--mash-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.option-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Fixed options (non-editable, like M.A.S.H.) */
.option-fixed {
  padding: 12px 14px;
  font-size: 0.95rem;
  border: 2px solid var(--mash-purple);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
  color: var(--mash-purple);
  font-weight: 600;
  text-align: center;
}

.category-fixed {
  border-color: var(--mash-purple-light);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.03) 0%, rgba(236, 72, 153, 0.03) 100%);
}


/* ============================================
   START BUTTON
   ============================================ */

.start-btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--mash-purple) 0%, var(--mash-pink) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.start-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.start-btn:active:not(:disabled) {
  transform: translateY(0);
}

.start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.start-btn:focus-visible {
  outline: 3px solid var(--mash-purple);
  outline-offset: 2px;
}


/* ============================================
   ELIMINATION PHASE
   ============================================ */

.magic-number-display {
  text-align: center;
  margin-bottom: 24px;
}

.magic-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.magic-num {
  display: inline-block;
  font-size: 3rem;
  font-weight: 900;
  color: var(--mash-purple);
  line-height: 1;
  min-width: 60px;
  transition: transform 0.1s ease, color 0.1s ease;
}

.magic-num.randomizing {
  animation: number-spin 0.1s ease-in-out;
  color: var(--mash-pink);
  text-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
}

.magic-num.revealed {
  animation: number-reveal 0.5s ease-out;
  color: var(--mash-purple);
  text-shadow: 0 0 30px rgba(139, 92, 246, 0.8);
}

@keyframes number-spin {
  0% {
    transform: scale(1) rotateX(0deg);
  }
  50% {
    transform: scale(1.1) rotateX(10deg);
  }
  100% {
    transform: scale(1) rotateX(0deg);
  }
}

@keyframes number-reveal {
  0% {
    transform: scale(1.5);
    text-shadow: 0 0 40px rgba(139, 92, 246, 1);
  }
  50% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
  }
}

#elimination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.elimination-category {
  background: var(--header-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.elimination-category h4 {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mash-purple);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.elimination-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.elimination-option {
  padding: 10px 12px;
  font-size: 0.9rem;
  background: var(--page-bg);
  border: 2px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s ease;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.elimination-option.counting {
  border-color: var(--mash-pink);
  background: rgba(236, 72, 153, 0.1);
  transform: scale(1.02);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.3);
}

.elimination-option.eliminated {
  text-decoration: line-through;
  color: var(--eliminated);
  background: var(--border);
  border-color: transparent;
  opacity: 0.6;
}

.elimination-option.winner {
  border-color: var(--winner-green);
  background: rgba(16, 185, 129, 0.1);
  color: var(--winner-green);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
  animation: winner-pulse 0.6s ease-in-out;
}

@keyframes winner-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}


/* ============================================
   RESULTS PHASE - FORTUNE CARD
   ============================================ */

.fortune-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 3px solid var(--fortune-gold);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  box-shadow:
    0 10px 30px rgba(245, 158, 11, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.fortune-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
  pointer-events: none;
}

.fortune-card h2 {
  margin: 0 0 20px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fortune-gold);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  position: relative;
}

.fortune-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #92400e;
  margin: 0;
  position: relative;
}

.fortune-text strong {
  color: #78350f;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
}


/* ============================================
   RESULTS BUTTONS
   ============================================ */

.results-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.btn-primary,
.btn-secondary {
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--mash-purple) 0%, var(--mash-pink) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.btn-secondary {
  background: transparent;
  color: var(--mash-purple);
  border: 2px solid var(--mash-purple);
}

.btn-secondary:hover {
  background: rgba(139, 92, 246, 0.1);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 3px solid var(--mash-purple);
  outline-offset: 2px;
}


/* ============================================
   RESPONSIVE - MASH SPECIFIC
   ============================================ */

@media (max-width: 640px) {
  .options-grid {
    grid-template-columns: 1fr;
  }

  .option-input {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .category {
    padding: 14px 16px;
  }

  .category h3 {
    font-size: 0.9rem;
  }

  .start-btn {
    padding: 14px 20px;
    font-size: 1rem;
  }

  #elimination-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .elimination-category {
    padding: 10px;
  }

  .elimination-category h4 {
    font-size: 0.7rem;
  }

  .elimination-option {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .magic-num {
    font-size: 2.5rem;
  }

  .fortune-card {
    padding: 24px 16px;
  }

  .fortune-card h2 {
    font-size: 1.25rem;
  }

  .fortune-text {
    font-size: 1rem;
    line-height: 1.7;
  }

  .results-buttons {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .phase-text {
    font-size: 0.85rem;
  }
}

@media (max-width: 400px) {
  #elimination-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .elimination-option {
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  .fortune-text {
    font-size: 0.9rem;
  }

  .fortune-text strong {
    display: inline-block;
    padding: 1px 6px;
  }
}
