:root[data-theme="dark"] {
  --bg: #0b0f17;
  --card-bg: #141923;
  --card-inner: #1a2230;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #dc2626;
  --primary-hover: #b91c1c;
  --accent-orange: #f59e0b;
  --border: rgba(255, 255, 255, 0.1);
  --border-focus: #ef4444;
  --badge-bg: rgba(220, 38, 38, 0.2);
  --badge-text: #fca5a5;
  --btn-quiet: #242c3d;
  --upload-bg: rgba(20, 25, 35, 0.6);
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --card-inner: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #dc2626;
  --primary-hover: #b91c1c;
  --accent-orange: #d97706;
  --border: rgba(15, 23, 42, 0.12);
  --border-focus: #dc2626;
  --badge-bg: #fee2e2;
  --badge-text: #991b1b;
  --btn-quiet: #e2e8f0;
  --upload-bg: rgba(241, 245, 249, 0.8);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-circle-badge {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: #ffffff;
  border: 3.5px solid #dc2626;
  display: grid;
  place-items: center;
  font-weight: 850;
  font-size: 26px;
  color: #dc2626;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.25);
  user-select: none;
}

.brand-titles h1 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.brand-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #dc2626;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.theme-toggle-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.stepper-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background: var(--card-inner);
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.step-node {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.15);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  border: 1px solid var(--border);
}

.step-node.active { color: var(--text); }
.step-node.active .step-num {
  background: #dc2626;
  color: #fff;
  border-color: #f87171;
  box-shadow: 0 0 10px rgba(220,38,38,0.4);
}

.step-node.done { color: #dc2626; }
.step-node.done .step-num {
  background: #991b1b;
  color: #fff;
  border-color: #dc2626;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  position: relative;
}

.hero-banner {
  background: linear-gradient(135deg, #2b0b0e 0%, #171a22 100%);
  color: #fff;
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
}

:root[data-theme="light"] .hero-banner {
  background: linear-gradient(135deg, #181c24 0%, #2b0b0e 100%);
  border-color: rgba(220, 38, 38, 0.25);
}

.hero-tag {
  display: inline-block;
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(220, 38, 38, 0.5);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.hero-banner h2 {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}

.hero-banner p {
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.5;
}

.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.field label b { color: var(--accent-orange); }

input[type="email"], input[type="text"], input[type="tel"], select, textarea {
  width: 100%;
  background: var(--card-inner);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}
textarea { resize: vertical; min-height: 85px; }

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  background: var(--upload-bg);
  cursor: pointer;
  transition: all 0.2s ease;
}
.upload-zone:hover {
  border-color: var(--border-focus);
  background: rgba(220, 38, 38, 0.05);
}
.upload-zone-icon { font-size: 32px; margin-bottom: 6px; }

.file-preview-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-preview-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-inner);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid var(--border);
}

.choice-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}
.choice-pill {
  background: var(--card-inner);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.choice-pill input { accent-color: var(--primary); width: 18px; height: 18px; }
.choice-pill.selected {
  border-color: var(--border-focus);
  background: rgba(220, 38, 38, 0.1);
  color: var(--primary);
}

.rating-item {
  background: var(--card-inner);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.rating-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.rating-title { font-size: 15px; font-weight: 700; }
.rating-title span { color: var(--accent-orange); }

.stars { display: inline-flex; flex-direction: row-reverse; gap: 6px; }
.stars input { display: none; }
.stars label {
  font-size: 30px;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
  line-height: 1;
}
.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label {
  color: #fbbf24;
  transform: scale(1.1);
}

.comment-btn-visible {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.2s ease;
}
.comment-btn-visible:hover {
  background: rgba(220, 38, 38, 0.16);
}
.comment-box-wrap { margin-top: 12px; }

.member-card, .coord-card {
  background: var(--card-inner);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
}
.member-card-head, .coord-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.member-card-title, .coord-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-orange);
}
.btn-remove-card {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn-remove-card:hover { text-decoration: underline; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.btn-primary { background: var(--primary); color: white; width: 100%; }
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--card-inner); }
.btn-dashed {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--primary);
  padding: 12px;
  font-size: 14px;
  margin: 10px 0 20px;
  width: 100%;
}
.btn-dashed:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: var(--primary);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.step-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.btn-back {
  flex: 0 0 110px;
  background: var(--btn-quiet);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-back:hover { opacity: 0.85; }

.profile-card {
  background: var(--card-inner);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 22px;
}
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.profile-row:last-child { border-bottom: none; }
.profile-label { color: var(--text-muted); font-weight: 500; min-width: 130px; }
.profile-val { font-weight: 600; text-align: right; word-break: break-word; }

.badge-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.bm-list-item {
  background: rgba(0,0,0,0.06);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 6px;
  text-align: left;
}
.bm-number { font-weight: 800; color: var(--accent-orange); font-size: 13px; }
.bm-desc { font-size: 13px; margin-top: 2px; }
.bm-addr { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.alert-box {
  border-radius: 12px;
  padding: 18px;
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  gap: 12px;
}
.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.notice-missing {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-orange);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 18px;
}

.btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.hidden { display: none !important; }

footer {
  margin-top: 50px;
  padding: 28px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  border-top: 1px solid var(--border);
}

.footer-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 3.5px solid #dc2626;
  display: grid;
  place-items: center;
  font-weight: 850;
  font-size: 24px;
  color: #dc2626;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.footer-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.strikethrough {
  text-decoration: line-through;
  color: var(--text-muted);
}

.won-stamp {
  font-family: 'Caveat', cursive, sans-serif;
  color: #dc2626;
  font-size: 26px;
  font-weight: 700;
  transform: rotate(-3deg);
  display: inline-block;
  text-shadow: 0 1px 3px rgba(220, 38, 38, 0.2);
}

.footer-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.emoji-three-fingers {
  display: inline-block;
  vertical-align: -5px;
  width: 28px;
  height: 28px;
  margin-left: 6px;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
}

.victory-hero-panel {
  background: #ffffff !important;
  border: 2px solid #ef4444 !important;
  color: #0f172a !important;
  border-radius: var(--radius);
  padding: 38px 26px !important;
  text-align: center;
  box-shadow: 0 16px 40px rgba(220, 38, 38, 0.15);
  margin-bottom: 24px;
}

:root[data-theme="dark"] .victory-hero-panel {
  background: linear-gradient(135deg, #36070a 0%, #171a22 100%) !important;
  border: 1.5px solid rgba(239, 68, 68, 0.5) !important;
  color: #f8fafc !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
}

.victory-stamp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  padding: 8px 18px;
  border-radius: 100px;
  margin-bottom: 20px;
}

:root[data-theme="dark"] .victory-stamp-badge {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.victory-hero-panel h2 {
  font-size: 26px;
  font-weight: 850;
  line-height: 1.25;
  color: #dc2626 !important;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

:root[data-theme="dark"] .victory-hero-panel h2 {
  color: #ef4444 !important;
}

.victory-text-body {
  font-size: 15px;
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto;
}

.victory-text-body p {
  margin-bottom: 16px;
}

.victory-diary-box {
  background: rgba(220, 38, 38, 0.04);
  border-left: 4px solid #dc2626;
  border-radius: 4px 12px 12px 4px;
  padding: 16px 20px;
  margin: 22px 0;
  text-align: left;
  font-size: 14px;
  line-height: 1.6;
}

:root[data-theme="dark"] .victory-diary-box {
  background: rgba(0, 0, 0, 0.35);
  border-left-color: #ef4444;
  color: #e2e8f0;
}

.victory-highlight {
  font-size: 16px;
  font-weight: 800;
  color: #dc2626;
  margin-top: 14px;
}

:root[data-theme="dark"] .victory-highlight {
  color: #f87171;
}

@media (max-width: 540px) {
  .card { padding: 22px 16px; }
  .btn-group { grid-template-columns: 1fr; }
  .choice-group { grid-template-columns: 1fr; }
  .profile-row { flex-direction: column; gap: 4px; }
  .profile-val { text-align: left; }
  .stars label { font-size: 26px; }
  .step-node span.step-title { display: none; }
  .step-actions { flex-direction: column-reverse; }
  .btn-back { width: 100%; flex: auto; }
}
