:root {
  --bg: #16140f;
  --surface: #201d17;
  --surface-raised: #2a261e;
  --border: #3a352b;
  --text: #f2ece0;
  --text-muted: #a39a87;
  --amber: #e8a33d;
  --amber-dim: #8a641f;
  --radius: 3px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(232, 163, 61, 0.06), transparent);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 5vh 20px 8vh;
}

.room {
  width: 100%;
  max-width: 620px;
}

.room__header {
  text-align: left;
  margin-bottom: 48px;
}

.wordmark {
  font-family: 'Fraunces', serif;
  font-size: 2.6rem;
  font-weight: 500;
  font-optical-sizing: auto;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.01em;
}

.tagline {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 6px 0 0;
}

.bench {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.plate-in {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.plate-in__label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.98rem;
  padding: 12px 14px;
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

textarea:focus,
select:focus,
.develop-btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}

textarea::placeholder {
  color: #5c5748;
}

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

.size-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}

.develop-btn {
  margin-left: auto;
  background: var(--amber);
  color: #1a1508;
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.develop-btn:hover {
  background: #f0b354;
}

.develop-btn:disabled {
  background: var(--amber-dim);
  cursor: default;
}

.quota {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.quota--empty {
  color: #e6836b;
}

.error {
  color: #e6836b;
  font-size: 0.9rem;
  background: rgba(230, 131, 107, 0.08);
  border: 1px solid rgba(230, 131, 107, 0.25);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 0;
}

.tray {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tray__empty {
  color: #5c5748;
  font-size: 0.9rem;
}

.tray__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.developing {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--amber-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.developing__ripple {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(232, 163, 61, 0.5), transparent 70%);
  animation: ripple 1.8s ease-in-out infinite;
}

@keyframes ripple {
  0%, 100% { transform: scale(0.5); opacity: 0.4; }
  50% { transform: scale(1.1); opacity: 0.9; }
}

.dots span {
  animation: blink 1.4s infinite;
  opacity: 0;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 20% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

.tray__result {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.tray__result img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.download-link {
  color: var(--amber);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 0;
}

.download-link:hover {
  border-bottom-color: var(--amber);
}

.download-link:disabled {
  color: var(--text-muted);
  cursor: default;
}

.download-msg {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.history {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.history__item {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.history__item:hover {
  opacity: 1;
  border-color: var(--amber-dim);
}

.history__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .developing__ripple,
  .dots span {
    animation: none;
  }
}

@media (max-width: 480px) {
  .plate-in__row {
    flex-wrap: wrap;
  }
  .develop-btn {
    margin-left: 0;
    width: 100%;
  }
}
