/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--accent-blue);
  font-family: var(--font-mono);
}

.header__counter {
  font-family: var(--font-mono);
  font-size: var(--font-size-lg);
  color: var(--text-primary);
}

.header__stage {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* Main game area */
.game-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-lg);
}

/* Stage 1 layout: responsive grid */
.stage-one {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  min-width: 0;
}

.stage-one .col-right {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .stage-one {
    grid-template-columns: 1fr 1fr;
  }
  .stage-one .col-right {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1200px) {
  .stage-one {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 300px;
  }
  .stage-one .col-right {
    grid-column: auto;
    display: flex;
    flex-direction: column;
  }
}

.stage-one .col-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.stage-one .col-center {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.stage-one .col-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.stage-one .row-bottom {
  grid-column: 1 / -1;
}

/* Message log */
.message-log {
  grid-column: 1 / -1;
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 120px;
  overflow-y: auto;
}

.message-log__entry {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--border-light);
  animation: fadeIn var(--transition-base);
}

.message-log__entry:last-child {
  border-bottom: none;
  color: var(--text-primary);
}

/* Stage 2 layout */
.stage-two {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  min-width: 0;
}

.stage-two .col-left,
.stage-two .col-center,
.stage-two .col-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .stage-two {
    grid-template-columns: 1fr 1fr;
  }
  .stage-two .col-right {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1200px) {
  .stage-two {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 300px;
  }
  .stage-two .col-right {
    grid-column: auto;
  }
}

/* Stage 3 layout */
.stage-three {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  min-width: 0;
}

.stage-three .col-left,
.stage-three .col-center,
.stage-three .col-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .stage-three {
    grid-template-columns: 1fr 1fr;
  }
  .stage-three .col-right {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1200px) {
  .stage-three {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 300px;
  }
  .stage-three .col-right {
    grid-column: auto;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
