:root {
  --bg: #0b1020;
  --panel: #121a33;
  --panel2: #0f1730;
  --text: #e7e9f2;
  --muted: #9aa3be;
  --accent: #67b7ff;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);
  background: radial-gradient(1200px 600px at 30% 0%, #1a2550 0%, var(--bg) 60%);
  overflow-x: hidden; /* prevent sideways swipe on mobile */
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(8, 12, 26, 0.72);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brandRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand { font-weight: 750; letter-spacing: 0.2px; }

.iconBtn {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

.controls--panel {
  margin-top: 10px;
}

.panel__sectionTitle {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 6px;
}

label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

select, input, button {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}

button {
  cursor: pointer;
  background: rgba(103, 183, 255, 0.16);
  border-color: rgba(103, 183, 255, 0.35);
  min-height: 40px; /* better touch target */
}
button:hover { background: rgba(103, 183, 255, 0.22); }
button:active { transform: translateY(1px); }

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: calc(100vh - 62px);
  position: relative;
}

.backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 20;
}

.panel {
  padding: 14px 14px 24px;
  background: linear-gradient(180deg, rgba(18,26,51,0.92), rgba(15,23,48,0.92));
  border-right: 1px solid rgba(255,255,255,0.08);
  overflow: auto;
  z-index: 30;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel__head h2 {
  margin: 8px 0;
}

.panel h2, .panel h3 { margin: 8px 0; }
.panel hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 16px 0; }

.tile-details {
  font-size: 13px;
  color: var(--text);
  line-height: 1.35;
}

.panel__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.panel__actions button.secondary { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.14); }
.panel__actions button.danger { background: rgba(255, 107, 107, 0.14); border-color: rgba(255, 107, 107, 0.35); }

.notes { color: var(--muted); font-size: 12px; line-height: 1.4; }

.board {
  position: relative;
  overflow: hidden;
}

.hud {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  z-index: 15;
  pointer-events: none;
}

.hud > * {
  pointer-events: auto;
}

.hud__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom {
  display: flex;
  gap: 6px;
}

.zoom .iconBtn {
  width: 42px;
  justify-content: center;
}

.resources--hud {
  padding: 8px 10px;
  border-radius: 12px;
}

.fleets {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: 260px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(18,26,51,0.82);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(8px);
}

.fleets__title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.fleets__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fleetBtn {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fleets__hint {
  margin-top: 10px;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
}

.board__wrap {
  width: 100%;
  height: 100%;
}

.board__svg {
  width: 100%;
  height: 100%;
  touch-action: none; /* allow pointer interactions on mobile */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.resources {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(18,26,51,0.8);
  border: 1px solid rgba(255,255,255,0.1);
  min-width: 220px;
  max-width: 100%;
}
.resources__label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.resources__vals { display: flex; justify-content: space-between; gap: 12px; }
.resources .k { color: var(--muted); }

/* SVG styles */
.hex { cursor: pointer; }
.hex polygon {
  fill: rgba(255,255,255,0.03);
  stroke: rgba(255,255,255,0.14);
  stroke-width: 1.3;
}

.hex.undiscovered polygon {
  fill: rgba(0,0,0,0.25);
  stroke: rgba(255,255,255,0.10);
}

.hex.discovered polygon {
  fill: rgba(255,255,255,0.04);
}

.hex.highlight polygon {
  stroke: rgba(103,183,255,0.9);
  stroke-width: 2.4;
}

.hex.moveCandidate polygon {
  fill: rgba(103,183,255,0.10);
  stroke: rgba(103,183,255,0.35);
}

.tile-label {
  font-size: 11px;
  fill: rgba(255,255,255,0.55);
}

.ship {
  cursor: pointer;
}

.ship.selected {
  filter: drop-shadow(0 0 10px rgba(103,183,255,0.55));
}

.selectRing {
  pointer-events: none;
}

.selectRing circle {
  fill: rgba(103,183,255,0.10);
  stroke: rgba(103,183,255,0.85);
  stroke-width: 2;
}

.lasso {
  pointer-events: none;
}

.lasso circle {
  fill: rgba(103,183,255,0.08);
  stroke: rgba(103,183,255,0.55);
  stroke-width: 2;
  stroke-dasharray: 6 6;
}

.content {
  pointer-events: none;
}
