:root {
  color-scheme: dark;
  --ink: #071016;
  --panel: rgba(10, 22, 28, 0.78);
  --panel-strong: rgba(11, 28, 33, 0.92);
  --line: rgba(211, 242, 236, 0.2);
  --text: #ecfffb;
  --muted: #a8c4c3;
  --accent: #31b6a6;
  --accent-2: #f2c65d;
  --danger: #ef6c91;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.game {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 18%, rgba(49, 182, 166, 0.18), transparent 27rem),
    linear-gradient(145deg, #071016 0%, #0b1b22 46%, #100d17 100%);
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.hud {
  position: absolute;
  top: 18px;
  left: 18px;
  width: min(430px, calc(100vw - 36px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.hud__copy {
  display: grid;
  gap: 7px;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(1.2rem, 2.8vw, 1.72rem);
  line-height: 1.05;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.42;
}

.meters {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  gap: 8px 12px;
  margin-top: 15px;
  align-items: center;
}

.meter {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  min-width: 92px;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.meter strong {
  color: var(--text);
  font-size: 0.94rem;
}

.bar {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(236, 255, 251, 0.18);
  border-radius: 999px;
  background: rgba(236, 255, 251, 0.08);
}

.bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #86e9d8, var(--accent-2));
  transition: width 120ms linear;
}

.bar--wave span {
  background: linear-gradient(90deg, #8ca6ff, #ef6c91, var(--accent-2));
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.actions button {
  min-width: 128px;
  min-height: 42px;
  border: 1px solid rgba(236, 255, 251, 0.24);
  border-radius: 7px;
  color: var(--text);
  background: rgba(236, 255, 251, 0.1);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.actions button:hover,
.actions button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(236, 255, 251, 0.55);
  background: rgba(236, 255, 251, 0.16);
  outline: none;
}

#sealButton {
  color: #071016;
  border-color: transparent;
  background: var(--accent);
  font-weight: 800;
}

#sealButton:disabled {
  color: rgba(7, 16, 22, 0.65);
  background: rgba(49, 182, 166, 0.45);
  cursor: default;
  transform: none;
}

.status {
  min-height: 2.7em;
  margin-top: 12px;
  color: #d9f7f0;
  font-size: 0.88rem;
}

@media (max-width: 720px) {
  .game {
    min-height: 640px;
  }

  .hud {
    top: 10px;
    left: 10px;
    width: calc(100vw - 20px);
    padding: 13px;
  }

  h1 {
    font-size: 1.18rem;
    max-width: none;
  }

  p {
    font-size: 0.88rem;
  }

  .actions button {
    flex: 1 1 130px;
  }
}
