:root {
  color-scheme: dark;
  --bg: #060b12;
  --panel: rgba(11, 20, 33, 0.88);
  --panel-border: rgba(147, 214, 255, 0.18);
  --text: #e8f4ff;
  --muted: #9cb7cf;
  --accent: #77ffd1;
  --accent-strong: #ffd166;
  --danger: #ff5d73;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top, rgba(119, 255, 209, 0.14), transparent 32%),
    radial-gradient(circle at 80% 20%, rgba(255, 209, 102, 0.14), transparent 24%),
    linear-gradient(180deg, #08111d 0%, var(--bg) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 34rem;
  height: 34rem;
  top: -10rem;
  left: -8rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(119, 255, 209, 0.24), rgba(119, 255, 209, 0.04) 48%, transparent 72%);
  filter: blur(20px);
  animation: driftGlow 18s ease-in-out infinite;
}

body::after {
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px),
    radial-gradient(circle at 84% 18%, rgba(125, 183, 255, 0.18), transparent 22%);
  background-size: 54px 54px, 54px 54px, auto;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.72), transparent 84%);
  opacity: 0.7;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(160, 198, 227, 0.14);
}

.nav-link.current {
  background: linear-gradient(135deg, var(--accent), #7db7ff);
  color: #04101a;
  font-weight: 700;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--accent);
}

h1,
h2 {
  font-family: "Rajdhani", sans-serif;
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 0.95;
}

.lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 1rem;
}

.page-note {
  margin: 10px 0 0;
  color: var(--muted);
}

.page-note strong {
  color: var(--text);
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(160, 198, 227, 0.16);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.form-panel {
  padding: 22px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field span {
  font-size: 0.84rem;
  color: var(--muted);
}

.inline-tip {
  grid-column: 1 / -1;
  margin: -2px 2px 0;
  color: var(--accent-strong);
  font-size: 0.92rem;
}

.inline-tip strong {
  color: var(--text);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(160, 198, 227, 0.18);
  border-radius: 16px;
  background: rgba(5, 12, 22, 0.75);
  color: var(--text);
  padding: 12px 14px;
}

textarea {
  resize: vertical;
  min-height: 110px;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(160, 198, 227, 0.16);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(5, 12, 22, 0.6);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 700;
  cursor: pointer;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(135deg, #8bffbf, #ffe07a);
  color: #102114;
  box-shadow: 0 12px 28px rgba(139, 255, 191, 0.18);
}

#generate-button {
  background: linear-gradient(135deg, var(--accent), #7db7ff);
  color: #04101a;
}

#randomize-button {
  background: linear-gradient(135deg, #ffe07a, #ff9d6c);
  color: #221000;
}

#download-button {
  background: linear-gradient(135deg, var(--accent-strong), #ff8f5d);
  color: #1b0d00;
}

#preview-button {
  background: linear-gradient(135deg, #88d2ff, #ffd57b);
  color: #11161d;
}

#editor-button {
  background: linear-gradient(135deg, #9dd7ff, #8bffbf);
  color: #04101a;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  margin: 16px 2px 0;
  color: var(--muted);
}

.finder-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(160, 198, 227, 0.16);
  display: grid;
  gap: 12px;
}

.finder-row {
  display: grid;
}

.finder-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(160, 198, 227, 0.16);
}

.finder-status {
  margin-top: 0;
}

.finder-results {
  display: grid;
  gap: 8px;
}

.editor-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(160, 198, 227, 0.16);
  display: grid;
  gap: 14px;
}

.editor-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.editor-head h2 {
  font-size: 1.45rem;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.editor-actions {
  margin-top: 0;
}

.editor-primary {
  background: linear-gradient(135deg, #7fffe4, #8bb7ff);
  color: #031019;
}

.editor-secondary,
.editor-mini {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(160, 198, 227, 0.16);
}

.editor-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.editor-pill {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  text-align: center;
}

.editor-pill strong {
  color: var(--text);
}

.side-panel {
  padding: 20px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.cover-wrap {
  display: flex;
  justify-content: center;
  padding: 8px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.preview-wrap {
  display: flex;
  justify-content: center;
  padding: 8px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

#cover-canvas {
  width: min(100%, 256px);
  height: auto;
  border-radius: 22px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

#map-preview-canvas {
  width: min(100%, 280px);
  height: auto;
  border-radius: 22px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, #040912 0%, #0c1520 100%);
}

.preview-actions {
  margin-top: 0;
}

.preview-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-block {
  display: grid;
  gap: 10px;
}

.summary-list,
.download-list,
.warning-list {
  display: grid;
  gap: 8px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.summary-line strong {
  color: var(--text);
}

.warning-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.warning-line span {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

.warning-line strong {
  color: var(--text);
  text-align: right;
}

.warning-line.good {
  border-color: rgba(119, 255, 209, 0.24);
}

.warning-line.warn {
  border-color: rgba(255, 209, 102, 0.26);
}

.warning-line.bad {
  border-color: rgba(255, 93, 115, 0.28);
}

.warning-line.neutral {
  border-color: rgba(147, 214, 255, 0.16);
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 24px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes driftGlow {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(2rem, 1.5rem, 0) scale(1.08); }
  100% { transform: translate3d(-1rem, 2rem, 0) scale(0.96); }
}
