/* Wanderia landing page - bright pastel fantasy (light + dark), shares the look of /wiki */
:root {
  --sky1: #7cc8ff;
  --sky2: #b8e4ff;
  --sky3: #fdf3ff;
  --bg: #f4faff;
  --card: #ffffff;
  --card2: #f3f9ff;
  --ink: #24324a;
  --muted: #64748f;
  --line: #d9e6f4;
  --accent: #3d9cf5;
  --pink: #ff7fb0;
  --pink-d: #e0598f;
  --mint: #3ccf9a;
  --mint-d: #23a878;
  --sun: #ffc93c;
  --sun-d: #e0a512;
  --violet: #8f7bff;
  --violet-d: #6b55e6;
  --shadow: 0 10px 30px rgba(60, 110, 170, .14);
  --r: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky1: #1d3160; --sky2: #2a2a5a; --sky3: #171c34; --bg: #121a2c; --card: #1c2640; --card2: #222e4c;
    --ink: #e5edf9; --muted: #9babc4; --line: #2e3c5c; --accent: #5aaeff; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sky1: #1d3160; --sky2: #2a2a5a; --sky3: #171c34; --bg: #121a2c; --card: #1c2640; --card2: #222e4c;
  --ink: #e5edf9; --muted: #9babc4; --line: #2e3c5c; --accent: #5aaeff; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", "Sarabun", "Leelawadee UI", Tahoma, Roboto, sans-serif;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .86em; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--card) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1160px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 14px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.3rem; color: var(--ink); letter-spacing: .3px; flex: none; }
.logo img { width: 36px; height: 36px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; padding: 6px 12px; border-radius: 999px; color: var(--ink); font-weight: 650; font-size: .95rem; }
.nav a:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.tools { margin-left: auto; display: flex; gap: 8px; flex: none; }
.pill { border: 1px solid var(--line); background: var(--card2); color: var(--ink); border-radius: 999px; padding: 4px 12px; cursor: pointer; font: inherit; font-weight: 700; min-width: 42px; }
.pill:hover { border-color: var(--accent); }

/* ---------- hero ---------- */
.hero { position: relative; background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 55%, var(--sky3) 100%); padding: 48px 0 90px; overflow: hidden; }
.hero-in { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.badge { display: inline-block; margin: 0 0 10px; padding: 4px 14px; border-radius: 999px; background: rgba(255, 255, 255, .75); color: #3a4a6b; font-weight: 700; font-size: .85rem; box-shadow: 0 3px 10px rgba(40, 80, 140, .12); }
.title { font-size: clamp(3rem, 9vw, 5.6rem); font-weight: 900; letter-spacing: 1px; color: #fff; margin: 0; line-height: 1.05;
  text-shadow: 0 4px 0 var(--pink), 0 8px 0 var(--violet-d), 0 14px 24px rgba(40, 20, 90, .3); }
.title span { display: inline-block; animation: bob 2.6s ease-in-out infinite; }
.title span:nth-child(2) { animation-delay: .1s; } .title span:nth-child(3) { animation-delay: .2s; } .title span:nth-child(4) { animation-delay: .3s; }
.title span:nth-child(5) { animation-delay: .4s; } .title span:nth-child(6) { animation-delay: .5s; } .title span:nth-child(7) { animation-delay: .6s; } .title span:nth-child(8) { animation-delay: .7s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.tagline { font-size: clamp(1.15rem, 2.6vw, 1.5rem); font-weight: 800; color: #24324a; margin: 18px 0 8px; }
.lead { color: #3a4a6b; max-width: 34em; margin: 0 0 22px; }
:root[data-theme="dark"] .tagline, :root[data-theme="dark"] .lead { color: #e5edf9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tagline, :root:not([data-theme="light"]) .lead { color: #e5edf9; } }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 16px; font-weight: 800; font-size: 1.05rem; color: #fff; border: 0; cursor: pointer;
  transition: transform .08s, box-shadow .08s, filter .15s; text-decoration: none; }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: translateY(3px); }
.btn .ico { font-size: .95em; }
.btn-play { background: linear-gradient(180deg, #ff9cc6, var(--pink)); box-shadow: 0 5px 0 var(--pink-d); }
.btn-play:active { box-shadow: 0 2px 0 var(--pink-d); }
.btn-dl { background: linear-gradient(180deg, #6fe0b6, var(--mint)); box-shadow: 0 5px 0 var(--mint-d); }
.btn-dl:active { box-shadow: 0 2px 0 var(--mint-d); }
.btn-reg { background: linear-gradient(180deg, #ab9cff, var(--violet)); box-shadow: 0 5px 0 var(--violet-d); }
.btn-reg:active { box-shadow: 0 2px 0 var(--violet-d); }
.btn.wide { width: 100%; }
.btn[aria-disabled="true"] { background: var(--line); color: var(--muted); box-shadow: none; cursor: default; pointer-events: none; }

.hero-art { position: relative; }
.shot { display: block; width: 100%; border-radius: var(--r); border: 6px solid #fff; box-shadow: 0 18px 40px rgba(40, 60, 120, .3); transform: rotate(1.5deg); }
.mascot { position: absolute; width: 84px; height: 84px; filter: drop-shadow(0 6px 8px rgba(40, 60, 120, .3)); animation: hop 2.2s ease-in-out infinite; }
.m1 { left: -26px; bottom: -30px; }
.m2 { right: -14px; top: -36px; animation-delay: .5s; }
.m3 { right: 18%; bottom: -40px; width: 70px; height: 70px; animation-delay: 1s; }
@keyframes hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 40% { transform: translateY(-14px) scale(.96, 1.04); } 70% { transform: translateY(0) scale(1.06, .94); } }

.clouds i { position: absolute; display: block; background: rgba(255, 255, 255, .8); border-radius: 999px; animation: drift 60s linear infinite; }
.clouds i::before, .clouds i::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.clouds i::before { width: 55%; height: 160%; left: 15%; bottom: 20%; }
.clouds i::after { width: 40%; height: 130%; right: 12%; bottom: 25%; }
.clouds i:nth-child(1) { width: 160px; height: 40px; top: 14%; left: -10%; }
.clouds i:nth-child(2) { width: 110px; height: 30px; top: 38%; left: 30%; animation-duration: 80s; animation-delay: -30s; opacity: .7; }
.clouds i:nth-child(3) { width: 200px; height: 46px; top: 66%; left: 60%; animation-duration: 95s; animation-delay: -60s; opacity: .6; }
.clouds i:nth-child(4) { width: 90px; height: 26px; top: 8%; left: 75%; animation-duration: 70s; animation-delay: -10s; }
:root[data-theme="dark"] .clouds i { background: rgba(255, 255, 255, .12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .clouds i { background: rgba(255, 255, 255, .12); } }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(110vw); } }
.wave { position: absolute; left: 0; bottom: -1px; width: 100%; height: 70px; fill: var(--bg); }

/* ---------- sections ---------- */
.section { padding: 56px 16px; }
.sec-title { text-align: center; font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 900; margin-bottom: .3em; }
.sec-title::after { content: ""; display: block; width: 70px; height: 6px; margin: 10px auto 0; border-radius: 6px; background: linear-gradient(90deg, var(--pink), var(--sun), var(--mint)); }
.sec-sub { text-align: center; max-width: 40em; margin: 0 auto 26px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); transition: transform .15s; }
.feat:hover { transform: translateY(-4px); }
.feat h3 { font-size: 1.15rem; margin-top: 12px; }
.feat p { margin: 0; color: var(--muted); }
.feat-ico { height: 64px; display: flex; align-items: center; gap: 6px; }
.feat-ico img { width: 64px; height: 64px; }
.feat-ico.jobs img, .feat-ico.emotes img { width: 46px; height: 46px; }

.gallery { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 18px; margin-top: 28px; }
.gallery figure { margin: 0; }
.zoom { display: block; width: 100%; padding: 0; border: 5px solid var(--card); border-radius: var(--r); overflow: hidden; cursor: zoom-in; box-shadow: var(--shadow); background: var(--card); }
.zoom img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .3s; }
.zoom:hover img { transform: scale(1.04); }
.gallery figcaption { text-align: center; font-weight: 700; margin-top: 8px; color: var(--muted); }

.dl-sec { background: linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--sky2) 40%, var(--bg)) 100%); }
.dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.dl { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); }
.dl h3 { font-size: 1.3rem; }
.dl p { margin: 0 0 10px; color: var(--muted); }
.dl .meta { min-height: 1.6em; font-size: .9rem; color: var(--ink); font-weight: 600; margin-top: auto; margin-bottom: 14px; }
.dl-ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 12px; }
.dl-ico svg { width: 40px; height: 40px; fill: #fff; }
.dl-ico svg .cut { fill: rgba(0, 0, 0, .18); }
.dl-ico svg .line { fill: none; stroke: rgba(0, 0, 0, .2); stroke-width: 2.4; }
#dl-pc .dl-ico { background: linear-gradient(160deg, #7cc8ff, var(--accent)); }
#dl-android .dl-ico { background: linear-gradient(160deg, #7ee8bf, var(--mint)); }
#dl-web .dl-ico { background: linear-gradient(160deg, #ffb3d1, var(--pink)); }

.wiki-card { display: flex; align-items: center; gap: 20px; padding: 24px 28px; border-radius: var(--r); color: var(--ink);
  background: linear-gradient(120deg, color-mix(in srgb, var(--sun) 30%, var(--card)), color-mix(in srgb, var(--pink) 22%, var(--card)));
  border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s; }
.wiki-card:hover { transform: translateY(-3px); text-decoration: none; }
.wiki-card img { width: 88px; height: 88px; flex: none; animation: hop 2.6s ease-in-out infinite; }
.wiki-card h2 { font-size: 1.4rem; margin-bottom: .2em; }
.wiki-card p { margin: 0; color: var(--muted); }
.wiki-card .arrow { margin-left: auto; font-size: 2rem; color: var(--pink); flex: none; }

/* ---------- server status (ลอยทับขอบคลื่นของ hero) ---------- */
.online-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 5px 14px; border-radius: 999px; background: rgba(255, 255, 255, .8); color: #3a4a6b; font-weight: 750; font-size: .92rem; box-shadow: 0 3px 10px rgba(40, 80, 140, .12); }
.online-pill:hover { text-decoration: none; background: #fff; }
.online-pill[hidden] { display: none; }
.status-sec { position: relative; z-index: 2; margin-top: -46px; }
.status-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 18px 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.status-head { display: flex; align-items: center; gap: 14px; }
.status-head img { width: 56px; height: 56px; flex: none; animation: hop 2.4s ease-in-out infinite; }
.status-head h2 { font-size: 1.25rem; margin: 0; }
.status-head p { margin: 0; }
.worlds { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.world { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 16px; background: var(--card2); border: 1px solid var(--line); font-weight: 800; }
.world .count { color: var(--muted); font-weight: 650; font-size: .92rem; }
.world.off { opacity: .75; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: #e0605e; box-shadow: 0 0 0 3px rgba(224, 96, 94, .22); }
.dot.on { background: var(--mint); box-shadow: 0 0 0 3px rgba(60, 207, 154, .3); animation: ping 1.8s ease-out infinite; }
.dot.wait { background: var(--line); box-shadow: none; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(60, 207, 154, .55); } 80%, 100% { box-shadow: 0 0 0 9px rgba(60, 207, 154, 0); } }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--card); padding: 28px 0 22px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.foot-logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.1rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--ink); font-weight: 600; font-size: .93rem; }
.foot-links a:hover { color: var(--accent); }
.foot-in > p { margin: 0 0 0 auto; }

/* ---------- image viewer ---------- */
dialog#viewer { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 92vh; }
dialog#viewer::backdrop { background: rgba(10, 20, 40, .75); }
dialog#viewer img { display: block; max-width: 94vw; max-height: 88vh; border-radius: 16px; border: 5px solid #fff; }
dialog#viewer .close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: #24324a; font-size: 1.6rem; line-height: 1; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; gap: 48px; }
  .hero { padding-top: 30px; }
  .features, .dl-grid { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery figure:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .status-sec { margin-top: -30px; }
  .status-card { padding: 16px; }
  .worlds { justify-content: stretch; }
  .world { flex: 1 1 100%; }
  .world .count { margin-left: auto; }
  .top-in { flex-wrap: wrap; gap: 6px 10px; }
  .nav { order: 3; width: 100%; }
  .features, .dl-grid, .gallery { grid-template-columns: 1fr; }
  .cta .btn { flex: 1 1 100%; }
  .mascot { width: 62px; height: 62px; }
  .m1 { left: -6px; } .m2 { right: -4px; }
  .wiki-card { flex-wrap: wrap; padding: 20px; }
  .wiki-card .arrow { display: none; }
  .foot-in > p { margin-left: 0; }
  .section { padding: 44px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* อีเวนต์ / เรตพิเศษ (เช่น EXP x2) */
.event-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px 8px; padding: 5px 14px; border-radius: 999px; background: linear-gradient(90deg, #ffd86b, #ff9fc8); color: #5a2a00; font-weight: 800; font-size: .92rem; box-shadow: 0 3px 12px rgba(255, 140, 60, .35); animation: evGlow 2.4s ease-in-out infinite; }
.event-pill:hover { text-decoration: none; filter: brightness(1.05); }
.event-pill[hidden] { display: none; }
.event-pill .spark { font-size: 1.05rem; }
@keyframes evGlow { 0%, 100% { box-shadow: 0 3px 12px rgba(255, 140, 60, .35); } 50% { box-shadow: 0 3px 20px rgba(255, 120, 180, .6); } }
.rates { flex-basis: 100%; padding: 8px 14px; border-radius: 12px; background: rgba(255, 200, 80, .18); font-weight: 700; }
.rates[hidden] { display: none; }
@media (max-width: 560px) { .event-pill { margin-left: 0; } }
@media (prefers-reduced-motion: reduce) { .event-pill { animation: none; } }

/* ปุ่มลอย: แจ้งปัญหา / เสนอแนะ */
.fab-support { position: fixed; right: 16px; bottom: 16px; z-index: 50; padding: 11px 16px; border-radius: 999px;
  background: linear-gradient(180deg, #ff9cc6, #ff6fa8); color: #fff; font-weight: 800; text-decoration: none;
  box-shadow: 0 4px 0 #d94f8a, 0 8px 20px rgba(40, 20, 90, .3); transition: transform .1s; }
.fab-support:hover { transform: translateY(-2px); }
@media (max-width: 520px) { .fab-support { right: 12px; bottom: 12px; padding: 9px 13px; font-size: 14px; } }
