@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&family=Sora:wght@500;700&display=swap");

:root {
  --bg: #140607;
  --bg-soft: #2a0b0e;
  --panel: rgba(37, 10, 12, 0.88);
  --panel-strong: rgba(58, 12, 16, 0.96);
  --panel-border: rgba(255, 129, 129, 0.24);
  --text: #fff2f2;
  --muted: #e8bbbb;
  --primary: #ff4d5e;
  --primary-strong: #d92d44;
  --primary-soft: rgba(255, 77, 94, 0.16);
  --accent: #ff9a7d;
  --danger: #ff8ea0;
  --success: #ffb37a;
  --glow-a: rgba(255, 89, 89, 0.5);
  --glow-b: rgba(134, 7, 31, 0.58);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 16px;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--primary) 30%, transparent), transparent 35%),
    radial-gradient(circle at bottom left, color-mix(in srgb, var(--primary-strong) 32%, transparent), transparent 32%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 48%, #080203 100%);
  overflow-x: hidden;
}

body.theme-goat {
  --bg: #0f0618;
  --bg-soft: #1b0a2b;
  --panel: rgba(20, 10, 39, 0.9);
  --panel-strong: rgba(35, 14, 61, 0.96);
  --panel-border: rgba(190, 128, 255, 0.26);
  --text: #f8efff;
  --muted: #ccb8e8;
  --primary: #9c5cff;
  --primary-strong: #6f32d9;
  --primary-soft: rgba(156, 92, 255, 0.16);
  --accent: #dfb3ff;
  --danger: #ff98da;
  --success: #dca8ff;
  --glow-a: rgba(155, 92, 255, 0.45);
  --glow-b: rgba(79, 26, 153, 0.52);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.bg-glow {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.45;
}

.glow-top {
  top: -120px;
  left: -60px;
  width: 360px;
  height: 360px;
  background: var(--glow-a);
}

.glow-bottom {
  right: -80px;
  bottom: -120px;
  width: 340px;
  height: 340px;
  background: var(--glow-b);
}

.page {
  position: relative;
  width: min(1120px, 100%);
  display: grid;
  gap: 20px;
}

.hero,
.panel {
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 20%), var(--panel);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  padding: 28px;
  text-align: center;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.badge,
.eyebrow {
  margin: 0;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent);
}

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

h1 {
  margin-top: 14px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.2rem, 2vw, 1.7rem);
}

.subtitle,
.hero-note,
.panel-intro p,
.recent-note {
  margin: 0;
  color: var(--muted);
}

.subtitle {
  max-width: 760px;
  margin: 14px auto 0;
}

.hero-note {
  margin-top: 10px;
}

.site-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.switch-link {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
}

.switch-link:visited {
  color: var(--muted);
  text-decoration: none;
}

.switch-main {
  border-color: rgba(255, 129, 129, 0.24);
}

.switch-goat {
  border-color: rgba(190, 128, 255, 0.34);
  color: #cba3ff;
  background: rgba(124, 70, 214, 0.12);
}

.switch-goat:visited {
  color: #cba3ff;
}

.switch-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: transparent;
}

.switch-link.active:visited {
  color: #fff;
}

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

.panel {
  padding: 24px;
}

.upload-panel,
.recent-panel,
.side-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.branded-panel {
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--primary) 18%, transparent), transparent 55%),
    var(--panel-strong);
}

.panel-intro {
  display: grid;
  gap: 10px;
  text-align: center;
}

.left-intro {
  text-align: left;
}

.stack {
  width: min(460px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.compact-stack {
  width: 100%;
}

label {
  color: var(--muted);
  font-weight: 700;
}

input[type="text"],
.file-input,
.ghost-btn,
.primary-btn,
.danger-btn {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  font: inherit;
}

input[type="text"] {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
}

.file-input {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 138px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    color-mix(in srgb, var(--primary) 10%, transparent);
  border-style: dashed;
  text-align: center;
  cursor: pointer;
}

.file-input-label {
  display: inline-block;
  max-width: 100%;
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.file-input input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.primary-btn,
.ghost-btn,
.danger-btn {
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.primary-btn {
  padding: 14px 16px;
  border: none;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 14px 32px color-mix(in srgb, var(--primary-strong) 35%, transparent);
}

.ghost-btn {
  width: auto;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.danger-btn {
  width: auto;
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent);
  background: color-mix(in srgb, var(--danger) 20%, transparent);
  color: color-mix(in srgb, var(--danger) 75%, white);
  font-weight: 800;
}

.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.switch-link:hover {
  transform: translateY(-1px);
}

.status {
  margin: 0;
  min-height: 1.4rem;
  text-align: center;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}

.subtle-status {
  text-align: left;
  font-size: 0.94rem;
}

.result {
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  padding: 16px;
  background: var(--primary-soft);
  text-align: center;
}

.result.hidden {
  display: none;
}

.result p {
  margin: 0 0 10px;
}

.result p:last-child {
  margin-bottom: 0;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.result-code {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

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

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

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--panel-border) 75%, transparent);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  font-size: 0.92rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid color-mix(in srgb, var(--panel-border) 75%, transparent);
}

thead th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: none;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  padding: 6px 10px;
}

.copy-btn {
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0;
}

td .danger-btn {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.empty {
  text-align: center;
  color: var(--muted);
}

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

@media (max-width: 900px) {
  body {
    align-items: flex-start;
    padding: 20px 12px 32px;
  }

  .page {
    gap: 16px;
  }

  .hero,
  .panel {
    border-radius: 22px;
    padding: 20px;
  }

  .hero-top,
  .panel-title {
    flex-direction: column;
    align-items: stretch;
  }

  .site-switch {
    justify-content: flex-start;
  }

  .ghost-btn,
  .danger-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 1.85rem;
  }

  .stack {
    width: 100%;
  }

  .file-input {
    min-height: 118px;
    padding: 16px;
  }

  th,
  td {
    padding: 12px 10px;
    font-size: 0.88rem;
  }
}
