:root {
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", ui-monospace, monospace;
  --ink: #f4f1ff;
  --dim: #b9b4d4;
  --mute: #8a85a8;
  --gold: #ffff55;
  --red: #ff5a52;
  --green: #55ff55;
  --panel: rgba(16, 14, 26, .78);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.45, .55, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #07081a; color: var(--ink); font-family: var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- world ---------- */
.scene {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(3, 2, 10, .75) 100%),
    linear-gradient(90deg, rgba(5, 4, 16, .55) 0%, transparent 45%);
}

/* ---------- chrome ---------- */
.top, .layout, .foot { position: relative; z-index: 2; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px clamp(16px, 4vw, 48px) 0; font-size: 13px; letter-spacing: .14em;
  animation: fade-down .8s var(--ease) both;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--dim); text-shadow: 2px 2px 0 #000; }
.brand b { color: #fff; }
.brand-icon { width: 22px; height: 22px; display: inline-block; filter: drop-shadow(2px 2px 0 #000); }
.brand-icon svg, .slot-icon svg, .srv-icon svg, .done-icon svg, .toast-icon svg { width: 100%; height: 100%; display: block; }
.edition { display: inline-flex; align-items: center; gap: 8px; color: var(--mute); font-weight: 700; font-size: 11px; }
.live-dot { width: 8px; height: 8px; background: var(--green); box-shadow: 0 0 0 2px #0b2a0b, 0 0 12px var(--green); animation: blink 2s steps(2, jump-none) infinite; }

.layout {
  min-height: calc(100vh - 120px); max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) 452px; gap: clamp(28px, 5vw, 72px);
  align-items: center; padding: 28px clamp(16px, 4vw, 48px) 40px;
}

/* ---------- hero ---------- */
.hero > * { animation: rise .9s var(--ease) both; }
.hero > :nth-child(2) { animation-delay: .55s; }
.hero > :nth-child(3) { animation-delay: .68s; }
.hero > :nth-child(4) { animation-delay: .8s; }
.logo-wrap { position: relative; width: min(100%, 520px); animation: none; }
.logo { display: block; width: 100%; filter: drop-shadow(0 18px 30px rgba(120, 10, 20, .35)); animation: hover 5s ease-in-out 1.6s infinite; }
.splash {
  position: absolute; right: -4%; bottom: 4%; border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--gold); font-weight: 900; font-size: clamp(15px, 2vw, 21px); white-space: nowrap;
  text-shadow: 2px 2px 0 #3f3f15; transform-origin: center;
  animation: splash-in .6s var(--spring) 1.3s both, splash .55s ease-in-out 1.9s infinite alternate;
}
.title {
  margin: 14px 0 10px; font-size: clamp(38px, 5.6vw, 68px); line-height: 1; font-weight: 900; letter-spacing: -.02em;
  text-shadow: 4px 4px 0 #2a0a12, 0 0 40px rgba(255, 80, 80, .2);
}
.lead { margin: 0; color: var(--dim); font-size: clamp(15px, 1.5vw, 17px); line-height: 1.7; text-shadow: 2px 2px 0 rgba(0, 0, 0, .7); }
.perks { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.tip {
  position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 104px; padding: 9px 12px 10px;
  background: rgba(16, 0, 16, .92); border: 2px solid #5000ff; border-bottom-color: #28007f; border-right-color: #3a00b8;
  box-shadow: 0 0 0 2px rgba(16, 0, 16, .92), 0 10px 24px rgba(0, 0, 0, .35);
  transition: transform .35s var(--spring), box-shadow .35s var(--ease);
}
.tip:hover { transform: translateY(-4px); box-shadow: 0 0 0 2px rgba(16, 0, 16, .92), 0 16px 30px rgba(60, 0, 160, .35); }
.tip b { font-size: 13px; color: #fff; text-shadow: 2px 2px 0 #3e3e3e; }
.tip span { font-size: 12px; color: #a8a8ff; }

/* ---------- card ---------- */
.card {
  --cut: 6px;
  position: relative; padding: 18px 22px 24px; background: var(--panel);
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border: 3px solid #000;
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, .09), inset -3px -3px 0 rgba(0, 0, 0, .45), 0 30px 70px rgba(0, 0, 0, .55);
  clip-path: polygon(0 var(--cut), 3px var(--cut), 3px 3px, var(--cut) 3px, var(--cut) 0, calc(100% - var(--cut)) 0, calc(100% - var(--cut)) 3px, calc(100% - 3px) 3px, calc(100% - 3px) var(--cut), 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - 3px) calc(100% - var(--cut)), calc(100% - 3px) calc(100% - 3px), calc(100% - var(--cut)) calc(100% - 3px), calc(100% - var(--cut)) 100%, var(--cut) 100%, var(--cut) calc(100% - 3px), 3px calc(100% - 3px), 3px calc(100% - var(--cut)), 0 calc(100% - var(--cut)));
  animation: card-in 1s var(--spring) .35s both;
}
.card.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }
.card.booting .stage { opacity: 0; }

.hotbar { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 22px; background: rgba(0, 0, 0, .45); border: 3px solid #000; }
.slot {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px 8px;
  border-right: 2px solid rgba(0, 0, 0, .7); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .06);
  color: var(--mute); font-size: 12px; font-weight: 700; transition: color .4s var(--ease);
}
.slot:last-of-type { border-right: 0; }
.slot-icon { width: 30px; height: 30px; display: block; filter: grayscale(.85) brightness(.6); transition: filter .45s var(--ease), transform .55s var(--spring); }
.slot.active { color: #fff; }
.slot.active .slot-icon { filter: none drop-shadow(2px 2px 0 rgba(0, 0, 0, .6)); transform: translateY(-3px) scale(1.12); }
.slot.done .slot-icon { filter: brightness(.9); }
.slot.done { color: var(--dim); }
.selector {
  position: absolute; top: -5px; left: -5px; width: calc(33.333% + 7px); height: calc(100% + 10px);
  border: 3px solid #fff; outline: 3px solid #000; box-shadow: inset 0 0 0 3px #000, 0 0 22px rgba(255, 255, 255, .15);
  pointer-events: none; transition: transform .6s var(--spring);
}

.stage { position: relative; height: 330px; transition: height .55s var(--ease), opacity .5s var(--ease); }
.panel {
  position: absolute; top: 0; left: 0; right: 0; opacity: 0; transform: translateX(42px);
  pointer-events: none; visibility: hidden;
  transition: opacity .38s var(--ease), transform .6s var(--ease), visibility 0s .6s;
}
.panel.left { transform: translateX(-42px); }
.panel.active { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .5s var(--ease) .12s, transform .7s var(--ease) .08s, visibility 0s; }
.panel > *, .form > * { transition: opacity .5s var(--ease), transform .6s var(--ease); }
.panel:not(.active) > *, .panel:not(.active) .form > * { opacity: 0; transform: translateY(10px); }
.panel.active > :nth-child(1) { transition-delay: .14s; }
.panel.active > :nth-child(2) { transition-delay: .2s; }
.panel.active > :nth-child(3) { transition-delay: .26s; }
.panel.active > :nth-child(4) { transition-delay: .32s; }
.panel.active > :nth-child(5) { transition-delay: .38s; }
.panel.active > :nth-child(6) { transition-delay: .44s; }
.panel.active > :nth-child(7) { transition-delay: .5s; }
.panel.active .form > :nth-child(2) { transition-delay: .3s; }
.panel.active .form > :nth-child(3) { transition-delay: .36s; }
.panel.active .form > :nth-child(4) { transition-delay: .4s; }
.panel.active .form > :nth-child(5) { transition-delay: .44s; }

h2 { margin: 0; font-size: 22px; font-weight: 900; text-shadow: 2px 2px 0 #000; }
.desc { margin: 6px 0 0; color: var(--dim); font-size: 14px; line-height: 1.55; }
.form { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
label { font-size: 12px; font-weight: 800; color: var(--dim); letter-spacing: .04em; }
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; min-width: 0; }
input {
  width: 100%; height: 48px; padding: 0 14px; background: #000; border: 2px solid #a0a0a0; border-radius: 0; outline: none;
  font-size: 16px; caret-color: #fff; transition: border-color .2s, box-shadow .3s var(--ease);
}
#nickname { font-family: var(--mono); letter-spacing: .04em; }
input::placeholder { color: #5f5b73; }
input:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); }
.hint { margin: 0; font-size: 12px; color: var(--mute); }
.err { margin: 2px 0 0; padding: 9px 11px; background: rgba(90, 10, 14, .55); border-left: 4px solid var(--red); color: #ffd0cc; font-size: 13px; line-height: 1.45; animation: err-in .35s var(--ease); }
.note { margin: 14px 0 0; color: var(--mute); font-size: 12px; min-height: 1em; }

.mc-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; margin-top: 6px; cursor: pointer; font-weight: 800; font-size: 15px;
  color: #fff; text-shadow: 2px 2px 0 #3a3a3a; background: #6f6f6f; border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #a8a8a8, inset -2px -4px 0 #4c4c4c;
  transition: transform .12s, filter .2s, color .2s;
}
.mc-btn:hover { color: var(--gold); outline: 2px solid #fff; outline-offset: -4px; }
.mc-btn:active { transform: translateY(2px); box-shadow: inset 2px 2px 0 #4c4c4c, inset -2px -2px 0 #8a8a8a; }
.mc-btn:disabled { cursor: wait; filter: saturate(.4) brightness(.8); }
.mc-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.mc-btn.primary { background: #3c8527; box-shadow: inset 2px 2px 0 #64b545, inset -2px -4px 0 #1d4d13; text-shadow: 2px 2px 0 #1d4d13; width: 100%; height: 52px; font-size: 16px; }
.mc-btn.primary:active { box-shadow: inset 2px 2px 0 #1d4d13, inset -2px -2px 0 #4f9c35; }
.mc-btn.small { height: 48px; margin: 0; padding: 0 14px; font-size: 13px; }
.mc-btn.busy span::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1s steps(4) infinite; }
.link { background: none; border: 0; padding: 4px 0; color: var(--mute); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: #fff; }

.server-row { display: flex; gap: 12px; align-items: center; padding: 10px; background: rgba(0, 0, 0, .5); border: 2px solid #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); margin-bottom: 18px; }
.srv-icon { width: 46px; height: 46px; flex: none; }
.srv-main { flex: 1; min-width: 0; }
.srv-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; }
.srv-right { display: inline-flex; align-items: center; gap: 8px; }
.srv-count { color: #aaa; font-size: 13px; font-family: var(--mono); }
.srv-motd { margin-top: 4px; color: #aaa; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-motd .on { color: var(--green); }
.srv-motd .off { color: var(--red); }
.ping { display: inline-flex; align-items: flex-end; gap: 1px; height: 12px; }
.ping i { width: 2px; background: #555; box-shadow: 1px 1px 0 #000; }
.ping.on i { background: var(--green); }
.ping.off i { background: #3a3a3a; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }

.done-head { display: flex; gap: 14px; align-items: center; }
.done-icon { width: 56px; height: 56px; flex: none; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .6)); }
.panel.active .done-icon { animation: pop .7s var(--spring) .2s both; }
.xp { position: relative; margin: 20px 0 16px; padding-top: 14px; }
.xp-level { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); color: #80ff20; font-weight: 900; font-size: 18px; text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000; }
.xp-bar { height: 10px; background: #1a1a1a; border: 2px solid #000; box-shadow: inset 0 0 0 1px #3a3a3a; overflow: hidden; }
.xp-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #80ff20 0 18px, #5fcf10 18px 20px); box-shadow: inset 0 2px 0 #c0ff70; }
.xp.go .xp-bar i { animation: xp 1.4s var(--ease) .35s forwards; }
.address { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; background: #000; border: 2px solid #a0a0a0; }
.address-label { font-size: 11px; color: var(--mute); font-weight: 800; white-space: nowrap; }
.address code { flex: 1; font-family: var(--mono); font-size: 18px; color: var(--gold); text-shadow: 2px 2px 0 #3f3f15; }
.address .mc-btn.small { height: 38px; }
.guide { list-style: none; margin: 16px 0 6px; padding: 0; display: grid; gap: 6px; }
.guide li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--dim); }
.guide b { width: 22px; height: 22px; display: grid; place-items: center; background: #3c8527; border: 2px solid #000; font-size: 12px; color: #fff; }
.guide em { font-style: normal; color: var(--gold); font-weight: 800; }
#again-button { width: 100%; margin-top: 12px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; top: 18px; right: 18px; z-index: 10; display: flex; gap: 12px; align-items: center;
  width: 300px; padding: 10px 14px; background: #212121; border: 2px solid #000;
  box-shadow: inset 0 0 0 2px #555, inset 0 0 0 4px #000, 0 18px 40px rgba(0, 0, 0, .5);
  transform: translateX(calc(100% + 40px)); transition: transform .7s var(--spring);
}
.toast.show { transform: none; }
.toast-icon { width: 36px; height: 36px; flex: none; }
.toast b { display: block; color: var(--gold); font-size: 14px; text-shadow: 2px 2px 0 #3f3f15; }
.toast span { display: block; color: #fff; font-size: 13px; margin-top: 2px; }

.foot {
  display: flex; justify-content: space-between; gap: 16px; padding: 0 clamp(16px, 4vw, 48px) 22px;
  color: var(--mute); font-size: 12px; text-shadow: 1px 1px 0 #000; animation: rise 1s var(--ease) 1s both;
}

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-14px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(60px) rotate(1.5deg) scale(.96); } }
@keyframes hover { 50% { transform: translateY(-8px); } }
@keyframes splash-in { from { opacity: 0; transform: rotate(-18deg) scale(0); } to { opacity: 1; transform: rotate(-18deg) scale(1); } }
@keyframes splash { from { transform: rotate(-18deg) scale(1); } to { transform: rotate(-18deg) scale(1.1); } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes err-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes pop { from { transform: scale(0) rotate(-40deg); } }
@keyframes xp { to { width: 100%; } }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; gap: 28px; padding-top: 18px; min-height: auto; }
  .hero { text-align: left; }
  .logo-wrap { width: min(100%, 400px); }
  .card { max-width: 520px; width: 100%; }
}
@media (max-width: 520px) {
  .top { padding-top: 16px; }
  .edition { display: none; }
  .card { padding: 14px 14px 18px; }
  .perks { gap: 8px; margin-top: 20px; }
  .tip { min-width: calc(50% - 4px); }
  .splash { right: 0; bottom: -6%; }
  .toast { left: 16px; right: 16px; width: auto; }
  .foot { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
