:root {
  --bg-ivory: #fcfaf7;
  --bg-card: #ffffff;
  --text-main: #2f2a26;
  --text-muted: #766d64;
  --gold: #b8925a;
  --gold-dark: #9c7742;
  --gold-light: #f4ece0;
  --border: #e7dfd3;
  --shadow: 0 10px 30px rgba(47, 42, 38, 0.06);
  --radius: 14px;
}

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

body {
  font-family: "Noto Sans JP", sans-serif;
  background-color: var(--bg-ivory);
  color: var(--text-main);
  line-height: 1.65;
}

.hidden {
  display: none !important;
}

.mt-lg {
  margin-top: 2.2rem;
}

/* Header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-main);
}

.demo-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--gold-light);
  color: var(--gold-dark);
  border: 1px solid var(--gold);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

.brand-sub {
  font-family: "Cormorant Garamond", serif;
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* Layout */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-card,
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.hero-card {
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #fbf7f0 100%);
}

.hero-card h1 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.hero-lead {
  font-size: 0.96rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.hero-note {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.step-tag {
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  background: var(--gold);
  color: #fff;
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
}

.section-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.guide-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Sample Dresses Grid */
.dress-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 820px) {
  .dress-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dress-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.dress-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #f6f2eb;
}

.dress-card-body {
  padding: 0.65rem 0.75rem;
}

.dress-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold-dark);
  background: var(--gold-light);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.25rem;
}

.dress-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
}

/* Camera & Capture */
.capture-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.viewport-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  background: #f5f0e8;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem;
  font-size: 0.9rem;
}

.placeholder-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

#camera-video,
#photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#camera-video.mirrored {
  transform: scaleX(-1);
}

.camera-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.guide-oval {
  width: 58%;
  height: 58%;
  border: 2px dashed rgba(255, 255, 255, 0.85);
  border-radius: 50% 50% 45% 45%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.18);
}

.camera-guide span {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.78rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
}

.flash-overlay {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease-out;
}

.flash-overlay.active {
  opacity: 0.9;
}

.control-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.submit-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-outline {
  background: #fff;
  border-color: var(--gold);
  color: var(--gold-dark);
}

.btn-outline:hover {
  background: var(--gold-light);
}

.btn-primary {
  background: var(--text-main);
  color: #fff;
}

.btn-primary:hover {
  background: #463f39;
}

.btn-gold {
  background: var(--gold);
  color: #fff;
}

.btn-gold:hover {
  background: var(--gold-dark);
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 1rem;
  width: 100%;
  max-width: 420px;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

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

.btn-text:hover {
  color: var(--text-main);
  text-decoration: underline;
}

/* Results */
.result-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-ivory);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1.25rem;
}

.bride-thumb-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bride-thumb-box img {
  width: 54px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.bride-thumb-box span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.progress-summary {
  flex: 1;
  min-width: 220px;
}

#progress-text {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--gold);
  transition: width 0.35s ease;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 680px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}

.result-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.result-image-box {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #f5f0e8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 1rem;
  text-align: center;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-card-footer {
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
}

.result-card-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 20, 16, 0.7);
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  max-width: 780px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.5rem;
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-title {
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.modal-body {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
}

.modal-image {
  max-width: 380px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.modal-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

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

.modal-qr {
  width: 160px;
  height: 160px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}
