:root {
  color-scheme: dark;
}

html,
body {
  height: 100%;
  margin: 0;
  background: #0b0f18;
  overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

canvas#game {
  display: block;
  width: 100vw;
  height: 100vh;
}

#hud {
  position: fixed;
  left: 16px;
  top: 16px;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

#hud .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  pointer-events: none;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 14, 24, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1;
}

.pill-button {
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill-button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(14, 20, 34, 0.78);
}

.pill-button:active {
  transform: translateY(1px);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: -1px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  background: rgba(170, 220, 255, 0.9);
}

kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.panel {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
}

.panel.hidden {
  display: none;
}

.panel-inner {
  width: min(520px, calc(100vw - 24px));
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 14, 24, 0.85);
  padding: 16px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
}

.panel-inner-wide {
  width: min(720px, calc(100vw - 24px));
}

.panel-title {
  font-weight: 800;
  letter-spacing: 0.2px;
  margin: 2px 2px 12px 2px;
  color: rgba(255, 255, 255, 0.92);
}

.panel-sub {
  margin: -6px 2px 12px 2px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

.field input,
.field select {
  width: 100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  outline: none;
}

.field input[type="color"] {
  padding: 6px;
  height: 42px;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.sections-actions {
  display: flex;
  gap: 10px;
  margin: 6px 0 12px 0;
  flex-wrap: wrap;
}

.sections-list {
  max-height: min(52vh, 520px);
  overflow: auto;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.section-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 14, 24, 0.6);
  margin-bottom: 10px;
}

.section-item:last-child {
  margin-bottom: 0;
}

.section-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.92);
}

.section-desc {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.35;
}

.section-badge {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  flex: 0 0 auto;
}

.scorebar {
  pointer-events: none;
  position: relative;
  width: min(420px, calc(100vw - 32px));
  height: 22px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 14, 24, 0.65);
}

.scorebar-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(
    90deg,
    rgba(170, 220, 255, 0.9),
    rgba(255, 226, 140, 0.9)
  );
  filter: blur(0px);
}

.scorebar-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
