/* DearGames — 시안(docs/mock-overview.png): 따뜻한 종이색 바탕 · 세리프 머리글 · 어두운 사진 카드 셋 · 손글씨 메모 */
:root {
  --bg: #f4ede3; --bg2: #ece3d6; --paper: #fbf7f1; --ink: #2a221c; --ink2: #5b4f45; --muted: #8a7d70; --line: #e0d5c6;
  --dark: #1d1814; --dark2: #2a231d;
  --imp: #c8665f; --imp-btn: #f6ede1; --sw: #5a9bc4; --sw-btn: #d8e9f4; --od: #d9a74a; --od-btn: #f6dca4;
  --good: #3f8a5a; --bad: #b8483e; --you: #2f6fb0; --ai: #c0703a;
  --serif: 'Libre Caslon Text', Georgia, 'Times New Roman', serif;
  --hand: 'Caveat', 'Bradley Hand', cursive;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); min-height: 100vh; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; margin: 0; }
.muted { color: var(--muted); }
.tiny { font-size: .8rem; color: var(--muted); }
.err { color: var(--bad); font-size: .9rem; }
.hand { font-family: var(--hand); }
[hidden] { display: none !important; }

/* ── 머리 ── */
.head { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 28px; padding: 14px max(16px, calc((100vw - 1240px) / 2)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.brand { font-family: var(--serif); font-size: 1.6rem; text-decoration: none; white-space: nowrap; }
.brand sup { font-family: var(--sans); font-size: .55rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-left: 4px; vertical-align: super; }
.tabs { display: flex; gap: 22px; flex: 1; }
.tabs a { text-decoration: none; font-size: .95rem; color: var(--ink2); padding: 4px 0; border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--ink); border-color: var(--ink); }
.me-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; padding: 0; }
.me-btn svg { width: 24px; height: 24px; }
.me-btn.in { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (max-width: 640px) {
  .head { gap: 12px; padding: 10px 16px; }
  .brand { font-size: 1.3rem; }
  .tabs { gap: 14px; }
  .tabs a { font-size: .85rem; }
}

.main { max-width: 1240px; margin: 0 auto; padding: 0 16px 60px; }

/* ── 첫 화면 ── */
.hero { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: center; padding: 34px 0 30px; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.2rem); line-height: 1.02; letter-spacing: -.025em; }
.hero p { font-family: var(--serif); font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--ink2); margin: 18px 0 0; max-width: 30em; }
.hero .guide-link { display: inline-block; margin-top: 14px; font-size: .9rem; color: var(--ink2); }
.still { position: relative; height: 230px; }
.book { position: absolute; left: 0; right: 22%; height: 52px; border-radius: 6px 10px 10px 6px; display: flex; align-items: center; padding-left: 22px; font-family: var(--serif); font-size: 1.6rem; color: #2d2620; box-shadow: 0 6px 14px rgba(60, 40, 20, .18), inset 0 -3px 0 rgba(0, 0, 0, .12); }
.book:nth-child(1) { top: 20px; background: linear-gradient(90deg, #d8cdb8, #e8dfcd 60%, #d4c8b1); transform: rotate(-1.5deg); }
.book:nth-child(2) { top: 76px; left: 4%; background: linear-gradient(90deg, #34556b, #4a6f86 60%, #33546a); color: #e9e3d6; transform: rotate(.6deg); }
.book:nth-child(3) { top: 132px; left: 1%; background: linear-gradient(90deg, #d9cfbd, #ece4d5 60%, #d6cab6); transform: rotate(-.4deg); }
.notecard { position: absolute; right: 2%; top: 4px; width: 132px; height: 186px; background: #f3ece0; border-radius: 6px; box-shadow: 0 10px 22px rgba(60, 40, 20, .22); transform: rotate(7deg); font-family: var(--hand); font-size: 1.6rem; line-height: 1.15; padding: 22px 18px; color: #3d332b; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 18px; }
  .still { height: 200px; max-width: 420px; }
}

/* ── 게임 카드 (시안의 세 장) ── */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 980px) { .cards { grid-template-columns: 1fr; } }
.gcard { position: relative; overflow: hidden; border-radius: var(--r); min-height: 540px; color: #f6efe6; background: var(--dark); display: flex; flex-direction: column; justify-content: flex-end; padding: 30px 30px 32px; isolation: isolate; text-decoration: none; }
.gcard .art { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; transition: transform .6s ease; }
.gcard:hover .art { transform: scale(1.03); }
.gcard::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(20, 15, 10, .05) 20%, rgba(20, 15, 10, .62) 52%, rgba(20, 15, 10, .92) 100%); }
.gcard .new { position: absolute; top: 18px; right: 18px; font-size: .78rem; padding: 3px 11px; border-radius: 99px; color: #fff; }
.gcard h2 { font-size: clamp(2.2rem, 3.6vw, 3rem); margin-bottom: 10px; }
.gcard .sub { font-family: var(--serif); font-size: 1.1rem; line-height: 1.4; margin: 0 0 18px; color: #efe6da; }
.meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: .85rem; color: #e6dccf; margin-bottom: 22px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 17px; height: 17px; }
.gcard .btn { align-self: flex-start; }
.gcard .scribble { position: absolute; right: 26px; bottom: 26px; font-family: var(--hand); font-size: 1.45rem; line-height: 1.05; color: rgba(240, 230, 215, .8); transform: rotate(-8deg); text-align: right; pointer-events: none; }
@media (max-width: 980px) { .gcard { min-height: 440px; } .gcard .scribble { display: none; } }
.c-imp .new { background: var(--imp); }
.c-sw .new { background: var(--sw); }
.c-od .new { background: var(--od); color: #3b2c10; }
.art-imp { background: radial-gradient(ellipse at 50% 18%, rgba(255, 196, 120, .55), transparent 45%), radial-gradient(ellipse at 50% 70%, #4a3626, #1c1510 70%); }
.seats { position: absolute; left: 0; right: 0; top: 92px; display: flex; justify-content: center; gap: 8px; padding: 0 20px; z-index: -1; }
.seats .av { width: 56px; height: 56px; font-size: 1.6rem; box-shadow: 0 8px 18px rgba(0, 0, 0, .45); }
.lamp { position: absolute; left: 50%; top: 0; width: 120px; height: 40px; transform: translateX(-50%); border-radius: 0 0 60px 60px; background: linear-gradient(#3a2b1e, #f4c27e); box-shadow: 0 18px 60px 20px rgba(255, 190, 110, .35); z-index: -1; }
.wordcard { position: absolute; right: 26px; top: 196px; width: 120px; padding: 16px 12px; background: #efe6d6; color: #3a3028; border-radius: 6px; transform: rotate(-9deg); font-family: var(--hand); font-size: 1.25rem; line-height: 1.1; text-align: center; box-shadow: 0 10px 22px rgba(0, 0, 0, .4); z-index: -1; }
.wordcard b { display: block; font-size: 1.9rem; font-weight: 500; }


/* ── 단추 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 10px; padding: 13px 22px; font-family: var(--serif); font-size: 1.05rem; text-decoration: none; transition: transform .12s, box-shadow .12s; line-height: 1.2; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .15); }
.btn:active { transform: none; }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.btn svg { width: 18px; height: 18px; }
.btn-imp { background: var(--imp-btn); color: var(--ink); }
.btn-sw { background: var(--sw-btn); color: var(--ink); }
.btn-od { background: var(--od-btn); color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .92rem; border-radius: 8px; }
.btn-danger { background: var(--bad); color: #fff; }

/* ── How it works ── */
.how { margin-top: 18px; background: var(--paper); border-radius: var(--r); padding: 26px 32px; display: grid; grid-template-columns: 1.1fr repeat(3, 1fr) .8fr; gap: 22px; align-items: center; }
.how h2 { font-size: 1.9rem; }
.how .lead { color: var(--ink2); font-family: var(--serif); margin: 6px 0 0; }
.step { display: flex; gap: 14px; }
.step i { flex: 0 0 34px; height: 34px; border-radius: 50%; background: #b5aa9c; color: #fff; display: grid; place-items: center; font-style: normal; font-size: .95rem; }
.step b { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; display: block; }
.step span { font-size: .88rem; color: var(--ink2); }
.how .hand { font-size: 1.5rem; color: var(--ink2); transform: rotate(-6deg); text-align: center; }
@media (max-width: 980px) { .how { grid-template-columns: 1fr; padding: 22px; } .how .hand { display: none; } }

/* ── 아바타 (AI 플레이어) ── */
.av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 1.15rem; color: #fff; flex: 0 0 auto; position: relative; }
.av svg { width: 60%; height: 60%; }
.av.you { background: var(--ink); }
.av-mara { background: linear-gradient(135deg, #c77a52, #8e4a32); }
.av-theo { background: linear-gradient(135deg, #5d6b7a, #343f4b); }
.av-bit { background: linear-gradient(135deg, #e9edf0, #9aa7b2); color: #20303c; }
.av-juno { background: linear-gradient(135deg, #8a5fb0, #553675); }
.av-felix { background: linear-gradient(135deg, #b4893a, #6f5320); }
.av-ines { background: linear-gradient(135deg, #4f8a7a, #2b5a4e); }
.tag-ai { font-size: .66rem; letter-spacing: .06em; padding: 1px 6px; border-radius: 99px; background: var(--bg2); color: var(--ink2); font-family: var(--sans); vertical-align: middle; }

/* ── 게임 화면 공통 ── */
.gtop { display: flex; align-items: center; gap: 14px; padding: 18px 0 14px; flex-wrap: wrap; }
.gtop h1 { font-size: 2rem; }
.gtop .pill { font-size: .85rem; padding: 4px 12px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); color: var(--ink2); }
.gtop .sp { flex: 1; }
.timer { font-variant-numeric: tabular-nums; font-family: var(--serif); font-size: 1.2rem; }
.timer.low { color: var(--bad); }
.panel { background: var(--paper); border-radius: var(--r); padding: 22px; border: 1px solid var(--line); }
.panel + .panel { margin-top: 14px; }
.panel h2 { font-size: 1.4rem; margin-bottom: 8px; }
.intro { max-width: 760px; margin: 24px auto; }
.intro .panel { padding: 30px; }
.intro ol, .intro ul { padding-left: 1.2em; color: var(--ink2); }
.intro li { margin: 6px 0; }
.choice { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 18px; }
.choice button { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 16px; }
.choice button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.score { display: flex; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; }
.score b { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; }
.vs { color: var(--muted); font-size: .85rem; }
.result-banner { text-align: center; padding: 30px 20px; }
.result-banner h2 { font-size: 2.4rem; margin-bottom: 8px; }
.result-banner .big { font-family: var(--serif); font-size: 1.2rem; color: var(--ink2); }
.care { max-width: 560px; margin: 60px auto; text-align: center; }
.care p { font-size: 1.15rem; line-height: 1.6; }

/* ── Impostor ── */
.imp { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
@media (max-width: 860px) { .imp { grid-template-columns: 1fr; } }
.secret { background: #efe6d6; border-radius: 10px; padding: 16px 18px; transform: rotate(-1.2deg); box-shadow: 0 8px 18px rgba(60, 40, 20, .14); }
.secret small { display: block; font-size: .78rem; color: var(--ink2); text-transform: uppercase; letter-spacing: .08em; }
.secret b { font-family: var(--hand); font-size: 2.4rem; font-weight: 500; line-height: 1; display: block; margin: 4px 0; }
.roster { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.seat { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; }
.seat.turn { border-color: var(--ink); background: var(--bg); }
.seat .nm { font-weight: 600; font-size: .95rem; }
.seat .cl { font-size: .82rem; color: var(--ink2); }
.seat.out { opacity: .55; }
.seat .badge { margin-left: auto; font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: var(--imp); color: #fff; }
.log { display: flex; flex-direction: column; gap: 10px; min-height: 300px; max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.msg { display: flex; gap: 10px; align-items: flex-start; animation: rise .35s ease; }
.msg .bub { background: var(--bg); border-radius: 4px 14px 14px 14px; padding: 9px 13px; max-width: 560px; }
.msg .bub small { display: block; font-size: .75rem; color: var(--muted); }
.msg .clue { font-family: var(--serif); font-size: 1.25rem; }
.msg.me { flex-direction: row-reverse; }
.msg.me .bub { background: var(--ink); color: var(--paper); border-radius: 14px 4px 14px 14px; }
.msg.me .bub small { color: #bfb3a6; }
.sys { text-align: center; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin: 6px 0; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.act { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.row { display: flex; gap: 8px; align-items: center; }
.row input, .act textarea { flex: 1; min-width: 0; }
input[type=text], textarea { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 14px; color: var(--ink); width: 100%; }
textarea { resize: vertical; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 99px; padding: 6px 12px 6px 6px; display: inline-flex; gap: 8px; align-items: center; font-size: .9rem; }
.chip .av { width: 26px; height: 26px; font-size: .8rem; }
.chip.on { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.votes { display: grid; gap: 8px; }
.vote-row { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.vote-row .arrow { color: var(--muted); }

/* ── Somewhere ── */
.sw { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; }
@media (max-width: 900px) { .sw { grid-template-columns: 1fr; } }
.photo { position: relative; border-radius: var(--r); overflow: hidden; background: #222; cursor: zoom-in; }
.photo img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; margin: 0 auto; }
.map { height: 460px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #dfe8ee; }
@media (max-width: 900px) { .map { height: 340px; } }
.map-actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.reveal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.who { border-radius: 12px; padding: 12px 14px; background: var(--bg); }
.who b { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; display: block; }
.who.you { border-left: 4px solid var(--you); }
.who.ai { border-left: 4px solid var(--ai); }
.clues { margin: 6px 0 0; padding-left: 1.1em; color: var(--ink2); font-size: .9rem; }
.credit { font-size: .75rem; color: var(--muted); margin-top: 8px; }
.credit a { color: var(--muted); }
.pin { width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.zoom { position: fixed; inset: 0; z-index: 80; background: rgba(10, 8, 6, .92); display: grid; place-items: center; cursor: zoom-out; }
.zoom img { max-width: 96vw; max-height: 94vh; }
.rounds { display: grid; gap: 8px; }
.round-row { display: grid; grid-template-columns: 80px 1fr auto auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; background: var(--bg); }
.round-row img { width: 80px; height: 54px; object-fit: cover; border-radius: 8px; }
.round-row .pts { font-variant-numeric: tabular-nums; text-align: right; font-size: .9rem; }

/* ── Oddity ── */
.od-stage { position: relative; margin: 0 auto; max-width: 100%; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.od-stage img { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 16px 40px rgba(40, 25, 10, .25); }
.od-wrap { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .od-wrap { grid-template-columns: 1fr; } }
.od-canvas { max-height: 74vh; display: flex; justify-content: center; }
.od-canvas .od-stage { height: 100%; }
.mark { position: absolute; border: 3px solid var(--good); border-radius: 8px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); pointer-events: none; animation: pop .3s ease; }
.mark.ai { border-color: var(--ai); border-style: dashed; }
.mark.missed { border-color: #fff; border-style: dotted; }
.mark label { position: absolute; left: 0; top: 100%; margin-top: 4px; background: rgba(20, 15, 10, .82); color: #fff; font-size: .72rem; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.miss { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; color: var(--bad); pointer-events: none; animation: pop .3s ease; }
.vdot { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--ai); border: 2px solid #fff; pointer-events: none; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.peek-bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 10px 0; }
.peek-bar i { display: block; height: 100%; background: var(--od); width: 100%; transition: width linear; }
.dots { display: flex; gap: 6px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--good); }
.dots i.on { background: var(--good); }
.dots.bad i { border-color: var(--bad); }
.dots.bad i.on { background: var(--bad); }
.chg { display: flex; gap: 8px; align-items: center; font-size: .9rem; padding: 6px 0; border-bottom: 1px solid var(--line); }
.chg:last-child { border: 0; }
.chg .t { flex: 1; }
.ok { color: var(--good); } .no { color: var(--muted); }
.flip-btn { position: absolute; right: 10px; top: 10px; }

/* ── My Games ── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; } }
.stat { border-radius: var(--r); padding: 18px 20px; color: #f6efe6; background: var(--dark2); }
.stat h3 { font-size: 1.5rem; }
.stat p { margin: 6px 0 0; color: #d9cfc2; font-size: .9rem; }
.hist { display: grid; gap: 8px; }
.hist-row { display: flex; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.hist-row .k { font-family: var(--serif); width: 100px; }
.hist-row .d { flex: 1; color: var(--ink2); font-size: .9rem; }
.res { font-size: .78rem; padding: 2px 10px; border-radius: 99px; }
.res.win { background: #dcefe2; color: var(--good); } .res.lose { background: #f5dfdb; color: var(--bad); } .res.draw { background: var(--bg2); color: var(--ink2); }
.menu { display: grid; gap: 4px; margin-top: 18px; }
.menu button, .menu a { text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; text-decoration: none; }
.menu .danger { color: var(--bad); }

/* ── About ── */
.guide { max-width: 760px; margin: 26px auto; }
.guide h2 { font-size: 2.2rem; margin-bottom: 10px; }
.guide h3 { font-size: 1.4rem; margin: 26px 0 8px; }
.guide p, .guide li { color: var(--ink2); }
.guide .gbox { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 10px 0; }
.guide .gbox img, .guide .gbox .thumb { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; }
@media (max-width: 560px) { .guide .gbox { grid-template-columns: 1fr; } }

/* ── 공통 겹창 · 알림 · 입장 암호 ── */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: .25s; max-width: min(92vw, 520px); z-index: 100; font-size: .92rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.overlay, .modal { position: fixed; inset: 0; z-index: 60; background: rgba(30, 22, 15, .45); display: grid; place-items: center; padding: 16px; }
.sheet { position: relative; background: var(--paper); border-radius: var(--r); padding: 28px 24px 22px; width: min(440px, 100%); display: grid; gap: 12px; box-shadow: 0 30px 60px rgba(30, 20, 10, .3); }
.sheet h2 { font-size: 1.6rem; }
.sheet p { margin: 0; }
.sheet-x { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 1.6rem; color: var(--muted); }
.gbtn { min-height: 44px; display: grid; gap: 8px; justify-items: center; }
.keep { font-size: .9rem; display: flex; gap: 8px; align-items: center; justify-content: center; }
.warn { background: #fbecd9; border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.fb-stars { display: flex; gap: 4px; }
.fb-stars button { border: 0; background: none; font-size: 1.8rem; color: #d7cbbb; padding: 0 2px; }
.fb-stars button.on { color: var(--od); }
.dw-gate { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: grid; place-items: center; padding: 16px; }
.gate-card { width: min(420px, 100%); display: grid; gap: 14px; text-align: center; }
.gate-card .brand { font-size: 2.4rem; }
.gate-card .slogan { font-family: var(--serif); color: var(--ink2); margin: 0; }
.gate-card input { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; text-align: center; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 60px 16px; color: var(--ink2); }
.empty h3 { font-size: 1.6rem; color: var(--ink); margin-bottom: 8px; }
.loading { display: grid; place-items: center; padding: 80px 0; }

/* 자매품 */
.sister { margin: 34px 0 10px; }
.sister-title { display: block; font-size: .82em; color: var(--muted); margin-bottom: 8px; }
.sister-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.sister-card { flex: 0 0 150px; scroll-snap-align: start; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.sister-card:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sister-icon { border-radius: 22%; }
.sister-name { font-weight: 600; font-size: .9em; }
.sister-tag { font-size: .75em; color: var(--muted); line-height: 1.3; }
.foot { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 26px; }
.foot button { border: 0; background: none; text-decoration: underline; color: var(--muted); font-size: inherit; }

/* Leaflet 안의 핀 */
.leaflet-container { font: inherit; }
.leaflet-div-icon { background: none; border: 0; }

/* 좁은 화면 다듬기 */
.tabs a { white-space: nowrap; }
@media (max-width: 640px) {
  .brand sup { display: none; }
  .tabs { gap: 12px; }
  .wordcard { display: none; }
  .still { height: 168px; transform: scale(.82); transform-origin: left top; margin-bottom: -20px; }
  .gtop h1 { font-size: 1.6rem; }
}

/* 설치 팝업 (install.js, 시리즈 공통) — 게임 화면 · 규칙 화면 위에는 띄우지 않는다 */
.dwi { position: fixed; left: 0; right: 0; bottom: env(safe-area-inset-bottom); z-index: 70; display: flex; justify-content: center; padding: 0 12px 12px; pointer-events: none; animation: rise .4s ease both; }
body[data-view="game"] .dwi, body[data-view="play"] .dwi { display: none; }
.dwi-card { pointer-events: auto; width: min(440px, 100%); background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; padding: 16px 16px 14px; box-shadow: 0 18px 50px rgba(40, 28, 18, .22); display: flex; flex-direction: column; gap: 12px; }
.dwi-head { display: flex; gap: 12px; align-items: flex-start; }
.dwi-head img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.dwi-head b { display: block; font-weight: 600; }
.dwi-head p { margin: 3px 0 0; font-size: .85em; line-height: 1.5; color: var(--ink2); }
.dwi-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.dwi-btn { padding: 10px 14px; border-radius: 999px; font-size: .85em; border: 0; cursor: pointer; background: none; }
.dwi-main { background: var(--ink); color: var(--paper); font-weight: 600; }
.dwi-ghost { border: 1px solid var(--line); color: var(--ink2); }
.dwi-more { font-size: .9em; }
.dwi-steps { margin: 0; padding-left: 20px; line-height: 1.9; }
.dwi-ico { display: inline-flex; vertical-align: -4px; padding: 2px 4px; border-radius: 6px; background: var(--bg2); }
.dwi-guide { margin: 0 0 8px; line-height: 1.6; }
@media (max-width: 860px) { .log { min-height: 120px; max-height: 50vh; } }
