* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at 20% 10%, #1d4ed8 0%, #0f172a 45%, #020617 100%);
  color: #e2e8f0;
  min-height: 100vh;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px;
}

h1 {
  margin-top: 0;
  margin-bottom: 18px;
  letter-spacing: 0.4px;
}

.panel {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.92) 0%, rgba(2, 6, 23, 0.92) 100%);
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.35);
}

.hidden {
  display: none;
}

h2,
h3 {
  margin-top: 0;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.inline-row {
  flex-wrap: wrap;
}

label {
  color: #cbd5e1;
  font-weight: 600;
}

input {
  background: rgba(11, 18, 32, 0.85);
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 9px 11px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

button {
  border: 1px solid #334155;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  color: #e2e8f0;
  border-radius: 10px;
  padding: 9px 13px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}

button:hover {
  background: linear-gradient(180deg, #475569 0%, #334155 100%);
  border-color: #64748b;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

.actions,
.join-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.status {
  color: #7dd3fc;
  font-weight: 600;
}

.ship-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.ship-btn.done {
  background: #065f46;
}

.ship-btn.selected {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.grid {
  display: grid;
  grid-template-columns: repeat(10, 34px);
  grid-template-rows: repeat(10, 34px);
  gap: 3px;
  user-select: none;
  background: #020617;
  padding: 8px;
  border-radius: 10px;
  width: max-content;
  border: 1px solid #334155;
}

.cell {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: linear-gradient(180deg, #0b2447 0%, #0a1f3f 100%);
}

.cell.ship {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.cell.hit {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
}

.cell.miss {
  background: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
}

.enemy .cell {
  cursor: pointer;
}

.enemy .cell.ship {
  background: #0b2447;
}

.battle-boards {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.log {
  max-height: 210px;
  overflow-y: auto;
  background: rgba(2, 6, 23, 0.95);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #334155;
}

.log p {
  margin: 0 0 6px;
}
