.game-container {
  max-width: 900px;
  min-height: 100vh;
  justify-content: flex-start;
}

/* Header style */
.game-header {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border-dim);
  padding-bottom: 15px;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: bold;
  border-bottom: 1px dashed transparent;
  transition: all 0.2s;
  display: inline-block;
}

.back-link:hover {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

.header-right {
  display: flex;
  justify-content: flex-end;
}

/* Scoreboard style */
.scoreboard-bar {
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border: 1px solid var(--border-dim);
  background-color: var(--accent);
  padding: 15px 10px;
  margin-bottom: 30px;
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.score-item .label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.score-item .val {
  font-size: 1.6rem;
  font-weight: bold;
}

.score-divider {
  width: 1px;
  height: 35px;
  background-color: var(--border-dim);
}

/* Game Window & Board Layout */
.game-window {
  width: 100%;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
  align-items: start;
}

@media (max-width: 768px) {
  .game-window {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.board-wrapper {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  background-color: #0d0d0d;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
}

.cell {
  border: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color 0.2s;
  padding: 15px;
}

/* Hover cell effect */
.cell:hover:not(:has(.ttt-mark-svg)) {
  background-color: #1a1a1a;
  cursor: pointer !important;
}

.cell:has(.ttt-mark-svg) {
  cursor: not-allowed !important;
}

/* Grid border cleaning */
.cell:nth-child(1), .cell:nth-child(2), .cell:nth-child(3) { border-top: none; }
.cell:nth-child(7), .cell:nth-child(8), .cell:nth-child(9) { border-bottom: none; }
.cell:nth-child(1), .cell:nth-child(4), .cell:nth-child(7) { border-left: none; }
.cell:nth-child(3), .cell:nth-child(6), .cell:nth-child(9) { border-right: none; }

/* SVG Mark styling */
.ttt-mark-svg {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Draw animation for X/O paths */
@keyframes ttt-draw-stroke {
  to {
    stroke-dashoffset: 0;
  }
}

.draw-path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
}

/* Board locking during AI turn */
.board-lock {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  cursor: wait !important;
}

.board-lock.hidden {
  display: none;
}

/* Sidebar Styling */
.ai-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.sidebar-box {
  border: 1px solid var(--border-dim);
  padding: 20px;
  position: relative;
  background-color: #0b0b0b;
}

.box-title {
  position: absolute;
  top: -10px;
  left: 15px;
  background-color: var(--bg);
  padding: 0 8px;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  border: 1px solid var(--border-dim);
}

.status-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.status-row:last-child {
  margin-bottom: 0;
}

.status-row .highlight {
  font-weight: bold;
}

.taunt-box {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.taunt-text {
  text-align: center;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}

.reset-button {
  width: 100%;
  padding: 12px;
  text-align: center;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.reset-button.confirm-state {
  border-color: #ff3333;
  color: #ff3333;
  background: rgba(255, 51, 51, 0.05);
}
.reset-button.confirm-state:hover {
  background: #ff3333;
  color: #ffffff;
}

/* Victory highlights */
.cell.winning-cell {
  background-color: var(--fg);
}
.cell.winning-cell .draw-path {
  stroke: var(--bg) !important;
}

@keyframes nextRoundPulse {
  0%, 100% { border-color: var(--border); box-shadow: 0 0 5px var(--glow-color); }
  50% { border-color: var(--muted); box-shadow: 0 0 15px var(--glow-color); }
}

.next-round-pulse {
  animation: nextRoundPulse 1.5s infinite;
  background-color: var(--fg);
  color: var(--bg);
}
.next-round-pulse:hover {
  background-color: var(--bg);
  color: var(--fg);
}

