/* ============================================
   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
   Road Sign Hunt theme colors
   ============================================ */

:root {
  --tile-bg: #FFFFFF;
  --tile-text: #1A1A1A;
  --tile-border: #DDD;
  --bingo-bg: #F5F5F5;
}


/* ============================================
   GAME AREA LAYOUT
   4x4 Bingo Grid
   ============================================ */

.game-area {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
}

.bingo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 460px;
  padding: 16px;
  background: var(--bingo-bg);
  border-radius: 16px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}


/* ============================================
   GAME TILES
   Road sign cards
   ============================================ */

.game-tile {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--tile-bg);
  border: 2px solid var(--tile-border);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  user-select: none;
  padding: 6px;
  overflow: hidden;
  box-sizing: border-box;
  min-width: 0;
}

.game-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  border-color: #BBB;
}

.game-tile:active {
  transform: translateY(-1px);
}

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

/* Sign image */
.tile-img {
  width: 65%;
  max-height: 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tile-img img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
}

/* Sign name label */
.tile-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--tile-text);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}


/* ============================================
   SPOTTED STATE
   When a sign has been marked off
   ============================================ */

.game-tile.completed {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  border-color: var(--check-green);
  box-shadow:
    inset 0 0 0 3px var(--check-green),
    0 2px 6px rgba(0, 0, 0, 0.06);
}

.game-tile.completed .tile-img {
  opacity: 0.6;
}

.game-tile.completed:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 3px var(--check-green),
    0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Checkmark badge */
.tile-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: var(--check-green);
  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 2px 6px rgba(0, 0, 0, 0.3);
}

.game-tile.completed .tile-check {
  opacity: 1;
  transform: scale(1);
}

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


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

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

  .bingo-grid {
    gap: 8px;
    padding: 12px;
    max-width: 400px;
  }

  .tile-img {
    width: 70%;
    max-height: 65%;
  }

  .tile-label {
    font-size: 9px;
  }
}

/* Mobile: Hide labels, make images larger */
@media (max-width: 500px) {
  .game-area {
    padding: 6px;
  }

  .bingo-grid {
    gap: 6px;
    padding: 10px;
    border-radius: 12px;
    max-width: 100%;
    width: calc(100% - 12px);
  }

  .game-tile {
    border-radius: 8px;
    padding: 6px;
    gap: 0;
    justify-content: center;
  }

  /* Hide labels on mobile - signs are recognizable by image */
  .tile-label {
    display: none;
  }

  .tile-img {
    width: 80%;
    max-height: 80%;
  }

  .tile-check {
    width: 20px;
    height: 20px;
    top: 3px;
    right: 3px;
  }

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

@media (max-width: 380px) {
  .bingo-grid {
    gap: 5px;
    padding: 8px;
  }

  .game-tile {
    padding: 5px;
    border-radius: 6px;
  }

  .tile-img {
    width: 85%;
    max-height: 85%;
  }

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

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