:root {
  --bg-1: #0b0a1e;
  --bg-2: #1a1040;
  --accent-1: #ff00e5;
  --accent-2: #00eaff;
  --accent-3: #fcee09;
  --text: #f5e9ff;
  --muted: #b8a2d8;
  --card: rgba(17, 10, 40, 0.6);
  --glass: rgba(255, 255, 255, 0.06);
  --shadow: 0 0 20px rgba(255, 0, 229, 0.35), 0 0 40px rgba(0, 234, 255, 0.25);
}

/* Global layout using CSS Grid */
body.synthwave {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  display: grid;
  grid-template-rows: 1fr;
  overflow-x: hidden;
  font-family: "Exo 2", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Animated gradient glow */
body.synthwave::before {
  content: "";
  position: fixed;
  inset: -40vmax;
  background: radial-gradient(60vmax 60vmax at 20% 10%, rgba(255,0,229,0.25), transparent 60%),
              radial-gradient(50vmax 50vmax at 80% 20%, rgba(0,234,255,0.20), transparent 60%),
              radial-gradient(70vmax 70vmax at 50% 100%, rgba(252,238,9,0.12), transparent 60%);
  filter: blur(40px) saturate(120%);
  animation: floatGlow 18s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

/* Subtle CRT scanlines */
body.synthwave::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.05),
    rgba(255,255,255,0.05) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: soft-light;
  opacity: 0.15;
  pointer-events: none;
  z-index: 2;
}

@keyframes floatGlow {
  0% { transform: translate3d(-2%, -2%, 0) scale(1); }
  100% { transform: translate3d(2%, 2%, 0) scale(1.02); }
}

.container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 2rem;
  padding: clamp(1rem, 3vw, 2rem);
  max-width: 900px;
  margin: 0 auto;
}

.hero {
  text-align: center;
}

.title {
  margin: 0;
  font-family: "Audiowide", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 1px;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(255, 0, 229, 0.35), 0 0 28px rgba(0, 234, 255, 0.25);
}

.subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.card {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 2.5vw, 2rem);
  background: linear-gradient(180deg, var(--card), rgba(10, 6, 25, 0.75));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px) saturate(140%);
}

/* Income island grid layout */
.income-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.label {
  color: var(--muted);
}

.input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  outline: none;
  transition: box-shadow 200ms ease, border-color 200ms ease, transform 150ms ease;
}

.input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(0,234,255,0.2), 0 0 24px rgba(0,234,255,0.25);
  transform: translateY(-1px);
}

.button {
  justify-self: start;
  border: none;
  padding: 0.9rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #140a2a;
  background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0,234,255,0.15), 0 0 0 1px rgba(255,255,255,0.1) inset;
  transition: transform 120ms ease, box-shadow 200ms ease, filter 200ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(255,0,229,0.2), 0 0 0 1px rgba(255,255,255,0.12) inset;
  filter: saturate(120%);
}

.button:active {
  transform: translateY(0);
}

.button.neon {
  position: relative;
}

.button.neon::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(24px 24px at 10% 50%, rgba(255,0,229,0.5), transparent 40%),
              radial-gradient(24px 24px at 90% 50%, rgba(0,234,255,0.5), transparent 40%);
  filter: blur(10px);
  opacity: 0.6;
  z-index: -1;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.9; }
}

.result {
  min-height: 2rem;
  color: var(--text);
  opacity: 0.95;
}

.result-grid {
  display: grid;
  gap: 1rem 1.25rem;
  animation: fadeInUp 500ms ease both;
}

.result-lead {
  margin: 0;
  font-weight: 600;
}

.result .glow,
.result .num {
  color: var(--text);
  text-shadow: 0 0 12px rgba(0, 234, 255, 0.35), 0 0 20px rgba(255, 0, 229, 0.25);
}

.province-grid {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.province {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  line-height: 1.35;
  box-shadow: 0 6px 16px rgba(0, 234, 255, 0.08);
  transition: box-shadow 200ms ease, transform 120ms ease, border-color 200ms ease;
}

.province:hover {
  transform: translateY(-2px);
  border-color: rgba(0,234,255,0.35);
  box-shadow: 0 10px 22px rgba(255, 0, 229, 0.12), 0 0 18px rgba(0, 234, 255, 0.22);
}

.province .num {
  font-weight: 700;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.footer {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.footer a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-color: rgba(0, 234, 255, 0.6);
  text-underline-offset: 3px;
  transition: color 160ms ease, text-decoration-color 160ms ease, text-shadow 200ms ease;
  text-shadow: 0 0 10px rgba(0, 234, 255, 0.25);
}

.footer a:hover {
  color: var(--accent-1);
  text-decoration-color: rgba(255, 0, 229, 0.7);
  text-shadow: 0 0 12px rgba(255, 0, 229, 0.35), 0 0 18px rgba(0, 234, 255, 0.2);
}

.footer a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 6px;
}
