@import url('https://fonts.googleapis.com/css2?family=Comic+Relief:wght@400;700&family=Fredoka:wght@300..700&family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

/* Reset some default spacing */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  /* Center everything on the page */
  body {
    font-family: "Fredoka", sans-serif;
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: green;
    color: #1f2937;
  }
  
  /* Main layout */
  main {
    width: min(95vw, 520px);
    text-align: center;
  }
  
  /* Title and sections */
  h1 {
    margin-bottom: 12px;
    font-size: 4rem;
    color: white;
  }
  
  #turn-indicator {
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 2rem;
    color: white;
  }
  
  section[aria-label="Scoreboard"] {
  margin-bottom: 20px;
  padding: 12px;
    background: #ffffff;
    border: 1px solid yellow;
    border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  background: yellow;
}

.score-box {
  /* background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px; */
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 110px;
}

.score-box img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  margin-bottom: 6px;
}

.score-label {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
}

.score-number {
  margin-top: 6px;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}
  
  /* 3x3 board */
  #board {
    width: min(80vw, 420px);
    aspect-ratio: 1 / 1;
    margin: 0 auto 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 0; /* no gaps so lines touch */
    border: 2px solid #111827;
    background: #ffffff;
  }
  
  /* Each cell */
  .cell {
    border: 1px solid #111827;
    background: #ffffff;
    font-size: clamp(2rem, 7vw, 3rem);
    font-weight: 700;
    cursor: pointer;
  }

.cell-mark {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
  margin: auto;
}
  
  /* Buttons */
  #restart-btn,
  #replay-btn {
    padding: 12px 18px;
    border: 1px solid #374151;
    background: #111827;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.35rem;
  }
  
  /* Dialog style */
  #result-dialog {
    border: none;
    border-radius: 10px;
    padding: 20px 24px;
    background: yellowgreen;
    width: 250px;
    font-size: 1.75rem;
    text-align: center;
  }

  #result-dialog[open] {
    position: fixed;
    inset: 0;
    margin: auto;
    margin-top: 300px;
  }
  
  #result-message {
    margin-bottom: 12px;
  }

  @media (max-width: 600px) {
    body {
      padding: 14px;
    }

    main {
      width: 100%;
    }

    #board {
      width: min(92vw, 360px);
    }

    section[aria-label="Scoreboard"] {
      padding: 10px;
      gap: 8px;
    }

    .score-box {
      min-height: 92px;
      padding: 8px 6px;
    }

    .score-box img {
      width: 28px;
      height: 28px;
      margin-bottom: 4px;
    }

    .score-label {
      font-size: 0.9rem;
    }

    .score-number {
      font-size: 1.5rem;
      margin-top: 4px;
    }
  }