/* =====================================================================
 *  시니어 키오스크 교육 앱 - 스타일
 *  큰 글씨 · 큰 버튼 · 고대비 + 실제 버거킹 키오스크 구조 재현
 * =================================================================== */

:root {
  /* 앱 브랜드(셸) 컬러 — 인트로/미션선택/난이도선택 등 공통 UI 전용 */
  --primary: #6AAEFF;
  --primary-strong: #5B94F5;
  --primary-grad: linear-gradient(135deg, #A8C8FF 0%, #7AABFF 30%, #5B94F5 60%, #7EC8FF 100%);

  /* 연습(버거킹) 전용 컬러 — JS가 시나리오별로 덮어씀. 절대 셸 UI에 쓰지 말 것 */
  --brand: #d62300;
  --brand-dark: #502314;
  --ink: #1a1a1a;
  --muted: #5b5b5b;
  --line: #e3e3e3;
  --ok: #1f8a4c;
  --warn: #c0392b;
  --bg: #2b2b2b;
  --hi: #ffd400;
  --red: #ff0006;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
  user-select: none; -webkit-user-select: none; overscroll-behavior: none;
  word-break: keep-all; overflow-wrap: break-word;
}

/* ----- 키오스크 베젤 ----- */
#stage { height: 100%; }
.kiosk-stage { height: 100%; display: flex; align-items: center; justify-content: center; padding: 14px; }
.kiosk {
  position: relative; width: 100%; max-width: 560px; height: 100%; max-height: 980px;
  background: #fff; border: 14px solid #111; border-radius: 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  display: flex; flex-direction: column; overflow: hidden;
}

/* ----- 상단 바 ----- */
.topbar { flex: 0 0 auto; background: var(--primary); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.topbar.play { background: var(--brand); } /* 연습 화면에서만 시나리오 색 사용 */
.topbar .brand { font-size: 23px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.topbar .mode-badge { font-size: 15px; font-weight: 800; background: rgba(0,0,0,.22); padding: 5px 12px; border-radius: 999px; }
.topbar .spacer { flex: 1; }
.iconbtn { border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 17px; font-weight: 700; padding: 9px 13px; border-radius: 10px; cursor: pointer; min-height: 44px; }
.iconbtn:active { transform: scale(.96); }
.iconbtn.off { opacity: .45; text-decoration: line-through; }

/* ----- 본문 ----- */
.screen { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; }
.pad { padding: 18px 16px; }

/* ----- 하단 안내 푸터 (키키 + 미션 + 진행률) ----- */
.learn-footer { flex: 0 0 auto; background: #1c1c1c; color: #fff; padding: 12px 14px 12px; }
.learn-footer .mission {
  display: flex; align-items: flex-start; gap: 10px; min-height: 56px;
  font-size: 20px; font-weight: 800; line-height: 1.35;
}
.learn-footer .mission .kiki { font-size: 40px; flex: 0 0 auto; cursor: pointer; animation: bob 2.4s ease-in-out infinite; }
.learn-footer .mission .speak { border: 0; background: #333; color: #fff; border-radius: 9px; font-size: 16px; padding: 6px 9px; cursor: pointer; flex: 0 0 auto; }
.learn-footer .mission b { color: var(--hi); }
.learn-footer .progress { margin-top: 10px; height: 26px; background: #000; border-radius: 7px; overflow: hidden; position: relative; }
.learn-footer .progress .fill { height: 100%; width: 0; background: linear-gradient(90deg, #ffb300, var(--brand)); transition: width .35s ease; }
.learn-footer .progress .ptext { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }
.learn-footer .ctrls { display: flex; gap: 8px; margin-top: 10px; }
.learn-footer .ctrls button { flex: 1; border: 0; background: #333; color: #fff; font-size: 16px; font-weight: 800; padding: 12px; border-radius: 10px; cursor: pointer; min-height: 50px; }
.learn-footer .ctrls .danger { background: #5a1f19; }
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }

/* ----- STEP 인디케이터(결제) ----- */
.steps { display: flex; background: #111; color: #fff; }
.steps .st { flex: 1; text-align: center; padding: 10px 4px; font-size: 14px; font-weight: 800; opacity: .4; border-right: 1px solid #333; line-height: 1.3; }
.steps .st:last-child { border-right: 0; }
.steps .st.on { opacity: 1; background: var(--brand); }
.steps .st .n { display: block; font-size: 12px; opacity: .85; }

/* ----- 언어 선택 ----- */
.lang { flex: 1; display: flex; flex-direction: column; }
.lang .hero { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 110px; background: #f4f4f4; }
.lang .black { background: #000; color: #fff; text-align: center; padding: 20px 12px; }
.lang .black h2 { font-size: 30px; font-weight: 800; margin: 0; letter-spacing: 1px; }
.lang .black .en { font-size: 16px; opacity: .85; margin: 6px 0 16px; }
.lang .flags { display: flex; justify-content: center; gap: 14px; }
.lang .flag { background: none; border: 0; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 12px; }
.lang .flag .f { font-size: 46px; }
.lang .flag .l { font-size: 18px; font-weight: 800; }

/* ----- 카테고리 탭 ----- */
.tabs { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.tab { border: 1px solid var(--line); background: #fafafa; padding: 16px 6px; font-size: 17px; font-weight: 800; cursor: pointer; min-height: 64px; }
.tab.active { background: var(--brand); color: #fff; }

/* ----- 메뉴 격자 ----- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.grid.three { grid-template-columns: 1fr 1fr 1fr; }
.card {
  border: 3px solid var(--line); background: #fff; border-radius: var(--radius);
  padding: 12px 8px; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  position: relative;
}
.card .em { font-size: 44px; }
.card .nm { font-size: 17px; font-weight: 800; line-height: 1.25; }
.card .ds { font-size: 12px; color: var(--muted); line-height: 1.3; }
.card .pr { font-size: 18px; font-weight: 800; color: var(--brand); }
.card.dim { opacity: .55; }

/* ----- 정답 강조(초급) ----- */
.ans-hi { box-shadow: 0 0 0 4px var(--hi), 0 6px 18px rgba(214,35,0,.25) !important; border-color: var(--brand) !important; animation: pulse 1.2s ease-in-out infinite; position: relative; z-index: 5; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 4px var(--hi),0 6px 18px rgba(214,35,0,.25)} 50%{box-shadow:0 0 0 10px rgba(255,212,0,.4),0 6px 18px rgba(214,35,0,.25)} }
.hand { position: absolute; right: -4px; bottom: -12px; font-size: 34px; pointer-events: none; animation: tap 1s ease-in-out infinite; z-index: 6; }
@keyframes tap { 0%,100%{transform:translateY(0) rotate(-8deg)} 50%{transform:translateY(-7px) rotate(-8deg)} }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-7px)} 75%{transform:translateX(7px)} }

/* ----- 모달 오버레이 ----- */
.overlay { position: absolute; inset: 0; background: rgba(76,76,76,.76); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 20; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 460px; max-height: 92%; overflow-y: auto; }
.modal h3 { font-size: 22px; font-weight: 800; text-align: center; padding: 18px 14px 12px; margin: 0; border-bottom: 1px solid var(--line); }
.modal .row { display: flex; align-items: center; gap: 12px; padding: 16px 16px; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.modal .row .chk { width: 26px; height: 26px; border: 2px solid #bbb; border-radius: 6px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.modal .row.sel .chk { background: var(--brand); border-color: var(--brand); color: #fff; }
.modal .row .info { flex: 1; }
.modal .row .info .t { font-size: 19px; font-weight: 800; }
.modal .row .info .d { font-size: 13px; color: var(--muted); margin-top: 3px; }
.modal .row .info .p { font-size: 17px; font-weight: 800; color: var(--red); margin-top: 4px; }
.modal .row .em { font-size: 38px; }
.modal .foot { padding: 14px; }
.modal .upimg { font-size: 70px; text-align: center; padding: 10px; }
.modal .uptext { font-size: 18px; text-align: center; padding: 6px 18px 14px; line-height: 1.5; }
.modal .uprow { display: flex; gap: 10px; padding: 0 14px 16px; }
.modal .uprow button { flex: 1; }

/* ----- 큰 버튼 ----- */
.btn { border: 0; border-radius: 12px; font-size: 22px; font-weight: 800; padding: 18px; cursor: pointer; min-height: 64px; width: 100%; position: relative; }
.btn:active { transform: scale(.98); }
.btn-dark { background: #333; color: #fff; }
.btn-red { background: var(--brand); color: #fff; }
.btn-gray { background: #8a8a8a; color: #fff; }
.btn-line { background: #fafafa; color: var(--ink); border: 2px solid var(--line); }
.btn-primary { background: var(--primary-strong); color: #fff; }

/* ----- 문의 폼 ----- */
.contact-overlay { z-index: 80; }
.contact-modal { max-width: 440px; }
.cform { padding: 16px; }
.cform label { display: block; font-size: 16px; font-weight: 800; margin: 12px 0 6px; }
.cform label:first-child { margin-top: 0; }
.cform .req { color: var(--brand); }
.cform input, .cform textarea {
  width: 100%; border: 2px solid var(--line); border-radius: 10px;
  padding: 14px; font-size: 18px; font-family: inherit;
  user-select: text; -webkit-user-select: text;
}
.cform input:focus, .cform textarea:focus { outline: none; border-color: var(--primary); }
.cform textarea { resize: none; }
.cform .seg { display: flex; gap: 8px; }
.cform .seg button { flex: 1; border: 2px solid var(--line); background: #fafafa; font-size: 16px; font-weight: 800; padding: 12px; border-radius: 10px; cursor: pointer; }
.cform .seg button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.cform-btns { display: flex; gap: 10px; margin-top: 16px; }
.cform-btns .btn { font-size: 19px; padding: 15px; min-height: 56px; }
.cform-msg { font-size: 15px; font-weight: 700; margin-top: 12px; min-height: 20px; text-align: center; }
.cform-msg.ok { color: var(--ok); }
.cform-msg.bad { color: var(--warn); }

/* ----- 메뉴확인(수량/카트) ----- */
.confirm-wrap { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.confirm-wrap h2 { font-size: 24px; font-weight: 800; text-align: center; margin: 4px 0; }
.sel-item { text-align: center; }
.sel-item .em { font-size: 80px; }
.sel-item .nm { font-size: 22px; font-weight: 800; margin-top: 4px; }
.sel-item .change { margin-top: 8px; font-size: 14px; background: #333; color: #fff; border: 0; padding: 8px 14px; border-radius: 8px; }
.qty-row { display: flex; align-items: center; justify-content: space-between; border: 2px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.qty-row .lab { font-size: 19px; font-weight: 800; }
.qty-row .amt { color: var(--red); font-weight: 800; font-size: 20px; }
.stepper { display: flex; align-items: center; }
.stepper button { width: 56px; height: 56px; border: 0; background: #999; color: #fff; font-size: 28px; font-weight: 800; cursor: pointer; position: relative; }
.stepper button:first-child { border-radius: 10px 0 0 10px; }
.stepper button:last-child { border-radius: 0 10px 10px 0; }
.stepper .num { width: 64px; height: 56px; border-top: 2px solid #ccc; border-bottom: 2px solid #ccc; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; }

/* 카트 바 */
.cartbar { border-top: 3px solid #111; }
.cartbar .summary { display: flex; padding: 12px; gap: 10px; font-size: 15px; font-weight: 800; }
.cartbar .summary .half { flex: 1; text-align: center; }
.cartbar .summary .cnt { background: var(--red); color: #fff; border-radius: 999px; padding: 1px 9px; margin-left: 6px; }
.cartbar .summary .won { color: var(--red); margin-left: 6px; }
.cartbar .empty { text-align: center; color: var(--muted); font-size: 14px; padding: 6px 0 12px; }
.cartbar .acts { display: flex; }
.cartbar .acts button { flex: 1; border: 0; padding: 16px; font-size: 18px; font-weight: 800; cursor: pointer; min-height: 60px; }
.cartbar .acts .cancel { background: #eee; color: #444; }
.cartbar .acts .pay { background: var(--brand); color: #fff; position: relative; }

/* 하단 키오스크 툴바(쿠폰 등 — 장식) */
.kiosk-toolbar { display: flex; background: #000; }
.kiosk-toolbar button { flex: 1; background: none; border: 0; color: #fff; font-size: 13px; font-weight: 700; padding: 12px 4px; opacity: .8; }

/* ----- STEP1 주문확인 ----- */
.order-confirm { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.order-confirm .ttl { font-size: 22px; font-weight: 800; text-align: center; }
.order-confirm .line { display: flex; justify-content: space-between; font-size: 19px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.order-confirm .line.total { font-size: 24px; font-weight: 800; border: 0; }
.order-confirm .line.total .v { color: var(--red); }
.order-confirm .acts { display: flex; gap: 10px; margin-top: 6px; }

/* ----- STEP2 결제수단 ----- */
.pay-method { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.pay-method .ttl { font-size: 23px; font-weight: 800; text-align: center; }
.pay-method .total { text-align: center; font-size: 20px; font-weight: 800; }
.pay-method .total .v { color: var(--red); }
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.method { border: 3px solid var(--line); border-radius: var(--radius); padding: 24px 10px; text-align: center; cursor: pointer; font-size: 21px; font-weight: 800; position: relative; }

/* ----- 번호판(ATM 비밀번호/금액) ----- */
.pinpad { padding: 18px 16px; text-align: center; }
.pinpad .ttl { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.pin-sub { font-size: 16px; color: var(--muted); margin-bottom: 14px; line-height: 1.4; }
.pin-disp { font-size: 40px; font-weight: 800; letter-spacing: 10px; min-height: 56px; background: #f3f3f3; border-radius: 12px; padding: 10px; margin-bottom: 16px; }
.pin-keys { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; max-width: 380px; margin: 0 auto; }
.pin-key { border: 2px solid var(--line); background: #fff; border-radius: 14px; font-size: 30px; font-weight: 800; padding: 18px 0; cursor: pointer; min-height: 72px; position: relative; }
.pin-key:active { transform: scale(.97); }
.pin-key.ok { background: var(--ok); color: #fff; border-color: var(--ok); font-size: 22px; }
.pin-key.clr { background: #f0f0f0; color: var(--warn); font-size: 20px; }
.method .em { font-size: 48px; display: block; margin-bottom: 6px; }

/* ----- 카드 투입 / 완료 ----- */
.center-scene { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 24px; cursor: pointer; }
.center-scene .big { font-size: 96px; animation: bob 2s ease-in-out infinite; }
.center-scene h2 { font-size: 27px; font-weight: 800; margin: 0; line-height: 1.3; }
.center-scene .sub { font-size: 17px; color: var(--muted); line-height: 1.4; }
.card-slot { width: 230px; height: 64px; border: 4px dashed var(--brand); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 34px; background: #fff5f3; margin-top: 8px; }
.center-scene .total { font-size: 19px; font-weight: 800; }
.center-scene .total .v { color: var(--red); }
.tap-hint { font-size: 19px; font-weight: 800; color: #fff; background: var(--brand); padding: 14px 22px; border-radius: 999px; animation: glow 1.4s ease-in-out infinite; margin-top: 6px; }
@keyframes glow { 0%,100%{opacity:1} 50%{opacity:.5} }

.done-info { font-size: 20px; font-weight: 800; background: #f3f3f3; padding: 14px 22px; border-radius: 12px; }
.done-info .no { color: var(--brand); font-size: 26px; }
.praise { font-size: 20px; color: var(--ok); font-weight: 800; }

/* ----- 토스트 ----- */
.toast { position: absolute; left: 50%; bottom: 230px; transform: translateX(-50%) translateY(20px); background: rgba(20,20,20,.93); color: #fff; font-size: 19px; font-weight: 800; padding: 14px 22px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 60; max-width: 88%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: #b23b2e; }

/* 색종이 */
.confetti { position: absolute; top: -10px; width: 10px; height: 16px; opacity: .9; z-index: 50; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(1000px) rotate(540deg); opacity: 0; } }

/* =====================================================================
 *  선택 화면들 (미션 / 난이도)
 * =================================================================== */
.select-screen { padding: 26px 20px; overflow-y: auto; height: 100%; }
.select-screen .title { text-align: center; margin-bottom: 18px; }
.select-screen .title h1 { font-size: 28px; font-weight: 800; margin: 0; }
.select-screen .title p { font-size: 17px; color: var(--muted); margin: 8px 0 0; }
/* 연습 카탈로그 그리드 */
.practice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 6px; }
.practice-card {
  position: relative; border: 3px solid var(--line); border-radius: var(--radius);
  padding: 20px 10px; text-align: center; cursor: pointer; background: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.practice-card:active { transform: scale(.98); }
.practice-card .pe { font-size: 46px; }
.practice-card .pn { font-size: 20px; font-weight: 800; }
.practice-card .pd { font-size: 14px; color: var(--muted); }
.practice-card.soon { opacity: .6; }
.practice-card .soon-tag {
  position: absolute; top: 8px; right: 8px; background: #999; color: #fff;
  font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px;
}
/* 사용 가능한 첫 카드(버거킹)는 파란 강조 */
.practice-card:not(.soon) { border-color: var(--primary); box-shadow: 0 4px 14px rgba(106,174,255,.25); }

.mission-card { border: 3px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; cursor: pointer; background: #fff; }
.mission-card h3 { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.mission-card p { font-size: 16px; color: var(--muted); margin: 0; line-height: 1.5; }
.mission-card .go { color: var(--primary-strong); font-weight: 800; font-size: 17px; margin-top: 12px; display: inline-block; }

.level-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.level-card { border: 3px solid var(--line); border-radius: var(--radius); padding: 20px; cursor: pointer; background: #fff; text-align: center; }
.level-card .lv { font-size: 26px; font-weight: 800; }
.level-card .em { font-size: 40px; }
.level-card p { font-size: 15px; color: var(--muted); margin: 8px 0 0; line-height: 1.4; }
.level-card.beginner { border-color: #2e7d32; }
.level-card.intermediate { border-color: #ef6c00; }
.level-card.advanced { border-color: #c62828; }
.backbtn { margin-top: 16px; width: 100%; border: 2px solid var(--line); background: #fafafa; font-size: 17px; font-weight: 800; padding: 14px; border-radius: 12px; cursor: pointer; }

/* =====================================================================
 *  인트로(랜딩)
 * =================================================================== */
.kiosk.intro { background: #fff; }
.intro-hero {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 14px; padding: 30px 24px;
  background: linear-gradient(160deg, #ffffff 0%, #eaf3ff 100%);
}
.intro-tag { font-size: 20px; font-weight: 800; color: var(--muted); letter-spacing: 1px; }
.intro-brand {
  font-size: 76px; font-weight: 900; margin: 0; letter-spacing: -2px; line-height: 1;
  background: var(--primary-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.intro-sub { font-size: 21px; font-weight: 700; color: var(--ink); margin: 6px 0 0; line-height: 1.45; }
.intro-sub b { color: var(--primary-strong); }
.intro-start {
  margin-top: 22px; border: 0; background: var(--primary-grad); color: #fff;
  font-size: 30px; font-weight: 900; padding: 22px 80px; border-radius: 999px;
  cursor: pointer; box-shadow: 0 10px 24px rgba(91,148,245,.4);
  animation: glow 1.6s ease-in-out infinite;
}
.intro-start:active { transform: scale(.97); }

.intro-org {
  flex: 0 0 auto; background: #1c1c1c; color: #fff;
  padding: 26px 24px 30px; text-align: center;
}
.intro-logo {
  height: 30px; width: auto; margin: 0 auto 16px; display: block;
  filter: invert(1) brightness(2); /* 검정 로고를 어두운 배경에서 흰색으로 */
}
.intro-org-text { font-size: 16px; line-height: 1.6; color: #ddd; margin: 0 0 20px; }
.intro-org-btns { display: flex; flex-direction: column; gap: 10px; }
.org-btn {
  border: 2px solid #555; background: transparent; color: #fff;
  font-size: 18px; font-weight: 800; padding: 16px; border-radius: 12px; cursor: pointer; min-height: 56px;
}
.org-btn:active { transform: scale(.98); }
.org-btn.primary { background: var(--primary-strong); border-color: var(--primary-strong); }

@media (max-height: 800px) {
  .intro-brand { font-size: 60px; }
  .intro-start { padding: 18px 60px; font-size: 26px; }
  .lang .hero { font-size: 80px; }
  .center-scene .big { font-size: 76px; }
  .sel-item .em { font-size: 60px; }
}
