body {
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    background: #2c3e50;
    font-family: Arial, sans-serif;
    min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
}

.container h1 {
    color: white;
    font-size: clamp(24px, 5vh, 48px);
    font-weight: bold;
    margin-bottom: clamp(5px, 1vh, 15px);
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.grid-container {
    width: min(90vw, 90vh);
    aspect-ratio: 1;
    max-width: 800px;
    max-height: 800px;
    min-width: 280px;
    min-height: 280px;
    background-color: #34495e;
    border: 4px solid #2c3e50;
    border-radius: 12px;
    padding: clamp(4px, 1vw, 8px);
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: clamp(4px, 1vw, 8px);
    flex-shrink: 0;
    min-width: 0;
    min-height: 0;
}

.square {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    background-color: #3498db;
    border: 2px solid #2980b9;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-size: clamp(10px, 2.2vw, 20px);
    box-sizing: border-box;
    overflow: hidden;
}

.square > span {
    text-align: center;
    line-height: 1.2;
    padding: 4px;
    word-wrap: break-word;
    font-size: clamp(8px, 1.8vw, 16px);
}

.square.has-book {
    background-color: #27ae60;
}

.book-cover {
    width: 100%;
    height: 60%;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 4px;
}

.book-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 4px;
    font-size: clamp(6px, 1.2vw, 10px);
    text-align: center;
    z-index: 2;
    line-height: 1.1;
}

.challenge-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 4px;
    font-size: clamp(6px, 1.2vw, 10px);
    text-align: center;
    z-index: 2;
    line-height: 1.1;
}

.square:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: #34495e;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 80%;
    max-width: 500px;
    color: white;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close:hover {
    color: white;
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #3498db;
}

.modal-description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.modal-category {
    background-color: #e74c3c;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    font-size: 14px;
    font-weight: bold;
}

#removeBook {
    background: #e74c3c !important;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    padding: 8px;
    margin-top: 18px;
    margin-bottom: 10px;
    font-size: 1em;
    transition: background 0.2s;
}
#removeBook:hover {
    background: #c0392b !important;
}
#currentBookTitle {
    margin-bottom: 8px;
}

@media print {
  body {
    background: white !important;
    color: black !important;
    overflow: visible !important;
  }
  .container {
    box-shadow: none !important;
    background: white !important;
  }
  #printBingoBtn,
  .overlay,
  .modal,
  .book-form,
  #currentBookDisplay,
  #removeBook,
  .modal-content,
  .close,
  .modal-title,
  .modal-description {
    display: none !important;
  }
  #privacyLink,
  #privacyModal {
    display: none !important;
  }
  #bingoInstruction {
    display: none !important;
  }
  .grid-container {
    max-width: 100vw !important;
    max-height: 100vh !important;
    border: 2px solid #222 !important;
    background: white !important;
    page-break-inside: avoid;
  }
  .square {
    border: 1px solid #222 !important;
    background: #f8f8f8 !important;
    color: #111 !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .book-cover {
    opacity: 1 !important;
  }
  .book-title, .challenge-text, .square > span {
    color: #fff !important;
    background: #222 !important;
    border-radius: 4px;
    padding: 2px 4px;
    opacity: 0.95;
  }
  h1 {
    color: #111 !important;
    text-shadow: none !important;
  }
  p {
    color: #333 !important;
  }
  p[style*="Press a square to add your book"] {
    display: none !important;
  }
  #printFooter {
    display: block !important;
  }
  /* Only overlays in squares with a book get dark background and white text */
  .has-book .book-title,
  .has-book .challenge-text,
  .has-book > span {
    color: #fff !important;
    background: #222 !important;
    border-radius: 4px;
    padding: 2px 4px;
    opacity: 0.95;
  }
  /* Overlays in empty squares stay black on white */
  .square:not(.has-book) .book-title,
  .square:not(.has-book) .challenge-text,
  .square:not(.has-book) > span {
    color: #111 !important;
    background: none !important;
    opacity: 1 !important;
  }
} 