@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

/* 영문/숫자 전용: Helvetica Neue 시스템 폰트 */
@font-face {
  font-family: 'SiteEnFont';
  src: local('Helvetica Neue'), local('Helvetica'), local('Arial');
  unicode-range: U+0020-007E, U+00A0-00FF;
}

:root {
  --bg: #FAF8F4;
  --surface: #FFFFFF;
  --ink: #1A1916;
  --ink-soft: #57544D;
  --sub: #8E8A80;
  --line: #E7E3DA;
  --line-strong: #D6D1C5;
  --accent: #6B5B43;      /* 절제된 브론즈 — 포인트 1색만 */
  --accent-soft: #F1ECE2;
  --danger: #A4332B;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(26,25,22,.04), 0 8px 28px rgba(26,25,22,.06);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  font-family: 'SiteEnFont', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   참가자 화면 (모바일 우선)
   ============================================================ */

.shell {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* 상단 행사 헤더 */
.masthead {
  padding: 30px 24px 22px;
  border-bottom: 1px solid var(--line);
}
.masthead .kicker {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.masthead h1 {
  font-size: 25px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 9px;
  letter-spacing: -.02em;
}
.masthead .meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--sub);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.masthead .meta span { white-space: nowrap; }
.masthead .meta .dot { color: var(--line-strong); }

.page {
  flex: 1;
  padding: 26px 24px 120px;
}

/* 단계 진행 표시 */
.steps {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 26px;
}
.steps .seg {
  height: 3px;
  flex: 1;
  background: var(--line);
  border-radius: 2px;
  transition: background .4s var(--ease);
}
.steps .seg.on { background: var(--ink); }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--accent);
  margin-bottom: 8px;
}
.title-lg {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.3;
}
.lede {
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.65;
}

/* 폼 요소 */
.field { margin-top: 22px; }
.field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 9px;
}
.field .req { color: var(--danger); margin-left: 3px; font-weight: 700; }
.field .opt { color: var(--sub); font-weight: 500; margin-left: 5px; font-size: 12px; }

.input, .select, .textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* iOS 자동 줌 방지 */
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: #B6B1A6; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(26,25,22,.06);
}
.textarea { resize: none; min-height: 92px; line-height: 1.6; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238E8A80' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* 직군 선택 칩(라디오) */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  flex: 1 1 calc(50% - 5px);
  position: relative;
}
.chips.cols-3 .chip { flex: 1 1 calc(33.333% - 6px); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip label {
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  padding: 13px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .18s var(--ease);
}
.chip input:checked + label {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

/* 동의 블록 */
.consents {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

/* 단일 통합 동의 */
.consent-main {
  padding: 18px;
  background: var(--accent-soft);
  align-items: flex-start;
}
.consent-main .txt {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}
.consent-main .tag {
  display: inline-block;
  margin-left: 7px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  vertical-align: middle;
  letter-spacing: .02em;
}
.terms-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border: none;
  border-top: 1px solid var(--line);
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--sub);
  cursor: pointer;
}
.terms-toggle .chev { transition: transform .25s var(--ease); flex-shrink: 0; }
.terms-toggle.open .chev { transform: rotate(180deg); }
.terms-body {
  padding: 2px 18px 18px;
  border-top: 1px solid var(--line);
}
.terms-body p {
  font-size: 12.5px;
  color: var(--sub);
  line-height: 1.55;
  margin-top: 12px;
  display: flex;
  gap: 10px;
}
.terms-body .t-label {
  flex-shrink: 0;
  width: 78px;
  color: var(--ink-soft);
  font-weight: 600;
}
.consent-all {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
}
.consent-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.consent-row:last-child { border-bottom: none; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  flex-shrink: 0;
  width: 22px; height: 22px;
  margin-top: 1px;
  border: 1.6px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  display: grid;
  place-items: center;
  transition: all .15s var(--ease);
}
.check .box svg { width: 13px; height: 13px; opacity: 0; transform: scale(.6); transition: all .15s var(--ease); }
.check input:checked + .box { background: var(--ink); border-color: var(--ink); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check .txt { flex: 1; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
.consent-all .check .txt { font-size: 15px; font-weight: 600; color: var(--ink); }
.check .tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}
.check .tag.required { color: var(--danger); }
.check .tag.optional { color: var(--sub); }
.consent-detail {
  font-size: 12px;
  color: var(--sub);
  margin-top: 5px;
  line-height: 1.55;
}

/* 별점 */
.rating { display: flex; gap: 6px; }
.rating button {
  flex: 1;
  aspect-ratio: 1;
  max-width: 56px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 22px;
  color: var(--line-strong);
  cursor: pointer;
  transition: all .15s var(--ease);
  display: grid;
  place-items: center;
}
.rating button.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.rating button:active { transform: scale(.94); }

/* 하단 고정 CTA */
.cta-dock {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 72%, rgba(250,248,244,0));
}
.btn {
  width: 100%;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: var(--radius);
  padding: 17px;
  cursor: pointer;
  transition: transform .12s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

/* 완료 / 상태 화면 */
.center-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 32px;
  min-height: 70dvh;
}
.seal {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  margin-bottom: 24px;
}
.seal svg { width: 28px; height: 28px; }
.center-screen h2 { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.center-screen p { margin-top: 12px; font-size: 14.5px; color: var(--ink-soft); line-height: 1.7; max-width: 320px; }

.hello-card {
  margin-top: 28px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  text-align: left;
}
.hello-card .name { font-size: 18px; font-weight: 700; }
.hello-card .who { font-size: 13px; color: var(--sub); margin-top: 3px; }

.notice {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--sub);
  line-height: 1.6;
}

/* 토스트 */
.toast {
  position: fixed;
  left: 50%; bottom: 96px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: all .3s var(--ease);
  z-index: 50;
  max-width: 88%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.hide { display: none !important; }
.spin { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   운영자 화면 (다크 · 프로젝터)
   ============================================================ */

body.admin { background: #0C0B0A; color: #F4F1EA; }
.admin-shell { max-width: 1280px; margin: 0 auto; padding: 28px 32px 60px; }

.admin-login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px;
}
.admin-login .lock { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: #8E8A80; }
.admin-login h1 { font-size: 24px; font-weight: 700; }
.admin-login input {
  width: 280px; max-width: 80vw;
  font: inherit; font-size: 16px; text-align: center;
  background: #15130F; border: 1px solid #2A2722; color: #fff;
  border-radius: 12px; padding: 14px;
}
.admin-login input:focus { outline: none; border-color: #6B5B43; }
.admin-login button {
  width: 280px; max-width: 80vw;
  font: inherit; font-size: 15px; font-weight: 600;
  background: #F4F1EA; color: #0C0B0A; border: none;
  border-radius: 12px; padding: 14px; cursor: pointer;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid #211E19;
  padding-bottom: 18px;
  margin-bottom: 28px;
}
.admin-top h1 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.admin-top .ev { font-size: 13px; color: #8E8A80; }
.admin-top .right { display: flex; gap: 10px; align-items: center; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}
.stat {
  background: #15130F;
  border: 1px solid #211E19;
  border-radius: 16px;
  padding: 22px 24px;
}
.stat .k { font-size: 12px; letter-spacing: .04em; color: #8E8A80; text-transform: uppercase; }
.stat .v { font-size: 46px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 17px; color: #6E6A60; font-weight: 500; margin-left: 4px; }

.admin-card {
  background: #15130F;
  border: 1px solid #211E19;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}
.admin-card h2 { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.admin-card h2 .badge {
  font-size: 11px; font-weight: 600; color: #C9A26B;
  border: 1px solid #3A3022; border-radius: 999px; padding: 3px 10px;
}

.draw-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.draw-controls input, .draw-controls select {
  font: inherit; font-size: 15px;
  background: #0C0B0A; border: 1px solid #2A2722; color: #fff;
  border-radius: 10px; padding: 11px 14px;
}
.draw-controls input.prize { flex: 1; min-width: 180px; }
.abtn {
  font: inherit; font-size: 14px; font-weight: 600;
  background: #F4F1EA; color: #0C0B0A; border: none;
  border-radius: 10px; padding: 12px 22px; cursor: pointer;
  transition: transform .12s var(--ease), opacity .2s;
}
.abtn:active { transform: scale(.97); }
.abtn:disabled { opacity: .35; cursor: not-allowed; }
.abtn.outline { background: transparent; color: #F4F1EA; border: 1px solid #2A2722; }

.winners-list { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.winner-row {
  display: flex; justify-content: space-between; align-items: center;
  background: #0C0B0A; border: 1px solid #211E19; border-radius: 10px;
  padding: 13px 16px; font-size: 14px;
}
.winner-row .nm { font-weight: 600; }
.winner-row .pz { color: #C9A26B; font-size: 13px; }
.winner-row .ph { color: #6E6A60; font-size: 12px; font-variant-numeric: tabular-nums; }

/* 추첨 풀스크린 연출 */
.stage {
  position: fixed; inset: 0;
  background: radial-gradient(120% 120% at 50% 30%, #1A1611 0%, #0C0B0A 60%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  text-align: center;
  padding: 40px;
}
.stage.show { display: flex; }
.stage .prize-label { font-size: 18px; letter-spacing: .14em; text-transform: uppercase; color: #C9A26B; font-weight: 600; }
.stage .rolling {
  font-size: clamp(48px, 12vw, 140px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin: 24px 0;
  min-height: 1.1em;
  font-variant-numeric: tabular-nums;
}
.stage .rolling.settle { animation: pop .5s var(--ease); }
@keyframes pop { 0% { transform: scale(.8); opacity: .4; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
.stage .sub { font-size: 17px; color: #8E8A80; }
.stage .stage-actions { margin-top: 50px; display: flex; gap: 14px; }
.stage .confetti-line { font-size: 15px; color: #6E6A60; margin-top: 8px; letter-spacing: .04em; }

@media (max-width: 720px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid .stat:last-child { grid-column: 1 / -1; }
  .admin-shell { padding: 22px 18px 50px; }
}
