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

:root {
  --color-bg: #fffbf9;
  --color-surface: #ffffff;
  --color-primary: #d4977e;
  --color-primary-dark: #c08468;
  --color-primary-light: #e8bfae;
  --color-primary-soft: #fdf5f1;
  --color-accent: #f0d4c8;
  --color-text: #3d2b24;
  --color-text-muted: #8c7268;
  --color-text-light: #c4aea5;
  --color-success: #5a9e6f;
  --color-error: #c75b5b;
  --color-border: #f3ebe6;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 100px;
  --shadow-sm: 0 1px 3px rgba(61, 43, 36, 0.04);
  --shadow-md: 0 4px 12px rgba(61, 43, 36, 0.06);
  --shadow-lg: 0 8px 30px rgba(61, 43, 36, 0.08);
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  min-height: 100dvh;
  color: var(--color-text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background decoration */
.bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  background: var(--color-primary-light);
  opacity: 0.06;
}

.bg-circle-1 {
  width: 300px;
  height: 300px;
  top: -80px;
  right: -60px;
  animation: float 20s ease-in-out infinite;
}

.bg-circle-2 {
  width: 200px;
  height: 200px;
  bottom: 10%;
  left: -40px;
  animation: float 25s ease-in-out infinite reverse;
}

.bg-circle-3 {
  width: 150px;
  height: 150px;
  top: 50%;
  right: -30px;
  animation: float 18s ease-in-out infinite 5s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(10px, -15px) scale(1.02); }
  66% { transform: translate(-8px, 10px) scale(0.98); }
}

/* Container */
.container {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 20px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  flex: 1;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   Welcome Screen
   ══════════════════════════════════════════ */
#welcome {
  justify-content: center;
  text-align: center;
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.rings {
  color: var(--color-primary);
  margin-bottom: 4px;
  opacity: 0.85;
}

h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--color-primary-light);
  line-height: 1.1;
}

h1 .amp {
  font-style: italic;
  opacity: 0.5;
  margin: 0 4px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-primary-light);
  margin: 4px 0;
}

.divider span {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--color-primary-light);
  opacity: 0.5;
}

.subtitle {
  font-size: 1rem;
  font-weight: 300;
  color: var(--color-text-muted);
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 16px 28px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  cursor: pointer;
  margin-top: 20px;
  min-height: 54px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(212, 151, 126, 0.25);
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 151, 126, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
  background: var(--color-primary-dark);
  box-shadow: 0 2px 8px rgba(212, 151, 126, 0.2);
}

.footer-hint {
  position: absolute;
  bottom: 32px;
  font-size: 0.8rem;
  color: var(--color-text-light);
  letter-spacing: 0.02em;
}

/* ══════════════════════════════════════════
   Upload Screen
   ══════════════════════════════════════════ */
.upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 24px;
}

.upload-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--color-text);
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.15s ease;
}

.btn-icon:active {
  background: var(--color-primary-soft);
}

/* Upload Zone */
.upload-zone {
  width: 100%;
  position: relative;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--color-surface);
  margin-bottom: 12px;
}

.upload-zone:active {
  border-color: var(--color-primary-light);
  background: var(--color-primary-soft);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.upload-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.upload-zone-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
}

.upload-zone-hint {
  font-size: 0.82rem;
  color: var(--color-text-light);
}

/* Capture actions */
.capture-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-bottom: 20px;
}

.btn-camera {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  background: var(--color-surface);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-camera:active {
  background: var(--color-primary-soft);
  border-color: var(--color-primary-light);
}

/* Secondary button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary-light);
  padding: 14px 24px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  cursor: pointer;
  min-height: 48px;
  transition: all 0.15s ease;
  margin-top: 8px;
}

.btn-secondary:active {
  background: var(--color-primary-soft);
}

/* ══════════════════════════════════════════
   Progress
   ══════════════════════════════════════════ */
.progress-summary {
  width: 100%;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  margin-bottom: 16px;
}

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

#progress-text {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

#progress-percent {
  font-size: 0.82rem;
  color: var(--color-primary);
  font-weight: 500;
}

.progress-bar-bg {
  width: 100%;
  height: 4px;
  background: var(--color-primary-soft);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ══════════════════════════════════════════
   File List
   ══════════════════════════════════════════ */
.file-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.file-item .thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--color-primary-soft);
  flex-shrink: 0;
}

.file-item .thumb-video {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-primary);
}

.file-item .info {
  flex: 1;
  min-width: 0;
}

.file-item .name {
  font-size: 0.8rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

.file-item .file-size {
  font-size: 0.72rem;
  color: var(--color-text-light);
  margin-top: 2px;
}

.file-item .file-progress-bar {
  height: 3px;
  background: var(--color-primary-soft);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.file-item .file-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  border-radius: 2px;
  transition: width 0.15s ease;
}

.file-item .status-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-item.uploading .status-icon {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.file-item.done .file-progress-fill {
  background: var(--color-success);
  width: 100%;
}

.file-item.done .status-icon {
  background: var(--color-success);
  color: #fff;
}

.file-item.error .file-progress-fill {
  background: var(--color-error);
  width: 100%;
}

.file-item.error .status-icon {
  background: #fdeaea;
  color: var(--color-error);
}

.file-item .btn-retry {
  background: none;
  border: 1px solid var(--color-error);
  color: var(--color-error);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.file-item .btn-retry:active {
  background: #fdeaea;
}

/* Done Message */
.done-message {
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  color: var(--color-success);
  font-size: 0.85rem;
  font-weight: 400;
  animation: fadeIn 0.3s ease;
  display: none;
}

.done-message.visible {
  display: flex;
}
