@font-face {
  font-family: 'Maplestory';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@2.1/MaplestoryOTFBold.woff') format('woff');
  font-weight: 700; font-display: swap;
}
:root {
  --bg: #141018;
  --panel: #1f1926;
  --line: rgba(255, 236, 200, 0.18);
  --line-soft: rgba(255, 236, 200, 0.1);
  --text: #f6efe3;
  --muted: #b9ad9c;
  --gold: #e2b04a;
  --gold-hi: #f6d98a;
  --ink: #2a1a08;
  --title: 'Maplestory', 'Pretendard', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  font-size: 15px; line-height: 1.6;
  word-break: keep-all; overflow-wrap: break-word;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── 맨 위 고정 바 ── */
.bar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  height: calc(56px + var(--safe-t));
  padding: var(--safe-t) calc(14px + var(--safe-r)) 0 calc(14px + var(--safe-l));
  background: rgba(20, 16, 24, 0.82);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; }
.brand img { height: 32px; width: auto; flex: none; }
.brand span { font-family: var(--title); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-home {
  flex: none; min-height: 38px; padding: 7px 14px;
  border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px; font-weight: 700; text-decoration: none;
}

main { max-width: 720px; margin: 0 auto; padding: calc(56px + var(--safe-t)) 0 calc(28px + var(--safe-b)); }

/* ── 맨 위 게임 배너 롤링 ── */
.roll { position: relative; }
.roll-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.roll-track::-webkit-scrollbar { display: none; }
.roll-slide { position: relative; flex: 0 0 100%; aspect-ratio: 2 / 1; scroll-snap-align: start; scroll-snap-stop: always; display: block; background: #2a2232; }
.roll-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.roll-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 26px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(10, 6, 14, 0.62));
}
.roll-go { font-size: 13px; font-weight: 800; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.roll-dots { position: absolute; left: 0; right: 0; bottom: -18px; display: flex; justify-content: center; gap: 6px; }
.roll-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); transition: width 0.25s; }
.roll-dots i.on { width: 20px; border-radius: 4px; background: var(--gold); }
@media (min-width: 721px) { .roll-slide { border-radius: 0 0 18px 18px; overflow: hidden; } }

/* ── 맨 아래 안내원 ── */
.guide { display: flex; align-items: flex-end; gap: 2px; margin: 34px 16px 0; }
.maid {
  position: relative; flex: none;
  width: 96px; aspect-ratio: 411 / 760;
  padding: 0; border: 0; background: none;
  transform-origin: 50% 100%;
  animation: maid-sway 3.2s ease-in-out infinite;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
  -webkit-tap-highlight-color: transparent;
}
.maid-f { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.maid-blink, .maid-laugh { opacity: 0; }
.maid-blink { animation: maid-blink 4.6s infinite; }
.maid.is-laugh { animation: maid-hop 0.55s ease-out; }
.maid.is-laugh .maid-laugh { opacity: 1; }
.maid.is-laugh .maid-blink { animation: none; opacity: 0; }
@keyframes maid-sway { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg) translateY(-2px); } }
@keyframes maid-blink { 0%, 92% { opacity: 0; } 92.5%, 95.5% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes maid-hop { 35% { transform: translateY(-10px) scale(1.03); } 70% { transform: translateY(0) scale(0.99); } }
.bubble {
  position: relative; flex: 1; min-width: 0;
  margin: 0 0 26px 10px; padding: 11px 14px;
  border-radius: 14px; background: #fff7ee; color: #3a2a20;
  font-size: 14px; line-height: 1.55;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.bubble::before {
  content: ''; position: absolute; left: -9px; bottom: 18px;
  border: 9px solid transparent; border-left: 0; border-right-color: #fff7ee;
}
.bubble b { display: block; font-family: var(--title); font-size: 16px; color: #d63a68; }

/* ── 게임 카드 ── */
.games { padding: 0 16px; margin-top: 40px; }
.games h2 { margin: 0 0 12px; font-family: var(--title); font-size: 20px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 680px) { .grid { grid-template-columns: 1fr 1fr; } }
.card {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 18px; border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #221b29, #17131b);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.card-pic { display: block; aspect-ratio: 2 / 1; overflow: hidden; background: #2a2232; }
.card-pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.card-pic:hover img, .card-pic:focus-visible img { transform: scale(1.04); }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 16px; }
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.tag { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.tag.beta { background: #ff5c8a; color: #fff; }
.tag.live { background: #3fbf7f; color: #062615; }
.tag.soon { background: #6b6278; color: #fff; }
.info { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0 0 10px; font-size: 14px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; font-weight: 700; color: var(--gold-hi); }
.card h3 { margin: 4px 0 6px; font-family: var(--title); font-size: 22px; line-height: 1.3; }
.card p { margin: 0; color: #e2d9ca; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 12px 18px; flex: 1 1 auto;
  border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 15px; font-weight: 800; text-decoration: none;
}
.btn-gold {
  flex: 1 1 100%;
  background: linear-gradient(180deg, #f6d98a, #d29a3a); color: var(--ink);
  border-color: #f8e3a6; font-size: 17px;
  box-shadow: 0 6px 18px rgba(210, 154, 58, 0.25), inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}
.btn:active { transform: translateY(1px); }

.foot { margin-top: 36px; text-align: center; font-size: 13px; color: var(--muted); }
.foot p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
