:root {
  color-scheme: light;
  --gold: #bd851b;
  --gold-dark: #94610b;
  --ink: #242017;
  --muted: #8d7a5f;
  --cream: rgba(255, 252, 245, 0.97);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: #e8ddcb;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

.poster {
  position: relative;
  width: min(100%, 760px);
  aspect-ratio: 864 / 1821;
  margin: 0 auto;
  overflow: hidden;
  background: #faf5ec url("/design.webp") center top / 100% 100% no-repeat;
  box-shadow: 0 0 40px rgba(71, 49, 16, 0.2);
}

.upload-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  left: 12.9%;
  top: 45.85%;
  width: 74.3%;
  height: 35.75%;
  padding: 5.5% 6.7%;
  border: 1px solid rgba(190, 134, 30, 0.55);
  border-radius: clamp(10px, 2vw, 22px);
  background: var(--cream);
  box-shadow: 0 3px 10px rgba(70, 45, 10, 0.16);
}

.nickname {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: clamp(38px, 8vw, 60px);
  min-height: 38px;
  padding: 0 4%;
  border: 1px solid #dfd0ba;
  border-radius: clamp(7px, 1.2vw, 13px);
  outline: none;
  background: rgba(255, 252, 246, 0.9);
  color: var(--ink);
  font-size: clamp(13px, 2.1vw, 19px);
  box-shadow: inset 0 1px 4px rgba(80, 56, 20, 0.05);
}

.nickname:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(189, 133, 27, 0.15); }
.nickname::placeholder { color: #a18d70; opacity: 1; }

.drop-zone {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  margin-top: 8%;
  padding: 4%;
  border: 2px dashed #ddcdb4;
  border-radius: 3px;
  background: rgba(255, 253, 248, 0.55);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragging {
  border-color: var(--gold);
  background: #fffaf0;
  outline: none;
}

.drop-zone:active { transform: scale(0.99); }
.drop-zone strong { color: var(--gold-dark); font-weight: 650; }
.drop-zone span { font-size: clamp(13px, 2.1vw, 20px); line-height: 1.45; }
.drop-zone small { margin-top: 5%; color: var(--muted); font-size: clamp(10px, 1.45vw, 14px); }

.upload-icon {
  width: clamp(48px, 10vw, 82px);
  height: auto;
  margin-bottom: 4%;
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-copy { display: none; }

.queue, .uploading, .success {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 8%;
}

.queue { display: flex; flex-direction: column; }
.queue[hidden], .uploading[hidden], .success[hidden], .error-box[hidden] { display: none; }

.queue-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #6f5730; }
.queue-summary strong { font-size: clamp(12px, 1.9vw, 17px); }
.queue-summary button, .success button {
  border: 0;
  background: transparent;
  color: var(--gold-dark);
  cursor: pointer;
  text-decoration: underline;
  font-size: clamp(11px, 1.6vw, 14px);
}

.file-list {
  flex: 1;
  min-height: 0;
  margin: 3% 0;
  overflow: auto;
  border-top: 1px solid #eadfcd;
  border-bottom: 1px solid #eadfcd;
}

.file-row { display: flex; align-items: center; gap: 3%; padding: 2.4% 1%; font-size: clamp(10px, 1.65vw, 14px); }
.file-row + .file-row { border-top: 1px solid #efe6d8; }
.file-row .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .file-size { flex: 0 0 auto; color: var(--muted); font-size: 0.88em; }
.file-row.done::before { content: "✓"; color: #397248; font-weight: 800; }
.file-row.failed::before { content: "!"; color: #a52e24; font-weight: 800; }

.upload-button {
  width: 100%;
  min-height: 38px;
  padding: 2.6% 4%;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #c99735, #a96f0d);
  color: white;
  font-size: clamp(12px, 1.9vw, 17px);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(154, 98, 10, 0.24);
}
.upload-button:disabled { opacity: 0.55; cursor: not-allowed; }

.uploading, .success { display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.uploading strong, .success strong { font-family: Georgia, serif; font-size: clamp(18px, 3.2vw, 29px); }
.uploading p, .success p { margin: 3% 0; color: var(--muted); font-size: clamp(10px, 1.6vw, 14px); }

.spinner { width: clamp(38px, 8vw, 65px); margin-bottom: 5%; animation: rotate 1.5s linear infinite; }
.spinner circle { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 90 150; }
@keyframes rotate { to { transform: rotate(360deg); } }

.progress-track { width: 85%; height: clamp(7px, 1.3vw, 11px); margin: 6% 0 2%; overflow: hidden; border-radius: 99px; background: #e7dccb; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #d5ad58, #b2760e); transition: width 0.15s; }
.uploading small { color: var(--gold-dark); font-weight: 750; }

.success-mark { display: grid; place-items: center; width: clamp(44px, 9vw, 72px); aspect-ratio: 1; margin-bottom: 5%; border-radius: 50%; background: #e9f3e9; color: #3f7245; font-size: clamp(26px, 5vw, 42px); }
.success button { margin-top: 3%; }

.error-box {
  position: absolute;
  left: 6.7%;
  right: 6.7%;
  bottom: 3%;
  padding: 2.5% 3%;
  border: 1px solid #d78d84;
  border-radius: 8px;
  background: #fff0ed;
  color: #8b251d;
  font-size: clamp(10px, 1.5vw, 13px);
  text-align: center;
  box-shadow: 0 3px 12px rgba(100, 20, 10, 0.12);
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 520px) {
  .poster { width: 100%; box-shadow: none; }
  .upload-card { padding: 5.5% 5.8%; }
  .desktop-copy { display: none; }
  .mobile-copy { display: inline; }
  .drop-zone { margin-top: 7%; }
  .drop-zone small { margin-top: 3%; }
  .queue, .uploading, .success { margin-top: 7%; }
  .file-row { padding: 2% 1%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
