:root {
  --bg: #07090d;
  --bg-alt: #10131b;
  --panel: rgba(20, 24, 34, 0.9);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f4f6fb;
  --muted: #adb6c9;
  --accent: #ff2d2d;
  --accent-2: #ff6b2d;
  --ok: #54d28a;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Sora", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 7% -10%, rgba(255, 45, 45, 0.32), rgba(255, 45, 45, 0) 38%),
    radial-gradient(circle at 90% 0%, rgba(255, 107, 45, 0.18), rgba(255, 107, 45, 0) 30%),
    linear-gradient(160deg, #06080c, #0f141e 52%, #090d15);
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.25rem;
}

.hero {
  margin-bottom: 1rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(13, 16, 24, 0.95), rgba(23, 28, 39, 0.82));
  box-shadow: var(--shadow);
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-logo {
  width: 150px;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.3vw, 2rem);
  letter-spacing: 0.02em;
}

.hero p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.hero-meta {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill {
  display: inline-block;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #f2f5ff;
  font-size: 0.78rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.card h2,
.card h3 {
  margin-top: 0;
}

.stack {
  display: grid;
  gap: 0.68rem;
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.92rem;
}

input,
select,
button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0.62rem 0.74rem;
}

button {
  border: none;
  background: linear-gradient(115deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

button:disabled {
  cursor: progress;
  filter: saturate(0.75) brightness(0.9);
  transform: none;
  opacity: 0.85;
}

.results {
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 0.84rem;
}

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

.briefing {
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.75rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 10px;
  overflow: hidden;
}

thead tr {
  background: rgba(255, 255, 255, 0.08);
}

th,
td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding: 0.42rem 0.45rem;
  text-align: left;
  font-size: 0.9rem;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

ul {
  padding-left: 1rem;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 18, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.hidden {
  display: none;
}

.loading-panel {
  width: min(92vw, 500px);
  background: linear-gradient(145deg, rgba(18, 23, 33, 0.95), rgba(26, 33, 47, 0.93));
  border: 1px solid var(--panel-border);
  border-radius: 15px;
  padding: 1.2rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0.72rem auto 0;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .page {
    padding: 0.85rem;
  }

  .hero-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-logo {
    width: 130px;
  }
}
