:root {
  /* Dark Razer-style palette */
  --bg: #0b0f0c;
  --card-bg: #0f1512;
  --text: #e5efe7;
  --muted: #9aa7a1;
  --border: #1f2a24;
  --success: #29ff6a;
  --error: #ff4d4d;
  --pill-bg: rgba(41, 255, 106, 0.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

  --razer-green: #00ff00;
  --focus: rgba(0, 255, 0, 0.25);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(0,255,0,0.08), transparent 60%),
    radial-gradient(1000px 600px at -10% 110%, rgba(0,255,127,0.06), transparent 60%),
    linear-gradient(180deg, #060807, #0b0f0c 60%);
}

.page { min-height: auto; display: block; }

.card {
  width: min(680px, calc(100% - 32px));
  margin: 2vh auto 24px;
  padding: 28px 28px 32px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)) , var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(0,255,0,0.04), var(--shadow);
  backdrop-filter: blur(2px);
}

.card__header { margin-bottom: 18px; }
.title { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.01em; }
.subtitle { margin: 0; color: var(--muted); }

.form { display: grid; gap: 10px; }
.label { font-weight: 600; }

.input-row { position: relative; }
.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: #0c120f;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-size: 16px;
}
.input::placeholder { color: #6e7d75; }
.input:focus {
  border-color: rgba(0,255,0,0.45);
  background: #0a110d;
  box-shadow: 0 0 0 4px var(--focus);
}
.help { color: var(--muted); font-size: 13px; margin-top: -2px; }
.error-text { color: #ff8080; font-size: 13px; margin-top: 4px; display: none; }
.error .error-text { display: block; }
.error .input { border-color: #ff4d4d; box-shadow: 0 0 0 4px rgba(255, 77, 77, 0.15); }

/* Razer Wave RGB Button */
.razer-btn {
  --razer-colors: linear-gradient(90deg,
    #00ff00 0%, #00ffff 16%, #0080ff 32%, #8000ff 48%, #ff00ff 64%, #ff0080 80%, #00ff00 100%
  );
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 22px;
  width: 100%;
  border-radius: 14px;
  border: 0;
  color: #0b0f0c;
  background: #eaffea;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 2px rgba(0,255,0,0.35), 0 10px 24px rgba(0,255,0,0.08);
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease;
  overflow: hidden;
}

.razer-btn__glow {
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  background-image: var(--razer-colors);
  background-size: 300% 100%;
  filter: blur(10px) saturate(1.3);
  animation: razerWave 6s linear infinite;
  opacity: 0.75;
  z-index: 0;
}

.razer-btn__label { position: relative; z-index: 1; }

.razer-btn__spinner {
  --size: 16px;
  width: var(--size);
  height: var(--size);
  border: 2px solid transparent;
  border-top-color: #0b0f0c;
  border-right-color: #0b0f0c;
  border-radius: 50%;
  transform: translateY(1px);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.razer-btn:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 2px rgba(0,255,0,0.55), 0 16px 30px rgba(0,255,0,0.12);
}
.razer-btn:active { transform: translateY(0); }
.razer-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2) brightness(0.98);
}

@keyframes razerWave {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.config-row {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.config-status { color: var(--muted); font-size: 13px; }
.link-btn {
  border: 0;
  background: none;
  color: #2563eb;
  cursor: pointer;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
}
.link-btn:hover { background: #eff6ff; }

.result {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: visible;
  background: #0c120f;
  box-shadow: 0 0 0 1px rgba(0,255,0,0.05), var(--shadow);
}
.result__header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}
.result__time { margin-left: auto; color: #9aa7a1; font-size: 12px; }
.result__body {
  margin: 0;
  padding: 14px;
  /* Let contents dictate height */
  overflow: visible;
  background: #0c120f;
  color: #dfe9e3;
}
.result__view { display: grid; gap: 8px; }
.kv {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 12px;
  align-items: start;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.kv + .kv { margin-top: 10px; }
.kv__key { color: #9fcfb1; font-weight: 800; text-transform: none; }
.kv__value { color: #e8f6ee; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.kv__value .pill-inline { display: inline-block; padding: 2px 6px; border-radius: 999px; background: rgba(0,255,0,0.12); color: #afffd0; font-weight: 700; }
.kv__value a { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }

/* Copy icon */
.copy-icon {
  cursor: pointer;
  color: #9fcfb1;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  margin-left: 6px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  opacity: 0.45;
}
.copy-icon:hover, .copy-icon:focus { color: #bfffd9; opacity: 1; outline: none; }

/* Copy JSON */
.copy-row { display: flex; justify-content: flex-end; padding: 8px 14px 14px; }
.ghost-btn {
  border: 1px solid rgba(0,255,0,0.35);
  background: transparent;
  color: #bfffd9;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.ghost-btn:hover { background: rgba(0,255,0,0.08); }

/* Input inline actions */
.input-actions { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; }
.ghost-btn.small { padding: 4px 8px; font-size: 12px; }

/* Section headers in results */
.section-title { margin: 10px 0 6px; color: #9fcfb1; font-weight: 800; opacity: 0.85; }
.pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: #afffd0;
}
.pill--ok { background: rgba(0,255,0,0.12); color: #afffd0; }
.pill--err { background: rgba(255,77,77,0.15); color: #ffd6d6; }

/* Footer removed per request */

/* Loading state */
.is-loading .razer-btn__spinner { opacity: 1; animation: spinner 0.9s linear infinite; }
.is-loading .razer-btn__label { opacity: 0.65; }

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

@media (max-width: 480px) {
  .card { margin-top: 10vh; padding: 22px; }
}

/* Full-screen loading overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 50;
}
.overlay[hidden] { display: none !important; }
.overlay__content { display: grid; gap: 14px; justify-items: center; }
.overlay__text { color: #d6ffe6; font-weight: 600; }

.ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 6px solid rgba(255,255,255,0.06);
  border-top-color: #00ff00;
  border-right-color: #29ff6a;
  border-bottom-color: #00ffa0;
  animation: spin 1s linear infinite;
}

.progress { width: 220px; height: 6px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; }
.progress .bar { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, #00ff00, #29ff6a); border-radius: inherit; animation: slide 1.4s ease-in-out infinite; }

@keyframes spin { to { transform: rotate(1turn); } }
@keyframes slide { 0% { transform: translateX(-100%); } 50% { transform: translateX(20%); } 100% { transform: translateX(160%); } }

/* Secondary action button */
.secondary-btn {
  margin: 12px 14px 16px;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(0,255,0,0.35);
  background: #0c120f;
  color: #d6ffe6;
  font-weight: 700;
  cursor: pointer;
}
.secondary-btn:hover { background: rgba(0,255,0,0.08); }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 90px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0,255,0,0.15);
}
.topbar__content {
  width: min(1060px, 100%);
  margin: 0 auto;
  height: 100%;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.brand__logo {
  height: 72px;
  width: auto;
  filter: drop-shadow(0 2px 10px rgba(0,255,0,0.35));
}
.brand__text { display: none; }

/* Hero section */
.hero {
  position: relative;
  min-height: 0;
  display: block;
  padding: 24px 16px 8px;
  overflow: hidden;
}
.hero__content { text-align: center; max-width: 1060px; margin: 0 auto; }
.hero__title {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #afffd0, #66ff99);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero__update { margin: 6px 0 18px; color: #96a59e; font-size: 14px; }
.hero__actions { display: none; }
.hero__fx {
  position: absolute;
  inset: -20% -10%;
  background:
    radial-gradient(800px 400px at 20% 10%, rgba(0,255,0,0.15), transparent 60%),
    radial-gradient(1200px 600px at 80% 90%, rgba(0,255,127,0.12), transparent 60%);
  pointer-events: none;
  filter: blur(30px) saturate(120%);
  opacity: 0.8;
}

/* Footer */
.footer { margin: 24px 0 40px; color: #9aa7a1; }
.footer__content { width: min(1060px, 100%); margin: 0 auto; padding: 0 16px; display: flex; justify-content: space-between; align-items: center; }
.footer a { color: #bfffd9; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer__version { opacity: 0.9; }

