:root {
  --gold: #f2c879;
  --navy: #1a2049;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  background: var(--navy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
}

.card {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(242, 200, 121, 0.3);
  border-radius: 16px;
  padding: 28px 24px;
  margin-top: 24px;
}

h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  color: var(--gold);
}

.sub {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1.5;
}

.field {
  display: block;
  margin: 14px 0;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1rem;
}

/* Dropzone / file picker */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  border: 1.5px dashed rgba(242, 200, 121, 0.4);
  border-radius: 12px;
  padding: 28px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--gold);
  background: rgba(242, 200, 121, 0.06);
}

.dropzone-label {
  font-weight: 600;
  color: var(--gold);
}

.dropzone-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.dropzone-sub:empty { display: none; }

/* Thumbnail grid */
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(8, 10, 26, 0.75);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

/* Mobile: tap-to-edit year chip */
.thumb-year-chip {
  display: block;
  width: 100%;
  padding: 5px 6px;
  border: none;
  background: rgba(8, 10, 26, 0.75);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.thumb-year-chip.unset {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
}

/* Desktop: inline editable year field under each thumb */
.thumb-year-input {
  width: 100%;
  padding: 5px 6px;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 10, 26, 0.75);
  color: var(--gold);
  font-size: 0.75rem;
  text-align: center;
}

.thumb-year-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Batch year prompt — forced choice, no pre-filled default */
.batch-year {
  margin: 18px 0;
  padding: 14px;
  border-radius: 10px;
  background: rgba(242, 200, 121, 0.08);
  border: 1px solid rgba(242, 200, 121, 0.25);
}

.batch-year-prompt {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gold);
}

.batch-year-row {
  display: flex;
  gap: 8px;
}

.batch-year-row input[type="number"] {
  flex: 1;
}

.skip-link {
  display: block;
  margin-top: 10px;
  background: none;
  border: none;
  padding: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
}

.batch-year-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Buttons */
.btn-primary {
  display: inline-block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--gold);
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(242, 200, 121, 0.4);
  background: none;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

button[type="submit"] {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--gold);
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}

button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: default;
}

.status {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
  text-align: center;
}

.status.ok {
  background: rgba(242, 200, 121, 0.15);
  color: var(--gold);
}

.status.error {
  background: rgba(255, 90, 90, 0.15);
  color: #ff9a9a;
}

/* Mobile bottom sheet for per-photo year override */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 26, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.sheet-overlay[hidden] { display: none; }

.sheet {
  width: 100%;
  max-width: 480px;
  background: #1f2555;
  border: 1px solid rgba(242, 200, 121, 0.3);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 20px;
}

.sheet img {
  display: block;
  width: 100%;
  max-height: 45vh;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.3);
}
