/* ============================================
   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');


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

:root {
  --bingo-free-bg: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  --bingo-marked-bg: #22c55e;
  --bingo-winning-glow: rgba(34, 197, 94, 0.6);
}


/* ============================================
   BINGO GRID LAYOUT
   Fixed 5x5 grid with square aspect ratio
   ============================================ */

#bingo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 500px;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}


/* ============================================
   BINGO SQUARES
   ============================================ */

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

.bingo-square:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
  z-index: 1;
}

.bingo-square:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.square-emoji {
  font-size: 1.8rem;
  line-height: 1;
}

.square-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


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

.bingo-square.marked {
  background: var(--bingo-marked-bg);
  border-color: transparent;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.bingo-square.marked .square-label {
  color: white;
}

.bingo-square.marked:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}


/* ============================================
   FREE SQUARE (Center)
   ============================================ */

.bingo-square.free {
  background: var(--bingo-free-bg);
  border-color: transparent;
  cursor: default;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.bingo-square.free .square-label {
  color: white;
  font-weight: 700;
}

.bingo-square.free:hover {
  transform: none;
}


/* ============================================
   WINNING LINE ANIMATION
   ============================================ */

.bingo-square.winning {
  animation: pulse-win 0.5s ease infinite alternate;
  box-shadow: 0 0 20px var(--bingo-winning-glow);
  z-index: 2;
}

@keyframes pulse-win {
  0% {
    transform: scale(1);
    box-shadow: 0 0 15px var(--bingo-winning-glow);
  }
  100% {
    transform: scale(1.08);
    box-shadow: 0 0 25px var(--bingo-winning-glow);
  }
}


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

@media (max-width: 640px) {
  #bingo-grid {
    gap: 6px;
    max-width: 100%;
  }

  .square-emoji {
    font-size: 1.5rem;
  }

  .square-label {
    font-size: 0.55rem;
  }
}

@media (max-width: 400px) {
  #bingo-grid {
    gap: 4px;
  }

  .bingo-square {
    border-radius: 6px;
    padding: 2px;
  }

  .square-emoji {
    font-size: 1.2rem;
  }

  /* Hide labels on very small screens */
  .square-label {
    display: none;
  }
}
