:root {
  --bg: #0f1118;
  --card: #161a23;
  --accent: #4ade80;
  --accent-dark: #22c55e;
  --text: #e9ecf5;
  --muted: #8e94a8;
  --border: #222838;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(120% 80% at 20% 20%, #1a1f2d, #0f1118 60%);
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.about-btn {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.35), rgba(34, 197, 94, 0.2));
  color: var(--text);
  border: 1px solid rgba(74, 222, 128, 0.4);
  box-shadow: 0 12px 24px rgba(34, 197, 94, 0.2);
  padding: 8px 16px;
  font-size: 14px;
}

.about-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

h1 {
  margin: 8px 0 6px;
  font-size: 32px;
}

h2 {
  margin: 0;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.12);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.chip {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.drop {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border 0.2s ease, transform 0.15s ease;
}

.drop strong {
  font-size: 16px;
}

.drop span {
  color: var(--muted);
  font-size: 14px;
}

.drop.drag {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.preview {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.hidden {
  display: none;
}

.actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #0b0f16;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.2s ease;
  box-shadow: 0 10px 30px rgba(74, 222, 128, 0.25);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.status {
  color: var(--muted);
  font-size: 14px;
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  font-size: 24px;
  letter-spacing: 0.12em;
  background: rgba(255, 255, 255, 0.02);
}

.examples {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.examples-header h3 {
  margin: 0;
  font-size: 16px;
}

.examples-header p {
  margin: 4px 0 0;
  font-size: 13px;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
  align-content: start;
}

.example-btn {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  box-shadow: none;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: grab;
}

.example-btn img {
  width: 100%;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  background: #0b0f16;
}

.example-btn span {
  font-size: 12px;
  color: var(--muted);
}

.example-btn:hover:not(:disabled) {
  border-color: rgba(74, 222, 128, 0.5);
}

.example-btn:active {
  cursor: grabbing;
}

.examples-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 15, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-body p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 14px;
}

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

@media (max-width: 720px) {
  h1 {
    font-size: 26px;
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
