:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #0d1117;
  color: #e6edf3;
}

body {
  margin: 0;
  padding: 1rem;
}

header {
  border-bottom: 1px solid #30363d;
  margin-bottom: 1rem;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
}

.subtitle, .hint {
  color: #8b949e;
  font-size: 0.9rem;
}

main {
  max-width: 1100px;
  margin: 0 auto;
}

.panel {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.85rem;
}

label.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

input, select, button {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #30363d;
  background: #0d1117;
  color: #e6edf3;
}

button {
  cursor: pointer;
  background: #238636;
  border-color: #2ea043;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.board {
  display: grid;
  grid-template-columns: 1.4rem repeat(10, 2rem);
  gap: 2px;
  width: max-content;
}

.cell, .axis {
  align-items: center;
  border: 1px solid #30363d;
  display: flex;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.axis {
  border-color: transparent;
  color: #8b949e;
  font-size: 0.75rem;
  width: 1.4rem;
}

.cell {
  background: #0d1117;
}

.cell.ship {
  background: #30363d;
}

.cell.hit {
  background: #da3633;
}

.cell.shot {
  outline: 2px solid #58a6ff;
}

.interactive .cell {
  cursor: pointer;
}

.interactive .cell:hover {
  border-color: #58a6ff;
}

.log {
  list-style: none;
  margin: 0;
  max-height: 18rem;
  overflow-y: auto;
  padding: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

.log li {
  border-bottom: 1px solid #21262d;
  padding: 0.35rem 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.log .ok { color: #3fb950; }
.log .error { color: #f85149; }
.log .warn { color: #d29922; }
.log .ask { color: #58a6ff; }
.log .result { color: #a371f7; font-weight: bold; }
.log .dim { color: #8b949e; }
