* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0e0e10;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(80, 80, 100, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(100, 80, 120, 0.1) 0%, transparent 50%);
  color: #e8e8ec;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ====== Header ====== */
header {
  text-align: center;
  padding: 56px 20px 12px;
}

header h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: #fff;
}

header .subtitle {
  color: rgba(255,255,255,0.35);
  font-size: 1rem;
  margin-top: 8px;
  font-weight: 400;
  letter-spacing: 2px;
}

/* ====== Category Select ====== */
.category-select {
  text-align: center;
  margin-bottom: 28px;
}

.category-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.category-options {
  display: inline-flex;
  gap: 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(10px);
}

.category-btn {
  padding: 10px 24px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.35);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.category-btn:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: rgba(255,255,255,0.08);
}

.category-btn:hover {
  color: rgba(255,255,255,0.6);
}

.category-btn.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-weight: 600;
}

@media (max-width: 600px) {
  .category-btn { padding: 10px 18px; font-size: 0.8rem; }
}

/* ====== Upload Area ====== */
.upload-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 680px;
  width: 100%;
  padding: 0 20px;
  margin-bottom: 36px;
}

@media (max-width: 600px) {
  .upload-area { grid-template-columns: 1fr; max-width: 340px; }
}

/* ====== Glass Card ====== */
.upload-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.upload-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.upload-card:hover {
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.upload-card.has-image {
  border-color: rgba(255,255,255,0.1);
}

.upload-card input { display: none; }

/* Placeholder */
.upload-card .placeholder {
  text-align: center;
  padding: 20px;
}

.upload-card .placeholder .icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.25;
}

.upload-card .placeholder .label {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
}

.upload-card .placeholder .hint {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.25);
  margin-top: 6px;
}

.upload-card .placeholder .action {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 20px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  transition: all 0.2s;
}

.upload-card:hover .placeholder .action {
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.6);
}

/* Preview */
.upload-card .preview {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.upload-card .preview img {
  max-height: 280px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 12px;
}

/* Clear button */
.upload-card .clear-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.upload-card .clear-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ====== Generate Button ====== */
.generate-btn {
  padding: 16px 56px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  color: #0e0e10;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.generate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(255,255,255,0.15);
}

.generate-btn:active {
  transform: scale(0.98);
}

.generate-btn:disabled {
  opacity: 0.15;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.generate-btn .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(14,14,16,0.2);
  border-top-color: #0e0e10;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

/* ====== Error ====== */
.error {
  margin-top: 24px;
  padding: 14px 28px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #f87171;
  border-radius: 12px;
  font-size: 0.85rem;
  max-width: 500px;
  text-align: center;
  backdrop-filter: blur(10px);
}

/* ====== Result ====== */
.result {
  margin-top: 48px;
  text-align: center;
  padding: 0 20px;
}

.result h2 {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 20px;
  font-weight: 500;
  letter-spacing: 1px;
}

.result .result-frame {
  display: inline-block;
  padding: 8px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
}

.result .result-frame img {
  max-width: 400px;
  max-height: 500px;
  width: 100%;
  object-fit: contain;
  border-radius: 14px;
  display: block;
}

.result a {
  display: inline-block;
  margin-top: 16px;
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 2px;
  transition: all 0.2s;
}

.result a:hover {
  color: rgba(255,255,255,0.6);
  border-color: rgba(255,255,255,0.3);
}

/* ====== Footer ====== */
footer {
  margin-top: auto;
  padding: 48px 0 20px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.2);
}

footer .pyttt {
  font-weight: 800;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
}
