/* 비행선 갑판과 창가 방: 고요해의 화면 틀(style.css)을 그대로 쓰고, 색만 따뜻한 등불빛으로 바꾼다 */
.place {
  --abyss: #120f0c;
  --glass: rgba(24, 18, 13, 0.62);
  --line: rgba(240, 220, 190, 0.16);
  --glow: #e3b26b;
  --glow-ink: #2a1a07;
  --mute: #b8a993;
}
/* ---------- 입장 화면: 왼쪽은 받침대 위 내 캐릭터 무대, 오른쪽은 꾸미기 (좁은 화면에서는 위아래) ---------- */
.place { --accent: #e3b26b; --accent-2: #7a4a2a; --sky: rgba(227, 178, 107, 0.22); }
.place[data-place="kyoto"] { --accent-2: #a8342a; --sky: rgba(200, 80, 60, 0.22); }
.place[data-place="finland"] { --accent-2: #2f6a5a; --sky: rgba(110, 230, 180, 0.2); }
.place[data-place="camp"] { --accent-2: #8a3a14; --sky: rgba(255, 140, 60, 0.22); }
.place[data-place="jeju"] { --accent-2: #2a5a7a; --sky: rgba(90, 170, 230, 0.22); }
.place[data-place="orbit"] { --accent-2: #4a3a7a; --sky: rgba(150, 130, 255, 0.22); }
.place[data-place="gallery"] { --accent-2: #6a5a3a; --sky: rgba(240, 220, 160, 0.2); }
.place[data-place="deck"] { --accent-2: #3a5a7a; --sky: rgba(160, 200, 240, 0.2); }

.place .gate { overflow-y: auto; align-items: start;
  background: radial-gradient(ellipse 70% 60% at 30% 40%, var(--sky), transparent 70%),
              radial-gradient(ellipse at 50% 55%, rgba(18, 12, 8, 0.25), rgba(12, 9, 6, 0.78) 80%); }
.place .gate-card { position: relative; width: min(880px, 100%); margin-block: auto; padding: 0; gap: 0; overflow: hidden;
  grid-template-columns: 1fr; border-radius: 24px; border: 1px solid rgba(240, 210, 160, 0.22);
  background: linear-gradient(160deg, rgba(40, 30, 22, 0.78), rgba(18, 13, 9, 0.84));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 235, 200, 0.08);
  animation: gate-in 0.7s cubic-bezier(.2, .8, .2, 1) both; }
/* 카드 위 가장자리의 금빛 선 */
.place .gate-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; z-index: 1;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent); opacity: 0.9; }
@keyframes gate-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }

.gate-side { position: relative; display: grid; align-content: start; gap: 6px; padding: 26px 26px 18px;
  background: radial-gradient(ellipse 90% 70% at 50% 78%, var(--sky), transparent 70%),
              linear-gradient(180deg, rgba(255, 240, 210, 0.03), transparent); }
.gate-head { display: grid; gap: 8px; }
.place .eyebrow { justify-self: start; padding: 4px 10px; border-radius: 999px; font-size: 11px; letter-spacing: 0.18em;
  color: var(--accent); background: rgba(227, 178, 107, 0.1); border: 1px solid rgba(227, 178, 107, 0.25); }
.place .gate h1 { font-size: clamp(34px, 5vw, 46px); letter-spacing: 0.04em; line-height: 1.15; word-break: keep-all;
  background: linear-gradient(180deg, #fff4e0, #e8c68e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.place .lede { font-size: 14px; line-height: 1.7; word-break: keep-all; }

.gate-stage { position: relative; display: grid; justify-items: center; margin-top: 4px; }
.look-preview { width: 100%; max-width: 360px; aspect-ratio: 32 / 30; justify-self: center; cursor: grab; touch-action: pan-y;
  border-radius: 18px; background: radial-gradient(circle at 50% 42%, rgba(255, 226, 176, 0.16), transparent 62%); }
.look-preview:active { cursor: grabbing; }
.place .online { margin: -4px 0 0; padding: 4px 12px; border-radius: 999px; font-size: 12px; color: var(--accent);
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.place .online::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%;
  background: #7fe0a0; box-shadow: 0 0 8px #7fe0a0; vertical-align: 1px; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.stage-dice { position: absolute; top: 6px; right: 0; padding: 6px 11px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); color: var(--ink); transition: transform 0.2s, border-color 0.2s; }
.stage-dice:hover { border-color: var(--accent); transform: rotate(-4deg) scale(1.05); }

.gate-form { display: grid; align-content: start; gap: 14px; padding: 24px 26px 22px; border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18); }
.gate-form .field { display: grid; gap: 7px; }
.gate-form label, .gate-form legend { font-size: 11.5px; letter-spacing: 0.14em; color: var(--mute); }
.place #name-input { padding: 12px 14px; border-radius: 12px; font-size: 16px; background: rgba(255, 245, 225, 0.06);
  border: 1px solid rgba(240, 220, 190, 0.2); transition: border-color 0.2s, box-shadow 0.2s; }
.place #name-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(227, 178, 107, 0.18); }
.name-error { margin: 0; font-size: 12.5px; color: #ffb4a0; }

.choices { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; border: 0; }
.choices, .swatches { margin: 0; }
.choices legend, .swatches legend { margin-bottom: 8px; }
.choices.gender button { flex: 1; max-width: 120px; }
.choices button { border-radius: 999px; border: 1px solid var(--line); color: var(--mute); padding: 7px 14px; font-size: 13px; transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  background: rgba(255, 245, 225, 0.03); }
.choices button:hover { border-color: rgba(227, 178, 107, 0.55); color: var(--ink); }
.choices button[aria-pressed="true"] { color: var(--glow-ink); border-color: transparent; background: linear-gradient(180deg, #f0c77f, #d9a05a); box-shadow: 0 4px 14px rgba(227, 178, 107, 0.3); }
.choices button:active, .swatch:active { transform: scale(0.94); }
.place .swatches { gap: 9px; }
.place .swatch { position: relative; width: 34px; height: 34px; border: 2px solid rgba(240, 220, 190, 0.25);
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.25), inset 0 3px 6px rgba(255, 255, 255, 0.18); transition: transform 0.15s, box-shadow 0.2s; }
.place .swatch:hover { transform: translateY(-2px); }
.place .swatch[aria-pressed="true"] { border-color: #fff3dc; box-shadow: 0 0 0 3px rgba(227, 178, 107, 0.45), inset 0 -4px 8px rgba(0, 0, 0, 0.25); }
.place .swatch[aria-pressed="true"]::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }

.primary.enter { position: relative; overflow: hidden; margin-top: 4px; padding: 15px 18px; font-size: 16px; letter-spacing: 0.06em;
  border-radius: 14px; background: linear-gradient(180deg, #f2cc86, #d69a52); box-shadow: 0 10px 26px rgba(214, 154, 82, 0.35);
  transition: transform 0.15s, box-shadow 0.2s; }
.primary.enter::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%); animation: shine 3.6s ease-in-out 1s infinite; }
.primary.enter:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(214, 154, 82, 0.45); }
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.place .gate-room { font-size: 12px; }

/* 넓은 화면: 두 칸 */
@media (min-width: 820px) {
  .place .gate-card { grid-template-columns: 1.05fr 1fr; }
  .gate-side { padding: 32px 28px 24px; }
  .gate-form { border-top: 0; border-left: 1px solid var(--line); padding: 32px 30px 26px; align-content: center; }
  .look-preview { max-width: 400px; }
}
/* 좁은 화면: 무대를 조금 낮게 */
@media (max-width: 819px) {
  .look-preview { max-width: 280px; aspect-ratio: 32 / 27; }
  .gate-side { padding: 22px 20px 14px; }
  .gate-form { padding: 18px 20px 20px; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .place .gate-card, .primary.enter::after, .place .online::before { animation: none; }
}
.seat-state { margin: 0; padding: 6px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line);
  font-size: 12px; color: var(--mute); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.seat-state.on { color: var(--glow); }
.tool.travel-tool { background: var(--glow); color: var(--glow-ink); border-color: transparent; font-weight: 700; }

/* 행선지 고르기 */
.dest-dialog { background: #1a140f; }
.dest-list { display: grid; gap: 10px; margin-top: 14px; }
.dest { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; text-align: left; padding: 14px 16px;
  border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--ink); }
.dest:hover { border-color: var(--glow); }
.dest strong { font-family: var(--display); font-size: 18px; }
.dest-count { color: var(--glow); font-size: 13px; font-variant-numeric: tabular-nums; }
.dest-mood, .dest-sound { grid-column: 1 / -1; font-size: 13px; color: var(--mute); }
/* 행선지는 두 줄로: 칸을 작게 해서 장소가 늘어도 덜 내려도 되게 */
#dest-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#dest-list .dest { grid-template-columns: 1fr; padding: 11px 12px; gap: 3px; align-content: start; }
#dest-list .dest strong { font-size: 15px; }
#dest-list .dest-mood, #dest-list .dest-sound { font-size: 12px; line-height: 1.4; }
#dest-list .dest-count { font-size: 12px; order: 3; }

/* 소원 풍등 */
.actions .lantern-btn { background: linear-gradient(180deg, #ffcf7a, #f08a3a); color: #2a1206; }
.actions .lantern-btn:disabled { background: var(--glass); color: var(--mute); }
.wish-form { display: grid; gap: 8px; margin-top: 14px; }
.wish-form input { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--ink); }

/* 앉았을 때만 나오는 몸짓 */
.actions .seat-motion { background: rgba(227, 178, 107, 0.18); color: var(--glow); font-weight: 700; }

/* 주운 유리병 편지 */
.note-dialog { background: #f4ead2; color: #3a2a1c; border-color: rgba(90, 60, 30, 0.3); }
.note-dialog h2 { color: #3a2a1c; }
.note-dialog .note-body { margin: 14px 0 10px; font-family: var(--display); font-size: 20px; line-height: 1.6; color: #2a1a0c; overflow-wrap: anywhere; }
.note-dialog .note-from { font-size: 13px; color: #7a5a3a; text-align: right; }
.note-dialog .support-actions button { border-color: rgba(90, 60, 30, 0.3); }
.note-dialog .primary, .note-dialog .support-actions .primary { background: #3a2a1c; color: #f4ead2; }

/* 구름을 지나 오르내리는 화면 */
.travel { position: fixed; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity 1s ease; pointer-events: none; z-index: 20;
  background:
    radial-gradient(ellipse 60% 30% at 30% 40%, rgba(255, 255, 255, 0.9), transparent 70%),
    radial-gradient(ellipse 50% 25% at 70% 60%, rgba(255, 255, 255, 0.85), transparent 70%),
    radial-gradient(ellipse 70% 35% at 50% 85%, rgba(250, 240, 230, 0.9), transparent 70%),
    linear-gradient(180deg, #f6dcc0, #cfd8e2); }
.travel.on { opacity: 1; }
/* 우주로 오르내릴 때는 별이 뜬 검푸른 하늘빛 */
.travel.space {
  background:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 70% 20%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, #dfe8ff, transparent),
    radial-gradient(1px 1px at 85% 60%, #fff, transparent),
    radial-gradient(1px 1px at 10% 85%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 55% 45%, #fff, transparent),
    radial-gradient(ellipse 120% 50% at 50% 115%, rgba(90, 150, 255, 0.45), transparent 70%),
    linear-gradient(180deg, #02030c, #0b1838); }
.travel.space p { color: #e6eeff; }
.travel p { margin: 0; font-family: var(--display); font-size: 22px; letter-spacing: 0.08em; color: #3a2a1c; }

/* 휴대폰: 위쪽 알림 띠가 겹치지 않게 줄이고, 아래 버튼은 잘리지 않게 두 줄까지 감싼다 */
@media (max-width: 640px) {
  .place .hud { gap: 6px; }
  .place .hud-left { max-width: 58%; gap: 6px; }
  .place .room { padding: 6px 11px; gap: 6px; font-size: 12px; }
  .place .room strong { font-size: 14px; }
  .place .seat-state { padding: 5px 10px; font-size: 11px; line-height: 1.4; }
  .place .hud-right { max-width: 42%; }
  .place .toast { top: calc(150px + env(safe-area-inset-top, 0px)); font-size: 13px; }
  .place .actions { flex-wrap: wrap; justify-content: center; overflow: visible; border-radius: 22px; padding: 4px; gap: 2px; }
  .place .actions button { padding: 8px 11px; font-size: 13px; }
  .place .hint { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  .place .dest-dialog, .place .support { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) { .travel { transition: none; } }

/* ---------- 개발자 모드 패널 (?debug=1) ---------- */
.dev-panel { position: fixed; left: 12px; top: 50%; transform: translateY(-50%); z-index: 30; display: grid; gap: 4px; max-width: 300px; max-height: 70vh; overflow-y: auto;
  padding: 8px; border-radius: 12px; background: rgba(30, 22, 14, 0.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #f3e6cc; }
.dev-panel button { padding: 5px 10px; border-radius: 8px; border: 1px dashed rgba(243, 230, 204, 0.5); background: rgba(255, 255, 255, 0.08); color: inherit; font-size: 12px; }
.dev-panel .dev-head { justify-self: start; border-style: solid; font-weight: 700; }
.dev-body { display: grid; gap: 4px; }
.dev-title { margin: 4px 0 0; font-size: 11px; letter-spacing: 0.08em; opacity: 0.7; }
.dev-row { display: flex; flex-wrap: wrap; gap: 5px; }
.dev-tip { margin: 0; font-size: 11px; line-height: 1.5; opacity: 0.8; }

/* ---------- 긴 명단 (미술관의 함께한 사람들) ---------- */
.list-dialog { width: min(520px, calc(100vw - 32px)); }
.list-dialog .list-sub { margin: 4px 0 10px; font-size: 13px; color: #7a5a3a; }
.list-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.list-tabs button { padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(90, 60, 30, 0.3); background: transparent; color: #3a2a1c; font-size: 13px; }
.list-tabs button[aria-pressed="true"] { background: #3a2a1c; color: #f4ead2; }
#list-search { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(90, 60, 30, 0.3); background: #fffaf0; color: #2a1a0c; font-size: 14px; }
.list-dialog .list-count { margin: 8px 0 4px; font-size: 12px; color: #7a5a3a; }
.list-names { list-style: none; margin: 0 0 10px; padding: 0; max-height: min(46vh, 420px); overflow-y: auto; border-top: 1px solid rgba(90, 60, 30, 0.2); }
.list-names li { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid rgba(90, 60, 30, 0.12); font-size: 15px; }
.list-names .rank { color: #9a7a5a; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.list-names .name { font-family: var(--display); overflow-wrap: anywhere; }
.list-names .n { color: #7a5a3a; font-size: 12px; font-variant-numeric: tabular-nums; }
.list-names li.top .name { color: #a8741a; font-weight: 700; }
.list-names li.me { background: rgba(232, 180, 80, 0.18); border-radius: 8px; }

/* 방(채널) 고르기: 지금 있는 방과 가득 찬 방은 고를 수 없다 */
.dest:disabled { opacity: 0.55; cursor: default; }
.dest:disabled:hover { border-color: var(--line); }

/* 후원: 버튼은 은은한 분홍빛, 창에는 이번 달 게이지 */
.tool.support-tool { color: #ffd2dc; border-color: rgba(255, 170, 190, 0.45); }
.support-bar { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-bottom: 4px; }
.support-bar span { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #ffb37a, #ff8fb0); transition: width 0.6s ease; }

/* 개발자 패널의 글자 칸과 고르기 */
.dev-panel .dev-input { font: inherit; font-size: 12px; padding: 5px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.35); color: #f4ead2; min-width: 0; }
.dev-panel input.dev-input { flex: 1 1 100%; }

.dev-panel .dev-note { margin: 0; font-size: 11.5px; opacity: 0.85; }

/* 하늘 고래 곁 시점에서 갑판으로 돌아가는 버튼 */
.sky-back { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 40; padding: 10px 18px; border-radius: 999px;
  border: 1px solid rgba(190, 225, 255, 0.6); background: rgba(16, 32, 56, 0.72); color: #eaf4ff; font: inherit; font-weight: 700;
  backdrop-filter: blur(6px); cursor: pointer; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
.sky-back[hidden] { display: none; }
.sky-back.ride { background: linear-gradient(135deg, rgba(255, 205, 110, 0.92), rgba(255, 150, 80, 0.92)); color: #2a1600; border-color: rgba(255, 230, 170, 0.9);
  animation: ride-glow 2s ease-in-out infinite; }
@keyframes ride-glow { 50% { box-shadow: 0 0 22px rgba(255, 210, 120, 0.8); } }

/* 엔딩 크레딧: 축제 날 밤 10시 불꽃놀이 끝에 함께 주운 사람들의 이름이 흘러 올라간다 */
.credits { position: fixed; inset: 0; z-index: 25; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, rgba(6, 10, 26, 0.35), rgba(6, 10, 26, 0.05) 30%, rgba(6, 10, 26, 0.05) 70%, rgba(6, 10, 26, 0.4));
  mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 82%, transparent 100%); }
.credits-roll { position: absolute; left: 50%; top: 100%; width: min(560px, 90vw); transform: translateX(-50%); text-align: center;
  color: #f6ecd6; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75); animation: credits-up 30s linear forwards; }
@keyframes credits-up { from { transform: translate(-50%, 0); } to { transform: translate(-50%, calc(-100% - 100vh)); } }
.credits-roll p { margin: 0 0 10px; }
.credits-roll .c-head { font-size: 26px; font-weight: 800; color: #ffd98a; margin-bottom: 6px; }
.credits-roll .c-sub { font-size: 14px; letter-spacing: 0.3em; opacity: 0.8; margin-bottom: 18px; }
.credits-roll ul { list-style: none; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; font-size: 16px; }
.credits-roll li.me { color: #ffd98a; font-weight: 800; text-shadow: 0 0 14px rgba(255, 210, 120, 0.9); }
.credits-roll .c-more { opacity: 0.8; font-size: 14px; }
.credits-roll .c-total { font-size: 16px; font-weight: 700; margin-top: 16px; }
.credits-roll .c-end { font-size: 18px; color: #bfe4ff; }
@media (max-width: 480px) { .credits-roll ul { grid-template-columns: repeat(2, 1fr); font-size: 15px; } }

/* 긴 읽을 거리 (선장의 항해일지): 작은 글씨, 줄바꿈 그대로, 길면 안에서 굴린다 */
.note-dialog.long .note-body { font-size: 16px; line-height: 1.7; white-space: pre-line; max-height: 58vh; overflow-y: auto; text-align: left; }

/* 고요 선장의 퀴즈 */
.quiz-dialog .quiz-q { font-size: 18px; font-weight: 700; margin: 10px 0 14px; }
.quiz-dialog .quiz-options { display: grid; gap: 8px; }
.quiz-dialog .quiz-options button { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.06); color: inherit; font: inherit; font-size: 16px; cursor: pointer; text-align: left; }
.quiz-dialog .quiz-options button:hover { border-color: #ffd98a; }
.quiz-dialog .quiz-note { font-size: 12.5px; opacity: 0.75; margin-top: 12px; }

/* 불멍: 화면의 버튼과 글씨를 천천히 지우고 불만 남긴다 (화면을 누르면 돌아온다) */
body #hud, body #dock, body .toast, body .dev-panel, body .hint { transition: opacity 1.6s ease; }
body.gazing #hud, body.gazing #dock, body.gazing .toast, body.gazing .dev-panel, body.gazing .hint, body.gazing .notice-banner { opacity: 0; pointer-events: none; }
