/* 메인 화면(내 방·동네)과 장소 화면 */
body.world-screen, body.place-screen { background: #2c1a33; }
.world-screen .sidebar, .world-screen .topbar, .place-screen .sidebar { display: none; }
.world-screen main { margin: 0; padding: 0; }
.world-screen #view { max-width: none; }

.world { position: relative; display: grid; place-items: center; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; background: linear-gradient(#6b4568, #4e3558 45%, #5d3a4b); animation: world-in .35s ease-out; }
.world-map { background: #231f3f; }
.world-map.is-day { background: #6f8a6a; }
.world-stage { position: relative; flex: none; width: min(100vw, 177.778vh); width: min(100vw, 177.778dvh); aspect-ratio: 16 / 9; container-type: size; }
.world-art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; user-select: none; pointer-events: none; }
@keyframes world-in { from { opacity: 0; transform: scale(1.02); } }
.world.is-leaving { opacity: 0; transition: opacity .24s; }

.spot, .phone, .coins { z-index: 1; }
.spot { position: absolute; padding: 0; border: 0; background: none; border-radius: 1.6cqw; color: #41283d; }
.spot::before { content: ''; position: absolute; inset: -1%; border-radius: inherit; border: 2px solid #ffd9a0b8; background: #ffd9a014; opacity: 0; transition: opacity .15s; }
.spot:hover::before, .spot:focus-visible::before { opacity: 1; }
.spot:focus-visible { outline: none; }
.spot-tag { position: absolute; left: 50%; bottom: 0; max-width: 13cqw; overflow: hidden; text-overflow: ellipsis; transform: translate(-50%, 40%); padding: .42em .95em; border-radius: 99px; background: #1d1228c7; border: 1px solid #ffffff2e; color: #f6e9ee; font-size: max(11px, 1.05cqw); font-weight: 700; line-height: 1.25; white-space: nowrap; letter-spacing: -.01em; backdrop-filter: blur(3px); transition: transform .15s, background .15s, color .15s; }
.spot:hover .spot-tag, .spot:focus-visible .spot-tag { background: #ffd9a0; color: #2b1830; transform: translate(-50%, 28%); }
.spot-badge { position: absolute; top: -.4cqw; right: -.4cqw; padding: .25em .6em; border-radius: 99px; background: #e2506a; color: #fff; font-size: max(10px, .9cqw); font-weight: 800; letter-spacing: .04em; animation: spot-bob 2s ease-in-out infinite; }
@keyframes spot-bob { 50% { transform: translateY(-18%); } }
.is-first .spot::before { animation: spot-hint 1.2s .5s ease-in-out 2; }
@keyframes spot-hint { 50% { opacity: .8; } }

.spot-tag.is-on { bottom: auto; transform: translate(-50%, -50%); }
.spot:hover .spot-tag.is-on, .spot:focus-visible .spot-tag.is-on { transform: translate(-50%, -50%) scale(1.06); }
.world-room .spot::before { display: none; }
.world-room .spot-me::before { display: block; }
.outlines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.outlines path { fill: #fff1d61a; stroke: #ffe6b8; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; opacity: 0; transition: opacity .15s; filter: drop-shadow(0 0 5px #ffbf73cc); }
.is-day .outlines path { fill: #ffffff24; stroke: #fff; filter: drop-shadow(0 0 4px #7a2f52b3); }
.is-first .outlines path { animation: outline-hint 1.2s .5s ease-in-out 2; }
@keyframes outline-hint { 50% { opacity: .9; } }
.world-stage:has(.spot-house:is(:hover, :focus-visible)) .o-house,
.world-stage:has(.spot-gym:is(:hover, :focus-visible)) .o-gym,
.world-stage:has(.spot-shop:is(:hover, :focus-visible)) .o-shop,
.world-stage:has(.spot-club:is(:hover, :focus-visible)) .o-club,
.world-stage:has(.spot-train:is(:hover, :focus-visible)) .o-train,
.world-stage:has(.spot-bed:is(:hover, :focus-visible)) .o-bed,
.world-stage:has(.spot-laptop:is(:hover, :focus-visible)) .o-laptop,
.world-stage:has(.spot-closet:is(:hover, :focus-visible)) .o-closet,
.world-stage:has(.spot-door:is(:hover, :focus-visible)) .o-door,
.world-stage:has(.spot-box:is(:hover, :focus-visible)) .o-box { opacity: 1; }

.phone { position: absolute; display: block; min-width: 40px; padding: .35cqw; border: 1px solid #ffffff3d; border-radius: 1.1cqw; background: #0f0a16; box-shadow: 0 .5cqw 1.4cqw #0f0818a6; transition: transform .15s; }
.phone-screen { display: grid; place-content: center; justify-items: center; gap: .35em; width: 100%; height: 100%; padding: 0 .2em; border-radius: .8cqw; background: linear-gradient(#5d7fd0, #8f6bc0 60%, #d97f93); color: #fff; overflow: hidden; }
.phone .icon { width: max(16px, 1.8cqw); height: max(16px, 1.8cqw); }
.phone b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: max(11px, 1cqw); white-space: nowrap; }
.phone:hover { transform: translateY(-.3cqw) rotate(-2deg); }
.coins { position: absolute; display: flex; align-items: center; justify-content: center; gap: .35em; padding: 0 .6em; border: 1px solid #ffffff2e; border-radius: 99px; background: #1d1228c7; color: #ffe3b0; font-size: max(12px, 1.1cqw); font-weight: 800; white-space: nowrap; }
.coins .icon { width: 1.25em; height: 1.25em; }
.coins:hover { background: #3a2549; }
.phone:focus-visible, .coins:focus-visible { outline: 3px solid #ffd9a0; outline-offset: 2px; }

.spot-me { z-index: 2; }
.spot-me::before { inset: auto 22% 4%; height: 9%; border: 0; border-radius: 50%; background: radial-gradient(closest-side, #1a0718b8, #1a071800); opacity: 1; animation: none !important; }
.spot-me canvas { position: absolute; left: 50%; bottom: 0; height: 100%; aspect-ratio: 1; transform: translateX(-50%); transform-origin: 50% 100%; filter: sepia(.13) saturate(1.12) hue-rotate(-7deg) brightness(.97) drop-shadow(-.12cqw -.1cqw .1cqw #ffc79a73) drop-shadow(.2cqw .25cqw .35cqw #1c08208c); animation: me-breathe 3.4s ease-in-out infinite; }
@keyframes me-breathe { 50% { transform: translateX(-50%) scale(1.006, .985); } }
.name-plate { position: absolute; left: 50%; bottom: -2.6cqw; display: flex; align-items: center; gap: .5em; transform: translateX(-50%); padding: .42em 1.1em; border-radius: 99px; background: #1d1228d9; border: 1px solid #ffffff2e; color: #f6e9ee; font-size: max(12px, 1.2cqw); white-space: nowrap; }
.name-plate i { color: #ffcf8f; font-style: normal; font-weight: 800; }
.spot-me:hover .name-plate, .spot-me:focus-visible .name-plate { background: #8d2f4c; }

.world-room .world-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 52% 18%, #ffbe8a1f, transparent 55%), radial-gradient(ellipse at 50% 55%, transparent 55%, #1a0a2480); }
.world-room.is-day .world-stage::after { background: radial-gradient(ellipse at 25% 35%, #fff2cf1f, transparent 50%), radial-gradient(ellipse at 50% 50%, transparent 65%, #2a143055); }
.world-room.is-day { background: linear-gradient(#92687f, #7a5576 45%, #6b4245); }
.is-day .spot-me canvas { filter: saturate(1.03) brightness(1.01) drop-shadow(-.12cqw -.08cqw .1cqw #fff1cf99) drop-shadow(.25cqw .25cqw .35cqw #3a142699); }
.board { position: absolute; z-index: 1; display: grid; grid-template-columns: 1.16fr 1fr; gap: 1.2cqw; padding: .75cqw .9cqw; color: #2b2036; }
.board-match { display: grid; align-content: space-between; justify-items: start; min-width: 0; }
.board h1 { font-size: 1.75cqw; font-weight: 800; letter-spacing: -.045em; line-height: 1.2; }
.magnets { display: flex; gap: .35cqw; }
.magnets button { padding: .4em .65em; border: 1px solid #cdc3d0; border-radius: .5cqw; background: #fff; color: #5d5068; font-size: .98cqw; font-weight: 700; letter-spacing: -.03em; white-space: nowrap; }
.magnets button:hover { border-color: #7c6b8a; }
.magnets button[aria-pressed="true"] { background: #3b2b4d; border-color: #3b2b4d; color: #fff; }
.board-match p { color: #695c73; font-size: .95cqw; line-height: 1.3; word-break: keep-all; }
.board-go { display: flex; align-items: center; justify-content: center; gap: .45em; width: 100%; padding: .6em; border: 0; border-radius: .6cqw; background: #c93a58; color: #fff; font-size: 1.3cqw; font-weight: 800; transition: background .15s; }
.board-go small { display: none; font-size: .8em; font-weight: 600; }
.board-go .icon { width: 1em; height: 1em; fill: currentColor; }
.board-go:hover { background: #dd5270; }
.board button:focus-visible { outline: 3px solid #7a3fb0; outline-offset: 2px; }
.board-quests { min-width: 0; padding-left: 1.1cqw; border-left: 1px solid #cfc6d2; }
.board-quests h2 { margin-bottom: .45cqw; color: #695c73; font-size: 1cqw; font-weight: 700; }
.board-quests ul { display: grid; gap: .5cqw; margin: 0; padding: 0; list-style: none; }
.board-quests li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5cqw; min-height: 2.8cqw; font-size: .98cqw; line-height: 1.25; }
.board-quests b { font-weight: 600; letter-spacing: -.035em; word-break: keep-all; }
.board-quests span { font-weight: 800; }
.board-quests em { color: #2f7d63; font-style: normal; font-weight: 800; }
.board-quests .is-done b { color: #968a9c; text-decoration: line-through; }
.board-quests button, .board-more i { padding: .3em .6em; border: 0; border-radius: 99px; background: #c93a58; color: #fff; font-size: .9cqw; font-style: normal; font-weight: 800; white-space: nowrap; }
.board-more { display: none; }
/* 작게 보일 때는 글자를 키우고 꼭 필요한 버튼 두 개만 */
@container (max-width: 1000px) {
  .board { grid-template-columns: 1fr; align-content: center; gap: 1.1cqw; padding: .8cqw 1.4cqw; }
  .board-match { gap: 1cqw; }
  .board h1, .magnets, .board-match p, .board-quests { display: none; }
  .board-go { min-height: 44px; padding: 0 .4em; font-size: 15px; border-radius: 9px; }
  .board-go small { display: inline; }
  .board-more { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; border: 1px solid #cdc3d0; border-radius: 9px; background: #fff; color: #3b2b4d; font-size: 13px; font-weight: 700; }
  .board-more i { font-size: 11px; }
}

.walker { position: absolute; z-index: 2; width: 8.5%; aspect-ratio: 1; transform: translate(-50%, -88%); transform-origin: 50% 88%; pointer-events: none; filter: sepia(.1) saturate(1.08) brightness(.97) drop-shadow(0 .4cqw .3cqw #140a2499); }
.walker canvas { width: 100%; height: 100%; }
.walker.is-left canvas { scale: -1 1; }
.world[data-walking] .walker canvas { animation: walker-hop .28s ease-in-out infinite; }
@keyframes walker-hop { 50% { transform: translateY(-9%) rotate(3deg); } }
.world-map .spot-tag { font-size: max(12px, 1.25cqw); }
.world-map.is-day .walker { filter: drop-shadow(.15cqw .35cqw .25cqw #2b1a3a73); }
.world-map .spot::before { display: none; }

.video-ball { animation: video-ball 1.5s ease-in-out infinite alternate; }
@keyframes video-ball { 50% { transform: translate(52px, -58px); } to { transform: translate(104px, -6px); } }

/* 세로로 든 휴대폰: 높이를 꽉 채우고 옆으로 밀어서 봅니다. */
@media (max-aspect-ratio: 11 / 10) {
  .world { display: block; place-items: start; overflow: auto hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
  .world::-webkit-scrollbar { display: none; }
  .world-stage { width: 177.778vh; width: 177.778dvh; height: 100%; }
  .board { transform: scale(.8); }
}
/* 장소 화면: 들어온 곳(방·동네)으로 돌아가는 버튼 */
.place-back { display: none; }
.place-screen .place-back { display: inline-flex; background: #fff4e2; color: #41283d; min-height: 44px; border-radius: 99px; padding-inline: 14px 18px; }
.place-screen .place-back .icon { transform: rotate(180deg); }
.place-screen .breadcrumb, .place-screen .top-account .logout-button { display: none; }
.place-screen main { margin: 0; min-height: 100dvh; padding: 0 clamp(12px, 3vw, 36px) 44px; background: radial-gradient(ellipse at 50% -10%, var(--place, #5b3d6b), #2c1a33 72%); }
.place-screen .topbar { min-height: 70px; padding-right: 0; }
.place-screen .page-heading { color: #fff0d9; }
.place-screen .page-lead { color: #ecd9e4; }
.place-screen[data-place="play"] { --place: #93304d; }
.place-screen[data-place="train"] { --place: #2f7b68; }
.place-screen[data-place="shop"] { --place: #6a52ad; }
.place-screen[data-place="club"] { --place: #31619a; }
.place-screen[data-place="closet"] { --place: #9a6143; }
.place-screen[data-place="info"] { --place: #6d4b82; }

@media (prefers-reduced-motion: reduce) {
  .world, .spot::before, .spot-badge, .spot-me canvas, .walker canvas, .video-ball, .outlines path { animation: none !important; }
}
