/* ==========================================================================
   로그인 — 파이 섬 선착장  (templates/login.html · 단독 화면)
   메인 화면(static/main/pm.css)의 섬 무대를 그대로 가져와 «선착장에서 바라본 섬»으로 세웁니다.
   무대 = 1600×640 디자인 px, 1em = 10 디자인 px (건물 자리는 메인과 같은 값).
   ========================================================================== */
html.pi-on, html.pi-on body { margin: 0; min-height: 100%; }
html.pi-on { scrollbar-gutter: auto; }
.pg-login { --lg-u: min(.56vw, 1.2vh); --lg-sea: 15vh; --lg-left: clamp(20px, 6vw, 104px); --lg-w: 500px; min-height: 100vh; min-height: 100dvh; display: flex; overflow: clip; isolation: isolate; }

/* ── 장면 ─────────────────────────────────────────────────────────────── */
.lg-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background-color: var(--pi-page); }
.lg-scene i, .lg-scene img, .lg-scene span, .lg-scene svg { position: absolute; display: block; }
.lg-sky { inset: 0; opacity: 0; transition: opacity var(--pi-sky-dur) linear; }
.lg-sky--dawn { background: linear-gradient(#8FA8EC 0%, #C2B2EC 36%, #F3C2D3 66%, #FBD9D2 86%, #F6E7F1 100%); }
.lg-sky--day { background: linear-gradient(#5DB9F1 0%, #8FD3F7 40%, #C6EAFB 80%, #DDF2FD 100%); }
.lg-sky--dusk { background: linear-gradient(#F29A6C 0%, #F7B77C 34%, #FAD292 64%, #FFE0B4 88%, #FFE6C8 100%); }
.lg-sky--night { background: linear-gradient(#33264F 0%, #4E3062 30%, #84466E 54%, #B85F6A 70%, #C47A5A 82%, #8C5560 93%, #704650 100%); }
html[data-time="dawn"] .lg-sky--dawn, html[data-time="day"] .lg-sky--day, html[data-time="dusk"] .lg-sky--dusk, html[data-time="night"] .lg-sky--night,
html:not([data-time]) .lg-sky--day { opacity: 1; }

.lg-stars { position: absolute; inset: 0 0 48%; opacity: 0; transition: opacity var(--pi-sky-dur) linear; -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent); }
html[data-time="night"] .lg-stars { opacity: 1; }
.lg-stars i { inset: 0; background-repeat: repeat; }
.lg-stars i:nth-child(1) { background-image: radial-gradient(circle at 12% 18%, #fff 0 1.2px, transparent 1.7px), radial-gradient(circle at 58% 34%, #FFF3C4 0 1.5px, transparent 2px), radial-gradient(circle at 86% 71%, #fff 0 1px, transparent 1.5px); background-size: 463px 257px; animation: lg-twinkle 3.6s ease-in-out infinite alternate; }
.lg-stars i:nth-child(2) { background-image: radial-gradient(circle at 31% 52%, #FFE9D6 0 1px, transparent 1.5px), radial-gradient(circle at 74% 14%, #fff 0 1.3px, transparent 1.8px); background-size: 587px 311px; animation: lg-twinkle 5.3s ease-in-out -2s infinite alternate; }
@keyframes lg-twinkle { from { opacity: .35; } to { opacity: 1; } }

/* 무대 — 오른쪽 아래에 붙임. 섬은 화면 오른쪽 2/3, 왼쪽은 안내판 자리 */
.lg-stage { position: absolute; right: -5.5em; bottom: calc(var(--lg-sea) - 3em); width: 160em; height: 64em; font-size: var(--lg-u); animation: lg-arrive 1.1s var(--pi-ease) both; }
@keyframes lg-arrive { from { transform: translateY(2.4em); opacity: 0; } to { transform: none; opacity: 1; } }
.lg-orb { width: 12em; height: 12em; transition: left var(--pi-sky-dur) var(--pi-ease), top var(--pi-sky-dur) var(--pi-ease), opacity var(--pi-sky-dur) linear; }
.lg-sun { left: 72em; top: -6em; }
html[data-time="dawn"] .lg-sun { left: 50em; top: 14em; }
html[data-time="dusk"] .lg-sun { left: 132em; top: 12em; }
html[data-time="night"] .lg-sun { left: 132em; top: 40em; opacity: 0; }
.lg-moon { left: 66em; top: 12em; opacity: 0; z-index: 21; }
html[data-time="night"] .lg-moon { top: -5em; opacity: 1; }
.lg-far { left: 0; top: 15em; width: 160em; height: 33em; -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.lg-cloud { left: 0; will-change: transform; animation: lg-drift 120s linear infinite; transition: opacity var(--pi-sky-dur) linear; }
html[data-time="night"] .lg-cloud { opacity: .7; }
.lg-cloud--1 { top: 44em; width: 36em; height: 15em; animation-duration: 150s; animation-delay: -34s; }
.lg-cloud--2 { top: 4em; width: 28em; height: 12em; animation-duration: 104s; animation-delay: -52s; }
.lg-cloud--3 { top: -4em; width: 22em; height: 9.6em; animation-duration: 72s; animation-delay: -23s; }
.lg-cloud--4 { top: 16em; width: 22em; height: 9.6em; animation-duration: 126s; animation-delay: -88s; }
@keyframes lg-drift { from { transform: translateX(-70em); } to { transform: translateX(170em); } }
.lg-island, .lg-season, .lg-lights { left: 0; top: 0; width: 160em; height: 64em; }
.lg-season { background: none 0 0 / 100% 100% no-repeat; }
html[data-season="spring"] .lg-season--ground { background-image: url(/static/main/art/season_spring.webp); }
html[data-season="spring"] .lg-season--top { background-image: url(/static/main/art/season_spring_top.webp); }
html[data-season="summer"] .lg-season--ground { background-image: url(/static/main/art/season_summer.webp); }
html[data-season="summer"] .lg-season--top { background-image: url(/static/main/art/season_summer_top.webp); }
html[data-season="autumn"] .lg-season--ground { background-image: url(/static/main/art/season_autumn.webp); }
html[data-season="autumn"] .lg-season--top { background-image: url(/static/main/art/season_autumn_top.webp); }
html[data-season="winter"] .lg-season--ground { background-image: url(/static/main/art/season_winter.webp); }
html[data-season="winter"] .lg-season--top { background-image: url(/static/main/art/season_winter_top.webp); }
.lg-season--top { z-index: 9; }
.lg-b > img:first-child { inset: 0; width: 100%; height: 100%; }
.lg-b--board { left: 48.5em; top: 37em; width: 15em; height: 15em; z-index: 6; }
.lg-b--market { left: 61em; top: 29em; width: 21em; height: 19em; z-index: 4; }
.lg-b--post { left: 78.5em; top: 41em; width: 10em; height: 13em; z-index: 8; }
.lg-b--guild { left: 82em; top: 15em; width: 25em; height: 27em; z-index: 2; }
.lg-b--bank { left: 98.5em; top: 34em; width: 18em; height: 18em; z-index: 7; }
.lg-b--tower { left: 109em; top: 6em; width: 22em; height: 34em; z-index: 1; }
.lg-b--arena { left: 122.5em; top: 32em; width: 24em; height: 18em; z-index: 5; }
.lg-b--mill { left: 139.5em; top: 20em; width: 15em; height: 23em; z-index: 3; }
.lg-flag { left: 10.7em; top: -.1em; width: 4.4em; height: 3em; transform-origin: .3em .4em; animation: lg-flap 1.9s ease-in-out infinite alternate; }
@keyframes lg-flap { 0% { transform: skewY(-5deg) scaleX(1); } 50% { transform: skewY(4deg) scaleX(.93); } 100% { transform: skewY(-2deg) scaleX(1.02); } }
.lg-blades { left: -2.5em; top: -4em; width: 20em; height: 20em; animation: lg-spin 14s linear infinite; }
@keyframes lg-spin { to { transform: rotate(360deg); } }
/* 색 온도(새벽 · 노을 · 밤) — 메인과 같은 곱하기 덮개 */
.lg-grade { inset: -20em -10em; z-index: 20; background-color: var(--pi-grade); mix-blend-mode: multiply; transition: background-color var(--pi-sky-dur) linear; -webkit-mask-image: linear-gradient(transparent 0, #000 22%, #000 80%, transparent 99%); mask-image: linear-gradient(transparent 0, #000 22%, #000 80%, transparent 99%); }
html[data-time="day"] .lg-grade, html:not([data-time]) .lg-grade { visibility: hidden; }
.lg-lights { z-index: 21; opacity: 0; background: none 0 0 / 100% 100% no-repeat; transition: opacity var(--pi-sky-dur) linear; }
html[data-time="night"] .lg-lights { opacity: 1; background-image: url(/static/main/art/lights.webp); animation: lg-glow 4.2s ease-in-out 1.2s infinite alternate; }
@keyframes lg-glow { from { opacity: 1; } to { opacity: .86; } }

/* 구름 바다 — 선착장 아래를 채움 */
.lg-sea { left: -40px; right: -40px; bottom: 0; height: calc(var(--lg-sea) + 46px); z-index: 22;
  background:
    radial-gradient(60px 46px at 60px 46px, #fff 98%, transparent) 0 0 / 150px 46px repeat-x,
    radial-gradient(80px 40px at 80px 46px, #F2FAFF 98%, transparent) -70px 0 / 210px 46px repeat-x,
    linear-gradient(#fff, #fff) 0 44px / 100% 100% no-repeat;
  filter: drop-shadow(0 -3px 0 rgba(59, 36, 20, .08)); animation: lg-sea 46s linear infinite; }
@keyframes lg-sea { to { background-position: 1050px 0, 980px 0, 0 44px; } }
html[data-time="dawn"] .lg-sea { filter: drop-shadow(0 -3px 0 rgba(59, 36, 20, .08)) sepia(.12) hue-rotate(-18deg); }
html[data-time="dusk"] .lg-sea { filter: drop-shadow(0 -3px 0 rgba(59, 36, 20, .08)) sepia(.5) saturate(1.5) hue-rotate(-12deg); }
html[data-time="night"] .lg-sea { filter: drop-shadow(0 -3px 0 rgba(0, 0, 0, .12)) brightness(.62) sepia(.35) hue-rotate(-50deg) saturate(1.5); }

/* 선착장 — 나무 다리 */
.lg-pier { position: absolute; left: -6px; bottom: calc(var(--lg-sea) + 10px); z-index: 23; width: calc(var(--lg-left) + var(--lg-w) + 62px); height: 26px;
  border: var(--pi-line) solid var(--pi-ink); border-radius: 0 10px 10px 0;
  background: repeating-linear-gradient(90deg, var(--pi-wood) 0 52px, var(--pi-wood-d) 52px 55px);
  box-shadow: inset 0 -7px 0 rgba(59, 36, 20, .16), 0 5px 0 var(--pi-ink); }
.lg-pier-post { top: 22px; width: 16px; height: calc(var(--lg-sea) + 30px); border: var(--pi-line) solid var(--pi-ink); border-top: 0; background: var(--pi-wood-d); box-shadow: inset -5px 0 0 rgba(59, 36, 20, .18); z-index: -1; }
.lg-pier-post--1 { right: 22px; } .lg-pier-post--2 { right: 46%; } .lg-pier-post--3 { right: 86%; }
.lg-pier-rope { left: 0; right: 18px; top: -40px; height: 40px;
  background:
    linear-gradient(var(--pi-ink), var(--pi-ink)) 100% 0 / 7px 100% no-repeat,
    radial-gradient(ellipse 50% 100% at 50% 0, transparent calc(100% - 4px), var(--pi-ink2) calc(100% - 3px) 100%, transparent calc(100% + 1px)) 0 6px / 25% 22px repeat-x;
  -webkit-mask-image: linear-gradient(90deg, transparent 80%, #000 86%); mask-image: linear-gradient(90deg, transparent 80%, #000 86%); }
.lg-lamp { right: 6px; top: -92px; width: 30px; height: 92px; }
.lg-lamp::before { content: ""; position: absolute; left: 11px; bottom: 0; width: 8px; height: 62px; border: var(--pi-line) solid var(--pi-ink); background: var(--pi-wood-d); border-radius: 3px 3px 0 0; }
.lg-lamp i { left: 0; top: 0; width: 30px; height: 34px; border: var(--pi-line) solid var(--pi-ink); border-radius: 9px 9px 6px 6px; background: var(--pi-gold-l); box-shadow: inset 0 -8px 0 var(--pi-gold); }
html[data-time="night"] .lg-lamp i, html[data-time="dusk"] .lg-lamp i { background: #FFF3B0; box-shadow: inset 0 -8px 0 var(--pi-gold), 0 0 0 6px rgba(255, 227, 154, .34), 0 0 34px 16px rgba(255, 214, 110, .5); animation: lg-glow 3.4s ease-in-out infinite alternate; }

/* 하늘 나룻배 — 선착장을 떠나 섬으로 가는 중 */
.lg-scene .lg-boat { left: calc(var(--lg-left) + var(--lg-w) + 6vw); top: 9vh; z-index: 19; width: clamp(70px, 7vw, 108px); height: auto; overflow: visible; transform-origin: 50% 100%; animation: lg-bob 4.6s ease-in-out infinite alternate; }
@keyframes lg-bob { from { transform: translateY(0) rotate(-2.2deg); } to { transform: translateY(-12px) rotate(2.2deg); } }

/* ── 안내판 ───────────────────────────────────────────────────────────── */
.lg-main { position: relative; z-index: 30; display: flex; flex-direction: column; justify-content: center; gap: 14px; width: 100%; max-width: var(--lg-w); margin: 0 0 0 var(--lg-left); padding: 30px 0 calc(var(--lg-sea) * .34); }
.lg-card.pi-paper { padding: 0; overflow: hidden; border-radius: var(--pi-r-l); box-shadow: var(--pi-drop-l); }
.lg-card.pi-rise > * { animation-duration: .55s; }
/* 간판 — 나무 팻말 */
.lg-sign { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 8px 22px; border-bottom: var(--pi-line) solid var(--pi-ink);
  background: repeating-linear-gradient(90deg, transparent 0 118px, rgba(59, 36, 20, .2) 118px 121px), linear-gradient(var(--pi-wood), var(--pi-wood-d)); box-shadow: inset 0 -6px 0 rgba(59, 36, 20, .14); }
.lg-logo { flex: none; width: 74px; height: 50px; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(59, 36, 20, .35)); }
.lg-sign-t { font-size: 22px; line-height: 1.2; color: var(--pi-ink); text-shadow: 0 1px 0 rgba(255, 251, 239, .55); }
.lg-body { padding: 22px 24px 24px; }
.lg-title { margin: 0; font-size: 27px; line-height: 1.25; color: var(--pi-ink); }
.lg-lead { margin: 8px 0 0; font-size: 15px; font-weight: 500; color: var(--pi-ink2); }
.lg-steps { margin: 16px 0 0; }

.lg-err.pi-note { margin: 18px 0 0; align-items: flex-start; animation: pi-shake .45s var(--pi-ease) .5s both; }
.lg-err-m { min-width: 0; flex: 1; }
.lg-err-t { display: block; font-family: var(--pi-jua); font-weight: 700; font-synthesis: none; font-size: 17px; line-height: 1.3; }
.lg-err-d { margin: 4px 0 0; font-size: 14px; line-height: 1.6; }
.lg-code { display: block; margin-top: 8px; padding: 6px 9px; border: var(--pi-line-s) dashed rgba(59, 36, 20, .4); border-radius: 8px; background: rgba(255, 255, 255, .6); font-family: var(--pi-mono); font-size: 12.5px; line-height: 1.45; word-break: break-all; -webkit-user-select: all; user-select: all; }

/* 으뜸 단추 — 디스코드 */
.lg-go.pi-btn { --_bg: #5865F2; --_bgh: #4752E0; --_fg: #fff; --_sh: 6px; min-height: 62px; margin-top: 16px; font-size: 20px; gap: 12px; }
.lg-go.pi-btn:hover { color: #fff; }
.lg-dc { flex: none; width: 28px; height: 28px; }
.pg-login .lg-go.pi-btn[aria-disabled="true"] { --_bg: #9AA1DE; --_bgh: #9AA1DE; --_fg: #fff; background-color: #9AA1DE; color: #fff; border-color: var(--pi-ink); opacity: 1; filter: none; box-shadow: 0 3px 0 var(--pi-ink); transform: translateY(3px); cursor: wait; }
.lg-go.is-ready { animation: pi-bump .5s var(--pi-spring) 2; }
.lg-safe { margin: 16px 0 0; font-size: 13px; font-weight: 500; color: var(--pi-ink2); text-align: center; }
.lg-safe .pi-i { display: inline-block; width: 15px; height: 15px; margin: -3px 5px 0 0; vertical-align: middle; }

.lg-why { display: grid; gap: 6px; margin: 16px 0 0; padding: 12px 14px; list-style: none; border: var(--pi-line-s) dashed var(--pi-rule); border-radius: var(--pi-r-s); background: var(--pi-shade); }
.lg-why li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.5; color: var(--pi-ink2); }
.lg-why li b { color: var(--pi-ink); font-weight: 700; }
.lg-why .pi-i { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--pi-ink); }

.lg-help { margin-top: 18px; padding-top: 16px; border-top: var(--pi-line-s) dashed var(--pi-rule); }
.lg-help-t { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 17px; line-height: 1.3; color: var(--pi-ink); }
.lg-help-t .pi-i { width: 20px; height: 20px; color: var(--pi-sky-t); }
.lg-help .pi-fold > summary { font-size: 14px; }
.lg-fold { font-size: 14px; line-height: 1.65; color: var(--pi-ink2); }
.lg-fold p { margin: 0; }
.lg-fold b { color: var(--pi-ink); font-weight: 700; }
.lg-fold ol { margin: 8px 0 0; padding-left: 20px; list-style: decimal; }
.lg-fold li { margin-bottom: 4px; }
.lg-fold li::marker { font-weight: 700; color: var(--pi-ink); }
.lg-fold code { padding: 1px 6px; border-radius: 6px; background: var(--pi-shade); font-family: var(--pi-mono); font-size: 12.5px; }
.lg-fold .lg-tip { margin-top: 10px; padding: 10px 12px; border: var(--pi-line-s) solid var(--pi-ink); border-radius: var(--pi-r-s); background: var(--pi-gold-bg); font-size: 13.5px; color: var(--pi-ink); }
.lg-copy { margin-top: 10px; }

.lg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 4px 6px 0; font-size: 13px; font-weight: 600; color: var(--pi-on-page2); }
.lg-foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--pi-on-page); text-decoration: underline; text-underline-offset: 3px; border-radius: 6px; }
/* 바닥 글은 구름 바다 위에 놓이므로 밤에도 먹색 */
@media (min-width: 861px) { .lg-foot { position: fixed; right: 26px; bottom: 10px; z-index: 31; margin: 0; color: var(--pi-ink2); } .lg-foot a { color: var(--pi-ink); } html[data-time="night"] .lg-foot, html[data-time="night"] .lg-foot a { color: #FFFBEF; } }

/* ── 낮은 창(노트북) — 안내판이 길면 장면은 그대로 두고 안내판만 흐름 ─────── */
@media (min-width: 861px) and (max-height: 820px) { .lg-main { justify-content: flex-start; } .lg-title { font-size: 24px; } .lg-go.pi-btn { min-height: 56px; } }

/* ── 휴대폰 · 좁은 화면 — 위에 섬, 아래에 안내판 ───────────────────────── */
@media (max-width: 860px) {
  .pg-login { --lg-u: .92vw; display: block; }
  .lg-scene { position: absolute; inset: 0 0 auto; height: calc(74vw + 40px); }
  .lg-stage { right: auto; left: calc(50vw - 100em); bottom: auto; top: 12vw; }
  .lg-sun { top: -4em; left: 62em; } html[data-time="night"] .lg-moon { top: -4em; left: 60em; }
  .lg-sea { height: 60px; bottom: -2px; --lg-sea: 14px; }
  .lg-scene .lg-pier { display: none; }
  .lg-scene .lg-boat { left: auto; right: 5vw; top: 5vw; width: 15vw; }
  .lg-sky { -webkit-mask-image: none; mask-image: none; }
  .lg-main { max-width: 520px; margin: 0 auto; padding: calc(60vw + 6px) 16px 28px; }
  .lg-card.pi-paper { box-shadow: var(--pi-drop); }
  .lg-sign { min-height: 60px; padding: 6px 16px; }
  .lg-logo { width: 62px; height: 42px; }
  .lg-sign-t { font-size: 20px; }
  .lg-body { padding: 18px 16px 20px; }
  .lg-title { font-size: 23px; }
  .lg-foot { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .lg-stage, .lg-cloud, .lg-flag, .lg-blades, .lg-sea, .lg-boat, .lg-stars i, .lg-lights, .lg-lamp i, .lg-err.pi-note, .lg-go.is-ready { animation: none !important; }
}
@media print { .lg-scene { display: none; } }
