:root {
  --navy: #2d3a5c;
  --ink: #3a2a3a;
  --cream: #fff8e7;
  --paper: #fdf3dc;
  --yellow: #ffd23f;
  --yellow-d: #d9a514;
  --blue: #4aa8ff;
  --blue-d: #2a78c8;
  --green: #4cc46a;
  --green-d: #2f9147;
  --red: #e63946;
  --coral: #ff8a7a;
  --gold: #f2b632;
  --sky1: #8fd6ff;
  --sky2: #dff4ff;
  --font-title: 'Jua', 'Noto Sans KR', 'Malgun Gothic', sans-serif; /* Jua에 없는 글자(예: 똠)는 굵은 Noto Sans KR로 채워요 */
  --font-body: 'Gowun Dodum', 'Malgun Gothic', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #6cc4ea; }
body { font-family: var(--font-body); color: var(--ink); user-select: none; -webkit-user-select: none; touch-action: none; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }

#app { position: fixed; inset: 0; overflow: hidden; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
canvas { display: block; }

/* ── 버튼 ── */
.btn {
  font-family: var(--font-title); font-size: 20px; letter-spacing: .5px;
  padding: 12px 28px; min-height: 52px;
  border: 3px solid var(--navy); border-radius: 999px;
  background: var(--yellow); color: var(--navy);
  box-shadow: 0 6px 0 var(--yellow-d), 0 9px 16px rgba(0,0,0,.22);
  cursor: pointer; position: relative; transition: transform .08s, box-shadow .08s, filter .2s;
}
.btn::after { content: ''; position: absolute; left: 16%; right: 16%; top: 5px; height: 7px; border-radius: 7px; background: rgba(255,255,255,.55); pointer-events: none; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--yellow-d), 0 4px 8px rgba(0,0,0,.2); }
.btn-blue { background: var(--blue); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.18); box-shadow: 0 6px 0 var(--blue-d), 0 9px 16px rgba(0,0,0,.22); }
.btn-blue:active:not(:disabled) { box-shadow: 0 2px 0 var(--blue-d); }
.btn-green { background: var(--green); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.18); box-shadow: 0 6px 0 var(--green-d), 0 9px 16px rgba(0,0,0,.22); }
.btn-green:active:not(:disabled) { box-shadow: 0 2px 0 var(--green-d); }
.btn:disabled { filter: grayscale(.85) brightness(1.05); opacity: .7; cursor: not-allowed; }
.btn-big { font-size: 24px; padding: 14px 40px; min-height: 60px; }
.btn-corner { position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 5; }
.btn.pulse:not(:disabled) { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.07); } }
.round-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--navy);
  background: var(--cream); font-family: var(--font-title); font-size: 22px; color: var(--navy);
  box-shadow: 0 4px 0 #c9b98f; cursor: pointer;
}
.round-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c9b98f; }
.link-btn { background: none; border: none; color: rgba(45,58,92,.7); text-decoration: underline; cursor: pointer; font-size: 14px; margin-top: 6px; }

/* ── 첫 화면 ── */
.title-bg { position: absolute; inset: 0; background: linear-gradient(#8fd6ff, #c9ecff 55%, #e9f8ff); background-size: cover; background-position: center; }
.title-bg.has-art canvas { display: none; }
#title-map { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; }
.title-cloud { position: absolute; width: 220px; height: 70px; background: #fff; border-radius: 50px; opacity: .9; filter: drop-shadow(0 6px 0 rgba(160,200,230,.6)); animation: drift 38s linear infinite; }
.title-cloud::before, .title-cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.title-cloud::before { width: 100px; height: 90px; left: 30px; top: -40px; }
.title-cloud::after { width: 80px; height: 70px; left: 110px; top: -28px; }
.title-cloud.c1 { top: 12%; left: -240px; animation-duration: 42s; }
.title-cloud.c2 { top: 64%; left: -240px; animation-duration: 55s; animation-delay: -20s; transform: scale(.7); }
.title-cloud.c3 { top: 36%; left: -240px; animation-duration: 48s; animation-delay: -34s; transform: scale(.5); }
@keyframes drift { to { left: 110%; } }
.title-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; z-index: 3; padding: 16px; }
.logo { display: flex; flex-direction: column; align-items: center; text-align: center;background-size: contain; background-position: center; background-repeat: no-repeat; padding: 10px 20px; }
.logo-ribbon { position: relative; display: inline-block; padding: 16px 44px; background: var(--red); border: 4px solid var(--navy); border-radius: 18px; box-shadow: 0 8px 0 #9e1f2b, 0 14px 24px rgba(0,0,0,.25); transform: rotate(-2deg); }
.logo.has-art .logo-ribbon { background: transparent; border-color: transparent; box-shadow: none; }
/* 제목 리본: 세계지도 나라 이름표와 같은 리본 그림을 깔아요 */
.logo .logo-ribbon.ribbon-art { background: url("../images/ui/signpost.webp") center / 100% 100% no-repeat; border-color: transparent; box-shadow: none; padding: clamp(18px, 3vw, 30px) clamp(70px, 11vw, 120px) clamp(46px, 7vw, 74px); transform: rotate(-2deg); filter: drop-shadow(0 8px 10px rgba(0,0,0,.25)); }
.logo-text .arc-ch { display: inline-block; transform-origin: 50% 100%; }
.logo .logo-ribbon.ribbon-art .logo-text {
  color: #fffaf0;
  /* 굵은 갈색 테두리(8방향) + 아래로 두꺼운 그림자로 입체감 */
  text-shadow:
    3px 0 0 #5a3212, -3px 0 0 #5a3212, 0 3px 0 #5a3212, 0 -3px 0 #5a3212,
    2px 2px 0 #5a3212, -2px 2px 0 #5a3212, 2px -2px 0 #5a3212, -2px -2px 0 #5a3212,
    0 6px 0 #5a3212, 0 9px 10px rgba(60, 30, 10, .35);
  letter-spacing: 1px;
}
.logo .logo-ribbon.ribbon-art .logo-text .arc-ch { background: linear-gradient(#fffdf6 0%, #fff6d8 55%, #ffd76a 56%, #ffc93c 100%); -webkit-background-clip: text; background-clip: text; }
.logo-text { font-family: var(--font-title); font-size: clamp(34px, 7vw, 64px); color: #fff; text-shadow: 0 4px 0 #9e1f2b, 3px 0 0 var(--navy), -3px 0 0 var(--navy), 0 3px 0 var(--navy), 0 -3px 0 var(--navy); white-space: nowrap; }
.logo-sub {
  font-family: var(--font-title); font-size: clamp(15px, 2.4vw, 20px); color: #fff; letter-spacing: .5px;
  margin: 10px 0 0; padding: 7px 20px 7px 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(#3d5487, var(--navy)); border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 4px 0 #1d2742, 0 8px 14px rgba(0,0,0,.2);
}
.sub-plane { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--yellow); color: var(--navy); font-size: 15px; transform: rotate(-20deg); }

/* 다시 온 친구 환영 카드: 캐릭터 사진 + 인사 + 배지 모은 정도 */
.welcome-card {
  display: flex; align-items: center; gap: 14px; width: min(440px, 92vw);
  padding: 12px 18px 12px 12px; border-radius: 22px;
  background: linear-gradient(#fffdf6, var(--cream)); border: 3px solid var(--navy);
  box-shadow: 0 6px 0 rgba(45,58,92,.35), 0 12px 22px rgba(0,0,0,.18);
}
.wc-photo { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%; background: #dff0ff 50% 22% / 128% no-repeat; border: 3px solid var(--yellow); box-shadow: 0 0 0 3px var(--navy); }
.wc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.wc-hello { margin: 0; font-family: var(--font-title); font-size: clamp(16px, 2.6vw, 19px); color: var(--navy); line-height: 1.3; }
.wc-hello b { color: #d9480f; font-weight: normal; }
.wc-progress { display: flex; align-items: center; gap: 10px; }
.wc-badge { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-title); font-size: 15px; color: #7a5400; background: #fff1c2; border: 2px solid #f2b632; border-radius: 999px; padding: 2px 10px 2px 4px; }
.wc-badge b { font-weight: normal; font-size: 17px; color: #b35c00; }
.wc-total { color: #a88a4a; }
.wc-medal { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6c4, #ffd23f 45%, #d9a514); border: 2px solid #b8860b; }
.wc-bar { flex: 1; height: 12px; border-radius: 999px; background: #e9e0c8; border: 2px solid #cdbf98; overflow: hidden; }
.wc-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffd23f, #ff9f1c); box-shadow: inset 0 3px 0 rgba(255,255,255,.45); transition: width .6s ease; }

.title-buttons { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.btn-ico { display: inline-block; margin-right: 10px; }
.btn-hero { min-width: min(320px, 82vw); font-size: 26px; padding: 16px 44px; }
.btn-hero .btn-ico { transform: rotate(-20deg); }
.btn-soft { font-size: 18px; padding: 9px 26px; min-height: 0; background: rgba(255,255,255,.92); color: var(--navy); border: 3px solid var(--navy); box-shadow: 0 4px 0 rgba(45,58,92,.45), 0 8px 14px rgba(0,0,0,.15); }
.btn-soft::after { display: none; }
.btn-soft:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(45,58,92,.45); }

/* ── 여권 생성 창 ── */
.modal { position: absolute; inset: 0; z-index: 50; background: rgba(20,30,60,.55); display: flex; align-items: center; justify-content: center; padding: 12px; animation: fadeIn .2s ease; }
.modal-close { position: absolute; right: -10px; top: -10px; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--navy); background: var(--coral); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; z-index: 3; box-shadow: 0 3px 0 #c45a4c; }
.passport-form {
  position: relative; display: grid; grid-template-columns: 1fr 1.35fr; width: min(860px, 100%); max-height: 100%;
  background: var(--paper); border: 10px solid #24734a; border-radius: 22px; box-shadow: 0 20px 40px rgba(0,0,0,.35);
  background-image: repeating-linear-gradient(0deg, rgba(120,150,200,.07) 0 2px, transparent 2px 14px);
  animation: popIn .35s cubic-bezier(.2,1.6,.4,1);
}
.passport-form.has-art { background-size: 100% 100%; border-color: transparent; box-shadow: none; }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pf-page { padding: 24px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pf-left { border-right: 3px dashed rgba(36,115,74,.3); align-items: center; justify-content: center; }
.pf-heading { font-family: var(--font-title); color: #24734a; letter-spacing: 2px; font-size: 18px; }
.pf-photo { width: 150px; height: 180px; border: 3px dashed #9aa7c7; border-radius: 14px; background: #fff center / contain no-repeat; display: flex; align-items: center; justify-content: center; color: #9aa7c7; font-size: 48px; }
.pf-line { width: 100%; display: flex; justify-content: space-between; border-bottom: 2px solid rgba(36,115,74,.25); padding: 4px 2px; font-family: var(--font-title); }
.pf-line b { color: var(--red); font-weight: normal; }
.pf-label { font-family: var(--font-title); font-size: 19px; color: #24734a; }
#nickname { font-family: var(--font-title); font-size: 22px; padding: 12px 16px; border: 3px solid #9aa7c7; border-radius: 14px; background: #fff; color: var(--ink); width: 100%; outline: none; user-select: text; }
#nickname:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(74,168,255,.25); }
.char-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.char-card { position: relative; border: 4px solid #d8cfb6; border-radius: 18px; background: #fff; padding: 10px 8px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--font-title); font-size: 17px; transition: transform .15s, border-color .15s; }
.char-card:hover { transform: translateY(-3px); }
.char-card.selected { border-color: var(--green); background: #effbe9; box-shadow: 0 0 0 4px rgba(76,196,106,.3); }
.char-img { width: 100%; height: 120px; background: center / contain no-repeat; }
.char-check { position: absolute; top: -12px; right: -12px; width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; border: 3px solid #fff; display: none; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.char-card.selected .char-check { display: flex; }
.pf-hint { margin: 0; text-align: center; font-size: 14px; color: #7a6f5a; min-height: 1.2em; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ── 세계지도 ── */
#map-canvas, #country-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#country-canvas { cursor: pointer; }
.loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-title); font-size: 26px; color: #fff; background: rgba(40,110,160,.6); z-index: 20; text-align: center; padding: 20px; line-height: 1.5; }
.signpost { position: absolute; z-index: 4; transform: translate(-50%, -100%); pointer-events: none; min-width: 120px; padding: 10px 22px 26px; text-align: center; animation: signIn .25s cubic-bezier(.2,1.6,.4,1); }
.signpost::before { content: ''; position: absolute; left: 0; right: 0; top: 0; bottom: 16px; background: #e8b878; border: 3px solid #7a4a22; border-radius: 10px; box-shadow: inset 0 -5px 0 #c9904e, 0 4px 8px rgba(0,0,0,.25); z-index: -1; }
.signpost::after { content: ''; position: absolute; left: calc(50% - 5px); bottom: 0; width: 10px; height: 18px; background: #a86a34; border: 3px solid #7a4a22; border-top: none; z-index: -2; }
.signpost.has-art { background: center / 100% 100% no-repeat; }
/* 리본 그림: 글자가 가운데 띠에 오도록 위아래 여백을 맞추고 줄간격을 좁혀요 */
.signpost.has-art { padding: 9px 46px 25px; min-width: 190px; }
.signpost.has-art .sign-text { line-height: 1.05; }
.signpost.has-art .sign-text small { margin-top: 1px; line-height: 1.1; }
.signpost.has-art::before, .signpost.has-art::after { display: none; }
.sign-text { font-family: var(--font-title); font-size: 22px; color: #5a3212; white-space: nowrap; }
.sign-text small { display: block; font-size: 13px; color: #7a4a22; }
@keyframes signIn { from { transform: translate(-50%, -80%) scale(.6); opacity: 0; } }
/* 바다 위를 날 때: 나무 팻말 대신 파란 물방울 (2026-12-02) */
.signpost.sea { background-image: none !important; padding: 9px 26px 12px; min-width: 150px; }
.signpost.sea::before { display: block; bottom: 0; background: rgba(28,105,160,.88); border-color: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.25); border-radius: 999px; }
.signpost.sea::after { display: none; }
.signpost.sea .sign-text { color: #fff; }
.signpost.sea .sign-text small { color: #cfeeff; }
.map-help, .drag-help { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(255,255,255,.85); padding: 6px 14px; border-radius: 999px; font-size: 14px; z-index: 3; pointer-events: none; white-space: nowrap; transition: opacity 1s; }
.fade-out { opacity: 0; }
.sound-toggle { position: absolute; top: max(14px, env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right)); z-index: 45; width: 44px; height: 44px; border: 2px solid var(--navy); border-radius: 50%; background: var(--cream); cursor: pointer; font-size: 22px; }
.sound-toggle:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
/* 세계지도: 첫 화면으로 돌아가기 (소리 버튼 왼쪽) */
.home-btn { position: absolute; top: max(14px, env(safe-area-inset-top)); right: calc(max(18px, env(safe-area-inset-right)) + 54px); z-index: 5; height: 44px; padding: 0 14px; border: 2px solid var(--navy); border-radius: 999px; background: var(--cream); font-family: var(--font-title); font-size: 16px; color: var(--navy); cursor: pointer; box-shadow: 0 3px 0 rgba(45,58,92,.25); }
.home-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(45,58,92,.25); }
.home-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.zoom-ctl { position: absolute; right: max(18px, env(safe-area-inset-right)); top: max(68px, calc(env(safe-area-inset-top) + 54px)); display: flex; flex-direction: column; gap: 10px; z-index: 5; }

/* 조이스틱 */
.joystick { position: absolute; left: max(22px, env(safe-area-inset-left)); bottom: max(22px, env(safe-area-inset-bottom)); width: 150px; height: 150px; border-radius: 50%; z-index: 5; touch-action: none;
  background: radial-gradient(circle, rgba(45,58,92,.18) 0 55%, rgba(45,58,92,.32) 56% 100%); border: 4px solid rgba(255,255,255,.85); box-shadow: 0 6px 14px rgba(0,0,0,.2); background-size: 100% 100%; }
.joystick::before { content: '▲\A◀　　▶\A▼'; white-space: pre; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: rgba(255,255,255,.9); font-size: 16px; line-height: 1.9; pointer-events: none; }
.joystick.has-art { background-color: transparent; border-color: transparent; box-shadow: none; }
.joystick.has-art::before { display: none; }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 12%, #6cc0ff 14% 100%); border: 4px solid var(--navy); box-shadow: 0 4px 0 var(--blue-d); pointer-events: none; background-size: 100% 100%; }
.joy-knob.has-art { background-color: transparent; border: none; box-shadow: none; }

/* 여권 버튼 */
.passport-btn { position: absolute; z-index: 6; width: 76px; height: 96px; border: 3px solid #14492e; border-radius: 10px 14px 14px 10px; cursor: pointer;
  background: linear-gradient(90deg, #1b5c3a 0 10%, #2a8150 10%); box-shadow: 0 6px 0 #103b25, 0 10px 18px rgba(0,0,0,.3); }
.passport-btn::before { content: '🌏'; position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: 30px; filter: sepia(1) saturate(4) hue-rotate(5deg) brightness(1.1); }
.passport-btn::after { content: '여권'; position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-family: var(--font-title); color: #f6d27a; font-size: 15px; }
.passport-btn.has-art { background: center / contain no-repeat; border: none; box-shadow: none; filter: drop-shadow(0 6px 6px rgba(0,0,0,.3)); }
.passport-btn.has-art::before, .passport-btn.has-art::after { display: none; }
.passport-btn:active { transform: translateY(3px); }
.pos-left-top { left: max(18px, env(safe-area-inset-left)); top: 18px; }
.pos-left-bottom { left: max(18px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom)); }
.pp-count { position: absolute; top: -10px; right: -12px; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; background: var(--red); color: #fff; border: 3px solid #fff; font-family: var(--font-title); font-size: 15px; display: flex; align-items: center; justify-content: center; z-index: 2; }
.passport-btn.bounce { animation: bounce .6s cubic-bezier(.3,1.8,.5,1); }
@keyframes bounce { 30% { transform: scale(1.25) rotate(-6deg); } 60% { transform: scale(.92) rotate(3deg); } }

/* ── 여권 (배지 모음) ── */
#modal-passport { overflow: auto; align-items: flex-start; padding: 16px 12px; }
.passport-book { position: relative; flex: 0 0 auto; width: min(980px, 100%); min-width: 0; margin: auto; background: var(--paper); border: 12px solid #24734a; border-radius: 22px; padding: 16px 20px 14px; box-shadow: 0 20px 40px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 10px; animation: popIn .35s cubic-bezier(.2,1.6,.4,1);
  background-image: radial-gradient(circle at 50% 50%, rgba(120,150,200,.08) 0 30%, transparent 31%), repeating-linear-gradient(0deg, rgba(120,150,200,.06) 0 2px, transparent 2px 14px); }
.passport-book.has-art { background-size: 100% 100%; border-color: transparent; box-shadow: none; padding: clamp(28px, 5vw, 62px) clamp(16px, 7vw, 100px) clamp(24px, 4vw, 50px); }
.passport-book .modal-close { top: -8px; right: -8px; }
.pb-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-family: var(--font-title); font-size: clamp(15px, 2.3vw, 20px); color: #173a2b; background: #fff8e6; border-radius: 8px; padding: 5px 8px; }
.pb-spread { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pb-page { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; padding: 8px 14px; align-content: start; }
.pb-page:first-child { border-right: 3px dashed rgba(36,115,74,.3); }
.pb-continent { grid-column: 1 / -1; font-family: var(--font-title); font-size: 14px; color: #8a7a5a; margin-top: 2px; }
.slot .badge { max-width: 100%; }
.slot { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.slot-name { font-family: var(--font-title); font-size: 13px; color: var(--ink); text-align: center; line-height: 1.15; word-break: keep-all; min-height: 3.1em; }
.slot.locked .slot-name { color: #615644; }
.passport-book.contest .pb-nav .round-btn { visibility: hidden; }
/* 쪽 번호가 빨간 리본 위에 겹쳐서 안 보였어요. 밝은 알약을 깔아요 */
#pb-pageno { position: relative; z-index: 3; background: rgba(255, 248, 230, .95); border: 2px solid #c9b98f; border-radius: 999px; padding: 1px 12px; font-size: 14px; color: #5a4630; white-space: nowrap; }

.pb-nav { display: flex; align-items: center; justify-content: center; gap: 16px; font-family: var(--font-title); }

/* 배지 (그림 파일이 없을 때 쓰는 임시 배지) */
.badge { width: clamp(64px, 11vw, 104px); aspect-ratio: 1; border-radius: 50%; position: relative; display: flex; align-items: center; justify-content: center; background: center / contain no-repeat; }
.badge.fallback { background: radial-gradient(circle, #bfe6ff 0 60%, #fff3d6 61% 66%, #f2b632 67% 82%, #c98a12 83% 100%); box-shadow: inset 0 0 0 3px #a86e0a, 0 3px 0 #a86e0a; }
.badge.fallback span { font-size: clamp(28px, 5vw, 46px); filter: drop-shadow(0 2px 0 rgba(0,0,0,.15)); }
.badge.locked { background: radial-gradient(circle, #eee6d4 0 62%, #d8cdb5 63% 100%); box-shadow: inset 0 0 0 3px #c4b796; }
.badge.locked span { font-size: clamp(20px, 3vw, 30px); opacity: .5; }
.badge.locked.has-art { background: center / contain no-repeat; box-shadow: none; }

/* ── 국가 탐험 HUD ── */
.country-hud { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100% - 24px); }
.country-title { display: flex; align-items: center; gap: 10px; background: var(--cream); border: 3px solid var(--navy); border-radius: 999px; padding: 6px 18px 6px 8px; font-family: var(--font-title); font-size: 22px; box-shadow: 0 4px 0 rgba(45,58,92,.3); }
.country-title img { width: 42px; height: 28px; border-radius: 4px; border: 1px solid rgba(0,0,0,.2); object-fit: cover; background: #eee; }
.country-title img.unknown { visibility: hidden; width: 0; margin-right: -10px; }
.progress { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
/* 퀴즈 진행 표시: 작은 동그라미 (풀기 전 흑백 → 풀면 노란색) */
.progress { gap: 8px; }
.progress .dot { width: 18px; height: 18px; border-radius: 50%; display: inline-block; background: #d6d6d6; border: 3px solid #8f8f8f; box-shadow: 0 2px 0 rgba(0,0,0,.2); transition: background .3s, border-color .3s, transform .3s; }
.progress .dot.done { background: radial-gradient(circle at 35% 30%, #fff6b0, #ffd23f 55%, #f0a91c); border-color: #b9740e; transform: scale(1.12); }

.arrival { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(20,40,70,.45) center / cover no-repeat; padding: 16px; }
.arrival.has-art { background-color: transparent; }
.arrival-card { position: relative; background: var(--cream); border: 4px solid var(--navy); border-radius: 22px; padding: 26px 30px 22px; text-align: center; max-width: 440px; box-shadow: 0 16px 30px rgba(0,0,0,.3); animation: popIn .4s cubic-bezier(.2,1.6,.4,1); }
.arrival-card h2 { font-family: var(--font-title); font-weight: normal; font-size: 32px; margin: 8px 0 4px; color: var(--navy); }
.arrival-card p { margin: 0 0 16px; }
.stamp { width: 120px; height: 120px; margin: -76px auto 0; border-radius: 50%; border: 5px double var(--red); color: var(--red); background: rgba(255,248,231,.95) center / contain no-repeat; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font-title); transform: rotate(-12deg); animation: stampIn .45s .25s both cubic-bezier(.3,1.6,.5,1); }
.stamp.has-art { border: none; }
.stamp-name { font-size: 20px; }
.stamp-date { font-size: 12px; }
/* 도착 그림이 있을 때: 그림이 잘 보이게 위쪽 하늘에 작은 띠로 */
.arrival.has-art { align-items: flex-start; padding-top: max(16px, 3vh); }
.arrival.has-art.banner-bottom { align-items: flex-end; padding-top: 16px; padding-bottom: max(16px, 4vh); }
.arrival.has-art .arrival-card { display: flex; align-items: center; gap: 16px; max-width: min(640px, 100%); padding: 12px 16px 12px 12px; text-align: left; border-radius: 18px; background: rgba(255,248,231,.94); }
.arrival.has-art .stamp { width: 84px; height: 84px; margin: 0; flex: none; }
.arrival.has-art .stamp-name { font-size: 15px; }
.arrival.has-art .stamp-date { font-size: 10px; }
.arrival.has-art .arrival-text { flex: 1; min-width: 0; }
.arrival.has-art .arrival-card h2 { font-size: 24px; margin: 0 0 2px; }
.arrival.has-art .arrival-card p { margin: 0; font-size: 14px; }
.arrival.has-art #arrival-ok { flex: none; }
@media (max-width: 560px) {
  .arrival.has-art .arrival-card { flex-wrap: wrap; justify-content: center; gap: 10px; }
  .arrival.has-art .arrival-text { flex-basis: calc(100% - 100px); }
  .arrival.has-art .arrival-card h2 { font-size: 20px; }
  .arrival.has-art #arrival-ok { flex-basis: 100%; }
}
@keyframes stampIn { from { transform: scale(2.4) rotate(-30deg); opacity: 0; } to { transform: scale(1) rotate(-12deg); opacity: 1; } }

/* ── 퀴즈 ── */
.quiz-panel { position: relative; width: min(640px, 100%); max-height: 100%; overflow: auto; background: var(--cream); border: 4px solid var(--navy); border-radius: 24px; padding: 0 22px 20px; box-shadow: 0 18px 36px rgba(0,0,0,.35); animation: popIn .3s cubic-bezier(.2,1.6,.4,1); }
.quiz-panel { overflow-x: hidden; }
.quiz-panel .modal-close { right: 10px; top: 7px; width: 38px; height: 38px; font-size: 22px; box-shadow: none; border-color: #fff; }
#quiz-step { margin-right: 46px; }
.quiz-panel.has-art { background-size: 100% 100%; border-color: transparent; box-shadow: none; }
.quiz-header { display: flex; justify-content: space-between; align-items: center; margin: 0 -22px 14px; padding: 12px 22px; background: var(--blue); color: #fff; font-family: var(--font-title); font-size: 20px; border-radius: 20px 20px 0 0; }
.quiz-face { flex: 0 0 auto; width: 52px; height: 52px; margin-right: 8px; image-rendering: pixelated; }
#quiz-title { flex: 1; min-width: 0; }
#quiz-step { flex-shrink: 0; }
.quiz-photo { text-align: center; margin-bottom: 8px; }
/* 사진 액자: 똑바로, 사진 크기에 딱 맞게 (틀 폭 = 사진 폭 + 여백) */
.photo-frame { display: inline-block; vertical-align: top; background: #fff; padding: 10px; border-radius: 6px; box-shadow: 0 6px 16px rgba(0,0,0,.2); max-width: 100%; box-sizing: border-box; }
/* 사진은 자르지 않고 원래 비율 그대로 (세로 사진은 키를 제한해서 너무 길어지지 않게) */
.photo-frame img { display: block; width: auto; height: auto; max-width: min(440px, calc(100vw - 90px)); max-height: min(330px, 42vh); min-width: 120px; min-height: 90px; object-fit: contain; border-radius: 3px; background: #e9e2cf; }
.quiz-credit { font-size: 12px; color: #8a7d62; margin: 8px 0 0; min-height: 1em; }
.quiz-credit a { color: inherit; }
.quiz-question { font-family: var(--font-title); font-size: 22px; line-height: 1.45; text-align: center; margin: 6px 0 16px; color: var(--navy); }
.quiz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { font-family: var(--font-title); font-size: 20px; min-height: 60px; padding: 10px; border: 3px solid var(--navy); border-radius: 16px; background: #fff; cursor: pointer; box-shadow: 0 5px 0 #c9bf9f; transition: transform .1s; display: flex; align-items: center; justify-content: center; }
.choice:hover:not(:disabled) { background: #fffbe0; }
.choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #c9bf9f; }
.choice img { width: 100%; max-width: 150px; aspect-ratio: 3 / 2; object-fit: contain; border: 1px solid rgba(0,0,0,.15); background: #f3f3f3; }
.choice.wrong { background: #e8eef7; border-color: #9aa7c7; color: #9aa7c7; box-shadow: none; animation: shake .4s; }
.choice.wrong img { opacity: .4; }
.choice.right { background: #e3f8e6; border-color: var(--green); box-shadow: 0 0 0 4px rgba(76,196,106,.3); }
.quiz-result { text-align: center; margin-top: 16px; padding-top: 12px; border-top: 3px dashed #e0d5b8; }
.quiz-mark { font-size: 54px; line-height: 1; animation: stampIn .4s cubic-bezier(.3,1.6,.5,1); }
.quiz-result p { font-size: 17px; line-height: 1.6; margin: 8px 0 14px; }
.quiz-try { text-align: center; color: #5b74b3; font-family: var(--font-title); margin: 10px 0 0; min-height: 1.3em; }
.quiz-try.warn { color: #b3261e; background: #ffe9e6; border-radius: 12px; padding: 6px 10px; line-height: 1.4; }

/* ── 배지 획득 연출 ── */
.ceremony { position: absolute; inset: 0; z-index: 60; background: rgba(20,30,60,.6); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.cer-badge { width: min(240px, 50vw); height: min(240px, 50vw); position: relative; z-index: 2; }
.cer-badge .badge { width: 100%; }
.cer-badge .badge.fallback span { font-size: min(110px, 22vw); }
.cer-badge.pop { animation: cerPop .7s cubic-bezier(.2,1.8,.4,1); }
@keyframes cerPop { from { transform: scale(0) rotate(-200deg); } }
.cer-burst { position: absolute; width: 520px; height: 520px; max-width: 100vw; max-height: 100vw; background: repeating-conic-gradient(rgba(255,230,120,.35) 0 10deg, transparent 10deg 20deg); border-radius: 50%; mask: radial-gradient(circle, #000 30%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cer-text { font-family: var(--font-title); font-size: 30px; color: #fff; text-shadow: 0 3px 0 var(--navy); margin: 0; z-index: 2; text-align: center; }
.cer-text small { display: block; font-size: 17px; opacity: .9; margin-top: 6px; }
.sparkle-star { position: absolute; z-index: 61; pointer-events: none; font-size: 26px; }

.toast { position: absolute; left: 50%; top: 112px; transform: translate(-50%, -20px); background: rgba(45,58,92,.92); color: #fff; padding: 10px 20px; border-radius: 999px; font-family: var(--font-title); font-size: 18px; z-index: 80; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── 작은 화면 ── */
@media (max-width: 700px) {
  .passport-form { grid-template-columns: 1fr; overflow: auto; }
  .pf-left { display: none; }
  .pf-page { padding: 18px 16px; }
  .char-img { height: 96px; }
  .pb-spread { grid-template-columns: minmax(0, 1fr); }
  .pb-page { padding-inline: 2px; }
  .passport-book.has-art { background-size: 100% 100%; padding-inline: 14px; }
  .slot-name { overflow-wrap: anywhere; }
  .pb-page:first-child { border-right: none; border-bottom: 3px dashed rgba(36,115,74,.3); }
  .joystick { width: 124px; height: 124px; }
  .joy-knob { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
  .btn-corner { font-size: 18px; padding: 10px 20px; min-height: 48px; }
  .map-help, .drag-help { bottom: auto; top: 128px; font-size: 12px; white-space: normal; width: max-content; max-width: 70%; text-align: center; }
  .passport-btn { width: 60px; height: 76px; }
  .passport-btn::before { font-size: 24px; }
  .quiz-question { font-size: 19px; }
  .choice { font-size: 17px; min-height: 52px; }
  .country-title { font-size: 18px; }
}
@media (max-height: 520px) {
  .title-center { gap: 12px; }
  .logo-sub { margin-top: 8px; }
}

/* 퀴즈 창: CSS 창 + 모서리 장식 (그림을 늘려 깔지 않아요) */
.quiz-wrap { position: relative; width: min(640px, 100%); max-height: 100%; display: flex; }
.quiz-wrap .quiz-panel { width: 100%; }

/* 여권(배지 모음): 그림 뒤 크림색 사각형을 없애고, 제목 글씨를 왼쪽·오른쪽 쪽으로 나눠서 그림을 가리지 않게 */
.passport-book.has-art { background-color: transparent; }
.passport-book.has-art .pb-header { background: none; padding: 0 10px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; }
.passport-book.has-art .pb-header > span { justify-self: start; background: rgba(255, 248, 230, .9); border-radius: 999px; padding: 2px 12px; font-size: clamp(13px, 1.9vw, 18px); white-space: nowrap; }
.passport-book.has-art .pb-header > span:last-child { justify-self: end; }
.passport-book.has-art .modal-close { top: 4px; right: 4px; }
@media (max-width: 700px) {
  /* 좁은 화면에서는 가로로 펼친 여권 그림이 찌그러져서 CSS 여권으로 그려요 */
  .passport-book.has-art { background-image: none !important; background-color: var(--paper); border: 10px solid #24734a; box-shadow: 0 20px 40px rgba(0,0,0,.35); padding: 14px 12px 12px; }
  .passport-book.has-art .pb-header { padding: 0 34px 0 2px; column-gap: 8px; }
  .passport-book.has-art .modal-close { top: -10px; right: -10px; }
}

/* 첫 화면 초기화 버튼 + 확인 창 */
.reset-btn { position: absolute; left: max(16px, env(safe-area-inset-left)); top: 16px; z-index: 5; font-family: var(--font-title); font-size: 16px; color: var(--navy); background: rgba(255,255,255,.9); border: 3px solid var(--navy); border-radius: 999px; padding: 6px 14px; cursor: pointer; box-shadow: 0 4px 0 rgba(45,58,92,.35); }
.reset-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(45,58,92,.35); }
.btn-red { background: var(--red); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.18); box-shadow: 0 6px 0 #9e1f2b, 0 9px 16px rgba(0,0,0,.22); }
.btn-red:active:not(:disabled) { box-shadow: 0 2px 0 #9e1f2b; }
.confirm-card { background: var(--cream); border: 4px solid var(--navy); border-radius: 22px; padding: 24px 26px 22px; text-align: center; max-width: 420px; box-shadow: 0 16px 30px rgba(0,0,0,.3); animation: popIn .3s cubic-bezier(.2,1.6,.4,1); }
.confirm-icon { font-size: 44px; }
.confirm-card h2 { font-family: var(--font-title); font-weight: normal; font-size: 26px; color: var(--navy); margin: 6px 0 8px; }
.confirm-card p { margin: 0 0 18px; line-height: 1.6; }
.confirm-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* NPC 대화창 (RPG 대화창처럼 화면 아래) */
.dialog { position: absolute; left: 50%; bottom: max(84px, calc(env(safe-area-inset-bottom) + 84px)); transform: translateX(-50%); width: min(760px, calc(100% - 24px)); z-index: 40; display: flex; gap: 14px; align-items: stretch; background: rgba(255, 248, 231, .97); border: 4px solid var(--navy); border-radius: 18px; padding: 12px 16px 12px 12px; box-shadow: 0 10px 24px rgba(0,0,0,.3); cursor: pointer; animation: popIn .25s cubic-bezier(.2,1.6,.4,1); user-select: none; }
.dialog-face { flex: 0 0 auto; width: 96px; height: 96px; border-radius: 14px; background: #dff0ff center / cover no-repeat; border: 3px solid #c9bf9f; image-rendering: pixelated; }
.dialog-face.is-sprite { background-size: 190%; background-position: 50% 8%; }
.dialog-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dialog-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dialog-name { font-family: var(--font-title); font-size: 18px; color: #fff; background: var(--navy); border-radius: 999px; padding: 2px 12px; }
.dialog-hint { font-family: var(--font-title); font-size: 15px; color: #6a4b00; background: #ffe58a; border-radius: 999px; padding: 2px 10px; }
.dialog-text { margin: 0; font-family: var(--font-title); font-size: 19px; line-height: 1.5; color: var(--ink); min-height: 3em; }
.dialog-next { position: absolute; right: 14px; bottom: 8px; font-size: 16px; color: var(--navy); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 700px) {
  .dialog { bottom: 78px; gap: 10px; padding: 10px; }
  .dialog-face { width: 72px; height: 72px; }
  .dialog-text { font-size: 16px; }
}

/* 첫 화면 버튼의 작은 여권 아이콘 (남색 수첩 + 금색 지구) */
.pp-ico { display: inline-block; vertical-align: -3px; width: 18px; height: 22px; margin-right: 10px; border-radius: 3px 5px 5px 3px; background: radial-gradient(circle at 50% 46%, transparent 4px, #f2b632 4.5px, #f2b632 6px, transparent 6.5px), #2d3a5c; box-shadow: inset 3px 0 0 #1d2742; }
.btn-hero .pp-ico { width: 22px; height: 27px; }

/* ── 첫 화면: 제목이 돋보이게 나머지를 한 단계 작게 (2026-11-23) ── */
#screen-title .logo-text { font-size: clamp(40px, 8.4vw, 78px); }
#screen-title .title-center { gap: 16px; }
#screen-title .logo-sub { font-size: clamp(13px, 2vw, 16px); padding: 5px 16px 5px 10px; margin-top: 6px; box-shadow: 0 3px 0 #1d2742, 0 6px 10px rgba(0,0,0,.18); }
#screen-title .sub-plane { width: 20px; height: 20px; font-size: 12px; }
#screen-title .welcome-card { width: min(360px, 88vw); padding: 8px 14px 8px 8px; gap: 10px; border-width: 2px; border-radius: 18px; box-shadow: 0 4px 0 rgba(45,58,92,.3), 0 8px 16px rgba(0,0,0,.15); }
#screen-title .wc-photo { width: 50px; height: 50px; border-width: 2px; box-shadow: 0 0 0 2px var(--navy); }
#screen-title .wc-body { gap: 5px; }
#screen-title .wc-hello { font-size: clamp(14px, 2.1vw, 16px); }
#screen-title .wc-badge { font-size: 13px; padding: 1px 8px 1px 3px; }
#screen-title .wc-badge b { font-size: 14px; }
#screen-title .wc-medal { width: 16px; height: 16px; }
#screen-title .wc-bar { height: 9px; }
#screen-title .title-buttons { gap: 10px; }
#screen-title .btn-hero { min-width: min(250px, 72vw); font-size: 20px; padding: 10px 30px; min-height: 48px; }
#screen-title .btn-soft { font-size: 15px; padding: 6px 20px; }
#screen-title .pp-ico { width: 14px; height: 18px; margin-right: 8px; }
#screen-title .btn-hero .pp-ico { width: 17px; height: 21px; }
@media (max-width: 480px) {
  #screen-title .logo-text { font-size: 30px; }
  #screen-title .logo .logo-ribbon.ribbon-art { padding: 16px 56px 40px; }
}
/* 제목 리본 아래 빈 공간만큼 부제 배지를 끌어올려 간격을 좁혀요 */
#screen-title .logo-sub { margin-top: -26px; position: relative; z-index: 1; }
#screen-title .title-center { gap: 14px; }
@media (max-width: 480px) { #screen-title .logo-sub { margin-top: -18px; } }
/* 여권 아이콘 다시 그리기: 금색 지구가 수첩 안쪽에 쏙 들어가게 (잘려 보이던 것 고침) */
#screen-title .pp-ico, .pp-ico {
  width: 16px; height: 20px; flex: 0 0 auto;
  background:
    radial-gradient(circle at 55% 44%, #2d3a5c 0 2.6px, #f2b632 2.7px 4.2px, transparent 4.3px),
    linear-gradient(90deg, #1d2742 0 3px, #2d3a5c 3px);
  border: 1.5px solid #f2b632; border-radius: 2px 4px 4px 2px; box-shadow: none;
}
#screen-title .btn-hero .pp-ico { width: 18px; height: 23px; }

/* ── 천하제일 대회 (2026-12-02) ── */
.contest-ctl { position: absolute; right: max(18px, env(safe-area-inset-right)); top: max(176px, calc(env(safe-area-inset-top) + 162px)); display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.contest-btn {
  width: 96px; padding: 8px 4px 7px; border: 3px solid var(--navy); border-radius: 18px;
  background: var(--cream); color: var(--navy); font-family: var(--font-title);
  display: flex; flex-direction: column; align-items: center; line-height: 1.1;
  box-shadow: 0 5px 0 #c9b98f; cursor: pointer;
}
.contest-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #c9b98f; }
.contest-btn .ct-btn-ico { font-size: 26px; }
.contest-btn .ct-btn-name { font-size: 14px; margin-top: 2px; }
.contest-btn .ct-btn-sub { font-size: 12px; color: #a0522d; margin-top: 2px; }
.contest-btn.locked { filter: grayscale(.8); opacity: .78; }
.contest-btn.locked .ct-btn-sub { color: #6b6b6b; }
@media (max-height: 620px) {
  .contest-ctl { flex-direction: row; top: auto; bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px)); }
  .contest-btn { width: 82px; }
}

.contest-panel { position: relative; width: min(640px, 100%); max-height: 100%; overflow: auto; overflow-x: hidden; background: var(--cream); border: 4px solid var(--navy); border-radius: 24px; padding: 0 22px 18px; box-shadow: 0 18px 36px rgba(0,0,0,.35); animation: popIn .3s cubic-bezier(.2,1.6,.4,1); }
.contest-panel .modal-close { right: 10px; top: 7px; width: 38px; height: 38px; font-size: 22px; box-shadow: none; border-color: #fff; }
.contest-header { margin: 0 -22px 12px; padding: 12px 52px 12px 22px; background: #b1472f; color: #fff; font-family: var(--font-title); font-size: 20px; border-radius: 20px 20px 0 0; }
#modal-contest.flag-contest .contest-header { background: #2f6fb1; }
.ct-rankbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--font-title); background: #fff3d0; border: 2px solid #e2c98a; border-radius: 999px; padding: 5px 14px; }
.ct-rank { color: #8a5a00; font-size: 17px; }
.ct-level { color: var(--navy); font-size: 17px; }
.ct-progress { display: flex; align-items: center; gap: 10px; margin: 10px 2px 2px; }
.ct-dots { display: flex; gap: 5px; flex: 1; }
.ct-dots i { flex: 1; height: 12px; border-radius: 6px; background: #e0d6bd; box-shadow: inset 0 1px 0 rgba(0,0,0,.08); transition: background .2s; }
.ct-dots i.on { background: var(--green); box-shadow: 0 0 0 2px rgba(76,196,106,.3); }
.ct-streak { font-family: var(--font-title); font-size: 14px; color: #7a6a4a; white-space: nowrap; }
.ct-msg { min-height: 2.6em; margin: 12px 0 0; text-align: center; font-family: var(--font-title); font-size: 16px; line-height: 1.3; }
.ct-msg.good { color: var(--green-d); }
.ct-msg.bad { color: var(--red); }
.ct-foot { text-align: center; margin-top: 6px; }
#ct-choices .choice.right { background: #e7fbe9; border-color: var(--green); box-shadow: 0 0 0 3px rgba(76,196,106,.35); }

.ct-levelup { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; background: rgba(28,24,20,.55); border-radius: 20px; }
.ct-lv-card { background: var(--paper); border: 4px solid var(--navy); border-radius: 22px; padding: 16px 24px 18px; text-align: center; box-shadow: 0 14px 30px rgba(0,0,0,.4); animation: popIn .3s cubic-bezier(.2,1.6,.4,1); }
.ct-lv-top { margin: 0 0 6px; font-family: var(--font-title); font-size: 19px; color: var(--red); }
.ct-lv-bottom { margin: 10px 0 12px; font-family: var(--font-title); font-size: 15px; color: #6a5a3a; }
.ct-stamp { margin: 0 auto; width: 148px; height: 148px; gap: 1px; }
.ct-stamp-emoji { font-size: 24px; line-height: 1; }
/* 칭호가 길어서 두세 줄로 접혀요. 한국어는 낱말 단위로 끊어요 */
.ct-stamp .stamp-name { font-size: 14px; line-height: 1.15; padding: 0 12px; text-align: center; word-break: keep-all; }

/* 여권 속 대회 면 */
.pb-tabs { display: flex; gap: 6px; justify-content: center; margin: 6px 0 2px; flex-wrap: wrap; }
.pb-tab { font-family: var(--font-title); font-size: 14px; padding: 5px 12px; border: 2px solid #c4b796; border-radius: 999px; background: rgba(255,248,231,.9); color: #7a6a4a; cursor: pointer; }
.pb-tab.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.lv-badge { position: relative; }
.lv-badge .lv-tag { position: absolute; right: -2px; bottom: -2px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--navy); color: #fff; border: 2px solid #fff; font-family: var(--font-title); font-style: normal; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.slot-name small { display: block; font-size: 11px; color: #7a6a4a; }
.slot.locked .slot-name small { color: #8a7f6a; }
@media (max-width: 560px) {
  .contest-panel { padding-inline: 14px; }
  .contest-header { margin-inline: -14px; padding-left: 14px; }
}
