/* ========== Base Styles ========== */

.hidden {
  display: none;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-image: url(../images/FSU24-pattern-red.jpg);
  margin: 0;
  padding: 0;
  text-align: center;
  min-height: 100vh;
  overflow-x: hidden; /* prevent horizontal scroll */
  box-sizing: border-box;
}


/* ========== Outer Grid Container ========== */

.page-grid {
  display: grid;
  grid-template-rows: auto 1fr auto; /* header, main, footer */
  height: 100vh;
}

/* ========== Header ========== */

/* Header */
.header {
  display: flex;
  justify-content: space-between; /* Space between logos and buttons */
  align-items: center;
  flex-wrap: wrap; /* allow wrapping on smaller screens */
  padding: 10px 20px;
  gap: 10px;
  background: transparent;
  user-select: none;
  position: relative; /* keep for fsu-logo absolute */
}

/* Jeopardy logo stays normal */
.jeopardy-logo {
  height: 4em;
  flex-shrink: 0;
}

/* FSU logo stays absolutely positioned right on desktop */
.fsu-logo {
  height: 4em;
  right: 20px;

}

/* Button container - remove absolute positioning */
.button-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-left: 0; /* reset margin */
  flex-grow: 1; /* take available space */
  
  order: 2; /* place after jeopardy-logo */
}

/* Buttons */
.next-game-button,
.refresh-game-button {
  padding: 10px 20px;
  font-size: 1em;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  border: 1px solid #ffffff7b;
  border-radius: 0.25em;
  background-color: #ce070b;
  color: #fff;
  transition: background-color 0.3s ease;
  white-space: nowrap; /* keep buttons from breaking */
}

.next-game-button:hover,
.refresh-game-button:hover {
  background-color: #ff0e12;
}

/* ========== Main Content ========== */

.content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 20px;
}

/* Jeopardy board grid - fixed 6 columns */

.jeopardy-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  width: 100%;
  max-width: 100vw;
  margin: 0 auto 20px;
  box-sizing: border-box;
}

/* Jeopardy cells styling */

.jeopardy-cell,
.category-cell {
  background-color: #212528;
  cursor: pointer;
  border: 2px solid #0b2748;
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
  padding: 2vmin; /* use viewport units for scaling */
  font-size: 3vmin; /* responsive font size */
  box-sizing: border-box;
  user-select: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.jeopardy-cell {
  color: #ffc107;
}

.category-cell {
  color: #fff;
  font-size: 2.5vmin;
}

/* Player scores container */

.player-scores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  padding-bottom: 10px;
}

.player-button {
  text-transform: uppercase;
  background-color: #ce070b;
  color: #fff;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border: 1px solid #ffffff7b;
  min-width: 120px;
  transition: background-color 0.3s ease;
}

.player-button:hover {
  background-color: #ff0e12;
}

.player-button span {
  margin-left: 5px;
}

/* Hidden cell style */

.hidden-cell {
  background-color: #d3d3d3;
  pointer-events: none;
  cursor: not-allowed;
  color: #555;
}

/* ========== Question and Answer Containers ========== */

#question-container,
#answer-container {
  font-size: 3em;
  text-align: center;
  border-radius: 0.25em;
}

#question-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #212528;
  color: yellow;
  border: 2px solid #0b2748;
  margin-bottom: 20px;
  height: 65vh;
  padding: 1rem;
  box-sizing: border-box;
}

#answer-container {
  background-color: #212528;
  color: white;
  border: 2px solid #0b2748;
  padding: 1rem;
  box-sizing: border-box;
}

/* Back link */

a.back-link {
  display: inline-block;
  margin-top: 20px;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}

a.back-link:hover {
  text-decoration: underline;
}

/* ========== Responsive Styles ========== */

/* Large tablets and desktops */
@media (max-width: 1024px) {
  .jeopardy-cell,
  .category-cell {
    padding: 1.5vmin;
    font-size: 2.5vmin;
  }

  .category-cell {
    font-size: 2.2vmin;
  }
}

/* Tablets */
@media (max-width: 768px) {
    #question-container, #answer-container{
        font-size: 1.2em;
    }

    .jeopardy-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  width: 100%;
  max-width: 100vw;
  margin: 0 auto 20px;
  box-sizing: border-box;
}

    .jeopardy-logo, .fsu-logo {
  height: 4em;
}

.next-game-button, .refresh-game-button {
    padding: 5px 10px;
    font-size: 0.75em;
}
/* FSU logo stays absolutely positioned right on desktop */

    .header {
    justify-content: center;
    position: relative;
  }

  .player-button {
    font-size: 1.2em;
    padding: 5px 10px;
    font-size: 0.75em;
  }

  .jeopardy-logo {
    height: 4em;
  }

    .fsu-logo {
    position: static;
    height: 4em;
    margin: 10px;
  }
    .button-container {
    justify-content: center;
    max-width: 100%;
    order: 3;
    margin-top: 10px;
  }
}

/* Mobile landscape */
@media (max-width: 600px) {
        .jeopardy-logo, .fsu-logo {
  height: 2em;
}

  .player-button {
    min-width: 90px;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {

  .player-button {
    min-width: 80px;
  }

  .button-container {
    align-items: center;
    position: static;
    margin: 10px auto 20px;
  }

  header {
    align-items: center;
  }

  .fsu-logo {
    position: static;
    margin-top: 10px;
  }
}
