html, body {
  height: 100%;
  overflow: hidden;
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-family: Segoe UI, Tahoma, Geneva, Verdana, sans-serif;
  padding: 15px;
  box-sizing: border-box;
  gap: 15px;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.game-header {
  text-align: center;
  color: #fff;
  flex-shrink: 0;

  & h1 {
    margin: 0 0 12px;
    font-size: 2.2em;
    font-weight: 700;
    text-shadow: 2px 2px 4px #0000004d;
  }

  & .game-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 1em;

    & .player-info, & .computer-info {
      display: flex;
      align-items: center;
      gap: 10px;
      background: #ffffff1a;
      padding: 10px 20px;
      border-radius: 8px;
      backdrop-filter: blur(10px);
    }

    & .label {
      font-weight: 600;
    }

    & .symbol {
      font-size: 1.5em;
      font-weight: 700;
      min-width: 40px;
      text-align: center;
    }

    & .vs {
      font-weight: 700;
      opacity: .8;
    }
  }
}

.icon-selector {
  background: #fffffff2;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 8px 32px #0003;
  width: 380px;
  max-width: 100%;
  flex-shrink: 0;

  & h3 {
    margin: 0 0 12px;
    color: #333;
    text-align: center;
    font-size: 1em;
    font-weight: 600;
  }

  & .icon-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;

    & .icon-btn {
      padding: 12px;
      font-size: 1.6em;
      border: 2px solid #ddd;
      border-radius: 10px;
      background: #fff;
      cursor: pointer;
      transition: all .3s;

      &:hover {
        border-color: #667eea;
        background: #f0f4ff;
        transform: scale(1.1);
      }

      &:active {
        transform: scale(.95);
      }
    }
  }
}

.game-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  width: 320px;
  height: 320px;
  background: #ffffff1a;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 8px 32px #0003;
  backdrop-filter: blur(10px);
  flex-shrink: 0;

  & .cell {
    background: #fff;
    border: none;
    border-radius: 10px;
    font-size: 2.5em;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    box-shadow: 0 4px 12px #0000001a;

    &:hover:not(.filled) {
      background: #f0f4ff;
      transform: scale(1.05);
    }

    &.filled {
      cursor: not-allowed;
    }

    &.winner {
      background: linear-gradient(135deg, gold 0%, #ffed4e 100%);
      color: #333;
      box-shadow: 0 0 20px #ffd70099;
      animation: .6s ease-in-out pulse;
    }
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

.game-status {
  background: #fffffff2;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 8px 32px #0003;
  width: 380px;
  max-width: 100%;
  text-align: center;
  flex-shrink: 0;

  & .status-message {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    min-height: 28px;
  }

  & .stats {
    display: flex;
    justify-content: space-around;
    gap: 15px;

    & .stat {
      display: flex;
      flex-direction: column;
      align-items: center;

      & .stat-label {
        font-size: .85em;
        color: #666;
        margin-bottom: 4px;
        font-weight: 500;
      }

      & .stat-value {
        font-size: 1.5em;
        font-weight: 700;
        color: #667eea;
      }
    }
  }
}

.button-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  flex-shrink: 0;

  & .btn {
    padding: 10px 28px;
    font-size: .9em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all .3s;
    text-transform: uppercase;
    letter-spacing: .4px;

    &.btn-primary {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: #fff;
      box-shadow: 0 4px 15px #667eea66;

      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px #667eea99;
      }

      &:active {
        transform: translateY(0);
      }
    }

    &.btn-secondary {
      background: #ffffffe6;
      color: #667eea;
      border: 2px solid #667eea;

      &:hover {
        background: #fff;
        transform: translateY(-2px);
        box-shadow: 0 4px 15px #0000001a;
      }

      &:active {
        transform: translateY(0);
      }
    }
  }
}

@media (width <= 600px) {
  .game-container {
    padding: 12px;
    gap: 12px;
  }

  .game-header {
    & h1 {
      margin: 0 0 8px;
      font-size: 1.8em;
    }

    & .game-info {
      flex-direction: column;
      gap: 10px;
      font-size: .9em;
    }
  }

  .game-board {
    width: 260px;
    height: 260px;
    gap: 8px;
    padding: 12px;

    & .cell {
      font-size: 2em;
    }
  }

  .icon-selector {
    width: 100%;
    max-width: 380px;
    padding: 12px;

    & h3 {
      margin: 0 0 10px;
      font-size: .95em;
    }

    & .icon-options {
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;

      & .icon-btn {
        padding: 10px;
        font-size: 1.4em;
      }
    }
  }

  .game-status {
    width: 100%;
    max-width: 380px;
    padding: 12px;

    & .status-message {
      font-size: 1em;
      margin-bottom: 10px;
    }

    & .stats {
      gap: 12px;

      & .stat-label {
        font-size: .8em;
      }

      & .stat-value {
        font-size: 1.3em;
      }
    }
  }

  .button-group {
    gap: 10px;

    & .btn {
      padding: 9px 22px;
      font-size: .85em;
    }
  }
}
