/* website/protochess/styles.css */

:root {
  --protochess-surface: rgba(15, 23, 42, 0.72);
  --protochess-surface-light: rgba(226, 232, 240, 0.4);
  --protochess-border: rgba(148, 163, 184, 0.28);
  --protochess-text: #f8fafc;
}

body.dark-mode .protochess-card {
  background: rgba(15, 23, 42, 0.55);
  color: var(--protochess-text);
}

body.light-mode .protochess-card {
  background: rgba(248, 250, 252, 0.85);
  color: #0f172a;
}

.protochess-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 960px) {
  .protochess-grid {
    grid-template-columns: 1fr;
  }
}

.protochess-board-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(30, 64, 175, 0.12), rgba(15, 23, 42, 0.5));
  padding: clamp(0.5rem, 1vw, 1.5rem);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
}

.protochess-board-wrapper canvas {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: #f8fafc;
}

.protochess-board-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 0.5rem;
  z-index: 5;
}

.protochess-board-toolbar button {
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

body.light-mode .protochess-board-toolbar button {
  background: rgba(226, 232, 240, 0.9);
  color: #0f172a;
}

.protochess-board-toolbar button:hover {
  transform: translateY(-2px);
  background: rgba(59, 130, 246, 0.85);
  color: #0f172a;
}

.protochess-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 18px;
  backdrop-filter: blur(12px);
  border: 1px solid var(--protochess-border);
  background: var(--protochess-surface);
}

body.light-mode .protochess-panel {
  background: rgba(248, 250, 252, 0.9);
}

.protochess-panel header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.protochess-turn {
  font-size: 1.05rem;
  font-weight: 600;
}

.protochess-status {
  margin: 0.25rem 0;
  color: rgba(248, 250, 252, 0.75);
}

body.light-mode .protochess-status {
  color: rgba(15, 23, 42, 0.7);
}

.protochess-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.protochess-controls button,
.protochess-controls select {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.4);
  color: #e2e8f0;
  padding: 0.4rem 0.8rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.protochess-controls select {
  min-width: 140px;
}

body.light-mode .protochess-controls button,
body.light-mode .protochess-controls select {
  background: rgba(226, 232, 240, 0.8);
  color: #0f172a;
}

.move-log {
  flex: 1;
  background: rgba(2, 6, 23, 0.35);
  border-radius: 12px;
  padding: 1rem;
  max-height: 260px;
  overflow-y: auto;
}

body.light-mode .move-log {
  background: rgba(226, 232, 240, 0.75);
}

.move-log ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.move-log li {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.match-section {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.2);
  border: 1px dashed rgba(148, 163, 184, 0.35);
}

body.light-mode .match-section {
  background: rgba(226, 232, 240, 0.35);
  border-color: rgba(100, 116, 139, 0.35);
}

.captured-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.captured-column {
  background: rgba(2, 6, 23, 0.25);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

body.light-mode .captured-column {
  background: rgba(226, 232, 240, 0.55);
  border-color: rgba(100, 116, 139, 0.28);
}

.captured-column h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.85);
}

body.light-mode .captured-column h3 {
  color: rgba(15, 23, 42, 0.8);
}

.captured-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.captured-piece {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: rgba(15, 23, 42, 0.55);
}

body.light-mode .captured-piece {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(100, 116, 139, 0.35);
}

.captured-empty {
  font-size: 0.85rem;
  color: rgba(248, 250, 252, 0.7);
}

body.light-mode .captured-empty {
  color: rgba(15, 23, 42, 0.65);
}

.match-section label {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.75);
}

body.light-mode .match-section label {
  color: rgba(15, 23, 42, 0.65);
}

.match-section input,
.match-section button {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
}

.match-section input {
  background: rgba(15, 23, 42, 0.4);
  color: #e2e8f0;
}

body.light-mode .match-section input {
  background: rgba(248, 250, 252, 0.9);
  color: #0f172a;
}

.match-section button {
  background: rgba(96, 165, 250, 0.18);
  color: #e0f2fe;
  cursor: pointer;
}

.match-section button:hover {
  background: rgba(59, 130, 246, 0.45);
  color: #0f172a;
}

.hidden {
  display: none !important;
}

.protochess-meta {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.protochess-meta article {
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

body.light-mode .protochess-meta article {
  background: rgba(248, 250, 252, 0.75);
  border-color: rgba(148, 163, 184, 0.3);
}

.protochess-meta h4 {
  margin-bottom: 0.35rem;
}

.protochess-meta p {
  margin: 0;
  line-height: 1.5;
}

.fullscreen-helper {
  font-size: 0.85rem;
  opacity: 0.75;
}
