/* ── CSS Variables ── */
:root {
  --bg:           #080810;
  --bg-surface:   #0f0f1a;
  --text:         #ededf5;
  --text-dim:     #5a5a78;
  --text-muted:   #2e2e42;
  --purple:       #8b7dff;
  --purple-dim:   rgba(139,125,255,0.18);
  --purple-glow:  rgba(139,125,255,0.4);
  --pink:         #ff5585;
  --pink-dim:     rgba(255,85,133,0.18);
  --pink-glow:    rgba(255,85,133,0.4);
  --gold:         #ffd84d;
  --gold-dim:     rgba(255,216,77,0.1);
  --card-bg:      #10101c;
  --card-border:  rgba(255,255,255,0.05);
  --divider:      #1e1e2e;
  --input-border: #252535;
  --radius:       14px;
}

/* ── Reset ── */
html {
  font-size: 125%;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background Effects ── */

/* 미세 그리드 패턴 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(139,125,255,0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,125,255,0.3) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

/* 상단 퍼플 글로우 */
.bg-glow {
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 700px;
  background: radial-gradient(ellipse, rgba(139,125,255,0.25) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* 하단 핑크 글로우 */
.bg-glow::after {
  content: '';
  position: fixed;
  bottom: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(255,85,133,0.2) 0%, transparent 65%);
  pointer-events: none;
}

/* 모든 콘텐츠를 그리드 위에 */
.header, .input-section, .result-area, .footer, .toast {
  position: relative;
  z-index: 1;
}

/* ── Header ── */
.header {
  text-align: center;
  padding: 65px 30px 0;
  max-width: 725px;
}

/* 뱃지 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid rgba(255, 216, 77, 0.2);
  border-radius: 20px;
  padding: 5px 14px;
  margin-bottom: 18px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: blink 1.8s ease-in-out infinite;
}

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

/* 로고 */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.logo-icon {
  font-size: 2.2rem;
  display: inline-block;
  position: relative;
  top: -12px;
  animation: wiggle 2.5s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-12deg); }
  30% { transform: rotate(10deg); }
  45% { transform: rotate(-6deg); }
  55% { transform: rotate(4deg); }
  65% { transform: rotate(0deg); }
}

.logo-text {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 2.6rem;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.headline {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  word-break: keep-all;
  margin-bottom: 6px;
  text-shadow: none;
}

.sub {
  font-size: 0.88rem;
  color: var(--text-dim);
  opacity: 0.75;
}

/* ── Tagline ── */
.tagline-wrap {
  margin-top: 14px;
  padding: 14px 20px;
  border: 1px solid rgba(139,125,255,0.15);
  border-radius: 10px;
  background: rgba(139,125,255,0.05);
  text-align: center;
}

.tagline-random {
  font-size: 0.78rem;
  color: rgba(237,237,245,0.5);
  font-style: italic;
  margin-bottom: 4px;
  line-height: 1.6;
  word-break: keep-all;
}

.tagline-random::before {
  content: '\201C';
  color: var(--purple);
  opacity: 0.5;
  font-size: 1rem;
  vertical-align: baseline;
  margin-right: 3px;
}

.tagline-random::after {
  content: '\201D';
  color: var(--purple);
  opacity: 0.5;
  font-size: 1rem;
  vertical-align: baseline;
}

.tagline-fixed {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 700;
  line-height: 1.6;
  word-break: keep-all;
  opacity: 1;
}

/* ── Input Section ── */
.input-section {
  width: 100%;
  max-width: 725px;
  padding: 0 30px;
  margin-top: 40px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  padding: 22px 80px 22px 25px;
  font-size: 1rem;
  font-family: 'Noto Sans KR', sans-serif;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input::placeholder {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.input-wrapper input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139,125,255,0.15), 0 0 20px rgba(139,125,255,0.1);
}

.char-count {
  position: absolute;
  right: 14px;
  bottom: 14px;
  font-size: 0.7rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Buttons ── */
.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  flex: 1;
  padding: 19px 12px;
  font-size: 0.92rem;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 700;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  color: #fff;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* shimmer effect */
.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transition: none;
}

.btn:hover:not(:disabled)::after {
  animation: shimmer 0.7s ease forwards;
}

@keyframes shimmer {
  to { left: 150%; }
}

.btn-cant {
  background: linear-gradient(135deg, #5c4fd6, var(--purple));
  box-shadow: 0 4px 24px rgba(139,125,255,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-cant:not(:disabled):hover {
  box-shadow: 0 8px 36px rgba(139,125,255,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.btn-must {
  background: linear-gradient(135deg, #c43060, var(--pink));
  box-shadow: 0 4px 24px rgba(255,85,133,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-must:not(:disabled):hover {
  box-shadow: 0 8px 36px rgba(255,85,133,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

/* ── Result Area ── */
.result-area {
  width: 100%;
  max-width: 725px;
  padding: 0 30px;
  margin-top: 35px;
  display: none;
}

.result-area.visible {
  display: block;
  animation: popUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Card ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 0 35px 32px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 8px 32px rgba(0,0,0,0.6),
    0 32px 80px rgba(0,0,0,0.4),
    0 0 80px rgba(139,125,255,0.08);
}

/* 상단 그라데이션 라인 */
.card-top-line {
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  margin: 0 -35px 0;
  border-radius: 4px 4px 0 0;
  box-shadow: 0 0 12px rgba(139,125,255,0.6), 0 0 24px rgba(255,85,133,0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  margin-bottom: 20px;
}

.card-header-left {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}


.card-body {
  text-align: center;
  padding: 0 0 6px;
}

.card-sentence {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-bottom: 4px;
  word-break: keep-all;
  line-height: 1.6;
}

.card-action {
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 700;
  color: var(--text);
}

/* 이유 문구 래퍼 */
.card-reason-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.card-reason {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.7;
  color: var(--text);
  padding: 14px 28px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 4px solid;
  border-image: linear-gradient(180deg, var(--purple), var(--pink)) 1;
  border-radius: 10px;
  word-break: keep-all;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  text-align: center;
}

.card-end {
  font-size: 0.95rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 12px;
  margin-bottom: 18px;
}

.card-divider {
  border: none;
  border-top: 1px dashed var(--divider);
  margin-bottom: 14px;
}

.card-stamp-area {
  position: relative;
}

.card-stamp {
  font-size: 0.82rem;
  color: rgba(237,237,245,0.55);
  font-style: italic;
  line-height: 1.6;
  padding-right: 50px;
}

/* 도장 — 보증 멘트 우측 하단에 겹치게 */
.card-stamp-seal {
  position: absolute;
  right: 0;
  bottom: -8px;
  width: 48px;
  height: 48px;
  border: 2px solid #e84040;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #e84040;
  text-align: center;
  line-height: 1.2;
  opacity: 0.4;
  transform: rotate(-15deg);
}

/* 파란 도장 — 왼쪽 */
.card-stamp-seal-blue {
  position: absolute;
  right: 56px;
  bottom: -6px;
  width: 48px;
  height: 48px;
  border: 2px solid #4a90d9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.52rem;
  font-weight: 700;
  color: #4a90d9;
  text-align: center;
  line-height: 1.2;
  opacity: 0.45;
  transform: rotate(10deg);
  letter-spacing: 0.02em;
}

/* ── Action Buttons ── */
.action-buttons {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.btn-action {
  flex: 1;
  padding: 15px 10px;
  font-size: 0.82rem;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-action:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(139,125,255,0.4);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-action:active {
  transform: scale(0.97);
}

/* 캡처 유도 */
.capture-hint {
  text-align: center;
  font-size: 0.72rem;
  color: rgba(237,237,245,0.55);
  margin-top: 14px;
}

/* ── Footer ── */
.footer {
  margin-top: auto;
  padding: 60px 30px 30px;
  font-size: 0.75rem;
  color: rgba(237,237,245,0.55);
  text-align: center;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--purple);
  color: #fff;
  padding: 13px 28px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(139,125,255,0.4);
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Shake ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.shake {
  animation: shake 0.35s ease;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .header { padding-top: 36px; }
  .logo-text { font-size: 2rem; }
  .logo-icon { font-size: 1.8rem; }
  .headline { font-size: 1.05rem; }
  .btn-group { flex-direction: column; }
  .card { padding: 0 18px 22px; }
  .card-reason { font-size: 0.98rem; }
  .card-action { font-size: 1.2rem; }
  .action-buttons { flex-wrap: wrap; }
  .action-buttons .btn-action {
    min-width: calc(50% - 4px);
    flex: 1 1 calc(50% - 4px);
  }
  .action-buttons .btn-action:last-child {
    flex: 1 1 100%;
  }
}

/* ── 페이지 레이아웃 ── */
.page-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 40px 0 0;
}

.main-content {
  flex: 1 1 0;
  max-width: 775px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── 사이드 배너 공통 ── */
.side-banner {
  flex: 0 0 240px;
  width: 240px;
  position: sticky;
  top: 40px;
  display: none;
  padding: 0 20px;
}

@media (min-width: 1100px) {
  .side-banner { display: block; }
}

.banner-inner {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.side-left .banner-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--purple), #a78bfa);
}

.side-right .banner-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--pink), #fb923c);
}

.banner-seal-icon,
.banner-ad-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.banner-title {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 2px;
}

.banner-subtitle {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--purple);
  font-weight: 700;
  margin-bottom: 10px;
}

.banner-ad-tag {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border: 1px solid var(--divider);
  padding: 2px 5px;
  border-radius: 4px;
}

.banner-ad-headline {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 10px;
}

.banner-divider {
  height: 1px;
  background: var(--divider);
  margin: 10px 0;
}

.banner-body {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.7;
  word-break: keep-all;
  text-align: left;
}

.banner-stamp {
  font-size: 0.62rem;
  color: var(--text-dim);
  line-height: 1.6;
  font-style: italic;
}

.banner-badge {
  margin-top: 12px;
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--purple);
  border: 1px solid rgba(139,125,255,0.3);
  background: rgba(139,125,255,0.06);
  padding: 4px 10px;
  border-radius: 99px;
}

.banner-cta {
  margin-top: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pink);
  cursor: pointer;
  transition: opacity 0.15s;
}

.banner-cta:hover { opacity: 0.7; }

/* ── 안전 필터 카드 ── */

/* 카테고리 A: 자해/자살 — 따뜻한 경고 */
.card-danger .card-top-line {
  background: linear-gradient(90deg, #ff6b6b, #ffa07a);
  box-shadow: 0 0 12px rgba(255,107,107,0.6), 0 0 24px rgba(255,160,122,0.3);
}

.card-danger .card-header-left {
  color: #ff6b6b;
}

.card-danger .card-reason {
  font-size: 1.1rem;
  color: var(--text);
  background: rgba(255,107,107,0.06);
  border: 1px solid rgba(255,107,107,0.15);
  text-align: center;
}

.card-danger .card-reason-wrap::before {
  background: linear-gradient(180deg, #ff6b6b, #ffa07a);
}

.card-danger .card-stamp {
  font-style: normal;
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--text-dim);
}

/* 카테고리 B: 중범죄 — 단호한 경고 */
.card-crime .card-top-line {
  background: linear-gradient(90deg, #ff4d4d, #cc0000);
  box-shadow: 0 0 12px rgba(255,77,77,0.6), 0 0 24px rgba(204,0,0,0.3);
}

.card-crime .card-header-left {
  color: #ff4d4d;
}

.card-crime .card-reason {
  font-size: 1.1rem;
  color: var(--text);
  background: rgba(255,77,77,0.06);
  border: 1px solid rgba(255,77,77,0.15);
  text-align: center;
}

.card-crime .card-reason-wrap::before {
  background: linear-gradient(180deg, #ff4d4d, #cc0000);
}

.card-crime .card-stamp {
  font-style: normal;
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--text-dim);
}

/* 안전 연락처 박스 */
.safety-links {
  margin-top: 16px;
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.safety-links-a {
  background: rgba(255,107,107,0.06);
  border: 1px solid rgba(255,107,107,0.2);
}

.safety-links-b {
  background: rgba(255,77,77,0.06);
  border: 1px solid rgba(255,77,77,0.2);
}

.safety-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.safety-item {
  font-size: 0.82rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.6;
  display: block;
  transition: opacity 0.15s;
}

a.safety-item:hover {
  opacity: 0.75;
}


/* ── 언어 스위처 ── */
.lang-switcher {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: -11px;
  margin-bottom: 14px;
}

.lang-btn {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body, sans-serif);
}

.lang-btn:hover {
  border-color: rgba(139,125,255,0.4);
  color: var(--text);
}

.lang-btn.active {
  border-color: var(--purple);
  color: var(--purple);
  background: rgba(139,125,255,0.1);
}

/* 베타 경고 */
.lang-beta-warning {
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255,216,77,0.07);
  border: 1px solid rgba(255,216,77,0.2);
  font-size: 0.72rem;
  color: var(--gold);
  text-align: center;
  line-height: 1.6;
  word-break: keep-all;
}

/* 모바일에서 언어 스위처 */
@media (max-width: 480px) {
  .lang-switcher {
    gap: 4px;
  }
  .lang-btn {
    font-size: 0.62rem;
    padding: 4px 7px;
  }
}
