.page {
  margin: 0 auto;
  padding: 24px 20px 40px;
  width: 100%;
  max-width: 730px;
}

.game-area {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 24px;
}

.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(450px, 100%);
}

.header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.title {
  margin: 0;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--accent);
}

.scores {
  display: flex;
  gap: 8px;
}

.score-panel {
  min-width: 78px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.score-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.score-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
}

.board {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  background: var(--surface);
  touch-action: none;
}

.status {
  min-height: 1.4em;
  margin: 14px 0 0;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 66px;
}

.btn {
  border: 2px solid var(--accent);
  padding: 0.6rem 1.1rem;
  background: var(--accent);
  color: var(--accent-contrast);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.btn:hover {
  background: transparent;
  color: var(--text);
}

.btn:active {
  transform: translateY(1px);
}

.btn-ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
}

.modal {
  width: 100%;
  max-width: 340px;
  padding: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.modal-title {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

.modal-message {
  margin: 0 0 22px;
}

.modal-message strong {
  color: var(--accent);
  font-size: 1.1rem;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions .btn {
  flex: 1;
}

/* Vista previa en el menú (?demo): solo el tablero */
.demo .header,
.demo .status,
.demo .sidebar,
.demo .modal-overlay {
  display: none;
}

.demo .page {
  padding: 12px;
}

@media (max-width: 730px) {
  .game-area {
    flex-direction: column;
    align-items: center;
  }

  .sidebar {
    width: 100%;
    max-width: 450px;
    padding-top: 0;
  }
}
