:root {
  --brand: #053A41;
  --accent: #FF6648;
  /* 기기 다크모드와 무관하게 라이트 테마 고정 (네이티브 폼 컨트롤/스크롤바 포함) */
  color-scheme: light only;
}

html, body {
  height: 100%;
}

body {
  font-family: "Pretendard", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: #ffffff !important;
  color: #0f172a;
}

/* print 차단 */
@media print {
  body {
    display: none !important;
  }
}

.no-select {
  -webkit-user-select: none;
  user-select: none;
}

.watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: multiply;
  background-repeat: repeat;
}

.lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.65);
  color: white;
}

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

.blur-lock {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(20px);
  background: rgba(255,255,255,0.12);
  color: #0b1220;
}

.blur-lock.show {
  display: flex;
}

.button-brand {
  background: var(--brand);
  color: white;
}

.button-accent {
  background: var(--accent);
  color: white;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  background: rgba(5, 58, 65, 0.08);
  color: var(--brand);
}

.timer-danger {
  color: var(--accent);
  animation: blink 1s linear infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}

/* ===== Host 상단: PIN 코드로 입장 버튼 ===== */
.join-link {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 9999px;
  color: var(--brand);
  background: rgba(5, 58, 65, 0.08);
  text-decoration: none;
  white-space: nowrap;
}

/* ===== PWA 설치 안내 배너 (하단 고정) ===== */
.pwa-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  padding: 10px max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

.pwa-banner.hidden {
  display: none;
}

.pwa-banner-inner {
  max-width: 48rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pwa-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
}

.pwa-banner-text {
  flex: 1;
  min-width: 0;
}

.pwa-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-desc {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-install {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  background: var(--brand);
  padding: 10px 14px;
  border-radius: 10px;
  white-space: nowrap;
}

.pwa-banner-install.hidden {
  display: none;
}

.pwa-banner-dismiss {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  color: #64748b;
  background: #f1f5f9;
}

body.has-pwa-banner main {
  padding-bottom: 92px;
}

/* ===== Guest 상단 고정 바: 360~430px 폭에서 잘림 없이 반응형 ===== */
.gh-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px clamp(10px, 4vw, 16px);
  gap: clamp(6px, 2vw, 12px);
}

.gh-brand-group {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.6vw, 8px);
  min-width: 0;
}

.gh-brand {
  font-weight: 700;
  color: var(--brand);
  font-size: clamp(0.72rem, 3.1vw, 0.95rem);
  white-space: nowrap;
}

.gh-pin-badge {
  font-size: clamp(0.6rem, 2.5vw, 0.78rem) !important;
  padding: clamp(2px, 0.6vw, 4px) clamp(6px, 2vw, 10px) !important;
  white-space: nowrap;
}

.gh-timer-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
  flex-shrink: 0;
}

.gh-timer-label {
  font-size: clamp(0.56rem, 2.1vw, 0.7rem);
  color: #64748b;
  white-space: nowrap;
}

.gh-timer-value {
  font-size: clamp(0.85rem, 3.4vw, 1.05rem);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* ===== 금액 카드: 3열 레이아웃에서 숫자가 테두리에 닿거나 줄바꿈되지 않도록 ===== */
.money-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 2vw, 12px);
}

.money-card {
  min-width: 0;
  padding: clamp(8px, 2.6vw, 16px);
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.money-card-label {
  font-size: clamp(0.58rem, 2.1vw, 0.75rem);
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.money-card-value {
  margin-top: 8px;
  font-size: clamp(0.66rem, 2.6vw, 0.875rem);
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
}

/* 대각선 보안 워터마크: 라이트 배경에서 은은하지만 식별 가능한 명도 */
.watermark {
  opacity: 0.16;
}

/* ===== 템플릿 4: 소개팅·모임 밸런스 게임 ===== */
.balance-card {
  min-height: 128px;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.balance-card:active {
  transform: scale(0.98);
}

.balance-card-disabled {
  cursor: default;
}

.balance-card-side {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 10px;
  border-radius: 9999px;
  background: rgba(5, 58, 65, 0.08);
  color: var(--brand);
}

.balance-card-text {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.balance-card-pct {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

.balance-card-pct.hidden {
  display: none;
}

.balance-card-active {
  border-color: var(--brand);
  background: rgba(5, 58, 65, 0.06);
}

.balance-card-active .balance-card-side {
  background: var(--brand);
  color: #ffffff;
}

.balance-result.hidden {
  display: none;
}

.balance-result-bar {
  height: 10px;
  border-radius: 9999px;
  background: rgba(255, 102, 72, 0.18);
  overflow: hidden;
  animation: balancePop 0.35s ease;
}

.balance-result-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 9999px;
  transition: width 0.5s ease;
}

.balance-result-caption {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.balance-result-match {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(255, 102, 72, 0.12);
  border-radius: 16px;
  padding: 14px;
  animation: balancePop 0.4s ease;
}

.balance-result-empty {
  text-align: center;
  font-size: 13px;
  color: #64748b;
}

@keyframes balancePop {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
