/* Modern color scheme */
  html, body, div, span, applet, object, iframe,
  h1, h2, h3, h4, h5, h6, p, blockquote, pre,
  a, abbr, acronym, address, big, cite, code,
  del, dfn, em, img, ins, kbd, q, s, samp,
  small, strike, strong, sub, sup, tt, var,
  b, u, i, center,
  dl, dt, dd, ol, ul, li,
  fieldset, form, label, legend,
  table, caption, tbody, tfoot, thead, tr, th, td,
  article, aside, canvas, details, embed,
  figure, figcaption, footer, header, hgroup,
  menu, nav, output, ruby, section, summary,
  time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
  }
  :root {
    --primary-color: #219EBC;      /* Blue Green */
    --secondary-color: #023047;    /* Prussian blue */
    --accent-color: #FB8500;       /* UT orange */
    --light-color: #307b9e;        /* Sky blue */
    --highlight-color: #FFB703;    /* Selective yellow */
    --text-color: #fff;
    --cell-bg: rgba(142, 202, 230, 0.15);  /* Sky blue with transparency */
    --x-color: #FB8500;            /* UT orange */
    --o-color: #fad169;            /* Selective yellow */
    --hover-color: rgba(142, 202, 230, 0.3);
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
  }

  body {
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    background-size: cover;
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
  }

  body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(var(--light-color) 1px, transparent 1px),
        radial-gradient(var(--light-color) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
    opacity: 0.05;
    z-index: -1;
  }

  .container {
    max-width: 500px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background-color: rgba(2, 48, 71, 0.85);  /* Prussian blue with transparency */
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(142, 202, 230, 0.2);
    backdrop-filter: blur(10px);
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  h1 {
    /* color: var(--light-color); */
    color: rgb(255, 255, 255);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    display: inline-block;
  }

  /* h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--highlight-color), transparent);
  } */

  button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 0.5rem;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    z-index: 1;
  }

  button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: all 0.4s ease;
    z-index: -1;
  }

  button:hover {
    background-color: var(--accent-color);
    /* transform: translateY(-2px); */
  }

  button:hover::before {
    left: 100%;
  }

  button:active {
    transform: translateY(0);
  }
  .buttonBottomPadding {
    margin-bottom: 5px;
  }
  .board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1/1;
    /* margin: 2rem auto; */
  }

  .cell {
    background-color: var(--cell-bg);
    border-radius: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    border: 1px solid rgba(142, 202, 230, 0.3);
    backdrop-filter: blur(5px);
  }

  .cell:hover {
    background-color: var(--hover-color);
    transform: scale(1.03);
  }

  .cell[data-value="X"] {
    color: var(--x-color);
    text-shadow: 0 0 5px rgba(251, 133, 0, 0.3);
  }

  .cell[data-value="O"] {
    color: var(--o-color);
    text-shadow: 0 0 5px rgba(255, 183, 3, 0.3);
  }

  .game-info {
    /* margin: 1rem 0; */
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--light-color);
    /* padding: 0.5rem 1.5rem; */
    /* background-color: rgba(142, 202, 230, 0.1); */
    /* border-radius: 2rem; */
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
  }

  .controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    width: 100%;
  }

  .controls button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    flex: 1;
  }

  /* Game over modal */
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(2, 48, 71, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(8px);
  }

  .modal-content {
    background-color: rgba(5, 72, 88, 0.95);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(142, 202, 230, 0.5);
    animation: modalFadeIn 0.3s ease-out;
  }

  @keyframes modalFadeIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }

  .modal h2 {
    color: var(--highlight-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
  }

  .modal p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
  }

  .modal button {
    background-color: var(--highlight-color);
  }

  .modal button:hover {
    background-color: var(--accent-color);
  }

  /* Menu page styles */
  .menu-button {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .menu-button i {
    margin-right: 0.5rem;
  }
  
  /* Add a link to Google Fonts */
  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
  
  /* Responsive design */
  @media (max-width: 768px) {
    .container {
      max-width: 90%;
      padding: 1.5rem;
    }
    h1 {
      font-size: 2rem;
    }
    .board {
      max-width: 320px;
    }
    .cell {
      font-size: 2.5rem;
    }
    .controls {
      flex-direction: column;
      width: 100%;
    }
    .controls button {
      max-width: 100%;
    }
  }

  @media (max-width: 480px) {
    .container {
      max-width: 95%;
      padding: 1.25rem 0.75rem;
      gap: 1rem;
    }
    h1 {
      font-size: 1.6rem;
      margin-bottom: 0.75rem;
    }
    .game-info {
      font-size: 1.2rem;
      margin: 0.75rem 0;
    }
    button {
      padding: 0.75rem 1.25rem;
      font-size: 0.95rem;
    }
    .board {
      max-width: 100%;
      margin: 1rem auto;
    }
    .cell {
      font-size: 1.8rem;
    }
    .modal-content {
      width: 95%;
      padding: 1.5rem 1rem;
    }
  }