:root {
  --accent: #5e6ad2;
  --s: 3; /* 핫바 배율: 게임 픽셀 1칸 = 3px */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --side: clamp(20px, 5vw, 72px);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
[data-tone="dark"] {
  --bg: #0b0c0f; --ink: #f2f3f5; --muted: #a2a8b3; --card: #14161a; --line: #272b33; --up: #3fb878; --down: #ec6a7c;
  color-scheme: dark;
}
[data-tone="light"] {
  --bg: #e9ebef; --ink: #0b0c0f; --muted: #535a66; --card: #f7f8fa; --line: #cfd4dc; --up: #23804e; --down: #c23a4d;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); color: var(--ink); transition: background-color .5s var(--ease), color .5s var(--ease); scrollbar-color: var(--line) var(--bg); }
body { font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; }
::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; background: none; border: 0; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
ul, ol { list-style: none; padding: 0; }
img { image-rendering: pixelated; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* 머리말 */
.top { position: fixed; inset: 0 0 auto; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px var(--side); pointer-events: none; }
.top > * { pointer-events: auto; }
.top { transition: background-color .3s, box-shadow .3s; }
.top.solid { background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; }
.brand svg { width: 22px; height: 22px; fill: currentColor; }
.brand .ac { fill: var(--accent); }
.tools { display: flex; align-items: center; gap: 18px; }
.status { display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 4px color-mix(in srgb, var(--up) 22%, transparent); }
.status span { color: var(--muted); font-weight: 500; }
.mode { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 8%, transparent); transition: background-color .2s, transform .4s var(--ease); }
.mode:hover { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.mode:active { transform: rotate(40deg) scale(.92); }
.mode svg { grid-area: 1 / 1; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: opacity .3s, transform .5s var(--ease); }
[data-tone="dark"] .mode .sun, [data-tone="light"] .mode .moon { opacity: 0; transform: rotate(-90deg) scale(.5); }

/* 소개 무대. 7단계 × 64svh를 지난 뒤, 아래 창이 올라와 덮는 동안(100svh) 그대로 붙어 있는다. */
.stage { height: calc(7 * 64svh + 200svh); }
.pin { position: sticky; top: 0; height: 100svh; overflow: hidden; }
#steve, #world { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#world { z-index: 1; } #steve { z-index: 3; }
/* 아래 창이 덮는 동안 무대 전체가 함께, 더 천천히 올라간다. */
.pin > * { translate: 0 calc(var(--lift, 0) * -42svh); }

/* 하늘. 지평선 색은 world.js의 안개 색과 같다. */
.sky { position: absolute; inset: 0; z-index: 0; background: linear-gradient(#05070f, #0b1022 38%, #131a30 58%); transition: opacity .5s; }
[data-tone="light"] .sky { background: linear-gradient(#5f93f2, #8fb8ff 38%, #bcd6ff 58%); }
.sky img { position: absolute; top: 9%; width: clamp(72px, 8.5vw, 128px); mix-blend-mode: screen; transition: opacity .6s, transform .9s var(--ease); }
.sky .sun { right: 13%; } .sky .moon { left: 13%; }
[data-tone="dark"] .sky .sun, [data-tone="light"] .sky .moon { opacity: 0; transform: translateY(60px); }
.stars { position: absolute; left: 0; top: 0; width: 2px; height: 2px; background: transparent; transition: opacity .6s; }
[data-tone="light"] .stars { opacity: 0; }

.word { position: absolute; inset: 0; z-index: 2; }
.word span {
  position: absolute; left: 50%; top: 27%; white-space: nowrap;
  font-size: min(var(--fs), 30svh); font-weight: 900; line-height: .9; letter-spacing: -.04em;
  transform: translate(-50%, -50%) translateY(.35em); clip-path: inset(100% 0 0 0);
  transition: transform .7s var(--ease), clip-path .7s var(--ease);
}
/* 두 글자 낱말은 벌려서 스티브의 머리가 글자 사이에 오게 한다. */
.word span.wide { letter-spacing: .5em; padding-left: .5em; }
.word span.on { transform: translate(-50%, -50%); clip-path: inset(-10% -5% -10% -5%); }
.word span.off { transform: translate(-50%, -50%) translateY(-.35em); clip-path: inset(0 0 100% 0); }

.say { position: absolute; z-index: 4; left: var(--side); bottom: 25svh; width: min(24rem, 32vw); }
.say article { position: absolute; left: 0; bottom: 0; width: 100%; padding: 22px 24px; border-radius: 18px; background: color-mix(in srgb, var(--bg) 74%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); opacity: 0; transform: translateY(14px); filter: blur(6px); pointer-events: none; transition: opacity .35s, transform .5s var(--ease), filter .35s; }
.say article.on { opacity: 1; transform: none; filter: none; pointer-events: auto; transition-delay: .12s; }
.say h1, .say h2 { font-size: clamp(1.6rem, 2.5vw, 2.4rem); font-weight: 800; line-height: 1.18; letter-spacing: -.03em; text-wrap: balance; word-break: keep-all; }
.say p { margin-top: 12px; color: var(--muted); font-size: 1.0625rem; word-break: keep-all; }
.more { display: inline-block; margin-top: 18px; padding: 10px 18px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; font-size: .9375rem; }

/* 접속 주소: 주소 자체를 누르면 복사된다. */
.addrs { margin-top: 22px; border-top: 1px solid var(--line); }
.addrs button { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 12px; width: 100%; padding: 12px 10px 12px 2px; border-bottom: 1px solid var(--line); text-align: left; transition: padding .35s var(--ease), background-color .2s; }
.addrs span { grid-column: 1 / -1; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.addrs code { font-family: inherit; font-size: clamp(1.35rem, 1.9vw, 1.75rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.25; }
.addrs em { font-style: normal; font-size: .8125rem; font-weight: 600; color: var(--muted); padding-bottom: 5px; opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .35s var(--ease), color .2s; }
.addrs button:hover, .addrs button:focus-visible { padding-left: 12px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.addrs button:hover em, .addrs button:focus-visible em, .addrs button.done em { opacity: 1; transform: none; }
.addrs button.ok em { color: var(--up); }

.skin { position: absolute; z-index: 4; right: var(--side); bottom: 25svh; width: 236px; padding: 14px 14px 8px; border-radius: 16px; background: color-mix(in srgb, var(--bg) 74%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.skin label { display: block; margin-bottom: 8px; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.skin div { display: flex; border: 1px solid var(--line); border-radius: 10px; background: var(--card); transition: border-color .2s; }
.skin div:focus-within { border-color: var(--accent); }
.skin input { flex: 1; min-width: 0; padding: 9px 12px; font-weight: 600; outline: 0; }
.skin input::placeholder { color: var(--muted); font-weight: 500; }
.skin button { padding: 0 14px; font-size: .875rem; font-weight: 700; color: var(--accent); }
[data-tone="dark"] .skin button { color: #9aa3f0; }
.skin p { min-height: 1.4em; margin-top: 6px; font-size: .8125rem; color: var(--muted); }


/* 스크롤 안내: 첫 화면에서만 보이고, 내리기 시작하면 사라진다. */
.cue { position: absolute; z-index: 4; left: 50%; bottom: calc(var(--s) * 22px + 62px); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: .875rem; font-weight: 700; white-space: nowrap; transition: opacity .3s, transform .5s var(--ease); animation: nudge 2.2s var(--ease) infinite; }
.cue svg { width: 15px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.cue .wheel { animation: wheel 2.2s var(--ease) infinite; }
.cue.gone { opacity: 0; transform: translateX(-50%) translateY(16px); pointer-events: none; }
/* 터치 화면에서는 마우스 대신 아래 화살표를 보여 준다. */
.cue .swipe { display: none; animation: nudge 2.2s var(--ease) infinite; }
@media (pointer: coarse) { .cue .mouse { display: none; } .cue .swipe { display: block; } .cue { animation: none; } }
@keyframes wheel { 0%, 20% { transform: none; opacity: 1; } 60% { transform: translateY(9px); opacity: 0; } 61% { transform: none; opacity: 0; } 100% { opacity: 1; } }
@keyframes nudge { 0%, 20%, 100% { translate: 0 0; } 55% { translate: 0 6px; } }

/* 아래 창: 붙어 있는 스티브 위로 올라와 덮는다. */
.cover { position: relative; z-index: 5; margin-top: -100svh; background: var(--bg); border-radius: 28px 28px 0 0; box-shadow: 0 -1px 0 var(--line), 0 -28px 70px rgb(0 0 0 / .32); transition: background-color .5s var(--ease); }
.feed { padding-block: 72px 24px; }
.head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 20px; }
.head h2 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; }
.head a { font-size: .9375rem; font-weight: 600; color: var(--muted); }
.head a:hover { color: var(--ink); }
.posts { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 14px; margin-bottom: 80px; }
.post { display: flex; flex-direction: column; gap: 12px; min-height: 150px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); transition: transform .3s var(--ease), border-color .2s; }
.post:hover { transform: translateY(-3px); border-color: var(--muted); }
.post.big { grid-row: span 2; justify-content: flex-end; }
.post h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.35; letter-spacing: -.02em; word-break: keep-all; }
.post.big h3 { font-size: clamp(1.6rem, 2.6vw, 2.25rem); font-weight: 800; line-height: 1.15; }
.post p { color: var(--muted); word-break: keep-all; }
.post time { margin-top: auto; font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.post.big time { margin-top: 0; }
.tag { align-self: flex-start; padding: 3px 9px; border-radius: 6px; font-size: .75rem; font-weight: 700; }
.post.big .tag { margin-bottom: auto; }
.tag.notice { background: var(--ink); color: var(--bg); }
.tag.patch { background: var(--accent); color: #fff; }
.tag.news { box-shadow: inset 0 0 0 1px var(--muted); }

.market { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.market a { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 2px 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); transition: transform .3s var(--ease), border-color .2s; }
.market a:hover { transform: translateY(-3px); border-color: var(--muted); }
.market img { width: 40px; height: 40px; grid-row: span 2; }
.market span { color: var(--muted); font-size: .875rem; }
.market b { grid-column: 2; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.market em { grid-column: 3; grid-row: 1 / span 2; font-style: normal; font-weight: 700; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); }
.sample { margin-top: 18px; font-size: .8125rem; color: var(--muted); }


.foot { padding: 72px 0 calc(var(--s) * 22px + 64px); font-size: .8125rem; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 14px; font-weight: 600; color: var(--ink); }

.nobar .foot { padding-bottom: 72px; } /* 핫바가 없는 화면(결제, 관리) */

/* 핫바 */
.hotbar { position: fixed; z-index: 20; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); }
/* 게임과 같은 치수: 칸 간격 20, 높이 22, 선택 틀 24x23이 칸보다 1픽셀씩 바깥으로 나온다. */
.hotbar > ul { position: relative; display: flex; padding-inline: calc(var(--s) * 1px); background: url(assets/mc/hotbar7.png) 0 0 / calc(var(--s) * 142px) calc(var(--s) * 22px) no-repeat; image-rendering: pixelated; filter: drop-shadow(0 10px 18px rgb(0 0 0 / .35)); }
.hotbar > ul::before { content: ""; position: absolute; z-index: 1; top: calc(var(--s) * -1px); left: calc(var(--s) * (var(--sel, 0) * 20px - 1px)); width: calc(var(--s) * 24px); height: calc(var(--s) * 23px); background: url(assets/mc/hotbar_selection.png) 0 0 / 100% 100%; pointer-events: none; }
.hotbar > ul.none::before { display: none; } /* 고른 칸이 없는 페이지(메인, 약관) */
.hotbar > ul > li { width: calc(var(--s) * 20px); }
.hotbar a { display: block; position: relative; text-align: center; -webkit-tap-highlight-color: transparent; }
.hotbar i { display: grid; place-items: center; height: calc(var(--s) * 22px); }
.hotbar img { position: relative; z-index: 2; width: calc(var(--s) * 16px); height: calc(var(--s) * 16px); transform-origin: 50% 100%; transition: transform .28s var(--ease); }
/* 칸 이름은 화면에 두지 않는다(읽기 프로그램용으로만 남김). */
.hotbar span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* 경험치 바(메인): 스크롤한 만큼 찬다. 가운데 숫자는 지금 단계. */
.xp { position: absolute; left: 0; bottom: calc(100% + var(--s) * 2px); width: calc(var(--s) * 142px); height: calc(var(--s) * 5px); background: url(assets/mc/xp_background7.png) 0 0 / 100% 100%; image-rendering: pixelated; pointer-events: none; }
.xp i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: url(assets/mc/xp_progress7.png) 0 0 / calc(var(--s) * 142px) 100% no-repeat; }
.xp b { position: absolute; left: 50%; bottom: calc(100% - var(--s) * 2px); translate: -50% 0; font-family: Galmuri11, sans-serif; font-size: calc(var(--s) * 6px); line-height: 1; color: #80ff20; text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000; }
.hotbar > ul > li.on img { transform: translateY(calc(var(--s) * -2px)) scale(1.18); }

.peek { position: absolute; bottom: calc(100% + var(--s) * 8px); left: 0; width: 264px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 18px 40px rgb(0 0 0 / .28); transform-origin: var(--ox, 50%) 100%; animation: peek .26s var(--ease); }
@keyframes peek { from { opacity: 0; transform: translateY(8px) scale(.94); } }
.peek h3 { font-size: 1.125rem; font-weight: 800; letter-spacing: -.02em; }
.peek p { margin-top: 4px; font-size: .875rem; color: var(--muted); word-break: keep-all; }
.peek ul { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.peek li { white-space: nowrap; padding: 4px 10px; border-radius: 6px; font-size: .8125rem; font-weight: 600; background: color-mix(in srgb, var(--ink) 8%, transparent); }

@media (max-width: 620px) {
  :root { --s: 2.2; }
  .status span { display: none; }
  .word span { top: 40%; font-size: min(var(--fs), 24svh); }
  .say article { padding: 16px 18px; }
  .say { left: 20px; right: 20px; top: 78px; bottom: auto; width: auto; }
  .say article { bottom: auto; top: 0; }
  .addrs { margin-top: 14px; }
  .addrs button { padding-block: 8px; }
  .addrs em { opacity: 1; transform: none; }
  .skin { display: none; } /* 좁은 화면에서는 자리가 없어 견본에서는 뺀다 */
  .posts, .market { grid-template-columns: 1fr; }
  .post.big { min-height: 240px; }
  .cover { border-radius: 20px 20px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01s !important; animation: none !important; }
}

/* 좁은 가로 창(태블릿, 나란히 띄운 창): 문구 상자를 줄여 큰 글자와 스티브를 가리지 않게 한다. */
@media (min-width: 621px) and (max-width: 1000px) {
  :root { --s: 2.5; }
  .say { width: min(17rem, 36vw); bottom: 23svh; }
  .say article { padding: 14px 16px; }
  .say h1, .say h2 { font-size: 1.25rem; }
  .say p { font-size: .9375rem; margin-top: 8px; }
  .addrs { margin-top: 12px; }
  .addrs button { padding-block: 7px; }
  .addrs code { font-size: 1.1rem; }
  .skin { display: none; }
}

/* 페이지 전환: 머리말과 핫바는 제자리에 있고 내용만 바뀐다. */
@view-transition { navigation: auto; }
.top { view-transition-name: top; }
.hotbar { view-transition-name: hotbar; }
::view-transition-old(root) { animation: vt-out .16s ease both; }
::view-transition-new(root) { animation: vt-in .34s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* 서버가 꺼졌거나 상태를 모를 때 */
.status.off i { background: var(--muted); box-shadow: none; }
/* 스킨 얼굴: 64x64 텍스처의 얼굴(8,8)과 모자 겹(40,8)을 잘라 낸다 */
.face { display: inline-block; flex: none; background-image: var(--skin), var(--skin); background-size: 800% 800%; background-position: 71.4286% 14.2857%, 14.2857% 14.2857%; image-rendering: pixelated; border-radius: 3px; }
canvas.body { image-rendering: pixelated; }
