:root {
  --bg: #14161a;
  --panel: #1d2026;
  --border: #2c3038;
  --text: #e6e8eb;
  --muted: #8b93a1;
  --accent: #4fd1c5;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.2rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
}

.badge {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
}
.badge.connected { background: #1f4d3d; color: #6fe3a5; }
.badge.disconnected { background: #4d1f1f; color: #e36f6f; }

main {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.map-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  max-width: 100%;
}

#scene-container {
  width: min(80vw, 900px);
  height: 600px;
  max-width: 100%;
  background: #0c0d10;
  border-radius: 4px;
  overflow: hidden;
  cursor: grab;
}
#scene-container:active {
  cursor: grabbing;
}
#scene-container canvas {
  display: block;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0.6rem 0 0 0;
  max-width: 500px;
}

.muted {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
}

.control-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  min-width: 260px;
}

.control-panel h2 {
  font-size: 1rem;
  margin: 0 0 0.8rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.control-panel .pad {
  display: grid;
  grid-template-columns: repeat(3, 3rem);
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.control-panel .pad.vertical {
  grid-template-columns: repeat(4, 3.4rem);
}

.control-panel button {
  background: #262a32;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.3rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.control-panel button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.control-panel button:active {
  background: var(--accent);
  color: #0c0d10;
}

.fleet-panel {
  flex: 1;
  min-width: 320px;
}

.fleet-panel h2 {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 0.6rem 0;
}

.turtle-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.7rem;
  cursor: pointer;
}
.turtle-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.turtle-card h3 {
  margin: 0 0 0.4rem 0;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
}

.status-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #2c3038;
  color: var(--accent);
  text-transform: uppercase;
}

.status-tag.real-tag {
  background: #4d3d1f;
  color: #f2c94c;
}

.turtle-card .row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.fuel-bar {
  height: 6px;
  border-radius: 4px;
  background: #2c3038;
  overflow: hidden;
  margin: 0.3rem 0 0.5rem 0;
}
.fuel-bar div {
  height: 100%;
  background: var(--accent);
}

.inventory {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}
