* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --ink: #2c2225;
  --muted: #82777a;
  --rose: #a44e62;
  --rose-dark: #82374b;
  --paper: #f8f4ef;
  --line: #e7dcd5;
  --card: #fffdfa;
}
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 0%, #f1e3df 0, var(--paper) 52rem);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
.page { width: min(100% - 40px, 900px); margin: 0 auto; padding: 48px 0 36px; }
.intro { max-width: 650px; margin: 0 auto 42px; text-align: center; }
.eyebrow { margin: 0 0 16px; color: var(--rose); font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.8rem, 7vw, 5.2rem); font-weight: 500; letter-spacing: -.055em; line-height: .98; white-space: nowrap; }
h1 em { color: var(--rose); font-weight: 500; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr); align-items: center; gap: 12px; }
.photo-card { position: relative; display: flex; min-width: 0; flex-direction: column; align-items: stretch; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: color-mix(in srgb, var(--card) 90%, transparent); box-shadow: 0 12px 32px #533a3510; cursor: pointer; transition: border-color .2s, transform .2s, box-shadow .2s; }
.photo-card:hover { border-color: #d6a9af; box-shadow: 0 16px 36px #533a3518; transform: translateY(-2px); }
.photo-card.drag-over { border-color: var(--rose); background: #fff8f5; box-shadow: 0 0 0 3px #a44e6222; }
.photo-card:focus-within { outline: 3px solid #a44e6255; outline-offset: 3px; }
.card-label { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .13em; }
.card-label span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: #f4e8e5; color: var(--rose); font-size: .65rem; letter-spacing: 0; }
.preview { display: grid; aspect-ratio: 4 / 3; overflow: hidden; place-items: center; border: 1px dashed #d9c8c1; border-radius: 13px; background: linear-gradient(135deg, #f8f0eb, #f2e6e4); }
.placeholder { display: flex; flex-direction: column; align-items: center; gap: 7px; color: #9d8986; font-size: .82rem; }
.plus { color: var(--rose); font-size: 2rem; font-weight: 300; line-height: 1; }
.preview-image { width: 100%; height: 100%; object-fit: cover; }
.preview-image[hidden], .placeholder[hidden] { display: none; }
.file-hint { overflow: hidden; margin: 11px 0 14px; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.choose-button { align-self: flex-start; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--ink); font-size: .8rem; font-weight: 700; }
.file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.pair-mark { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--rose); font-family: Georgia, serif; font-size: 1.2rem; }
.submit-button { display: flex; width: min(100%, 360px); min-height: 58px; align-items: center; justify-content: space-between; margin: 28px auto 0; padding: 0 22px; border: 0; border-radius: 999px; background: var(--rose); color: white; font-weight: 750; cursor: pointer; box-shadow: 0 8px 20px #a44e6233; transition: background .2s, transform .2s, opacity .2s; }
.submit-button:hover:not(:disabled) { transform: translateY(-2px); background: var(--rose-dark); }
.submit-button:focus-visible { outline: 3px solid #a44e6255; outline-offset: 4px; }
.submit-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.submit-button span:last-child { font-size: 1.25rem; }
.status { min-height: 1.4em; margin: 13px auto 0; color: var(--rose-dark); text-align: center; font-size: .88rem; }
.result { width: min(100%, 680px); margin: 22px auto 0; text-align: center; }
.score-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.score-card { min-width: 0; padding: 10px 6px 6px; border: 1px solid #f0dfdb; border-radius: 14px; background: #fffdfa; }
.score-label { min-height: 2.4em; margin: 0 0 2px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .08em; line-height: 1.2; }
.score-line { display: flex; align-items: baseline; justify-content: center; gap: 4px; margin: 0; color: var(--rose); font-family: Georgia, "Times New Roman", serif; }
.score-line > span:first-child { font-size: clamp(2.4rem, 7vw, 3.6rem); letter-spacing: -.06em; line-height: 1.1; }
.score-out-of { color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; font-size: .78rem; }
@media (max-width: 600px) {
  .page { width: min(100% - 28px, 440px); padding-top: 30px; }
  .intro { margin-bottom: 28px; }
  h1 { font-size: clamp(1.7rem, 8.5vw, 2.75rem); }
  .pair { grid-template-columns: 1fr; gap: 12px; }
  .photo-card { padding: 14px; border-radius: 16px; }
  .preview { aspect-ratio: 16 / 9; }
  .pair-mark { width: 28px; height: 28px; margin: -3px auto; font-size: 1rem; }
  .file-hint { margin: 9px 0 11px; }
  .submit-button { margin-top: 20px; }
  .score-grid { gap: 6px; }
  .score-card { padding-inline: 3px; }
  .score-label { font-size: .62rem; letter-spacing: .05em; }
  .score-line > span:first-child { font-size: clamp(2rem, 10vw, 2.8rem); }
  .score-out-of { font-size: .68rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
