/* AI 체험놀이터 공통 디자인
   배경: 「AI 놀이터 하늘」 하늘색→보라 그라데이션 + 데이터 점 격자 + 신경망 별자리 장식
   유메이커 노랑테두리 템플릿에서 가져온 것: 흰 테두리 선 · 노랑 #FFC107 포인트 · 빨강 강조 #D32F2F
   글꼴: 제목 페이퍼로지 8 ExtraBold / 소제목 6 SemiBold / 본문 5 Medium */
@font-face { font-family: 'Paperlogy'; src: url('fonts/Paperlogy-5Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Paperlogy'; src: url('fonts/Paperlogy-6SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Paperlogy'; src: url('fonts/Paperlogy-8ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --sky1: #7FCBFF;
  --sky2: #9AAEFF;
  --sky3: #B79CFF;
  --yellow: #FFC107;
  --yellow-deep: #F5A800;
  --yellow-soft: #FFF4CC;
  --red: #D32F2F;
  --pink: #FF8FB1;
  --ink: #1F2350;
  --ink-soft: #5A5F86;
  --card: #FFFFFF;
  --line: #E3E4F3;
  --mute: #EEF0F8;
  --mute-deep: #B9BDDA;
  --green: #2E9E5B;
  --blue: #1E88E5;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(40, 40, 120, .16);
  --frame: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--sky2); }
body {
  font-family: 'Paperlogy', 'Malgun Gothic', sans-serif;
  font-weight: 500;
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  background:
    url('bg-network.svg') right -70px top -60px / clamp(260px, 34vw, 440px) no-repeat fixed,
    url('bg-network.svg') left -90px bottom -110px / clamp(240px, 30vw, 400px) no-repeat fixed,
    radial-gradient(rgba(255,255,255,.32) 1.6px, transparent 2px) 0 0 / 26px 26px fixed,
    linear-gradient(150deg, var(--sky1) 0%, var(--sky2) 50%, var(--sky3) 100%) fixed;
}
/* 화면 가장자리 흰 테두리 선 (노랑테두리 템플릿) */
body::before {
  content: ''; position: fixed; inset: var(--frame); z-index: 0; pointer-events: none;
  border: 4px solid #fff; border-radius: 28px;
}
h1, h2, h3, .xb { font-weight: 800; }
h4, .sb { font-weight: 600; }
button, input, select { font-family: inherit; }
button { cursor: pointer; border: none; }
a { color: inherit; }
.hide { display: none !important; }

/* 제목 아래 가로선 + 동그라미 장식 (하늘 배경 위 = 노랑, 흰 카드 안도 노랑) */
.ttl { position: relative; display: inline-block; padding-bottom: 14px; }
.ttl::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 72%; height: 5px; border-radius: 5px;
  background: var(--deco, var(--yellow));
}
.ttl::before {
  content: ''; position: absolute; left: calc(72% + 8px); bottom: -3px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--deco, var(--yellow));
}
.card-area .ttl, .panel .ttl, .modal .ttl { --deco: var(--yellow); }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .65em 1.3em; border-radius: 999px; text-decoration: none;
  font-size: clamp(16px, min(2.3vh, 2vw), 21px); font-weight: 800;
  background: var(--card); color: var(--ink);
  box-shadow: 0 5px 0 rgba(0,0,0,.18);
  transition: transform .1s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.red { background: var(--red); color: #fff; }
.btn.ink { background: var(--ink); color: #fff; }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.green { background: var(--green); color: #fff; }
.btn.white { background: #fff; color: var(--ink); }
.btn.soft { background: var(--mute); color: var(--ink); box-shadow: none; }

/* ── 흰 카드 판 ── */
.panel { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }

/* ── 체험 화면 위쪽 바 ── */
.expbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  max-width: 1200px; margin: 0 auto; padding: calc(var(--frame) + 16px) 28px 8px;
}
.expbar h1 { flex: 1; min-width: 200px; font-size: clamp(24px, min(4.2vh, 3.6vw), 40px); }
.expbar .back { font-size: 17px; padding: .5em 1.1em; }
.expbar .sheet {
  background: var(--red); color: #fff; font-weight: 800; border-radius: 999px;
  padding: 8px 16px; font-size: clamp(14px, 1.6vw, 17px); box-shadow: 0 4px 0 rgba(0,0,0,.15);
}

/* 체험 본문 / 「AI의 비밀」 카드 */
.exp-main { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 8px 28px 16px; }
.secret {
  position: relative; z-index: 1;
  max-width: 1144px; margin: 10px auto 36px; padding: 18px 24px 18px 24px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 10px solid var(--red);
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
@media (max-width: 1200px) { .secret { margin-left: 28px; margin-right: 28px; } }
.secret .tag { background: var(--ink); color: var(--yellow); font-weight: 800; border-radius: 999px; padding: 6px 14px; font-size: 17px; white-space: nowrap; }
.secret p { flex: 1; min-width: 240px; font-size: clamp(17px, 1.9vw, 21px); }
.secret p b { color: var(--red); }

/* ── 카드(모달) ── */
.modal-bg {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(25, 28, 70, .55);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--card); color: var(--ink);
  border-radius: var(--radius); padding: clamp(22px, 3.4vh, 36px);
  width: min(600px, 100%); max-height: 92vh; overflow: auto;
  border: 5px solid var(--yellow); text-align: center;
  animation: pop .35s cubic-bezier(.2,1.4,.4,1);
}
.modal .emoji { font-size: clamp(48px, min(8vh, 9vw), 76px); line-height: 1.1; }
.modal h2 { font-size: clamp(22px, min(3.6vh, 4vw), 32px); margin: 8px 0 10px; }
.modal .body { font-size: clamp(16px, min(2.4vh, 2.6vw), 20px); line-height: 1.65; color: var(--ink-soft); }
.modal .body b { color: var(--red); }
.modal .btn { margin-top: 18px; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── 토스트 ── */
.toast {
  position: fixed; left: 50%; bottom: 60px; z-index: 120;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--yellow);
  padding: 12px 24px; border-radius: 999px; font-weight: 800;
  font-size: clamp(16px, min(2.4vh, 2.6vw), 22px);
  box-shadow: 0 8px 20px rgba(0,0,0,.25); opacity: 0; transition: .3s; pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 켜기/끄기 스위치 (관리자) ── */
.sw { position: relative; width: 78px; height: 40px; flex: 0 0 auto; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw span {
  position: absolute; inset: 0; border-radius: 999px; background: #C5C8DE; transition: .2s;
  display: flex; align-items: center; justify-content: flex-end; padding: 0 10px;
  font-size: 13px; font-weight: 800; color: #fff;
}
.sw span::before { content: ''; position: absolute; left: 4px; top: 4px; width: 32px; height: 32px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.sw span::after { content: var(--off, '꺼짐'); }
.sw input:checked + span { background: var(--green); justify-content: flex-start; }
.sw input:checked + span::before { transform: translateX(38px); }
.sw input:checked + span::after { content: var(--on, '켜짐'); }
.sw input:disabled + span { opacity: .45; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── 체험 페이지 안에서 쓰는 공통 부품 ── */
.box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 3vh, 30px); }
.box + .box { margin-top: 16px; }
.hint { font-weight: 600; color: var(--ink-soft); font-size: clamp(16px, 1.9vw, 20px); margin-bottom: 14px; }
.box .hint b { color: var(--red); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }

/* 탭 (위쪽 큰 알약 버튼) */
.tabs { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  flex: 1; min-width: 160px; padding: .7em 1em; border-radius: 999px;
  background: rgba(255,255,255,.55); color: var(--ink); font-weight: 800;
  font-size: clamp(16px, 1.9vw, 21px);
}
.tab.on { background: #fff; box-shadow: 0 5px 0 var(--yellow-deep); }

/* 고르는 버튼 */
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  padding: .55em 1em; border-radius: 16px; border: 3px solid var(--line); background: #fff; color: var(--ink);
  font-weight: 600; font-size: clamp(15px, 1.7vw, 19px);
}
.choice:hover { border-color: var(--sky2); }
.choice.on { border-color: var(--yellow-deep); background: var(--yellow-soft); }
.choice.good { border-color: var(--green); background: #E5F6EC; }
.choice.bad { border-color: var(--red); background: #FDE8E8; }
.choice:disabled { cursor: default; }

.bigbtns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.bigbtns .btn { flex: 1 1 auto; }
.result { margin-top: 14px; background: var(--yellow-soft); border-radius: 18px; padding: 16px 18px; font-size: clamp(16px, 1.9vw, 20px); line-height: 1.6; }
.result b { color: var(--red); }
.result.good { background: #E5F6EC; }
.counter { font-weight: 800; color: var(--ink-soft); font-size: 15px; text-align: right; margin-bottom: 6px; }

/* 카메라 */
.cam { position: relative; border-radius: 18px; overflow: hidden; background: #1F2350; aspect-ratio: 4 / 3; display: grid; place-items: center; color: #fff; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam .msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; font-size: 18px; line-height: 1.6; }
