body {
  background: linear-gradient(135deg, #1a2a33 0%, #263f47 100%);
  color: #a8bfc9;
  font-family: 'Outfit', sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  min-height: 100vh;
  animation: fadeIn 0.5s;
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
.screen.active {
  display: flex;
}

.title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #f2b137;
  margin-bottom: 1.5rem;
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 0 2px 12px #1a2a33cc;
}

.mark-selector {
  display: flex;
  gap: 1.5rem;
  background: linear-gradient(90deg, #263f47 60%, #1f3540 100%);
  border-radius: 18px;
  padding: 1.2rem 2.5rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 4px 24px #1a2a3340;
}
.mark-option {
  font-size: 2.2rem;
  font-weight: 700;
  background: none;
  border: none;
  color: #a8bfc9;
  padding: 0.7rem 2.2rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px #1a2a3320;
}
.mark-option.selected, .mark-option:focus {
  background: #1f3540;
  color: #f2b137;
  box-shadow: 0 0 0 2px #f2b13780;
}
.mark-option:hover:not(.selected) {
  background: #263f47;
  color: #3cc4bf;
}

.note {
  color: #a8bfc9;
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  text-align: center;
  letter-spacing: 1px;
}

.difficulty-label {
  color: #a8bfc9;
  font-size: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0.2rem;
  display: block;
  text-align: center;
  font-weight: 700;
  letter-spacing: 1px;
}
.difficulty-select {
  width: 100%;
  max-width: 220px;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  border: none;
  background: #263f47;
  color: #f2b137;
  font-size: 1.1rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  margin-bottom: 1.2rem;
  margin-left: auto;
  margin-right: auto;
  display: block;
  outline: none;
  box-shadow: 0 2px 8px #1a2a3320;
  transition: background 0.2s, color 0.2s;
}
.difficulty-select:focus {
  background: #1f3540;
  color: #3cc4bf;
}

.btn {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  padding: 1.1rem 2.7rem;
  margin: 0.6rem 0;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  letter-spacing: 1px;
  box-shadow: 0 2px 12px #1a2a3320;
}
.btn.yellow {
  background: linear-gradient(90deg, #f2b137 80%, #f2cb7b 100%);
  color: #1a2a33;
}
.btn.teal {
  background: linear-gradient(90deg, #3cc4bf 80%, #7beee7 100%);
  color: #1a2a33;
}
.btn.gray {
  background: #a8bfc9;
  color: #1a2a33;
}
.btn:active, .btn:hover {
  opacity: 0.93;
  box-shadow: 0 4px 18px #1a2a3340;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 400px;
  margin-bottom: 1.5rem;
}
.game-status {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f2b137;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px #1a2a3340;
}
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #a8bfc9;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
.icon-btn:hover {
  background: #263f47;
  color: #f2b137;
}
.icon {
  width: 28px;
  height: 28px;
}

.game-board {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: linear-gradient(135deg, #263f47 60%, #1f3540 100%);
  border-radius: 22px;
  padding: 2rem 2.2rem;
  margin-bottom: 2.2rem;
  box-shadow: 0 8px 32px #1a2a3340;
}
.row {
  display: flex;
  gap: 0.7rem;
}
.cell {
  width: 68px;
  height: 68px;
  background: #1f3540;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border 0.2s;
  border: 2px solid transparent;
  cursor: pointer;
}
.cell.x {
  color: #3cc4bf;
  text-shadow: 0 2px 8px #1a2a3340;
}
.cell.o {
  color: #f2b137;
  text-shadow: 0 2px 8px #1a2a3340;
}
.cell:empty {
  color: #a8bfc9;
}
.cell:hover:empty {
  background: #263f47;
  border: 2px solid #3cc4bf;
  color: #3cc4bf;
}
.cell.win {
  background: #f2b13733;
  box-shadow: 0 0 18px 4px #f2b137cc, 0 2px 8px rgba(0,0,0,0.08);
  border: 2.5px solid #f2b137;
  z-index: 2;
}

.score-board {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  margin-top: 1.2rem;
  background: linear-gradient(90deg, #1f3540 60%, #263f47 100%);
  border-radius: 14px;
  padding: 1rem 1.4rem;
  gap: 1.2rem;
  box-shadow: 0 2px 12px #1a2a3320;
}
.score {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
  min-width: 80px;
  box-shadow: 0 2px 8px #1a2a3320;
}
.score span {
  font-size: 1.4rem;
  margin-top: 0.2rem;
}
.score.teal {
  background: linear-gradient(90deg, #3cc4bf 80%, #7beee7 100%);
  color: #1a2a33;
}
.score.yellow {
  background: linear-gradient(90deg, #f2b137 80%, #f2cb7b 100%);
  color: #1a2a33;
}
.score.gray {
  background: #a8bfc9;
  color: #1a2a33;
}

.message.small {
  font-size: 1.25rem;
  color: #f2b137;
  margin-bottom: 1.2rem;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px #1a2a3340;
}
.winner-display {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.7rem;
  justify-content: center;
}
.winner-mark.x {
  color: #3cc4bf;
  font-size: 2.7rem;
  font-weight: 700;
  text-shadow: 0 2px 8px #1a2a3340;
}
.winner-mark.o {
  color: #f2b137;
  font-size: 2.7rem;
  font-weight: 700;
  text-shadow: 0 2px 8px #1a2a3340;
}
.winner-text {
  font-size: 1.4rem;
  color: #a8bfc9;
  font-weight: 700;
  letter-spacing: 1px;
}
.end-buttons {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 1.7rem;
  justify-content: center;
}

.popup {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26, 42, 51, 0.92);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.4s;
}
.popup.active {
  display: flex;
}
.popup-content {
  background: linear-gradient(135deg, #263f47 60%, #1f3540 100%);
  border-radius: 22px;
  padding: 2.2rem 2.7rem;
  box-shadow: 0 8px 32px #1a2a3340;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.popup-buttons {
  display: flex;
  gap: 1.7rem;
  margin-top: 1.7rem;
}

@media (max-width: 600px) {
  #app, .screen {
    min-height: 100vh;
    width: 100vw;
    padding: 0 0.5rem;
  }
  .game-board, .score-board, .top-bar {
    max-width: 98vw;
  }
  .cell {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    border-radius: 8px;
    padding: 0;
  }
  .mark-selector {
    padding: 0.7rem 0.7rem;
  }
  .popup-content {
    padding: 1.2rem 0.7rem;
  }
} 