:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #070b14;
  color: #e6f0ff;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.ui {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  pointer-events: none;
}

.panel {
  width: min(26rem, calc(100vw - 2rem));
  border: 1px solid rgba(179, 208, 255, 0.25);
  background: rgba(7, 11, 20, 0.75);
  backdrop-filter: blur(7px);
  border-radius: 0.8rem;
  padding: 0.9rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

h1 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
}

.small {
  margin: 0 0 0.8rem;
  opacity: 0.85;
  font-size: 0.86rem;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.8rem;
  margin-bottom: 0.7rem;
}

.stats div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 0.85rem;
}

.stats span {
  color: #a1badf;
}

.stats strong {
  color: #f3f8ff;
}

.bars {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.bar-wrap label {
  display: block;
  margin-bottom: 0.2rem;
  color: #a1badf;
  font-size: 0.78rem;
}

.bar {
  width: 100%;
  height: 0.7rem;
  background: rgba(161, 186, 223, 0.16);
  border: 1px solid rgba(161, 186, 223, 0.45);
  border-radius: 999px;
  overflow: hidden;
}

.bar i {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00ff9d, #44d7ff);
}

.bar.lean i {
  width: 50%;
  margin-left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #ff6f91, #ffd166);
}

.controls {
  pointer-events: auto;
  display: flex;
  gap: 0.45rem;
}

button {
  appearance: none;
  border: 1px solid rgba(161, 186, 223, 0.5);
  background: #0c1630;
  color: #d9e8ff;
  padding: 0.5rem 0.75rem;
  border-radius: 0.45rem;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  background: #16274e;
}
