:root {
  --fans-pink: #FF4E6A;
  --fans-pink-dark: #E03A54;
  --fans-bg: #F4F5F7;
  --text-main: #191F28;
  --text-sub: #6B7684;
  --border-color: #E5E8EB;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", sans-serif;
}

body {
  background-color: #E9ECEF;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* 모바일 앱 뷰포트 컨테이너 */
.app-container {
  width: 100%;
  max-width: 440px;
  background-color: #FFFFFF;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.06);
  padding-bottom: 90px;
}

/* 상단 헤더 (FANS 스타일) */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-color);
}

.header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.badge-fans {
  background-color: var(--fans-pink);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* 실시간 서버 시계 바 */
.clock-bar {
  background-color: #191F28;
  color: #FFFFFF;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.clock-label {
  font-size: 12px;
  color: #ADB5BD;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 7px;
  height: 7px;
  background-color: #FF4E6A;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.clock-time {
  font-family: "SF Mono", "Roboto Mono", monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #00F5A0;
}

/* 테스트 설정 컨트롤 패널 */
.control-panel {
  background-color: var(--fans-bg);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.control-group {
  display: flex;
  gap: 6px;
}

.control-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
}

select,
.btn-mini {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #D1D6DB;
  background: #FFF;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.btn-mini {
  background: var(--text-main);
  color: #FFF;
  border: none;
  cursor: pointer;
}

.btn-mini:active {
  opacity: 0.8;
}

/* 이벤트 본문 (FANS 공지 스타일) */
.event-content {
  padding: 20px 18px;
}

.event-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--fans-pink);
  background: #FFF0F3;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.event-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-main);
  margin-bottom: 12px;
}

.event-meta {
  font-size: 12px;
  color: var(--text-sub);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 18px;
  line-height: 1.6;
}

.highlight-pink {
  color: var(--fans-pink);
}

.info-box {
  background-color: var(--fans-bg);
  border-radius: 12px;
  padding: 16px;
  font-size: 13px;
  color: #333D4B;
  line-height: 1.65;
  margin-bottom: 20px;
}

.info-box strong {
  color: var(--text-main);
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

/* 최근 기록 영역 */
.history-section {
  margin-top: 10px;
}

.history-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.btn-clear {
  color: #8B95A1;
  font-weight: 400;
  cursor: pointer;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-item {
  background: #F9FAFB;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.history-item.empty {
  color: #8B95A1;
  justify-content: center;
}

.history-time {
  font-family: monospace;
  color: #333D4B;
}

/* 하단 고정 신청 버튼 (FANS 시그니처) */
.bottom-bar {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: #FFFFFF;
  padding: 12px 16px 20px;
  border-top: 1px solid var(--border-color);
  z-index: 20;
}

.btn-apply {
  width: 100%;
  height: 52px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.05s ease, background-color 0.15s ease;
}

.btn-apply:active {
  transform: scale(0.985);
}

.btn-wait {
  background-color: #E5E8EB;
  color: #8B95A1;
}

.btn-active {
  background-color: var(--fans-pink);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(255, 78, 106, 0.35);
}

.btn-penalty {
  background-color: #333D4B;
  color: #FF6B6B;
}

/* 결과 모달 (로딩 없이 즉시 팝업) */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-card {
  background: #FFFFFF;
  width: 100%;
  max-width: 360px;
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  animation: popIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from {
    transform: scale(0.92);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.result-status {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 12px;
}

.status-win {
  background: #E8F8F0;
  color: #00A86B;
}

.status-sub {
  background: #FFF4E5;
  color: #FF8A00;
}

.status-fail {
  background: #FFEBEE;
  color: #E53935;
}

.result-rank-label {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.result-rank {
  font-size: 34px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 16px;
}

.result-rank span {
  color: var(--fans-pink);
}

.result-detail-box {
  background: var(--fans-bg);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.detail-row span:first-child {
  color: var(--text-sub);
}

.detail-row span:last-child {
  font-weight: 700;
  color: var(--text-main);
  font-family: monospace;
  font-size: 14px;
}

.btn-retry {
  width: 100%;
  height: 46px;
  background: var(--fans-pink);
  color: #FFF;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

}