/* ============================================
   CSS IMPORTS
   ============================================ */

@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');


/* ============================================
   GAME-SPECIFIC VARIABLES
   ============================================ */

:root {
  --bingo-bg: #FEFCE8;
  --bingo-tile: #FFFFFF;
  --bingo-marked: #10B981;
  --primary-color: #7C3AED;
  --primary-light: #EDE9FE;
  --secondary-color: #0EA5E9;
  --secondary-light: #E0F2FE;
}


/* ============================================
   GAME SELECTION SCREEN
   ============================================ */

.game-selection {
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.selection-section {
  margin-bottom: 32px;
  padding: 24px;
  border-radius: 16px;
  text-align: center;
}

.selection-section h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.primary-section {
  background: var(--primary-light);
  border: 2px solid var(--primary-color);
}

.primary-section h2 {
  color: var(--primary-color);
}

.secondary-section {
  background: var(--secondary-light);
  border: 2px solid var(--secondary-color);
}

.secondary-section h2 {
  color: var(--secondary-color);
}

.option-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.game-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 28px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 160px;
}

.game-option-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.game-option-btn:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

.primary-btn:hover {
  border-color: var(--primary-color);
  background: white;
}

.secondary-btn:hover {
  border-color: var(--secondary-color);
  background: white;
}

.btn-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.btn-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.btn-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}


/* ============================================
   BINGO CARD
   ============================================ */

.bingo-card {
  padding: 10px;
}

.card-header {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.current-experience,
.current-mode {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.current-experience {
  background: var(--primary-color);
  color: white;
}

.current-mode {
  background: var(--secondary-color);
  color: white;
}

.bingo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 550px;
  margin: 0 auto;
  background: var(--bingo-bg);
  padding: 12px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}


/* ============================================
   BINGO TILES
   ============================================ */

.bingo-tile {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: var(--bingo-tile);
  border: 2px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  user-select: none;
  overflow: hidden;
}

.bingo-tile:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.bingo-tile:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

.bingo-tile .tile-label {
  font-size: 0.65rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  color: var(--text-dark);
  word-break: break-word;
  hyphens: auto;
}


/* ============================================
   FREE SPACE
   ============================================ */

.bingo-tile.free-space {
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  border-color: #D97706;
  cursor: default;
}

.bingo-tile.free-space .tile-label {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.bingo-tile.free-space:hover {
  transform: none;
}


/* ============================================
   MARKED STATE
   ============================================ */

.bingo-tile.marked {
  background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
  border-color: var(--bingo-marked);
  box-shadow: inset 0 0 0 3px var(--bingo-marked);
}

.bingo-tile.marked:hover {
  transform: scale(1.02);
}

.bingo-tile.marked .tile-label {
  color: #065F46;
}

.bingo-tile.free-space.marked {
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  border-color: #D97706;
  box-shadow: inset 0 0 0 3px #D97706;
}

.bingo-tile.free-space.marked .tile-label {
  color: white;
}

/* Checkmark badge */
.bingo-tile .tile-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: var(--bingo-marked);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.bingo-tile.marked .tile-check {
  opacity: 1;
  transform: scale(1);
}

.bingo-tile.free-space .tile-check {
  background: #D97706;
}

.bingo-tile .tile-check svg {
  width: 12px;
  height: 12px;
  color: white;
}


/* ============================================
   HOW TO PLAY ENHANCEMENTS
   ============================================ */

.instructions-list {
  margin: 12px 0;
  padding-left: 20px;
}

.instructions-list li {
  margin-bottom: 6px;
  line-height: 1.4;
}

.how-to-play .tip {
  margin-top: 12px;
  padding: 10px;
  background: var(--primary-light);
  border-radius: 8px;
  font-size: 0.9rem;
}


/* ============================================
   SEO CONTENT SECTION
   ============================================ */

.seo-content {
  max-width: 800px;
  margin: 40px auto;
  padding: 32px 24px;
  background: #F9FAFB;
  border-radius: 16px;
}

.seo-content h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--text-dark);
}

.seo-content p {
  margin-bottom: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}

.seo-content p:last-child {
  margin-bottom: 0;
}

.seo-content strong {
  color: var(--text-dark);
}


/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 640px) {
  .game-selection {
    padding: 16px;
  }

  .selection-section {
    padding: 20px 16px;
    margin-bottom: 24px;
  }

  .selection-section h2 {
    font-size: 1.25rem;
  }

  .option-buttons {
    gap: 12px;
  }

  .game-option-btn {
    padding: 16px 20px;
    min-width: 140px;
    flex: 1;
  }

  .btn-icon {
    font-size: 1.75rem;
  }

  .btn-title {
    font-size: 1rem;
  }

  .bingo-grid {
    gap: 6px;
    padding: 10px;
  }

  .bingo-tile {
    border-radius: 8px;
    padding: 6px;
  }

  .bingo-tile .tile-label {
    font-size: 0.55rem;
  }

  .bingo-tile.free-space .tile-label {
    font-size: 0.85rem;
  }

  .bingo-tile .tile-check {
    width: 16px;
    height: 16px;
    top: 2px;
    right: 2px;
  }

  .bingo-tile .tile-check svg {
    width: 10px;
    height: 10px;
  }

  .card-header {
    gap: 8px;
  }

  .current-experience,
  .current-mode {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  .seo-content {
    margin: 24px 16px;
    padding: 24px 20px;
  }

  .seo-content h2 {
    font-size: 1.25rem;
  }
}

/* ============================================
   ITEM POPUP (MOBILE TAP-TO-EXPAND)
   ============================================ */

.item-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.item-popup[hidden] {
  display: none;
}

.item-popup-content {
  background: white;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: popup-appear 0.2s ease-out;
}

@keyframes popup-appear {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.item-popup-text {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-dark);
  margin-bottom: 24px;
}

.item-popup-btn {
  display: inline-block;
  padding: 14px 48px;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--bingo-marked);
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.item-popup-btn:hover {
  background: #059669;
  transform: scale(1.02);
}

.item-popup-btn:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

.item-popup-btn.unmark-btn {
  background: #6B7280;
}

.item-popup-btn.unmark-btn:hover {
  background: #4B5563;
}


@media (max-width: 640px) {
  /* Mobile tile text truncation */
  .bingo-tile .tile-label {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 400px) {
  .selection-section {
    padding: 16px 12px;
  }

  .game-option-btn {
    padding: 14px 16px;
    min-width: 120px;
  }

  .btn-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
  }

  .btn-title {
    font-size: 0.95rem;
  }

  .btn-desc {
    font-size: 0.7rem;
  }

  .bingo-grid {
    gap: 4px;
    padding: 8px;
  }

  .bingo-tile {
    border-radius: 6px;
    padding: 4px;
    border-width: 1px;
  }

  .bingo-tile .tile-label {
    font-size: 0.5rem;
  }

  .bingo-tile.free-space .tile-label {
    font-size: 0.7rem;
  }

  .bingo-tile .tile-check {
    width: 14px;
    height: 14px;
  }

  .bingo-tile .tile-check svg {
    width: 8px;
    height: 8px;
  }
}
