html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  background: #2b1b12;
  color: #e0c9a6;
}

/* Views */
.view {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s ease;
}

.view.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

/* Background image */
.bg {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
}

/* Enter button */
#enter-btn {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  padding: 18px 40px;
  font-size: 1.4em;
  background: #8b5a2b;
  color: white;
  border: 3px solid #5c3a1f;
  border-radius: 12px;
  cursor: pointer;
  z-index: 10;
}

/* Roast bubble */
#roast-bubble {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 16px 24px;
  border-radius: 18px;
  border: 3px solid #8b5a2b;
  font-size: 1.1em;
  max-width: 80%;
  text-align: center;
  z-index: 5;
}

/* Games menu */
#games-menu {
  position: absolute;
  bottom: 8%;
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 0 10px;
  z-index: 10;
}

#games-menu button {
  padding: 14px 28px;
  font-size: 1.1em;
  background: #5c3a1f;
  color: #e0c9a6;
  border: 2px solid #8b5a2b;
  border-radius: 10px;
  cursor: pointer;
}

/* Game screens */
.game-screen {
  position: absolute;
  inset: 0;
  display: none;
  background: #2b1b12;
  z-index: 20;
  pointer-events: none;
}

.game-screen.visible {
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.game-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  position: absolute;
  inset: 0;
  z-index: -1;
}

.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 12px 24px;
  font-size: 1.2em;
  background: #8b5a2b;
  color: white;
  border: 3px solid #5c3a1f;
  border-radius: 10px;
  cursor: pointer;
  z-index: 30;
}

/* Football card specific layout */
#game-football {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #2b1b12;
  z-index: 20;
}

#football-rules {
  background: rgba(0,0,0,0.65);
  color: #e0c9a6;
  padding: 16px 20px;
  margin: 70px 20px 12px;
  border-radius: 10px;
  border: 2px solid #8b5a2b;
  font-size: 1em;
  line-height: 1.4;
  z-index: 10;
  max-height: 30vh;
  overflow-y: auto;
  flex-shrink: 0;
}

#football-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  padding: 15px 20px;
  margin-top: 0;               /* pushes grid to bottom */
  max-height: 60vh;               /* leaves room for rules + back button */
  overflow-y: auto;
  flex-grow: 1;
}

.team-slot {
  background: rgba(255,255,255,0.08);
  border: 2px solid #8b5a2b;
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  color: white;
  font-size: 0.9em;
  cursor: pointer;
  transition: background 0.3s;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.team-slot:hover {
  background: rgba(139,90,43,0.4);
}

.team-slot.claimed {
  background: rgba(139,90,43,0.7);
  cursor: default;
}

.username {
  font-size: 0.8em;
  margin-top: 4px;
  color: #e0c9a6;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  #football-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px 15px;
  }

  .team-slot {
    font-size: 0.85em;
    min-height: 70px;
  }

  #football-rules {
    margin: 65px 15px 10px;
    font-size: 0.9em;
  }

  .back-btn {
    top: 12px;
    left: 12px;
    padding: 10px 20px;
    font-size: 1.1em;
  }
}

/* Very small screens (old phones) */
@media (max-width: 480px) {
  #football-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .team-slot {
    font-size: 0.8em;
    min-height: 80px;
  }

  #football-rules {
    font-size: 0.85em;
  }
}
