:root {
  --ink: #d6ffe8;
  --panel-bg: rgba(8, 20, 24, 0.76);
  --panel-edge: rgba(151, 241, 208, 0.35);
  --accent: #9dffb1;
  --muted: #8db7aa;
  --warn: #ffd39f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Cascadia Mono", "Consolas", "Courier New", monospace;
  background: radial-gradient(circle at 12% 10%, #24342e 0%, #101822 45%, #070b12 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 84% 22%, rgba(58, 138, 116, 0.12), transparent 42%),
    radial-gradient(circle at 16% 75%, rgba(184, 121, 74, 0.08), transparent 44%);
}

#asciiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

#uiPanel {
  position: fixed;
  top: 16px;
  left: 16px;
  width: min(460px, calc(100vw - 32px));
  padding: 14px 14px 12px;
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  background: var(--panel-bg);
  backdrop-filter: blur(4px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
  z-index: 10;
}

h1 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.subtitle {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.seedRow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.seedRow label {
  color: var(--warn);
  font-size: 0.82rem;
}

#seedInput,
#applySeedBtn {
  font: inherit;
  color: var(--ink);
}

#seedInput {
  padding: 6px 8px;
  border: 1px solid rgba(167, 255, 226, 0.42);
  border-radius: 6px;
  background: rgba(9, 24, 27, 0.75);
}

#seedInput:focus {
  outline: 1px solid rgba(157, 255, 177, 0.86);
  outline-offset: 1px;
}

#applySeedBtn {
  padding: 6px 10px;
  border: 1px solid rgba(157, 255, 177, 0.65);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(108, 182, 127, 0.35), rgba(34, 56, 39, 0.7));
  cursor: pointer;
}

#applySeedBtn:hover {
  filter: brightness(1.08);
}

#applySeedBtn:active {
  transform: translateY(1px);
}

.controls {
  margin: 10px 0 10px;
  color: #b2d2c7;
  font-size: 0.79rem;
}

#hud {
  display: grid;
  gap: 4px;
  color: #d7f5eb;
  font-size: 0.82rem;
}

#hud .k {
  color: #9feab7;
}

@media (max-width: 860px) {
  #uiPanel {
    width: calc(100vw - 24px);
    top: 12px;
    left: 12px;
    padding: 12px;
  }

  .seedRow {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .seedRow label {
    margin-bottom: -2px;
  }

  #applySeedBtn {
    justify-self: start;
  }
}
