:root {
  color-scheme: dark;
  --bg: #070712;
  --panel: rgba(16, 14, 31, 0.88);
  --panel-2: rgba(24, 18, 44, 0.92);
  --line: rgba(177, 99, 255, 0.23);
  --text: #f5eeff;
  --muted: #b9a8d6;
  --purple: #a950ff;
  --purple-2: #6e2bff;
  --cyan: #55ddff;
  --danger: #ff5570;
  --success: #72ffa9;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 10%, rgba(142, 39, 255, 0.28), transparent 32%),
              radial-gradient(circle at 85% 15%, rgba(70, 18, 180, 0.35), transparent 34%),
              linear-gradient(135deg, #05050e 0%, #09071a 45%, #130926 100%);
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
}

.app-shell {
  width: min(1500px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 70px;
  position: relative;
}

.hero-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: start;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(16, 12, 31, 0.92), rgba(31, 18, 63, 0.76));
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero-header::after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  right: -180px;
  top: -260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(178, 81, 255, 0.35), transparent 68%);
}

.eyebrow {
  color: var(--purple);
  font-weight: 800;
  letter-spacing: 0.22em;
  margin: 0 0 8px;
}

h1, h2, p { margin-top: 0; }

h1 {
  font-size: clamp(38px, 6vw, 78px);
  line-height: 0.9;
  margin-bottom: 16px;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(169, 80, 255, 0.55);
}

h2 {
  font-size: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}

.lead {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
}

.security-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
  border-radius: 999px;
  border: 1px solid rgba(114, 255, 169, 0.25);
  background: rgba(22, 80, 48, 0.18);
  color: #d7ffe5;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 16px var(--success);
}

.logout-form { position: relative; z-index: 1; }

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

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

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

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel p,
.hint,
.limit-note {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #dccdff;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(175, 105, 255, 0.26);
  background: rgba(8, 8, 18, 0.84);
  color: var(--text);
  border-radius: 14px;
  min-height: 42px;
  padding: 10px 12px;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(183, 95, 255, 0.85);
  box-shadow: 0 0 0 4px rgba(169, 80, 255, 0.15);
}


.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.45;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--purple);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--purple);
}

.grid-1,
.grid-2,
.grid-4,
.grid-5,
.grid-6 {
  display: grid;
  gap: 14px;
}
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.compact-row { margin-top: 14px; }

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 14px;
}
.toggle-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(175, 105, 255, 0.18);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.035);
}
.toggle-row.stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.toggle-row.single { margin-bottom: 0; }

.slider-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.slider-list label {
  grid-template-columns: 88px 32px 1fr;
  align-items: center;
}
.slider-list output { color: var(--cyan); font-weight: 900; }

.enemy-table {
  display: grid;
  gap: 8px;
}
.enemy-head,
.enemy-row {
  display: grid;
  grid-template-columns: 1.35fr 0.55fr 0.7fr 0.7fr 0.7fr 0.7fr;
  gap: 10px;
  align-items: center;
}
.enemy-head {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 8px;
}
.enemy-row {
  padding: 9px;
  border: 1px solid rgba(175, 105, 255, 0.16);
  border-radius: 18px;
  background: rgba(255,255,255,0.028);
}
.enemy-row strong {
  display: grid;
  gap: 2px;
}
.enemy-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.action-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
}
.action-left { display: flex; gap: 12px; flex-wrap: wrap; }

.primary-btn,
.ghost-btn {
  min-height: 46px;
  border: 0;
  border-radius: 15px;
  padding: 0 20px;
  color: white;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}
.primary-btn {
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  box-shadow: 0 14px 32px rgba(130, 44, 255, 0.34);
}
.ghost-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.primary-btn:hover,
.ghost-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.primary-btn:disabled { opacity: 0.55; cursor: wait; transform: none; }
.full { width: 100%; margin-top: 16px; }

.progress-card {
  border: 1px solid rgba(85, 221, 255, 0.22);
  border-radius: 18px;
  background: rgba(12, 20, 42, 0.72);
  padding: 14px;
}
.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ecfaff;
  margin-bottom: 8px;
}
.progress-bar {
  height: 14px;
  background: rgba(0,0,0,0.42);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  box-shadow: 0 0 24px rgba(85, 221, 255, 0.55);
  transition: width .25s ease;
}
#jobMessage { margin: 8px 0 0; color: var(--muted); }
.download-link {
  display: inline-flex;
  margin-top: 10px;
  color: #e8fbff;
  text-decoration: none;
  font-weight: 900;
}
.download-link:hover { color: var(--cyan); }

.alert {
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
}
.alert.error {
  border: 1px solid rgba(255, 85, 112, 0.35);
  background: rgba(255, 85, 112, 0.12);
  color: #ffd9df;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px;
}
.login-card {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  background: var(--panel-2);
  box-shadow: var(--shadow);
}
.brand-mini {
  font-size: 34px;
  font-weight: 1000;
  letter-spacing: -0.05em;
  margin-bottom: 12px;
}
.brand-mini span { color: var(--purple); }

@media (max-width: 1050px) {
  .control-grid,
  .grid-4,
  .grid-5,
  .hero-header,
  .action-panel { grid-template-columns: 1fr; }
  .enemy-head { display: none; }
  .enemy-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .enemy-row strong { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .app-shell { width: min(100% - 22px, 1500px); padding-top: 14px; }
  .panel, .hero-header { padding: 16px; border-radius: 20px; }
  .grid-2, .toggle-row.stack { grid-template-columns: 1fr; }
  .slider-list label { grid-template-columns: 1fr 32px; }
  .slider-list input { grid-column: 1 / -1; }
}

.arcade-enemy-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  padding: 12px 14px;
  border: 1px solid rgba(85, 221, 255, 0.16);
  border-radius: 16px;
  background: rgba(85, 221, 255, 0.045);
}
.compact-button {
  min-height: 42px;
  padding: 0 12px;
}
.muted-panel {
  opacity: 0.76;
}
