* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
}
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
  background: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.ticket-container {
  width: 100%;
  max-width: 400px;
  max-height: 98dvh;
  margin-top: 0;
}

.ticket-card {
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0,0,0,0.12);
}

/* 상단 네온 헤더 */
.ticket-header {
  background: url('../images/bg-neon.png') center center / cover no-repeat;
  padding: 24px 24px;
  text-align: center;
}

.header-logo {
  width: 70px;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* 본문 흰색 영역 */
.ticket-body {
  background: #fff;
  padding: 16px 24px;
  text-align: center;
}

.ticket-title {
  font-size: 22px;
  font-weight: 900;
  color: #111;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.ticket-user-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.ticket-name {
  font-size: 16px;
  font-weight: 700;
  color: #222;
}

.ticket-phone {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  letter-spacing: 1px;
}

/* QR 코드 */
.qr-wrapper {
  display: inline-block;
  margin-bottom: 12px;
  position: relative;
}

#qrArea {
  width: 160px;
  height: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#qrArea img,
#qrArea canvas {
  display: block;
}

.qr-overlay {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.85);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 8px;
}

.qr-overlay.show {
  display: flex;
}

.qr-overlay span {
  font-size: 13px;
  color: #666;
  font-weight: 600;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #ddd;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 타이머 */
.timer-section {
  margin-bottom: 12px;
}

.timer-label {
  font-size: 11px;
  color: #999;
  margin-bottom: 4px;
}

.timer-display {
  font-size: 24px;
  font-weight: 700;
  color: #222;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

.timer-display.warning {
  color: #E74C3C;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.timer-bar {
  width: 100%;
  height: 3px;
  background: #eee;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3498DB, #2C3E50);
  border-radius: 2px;
  transition: width 1s linear;
}

.timer-bar-fill.warning {
  background: linear-gradient(90deg, #E74C3C, #C0392B);
}

/* 안내 문구 */
.ticket-notice {
  font-size: 12px;
  color: #555;
  line-height: 1.7;
  text-align: center;
  font-weight: 500;
}

/* 하단 네온 푸터 */
.ticket-footer {
  background: url('../images/bg-neon.png') center center / cover no-repeat;
  padding: 20px 24px 14px;
  text-align: center;
}

.footer-logo {
  width: 150px;
  height: auto;
  margin: 0 auto 0;
  display: block;
}

.footer-logo-run {
  width: 130px;
  height: auto;
  margin: 0 auto 8px;
  display: block;
}

.footer-copyright {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
}

/* 결과 영역 */
.result-box {
  display: none;
  margin-top: 16px;
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.8;
}

.result-box.success {
  display: block;
  background: #E8F8F5;
  color: #1ABC9C;
  border: 1px solid #1ABC9C;
}

.result-box.error {
  display: block;
  background: #FDEDEC;
  color: #E74C3C;
  border: 1px solid #E74C3C;
}

/* 조회 폼 */
.lookup-form {
  margin-top: 20px;
  text-align: left;
}

.lookup-form .form-group {
  margin-bottom: 16px;
}

.lookup-form .form-group label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 600;
}

.lookup-form .form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.lookup-form .form-group input:focus {
  border-color: #333;
}

.lookup-form .submit-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  background: #222;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  font-family: inherit;
}

.lookup-form .submit-btn:hover {
  opacity: 0.9;
}

.lookup-error {
  background: #FDEDEC;
  color: #E74C3C;
  border: 1px solid #E74C3C;
  padding: 14px;
  border-radius: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* 인증 영역 */
#step1 .form-group {
  margin-bottom: 16px;
  text-align: left;
}

#step1 .form-group label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 600;
}

#step1 .form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

#step1 .form-group input:focus {
  border-color: #333;
}

#step1 .submit-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  background: #222;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  font-family: inherit;
}

#step1 .submit-btn:hover {
  opacity: 0.9;
}

#step1 .submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─────────────────────────────
   투표 페이지 (festival-vote.php)
   ───────────────────────────── */

/* 투표 페이지는 카테고리가 많아 스크롤 필요 */
body.vote-page,
body.vote-page html {
  position: static;
  overflow: auto;
  height: auto;
  min-height: 100%;
}

body.vote-page {
  align-items: flex-start;
  padding: 0;
}

body.vote-page .ticket-container {
  max-height: none;
}

.vote-category {
  margin-bottom: 18px;
  text-align: left;
}

.vote-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  color: #111;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.vote-category-title::before,
.vote-category-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e5e5;
}

.car-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.car-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  min-height: 46px;
  text-align: center;
  word-break: keep-all;
}

.car-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.car-option:has(input[type="radio"]:checked) {
  border-color: #222;
  background: #222;
  color: #fff;
}

.vote-submit {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  background: #222;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  font-family: inherit;
}

.vote-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 이미 투표 완료한 사용자용 결과 영역 */
.vote-result-list {
  text-align: left;
  margin-bottom: 16px;
}

.vote-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f6f6f6;
  border-radius: 10px;
  margin-bottom: 8px;
}

.vote-result-label {
  font-size: 13px;
  font-weight: 700;
  color: #666;
}

.vote-result-value {
  font-size: 15px;
  font-weight: 800;
  color: #111;
  text-align: right;
  word-break: keep-all;
}

.vote-done-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 14px;
  background: #E8F8F5;
  color: #1ABC9C;
  border: 1px solid #1ABC9C;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

/* 마감 + 미참여자용 안내 박스 */
.vote-closed-box {
  margin: 14px 0 16px;
  padding: 28px 16px;
  background: #FDEDEC;
  border: 1px solid #E74C3C;
  border-radius: 12px;
  text-align: center;
}

.vote-closed-title {
  font-size: 16px;
  font-weight: 800;
  color: #C0392B;
  margin-bottom: 6px;
}

.vote-closed-sub {
  font-size: 13px;
  font-weight: 600;
  color: #C0392B;
}

/* 유효하지 않은 티켓 */
.no-data {
  padding: 60px 24px;
  text-align: center;
  color: #999;
  font-size: 15px;
}

.no-data a {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 24px;
  background: #333;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
