/* ==========================================================
   Itemrovip-1903 — Premium Ragnarok item shop
   ========================================================== */
:root {
  --bg: #060a1c;
  --bg2: #0b1230;
  --panel: rgba(16, 24, 60, .72);
  --panel-solid: #111a40;
  --line: rgba(140, 170, 255, .18);
  --text: #e8ecff;
  --muted: #9aa6d1;
  --blue: #4f7cff;
  --blue2: #2c4fc4;
  --ro-bar1: #7d9ae0;
  --ro-bar2: #3e5fb8;
  --gold: #f3c969;
  --gold2: #c8902f;
  --pink: #ff8fc7;
  --green: #5fe0a0;
  --red: #ff6b7d;
  --r-common: #c9d1e8;
  --r-rare: #59a8ff;
  --r-epic: #b07bff;
  --r-legend: #ffc94d;
  --r-mythic: #ff5a7a;
  --radius: 16px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .7);
  --font: 'Sarabun', 'Kanit', system-ui, sans-serif;
  --display: 'Kanit', system-ui, sans-serif;
  --latin: 'Cinzel', 'Kanit', serif;
  --nav-h: 72px;
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><path d='M3 2 L22 13 L13.5 14.5 L18 24 L14.5 25.5 L10 16 L3 22 Z' fill='%23f3c969' stroke='%235a3a00' stroke-width='1.6' stroke-linejoin='round'/><path d='M5.5 6 L17 13 L11.8 13.8' fill='none' stroke='%23fff6cf' stroke-width='1.2'/></svg>") 3 2, auto;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  font-size: 16px; line-height: 1.65; overflow-x: hidden;
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(79, 124, 255, .18), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(176, 123, 255, .12), transparent 60%),
    radial-gradient(800px 600px at 110% 80%, rgba(243, 201, 105, .07), transparent 60%);
  background-attachment: fixed;
}
body.noscroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
a, button, [data-tip], .tab, label, select { cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><path d='M3 2 L22 13 L13.5 14.5 L18 24 L14.5 25.5 L10 16 L3 22 Z' fill='%23ffffff' stroke='%232c4fc4' stroke-width='1.6' stroke-linejoin='round'/><circle cx='21' cy='5' r='3' fill='%23f3c969'/></svg>") 3 2, pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); line-height: 1.25; margin: 0; font-weight: 600; }
.ico { width: 1.1em; height: 1.1em; vertical-align: -.18em; flex: none; }
::selection { background: var(--gold); color: #2a1900; }
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-track { background: #070b1f; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--ro-bar1), var(--ro-bar2)); border-radius: 10px; border: 2px solid #070b1f; }

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #16245c, #050816 70%); transition: opacity .7s, visibility .7s;
}
body.loaded #loader { opacity: 0; visibility: hidden; }
.loader-inner { width: min(420px, 84vw); text-align: center; }
.loader-logo { width: 220px; margin: 0 auto 10px; filter: drop-shadow(0 0 30px rgba(79, 124, 255, .6)); animation: float 3s ease-in-out infinite; }
.loader-bar { height: 14px; border-radius: 8px; background: #0b1230; border: 1px solid #3e5fb8; padding: 2px; box-shadow: inset 0 2px 6px #000; }
.loader-bar span { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #4f7cff, #9cc0ff, #f3c969); animation: load 1.3s ease-out forwards; box-shadow: 0 0 12px #4f7cff; }
.loader-text { font-family: var(--latin); letter-spacing: .2em; color: #cfe0ff; margin: 14px 0 4px; }
.loader-tip { color: var(--muted); font-size: .9rem; margin: 0; }
.dots::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes load { to { width: 100%; } }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ---------- EXP bar ---------- */
.expbar { position: fixed; top: 0; left: 0; right: 0; height: 6px; z-index: 1001; background: rgba(0, 0, 0, .55); }
.expbar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #36d37a, #a6ff7a); box-shadow: 0 0 10px #5fe0a0; transition: width .15s; }
.expbar-label {
  position: absolute; right: 12px; top: 8px; font: 600 11px/1 var(--display); letter-spacing: .04em;
  background: rgba(8, 14, 40, .8); border: 1px solid var(--line); padding: 4px 8px; border-radius: 6px; color: #bfffd8;
  opacity: 0; transform: translateY(-4px); transition: .3s; pointer-events: none;
}
.nav.scrolled ~ .expbar .expbar-label, body:has(.nav.scrolled) .expbar-label { opacity: 1; transform: none; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 6px; left: 0; right: 0; z-index: 1000; height: var(--nav-h);
  display: flex; align-items: center; gap: 18px; padding: 0 clamp(16px, 4vw, 48px);
  transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.nav.scrolled, body:not([data-page="home"]) .nav { background: rgba(6, 10, 28, .78); backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 1px 0 var(--line), 0 10px 30px -10px rgba(0, 0, 0, .6); }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.brand-logo { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(79, 124, 255, .7)); transition: transform .4s; }
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.08); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text b { font: 700 1.15rem var(--latin); letter-spacing: .04em; background: linear-gradient(180deg, #fff 20%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.brand-text small { color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { position: relative; padding: 8px 14px; border-radius: 10px; font: 500 .95rem var(--display); color: #cdd6ff; transition: .25s; }
.nav-links a:hover { color: #fff; background: rgba(79, 124, 255, .14); }
.nav-links a.on { color: var(--gold); }
.nav-links a.on::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); transform: translateX(-50%); box-shadow: 0 0 10px var(--gold); }
.nav-admin { display: inline-flex; align-items: center; gap: 6px; }
.nav-admin svg { width: 18px; height: 18px; fill: currentColor; transition: transform .6s; }
.nav-admin:hover svg { transform: rotate(120deg); }
.nav-admin span { display: none; }
.burger { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(16, 24, 60, .7); padding: 12px 10px; flex-direction: column; justify-content: space-between; }
.burger span { display: block; height: 2px; background: #fff; border-radius: 2px; transition: .3s; }
body.menu-open .burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.menu-open .burger span:nth-child(2) { opacity: 0; }
body.menu-open .burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  --c1: #4f7cff; --c2: #2c4fc4;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; font: 600 .95rem var(--display);
  padding: 10px 18px; border-radius: 12px; color: #fff; position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, var(--c1), var(--c2)); box-shadow: 0 8px 24px -8px var(--c1), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .2s, box-shadow .2s; white-space: nowrap;
}
.btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s; z-index: -1; }
.btn:hover { transform: translateY(-2px); }
.btn:hover::before { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; border-radius: 14px; }
.btn-gold { --c1: #ffd77a; --c2: #c8902f; color: #2a1900; box-shadow: 0 10px 30px -8px rgba(243, 201, 105, .7), inset 0 1px 0 #fff6d6; }
.btn-fb { --c1: #3d8bff; --c2: #1658d6; }
.btn-ghost { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden; padding: calc(var(--nav-h) + 30px) 20px 90px; }
.hero-media, .hero-media video, .hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-media video { transform: scale(1.04); animation: heroZoom 24s ease-in-out infinite alternate; }
@keyframes heroZoom { to { transform: scale(1.12); } }
.hero-shade { position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(6, 10, 28, .55) 0%, rgba(6, 10, 28, .25) 35%, rgba(6, 10, 28, .7) 75%, var(--bg) 100%),
  radial-gradient(ellipse at center, transparent 30%, rgba(6, 10, 28, .55) 100%); }
.hero-particles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-content { position: relative; text-align: center; max-width: 860px; animation: heroIn 1.2s .3s both cubic-bezier(.2, .8, .2, 1); }
@keyframes heroIn { from { opacity: 0; transform: translateY(30px) scale(.98); } }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font: 500 .82rem var(--display); letter-spacing: .04em;
  background: rgba(8, 14, 40, .55); border: 1px solid rgba(243, 201, 105, .45); color: var(--gold); backdrop-filter: blur(8px); }
.hero-logo { width: clamp(180px, 30vw, 300px); margin: 18px auto 0; filter: drop-shadow(0 6px 20px rgba(0, 0, 0, .6)) drop-shadow(0 0 30px rgba(79, 124, 255, .6)); animation: float 5s ease-in-out infinite; }
.hero-shop { position: relative; font: 800 clamp(2.3rem, 7vw, 5rem)/1.05 var(--latin); letter-spacing: .03em; margin: -6px 0 8px;
  background: linear-gradient(180deg, #fffaf0 10%, #ffe08a 45%, #c8902f 80%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #5a3a00) drop-shadow(0 10px 30px rgba(0, 0, 0, .6)); }
.hero-shop::after { content: attr(data-text); position: absolute; inset: 0; background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, .9) 50%, transparent 60%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 4.5s ease-in-out infinite; }
@keyframes shine { 0% { background-position: 150% 0; } 60%, 100% { background-position: -100% 0; } }
.hero-title { font: 600 clamp(1.2rem, 3vw, 1.8rem) var(--display); margin: 0 0 8px; text-shadow: 0 2px 12px rgba(0, 0, 0, .7); }
.hero-sub { color: #d6def9; max-width: 620px; margin: 0 auto 26px; text-shadow: 0 2px 10px rgba(0, 0, 0, .8); }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; justify-content: center; gap: clamp(10px, 3vw, 24px); margin-top: 34px; flex-wrap: wrap; }
.hero-stats div { min-width: 120px; padding: 12px 18px; border-radius: 14px; background: rgba(8, 14, 40, .55); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.hero-stats b { display: block; font: 700 1.7rem var(--latin); color: var(--gold); text-shadow: 0 0 20px rgba(243, 201, 105, .5); }
.hero-stats span { font-size: .82rem; color: var(--muted); }
.hero-scroll { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .75rem; color: var(--muted); letter-spacing: .1em; }
.hero-scroll span { width: 22px; height: 36px; border: 2px solid rgba(255, 255, 255, .5); border-radius: 12px; position: relative; }
.hero-scroll span::after { content: ''; position: absolute; left: 50%; top: 6px; width: 4px; height: 8px; margin-left: -2px; background: var(--gold); border-radius: 2px; animation: wheel 1.6s infinite; }
@keyframes wheel { to { transform: translateY(12px); opacity: 0; } }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- marquee ---------- */
.marquee { position: relative; z-index: 2; overflow: hidden; border-block: 1px solid rgba(243, 201, 105, .35);
  background: linear-gradient(90deg, #1a1030, #2a1d0a, #1a1030); padding: 10px 0; margin-top: -1px; }
.marquee-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee span { padding-right: 60px; white-space: nowrap; font: 500 .95rem var(--display); color: var(--gold); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { position: relative; padding: clamp(56px, 8vw, 100px) clamp(16px, 4vw, 48px); max-width: 1320px; margin: 0 auto; }
.section-glow::before { content: ''; position: absolute; inset: 10% 10%; background: radial-gradient(closest-side, rgba(79, 124, 255, .15), transparent); z-index: -1; filter: blur(40px); }
.sec-head { text-align: center; margin-bottom: 34px; position: relative; }
.sec-head h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
.sec-head p { color: var(--muted); margin: 6px 0 0; }
.sec-head .link-more { position: absolute; right: 0; bottom: 4px; color: var(--gold); font: 500 .95rem var(--display); }
.kicker { display: inline-flex; align-items: center; gap: 10px; font: 600 .78rem var(--latin); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.kicker::before, .kicker::after { content: ''; width: 26px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.kicker::after { transform: scaleX(-1); }
.pill { display: inline-block; vertical-align: middle; font: 500 .8rem var(--display); padding: 4px 10px; border-radius: 999px; background: rgba(243, 201, 105, .14); color: var(--gold); border: 1px solid rgba(243, 201, 105, .35); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--d, 0ms), transform .7s var(--d, 0ms) cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.item-card.reveal.in { transition: opacity .7s var(--d, 0ms), transform .25s; }

/* ---------- categories ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.cat-tile { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 22px 12px 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(30, 44, 100, .65), rgba(12, 18, 46, .8)); border: 1px solid var(--line); overflow: hidden; transition: .3s; }
.cat-tile::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, var(--gold), transparent 40%, transparent 60%, var(--blue));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: .3s; }
.cat-tile:hover { transform: translateY(-6px); box-shadow: 0 18px 40px -16px rgba(79, 124, 255, .6); }
.cat-tile:hover::after { opacity: 1; }
.cat-ico { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; margin-bottom: 6px; color: var(--gold);
  background: radial-gradient(circle at 35% 30%, #3b57b8, #121a45); box-shadow: inset 0 0 0 2px rgba(243, 201, 105, .5), 0 0 24px rgba(79, 124, 255, .35); transition: .4s; }
.cat-ico .ico { width: 28px; height: 28px; }
.cat-tile:hover .cat-ico { transform: rotateY(360deg); }
.cat-tile b { font: 600 1rem var(--display); }
.cat-tile span { font-size: .8rem; color: var(--muted); }

/* ---------- item cards ---------- */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.item-card {
  --rc: var(--r-rare);
  position: relative; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, rgba(24, 34, 82, .9), rgba(10, 15, 40, .95)); border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: var(--shadow); transform-style: preserve-3d; will-change: transform;
}
.item-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 3;
  background: linear-gradient(160deg, var(--rc), transparent 35%, transparent 70%, var(--rc));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .7; transition: opacity .3s; }
.item-card:hover::before { opacity: 1; }
.item-card:hover { box-shadow: 0 24px 50px -18px var(--rc); }
.r-common { --rc: var(--r-common); } .r-rare { --rc: var(--r-rare); } .r-epic { --rc: var(--r-epic); } .r-legend { --rc: var(--r-legend); } .r-mythic { --rc: var(--r-mythic); }
.ic-slot { position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--rc) 22%, transparent), transparent 70%); }
.ic-slot img { width: 78%; height: 78%; object-fit: contain; border-radius: 14px; transition: transform .5s cubic-bezier(.2, .8, .2, 1), filter .4s; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .5)); position: relative; z-index: 1; }
.item-card:hover .ic-slot img { transform: scale(1.08) translateY(-4px); }
.ic-aura { position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(from 0deg, transparent, var(--rc), transparent 30%, transparent 50%, var(--rc), transparent 80%); filter: blur(18px); opacity: .35; animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.holo .ic-slot::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .5), transparent 40%),
    linear-gradient(115deg, transparent 20%, rgba(255, 120, 200, .35) 35%, rgba(120, 200, 255, .35) 50%, rgba(255, 230, 120, .35) 65%, transparent 80%); }
.holo:hover .ic-slot::after { opacity: 1; }
.ic-rarity { position: absolute; left: 10px; top: 10px; z-index: 2; font: 700 .65rem var(--latin); letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; color: var(--rc); background: rgba(0, 0, 0, .45); border: 1px solid color-mix(in srgb, var(--rc) 50%, transparent); }
.ic-hot { position: absolute; right: 10px; top: 10px; z-index: 2; font: 800 .68rem var(--display); padding: 3px 8px; border-radius: 6px; color: #2a1900; background: linear-gradient(180deg, #ffe08a, #f39a2f); box-shadow: 0 0 14px rgba(255, 170, 60, .7); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.ic-info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 2px; flex: 1; border-top: 1px solid rgba(255, 255, 255, .06); background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent); }
.ic-info small { color: var(--muted); font-size: .78rem; display: flex; align-items: center; gap: 5px; }
.ic-info h3 { font-size: 1.08rem; font-weight: 600; margin-top: 2px; }
.ic-en { margin: 0; font-size: .78rem; color: #7f8bbd; font-family: var(--latin); letter-spacing: .02em; }
.ic-price { margin-top: 8px; font: 700 1.35rem var(--display); color: var(--gold); display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.ic-price em { font: 400 .75rem var(--font); color: var(--muted); font-style: normal; }
.zeny { font-size: .8em; opacity: .9; }
.ic-meta { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .82rem; }
.qty-ok { color: var(--green); }
.qty-ok b { font-size: 1rem; }
.qty-out { color: var(--red); }
.ic-code { font: 600 .72rem var(--latin); color: #7f8bbd; letter-spacing: .06em; }
.item-card.is-out .ic-sold { color: #2a1900; background: linear-gradient(180deg, #ffe08a, #c8902f); }
.sold-banner { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(196, 40, 60, .08); border: 1px solid rgba(196, 40, 60, .35); color: #8a1c2c; font-weight: 600; font-size: .92rem; }
.sold-banner a { color: #2c4fc4; text-decoration: underline; }
.btn-ghost.dark { color: #2c4fc4; background: #fff; box-shadow: inset 0 0 0 1px #8ea6e6; }
.ic-sold { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); background: rgba(243, 201, 105, .1); padding: 2px 8px; border-radius: 999px; }
/* SOLD OUT → grayscale */
.is-out img { filter: grayscale(1) brightness(.6) contrast(.9) !important; }
.item-card.is-out .ic-aura { display: none; }
.item-card.is-out { --rc: #555c74; }
.item-card.is-out .ic-price { color: #8d93ab; }
.stamp { position: absolute; z-index: 3; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); font: 800 1.2rem var(--latin); letter-spacing: .12em;
  color: #ff9aa8; padding: 4px 14px; border: 3px double #ff6b7d; border-radius: 8px; background: rgba(20, 6, 12, .55); text-shadow: 0 0 8px rgba(255, 107, 125, .6); }
.stamp.big { font-size: 2rem; padding: 6px 22px; }

/* ---------- RO window ---------- */
.ro-win { border-radius: 10px; overflow: hidden; background: linear-gradient(180deg, rgba(232, 238, 255, .97), rgba(205, 216, 245, .97)); color: #1c2340; border: 1px solid #8ea6e6;
  box-shadow: 0 0 0 1px #1d2c66, 0 20px 50px -20px rgba(0, 0, 0, .8), inset 0 1px 0 #fff; }
.ro-win-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: linear-gradient(180deg, var(--ro-bar1), var(--ro-bar2)); color: #fff; font: 600 .85rem var(--display); letter-spacing: .02em; text-shadow: 0 1px 0 #1d2c66; border-bottom: 1px solid #1d2c66; }
.ro-win-bar span { margin-right: auto; }
.ro-win-bar i { width: 12px; height: 12px; border-radius: 3px; background: linear-gradient(180deg, #e8eeff, #9fb3ea); border: 1px solid #1d2c66; }
.ro-win-body { padding: 16px 18px; }
.ro-win-body p { margin: 0 0 8px; }
.ro-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 80px; padding: 6px 16px; border-radius: 6px; font: 600 .88rem var(--display); color: #1c2340;
  background: linear-gradient(180deg, #ffffff, #c5d2f2); border: 1px solid #6e85c8; box-shadow: inset 0 1px 0 #fff, 0 2px 0 #4b62a8; transition: .15s; }
.ro-btn:hover { background: linear-gradient(180deg, #fff, #dfe7ff); transform: translateY(-1px); }
.ro-btn:active { transform: translateY(1px); box-shadow: inset 0 1px 0 #fff; }
.ro-btn-gold { background: linear-gradient(180deg, #fff2c4, #f3c969); border-color: #b0802a; box-shadow: inset 0 1px 0 #fff, 0 2px 0 #8a5c17; color: #3a2600; }
.npc-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.about-art { position: relative; border-radius: 22px; }
.about-art img { border-radius: 22px; aspect-ratio: 4/3; object-fit: cover; width: 100%; box-shadow: var(--shadow); }
.about-frame { position: absolute; inset: -12px; border-radius: 28px; border: 1px solid rgba(243, 201, 105, .4); pointer-events: none; }
.about-frame::before, .about-frame::after { content: '✦'; position: absolute; color: var(--gold); font-size: 22px; text-shadow: 0 0 12px var(--gold); }
.about-frame::before { top: -14px; left: 30px; } .about-frame::after { bottom: -14px; right: 30px; }
.about-text h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: 12px; }
.about-text > p { color: #c8d1f2; }
.feat-list { display: grid; gap: 12px; margin-top: 20px; }
.feat { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); transition: .3s; }
.feat:hover { border-color: rgba(243, 201, 105, .5); transform: translateX(6px); }
.feat-ico { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(180deg, #ffd77a, #c8902f); color: #2a1900; flex: none; }
.feat-ico .ico { width: 22px; height: 22px; }
.feat b { font-family: var(--display); }
.feat p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }

/* ---------- NPC how to ---------- */
.npc-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: end; max-width: 860px; margin: 0 auto 36px; }
.npc-sprite { position: relative; text-align: center; }
.npc-sprite img { width: 200px; margin: 0 auto; animation: npcIdle 2.4s ease-in-out infinite; position: relative; z-index: 1; }
@keyframes npcIdle { 50% { transform: translateY(-6px); } }
.npc-shadow { width: 120px; height: 18px; margin: -10px auto 0; border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, .6), transparent 70%); }
.npc-emote { position: absolute; z-index: 2; top: 0; right: 18px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 800 1.3rem var(--display); color: #c43a2a; background: #fff; border: 2px solid #1c2340; animation: emote 2s ease-in-out infinite; }
.npc-emote::after { content: ''; position: absolute; bottom: -8px; left: 8px; border: 6px solid transparent; border-top-color: #fff; }
@keyframes emote { 0%, 100% { transform: translateY(0) scale(1); } 10% { transform: translateY(-6px) scale(1.15); } 20% { transform: none; } }
.npc-text { min-height: 3.4em; font-size: 1.05rem; }
.npc-text::after { content: '▌'; animation: blink 1s steps(2) infinite; color: #3e5fb8; }
@keyframes blink { 50% { opacity: 0; } }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: s; }
.step { position: relative; padding: 22px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); text-align: center; }
.step:not(:last-child)::after { content: '➜'; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); color: var(--gold); z-index: 2; font-size: 1.1rem; }
.step-n { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font: 800 1.2rem var(--latin); color: #2a1900; background: linear-gradient(180deg, #ffe08a, #c8902f); box-shadow: 0 0 20px rgba(243, 201, 105, .5); margin-bottom: 8px; }
.step b { display: block; font: 600 1.05rem var(--display); }
.step p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }

/* ---------- credits ---------- */
.credit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.credit-tile { all: unset; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: transform .3s, border-color .3s; }
.credit-tile:not([disabled]):hover { transform: translateY(-4px); border-color: rgba(243, 201, 105, .6); }
.credit-tile:focus-visible { outline: 2px solid var(--gold); }
.ct-img { position: relative; aspect-ratio: 3/4; background: #0a1030; overflow: hidden; }
.ct-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.credit-tile:hover .ct-img img { transform: scale(1.06); }
.ct-noimg { display: grid; place-items: center; height: 100%; color: var(--muted); } .ct-noimg .ico { width: 40px; height: 40px; }
.ct-qty { position: absolute; right: 8px; top: 8px; font: 700 .85rem var(--display); padding: 2px 10px; border-radius: 999px; background: linear-gradient(180deg, #ffe08a, #c8902f); color: #2a1900; }
.ct-info { padding: 10px 12px; font-size: .85rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.ct-info b { color: var(--text); font-family: var(--display); font-weight: 500; font-size: .95rem; }
.ct-info p { margin: 2px 0 0; color: #c8d1f2; }
.empty { max-width: 560px; margin: 0 auto; text-align: center; }

/* ---------- articles ---------- */
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.art-card { display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: transform .35s, box-shadow .35s; }
.art-card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -24px rgba(79, 124, 255, .55); }
.art-cover { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.art-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s; }
.art-card:hover .art-cover img { transform: scale(1.08); }
.art-cover span { position: absolute; left: 12px; bottom: 12px; font: 500 .75rem var(--display); padding: 4px 10px; border-radius: 999px; background: rgba(8, 14, 40, .75); border: 1px solid rgba(243, 201, 105, .5); color: var(--gold); backdrop-filter: blur(6px); }
.art-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.art-body time { font-size: .8rem; color: var(--muted); }
.art-body h3 { font-size: 1.15rem; }
.art-body p { margin: 0; color: #b6c0e6; font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.art-more { margin-top: auto; padding-top: 8px; color: var(--gold); font: 500 .9rem var(--display); }

.article-hero { position: relative; min-height: 62vh; display: flex; align-items: flex-end; padding: calc(var(--nav-h) + 40px) clamp(16px, 4vw, 48px) 48px;
  background: linear-gradient(180deg, rgba(6, 10, 28, .75), rgba(6, 10, 28, .6) 45%, var(--bg)), var(--img) center/cover no-repeat; }
.article-hero .kicker, .page-hero .kicker { letter-spacing: .12em; }
.article-hero-in { max-width: 860px; margin: 0 auto; width: 100%; }
.article-hero h1 { font-size: clamp(1.8rem, 4.6vw, 3rem); text-shadow: 0 4px 20px rgba(0, 0, 0, .7); margin: 6px 0 10px; }
.article-hero time { color: #cdd6ff; }
.article-body { max-width: 780px; margin: 0 auto; padding: 10px clamp(16px, 4vw, 24px) 60px; font-size: 1.07rem; color: #d7defa; }
.article-body .lead { font-size: 1.2rem; color: #fff; border-left: 3px solid var(--gold); padding-left: 16px; }
.article-body h2 { font-size: 1.55rem; margin: 38px 0 12px; color: #fff; display: flex; align-items: center; gap: 10px; }
.article-body h2::before { content: '◆'; color: var(--gold); font-size: .8em; }
.article-body h3 { font-size: 1.2rem; margin: 22px 0 6px; color: #bcd0ff; }
.article-body ul { padding-left: 0; list-style: none; }
.article-body li { position: relative; padding-left: 26px; margin: 8px 0; }
.article-body li::before { content: ''; position: absolute; left: 4px; top: .6em; width: 9px; height: 9px; transform: rotate(45deg); background: linear-gradient(135deg, var(--gold), var(--gold2)); }
.article-body blockquote { margin: 22px 0; padding: 16px 20px; border-radius: 12px; background: rgba(243, 201, 105, .08); border: 1px solid rgba(243, 201, 105, .3); color: #ffe9b0; }
.article-body strong { color: #fff; }
.article-body a { color: var(--gold); text-decoration: underline; }
.md-fig { margin: 26px 0; }
.md-fig img { border-radius: 16px; width: 100%; box-shadow: var(--shadow); }
.md-fig figcaption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 8px; }
.article-cta { margin-top: 40px; }

/* ---------- page hero ---------- */
.page-hero { position: relative; isolation: isolate; padding: calc(var(--nav-h) + 60px) 20px 60px; text-align: center; overflow: hidden; }
.page-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 10, 28, .6), rgba(6, 10, 28, .5) 50%, var(--bg)), var(--img) center/cover; z-index: -1; animation: heroZoom 30s ease-in-out infinite alternate; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); text-shadow: 0 4px 20px rgba(0, 0, 0, .6); }
.page-hero p { color: #d0d8f7; margin: 6px 0 0; }

/* ---------- shop ---------- */
.shop { padding-top: 20px; }
.shop-bar { position: sticky; top: calc(var(--nav-h) + 6px); z-index: 20; display: flex; flex-direction: column; gap: 12px; padding: 12px; margin-bottom: 24px; border-radius: 16px; background: rgba(8, 13, 36, .85); border: 1px solid var(--line); backdrop-filter: blur(14px); }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; white-space: nowrap; font: 500 .92rem var(--display); color: #c6cff5; background: rgba(255, 255, 255, .04); border: 1px solid transparent; transition: .25s; }
.tab i { font-style: normal; font-size: .75rem; padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.tab:hover { color: #fff; border-color: var(--line); }
.tab.on { color: #2a1900; background: linear-gradient(180deg, #ffe08a, #c8902f); box-shadow: 0 6px 20px -6px rgba(243, 201, 105, .7); }
.tab.on i { background: rgba(0, 0, 0, .15); }
.shop-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--muted); }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: inherit; padding: 10px 0; min-width: 0; }
.search:focus-within { border-color: var(--gold); }
.ro-select { font: inherit; color: var(--text); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ro-select option { background: #111a40; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: #c6cff5; user-select: none; }
.toggle input { accent-color: var(--gold); width: 18px; height: 18px; }
.spinner { grid-column: 1/-1; width: 46px; height: 46px; margin: 40px auto; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .1); border-top-color: var(--gold); animation: spin 1s linear infinite; }

/* ---------- item page ---------- */
.item-page { max-width: 1240px; margin: 0 auto; padding: calc(var(--nav-h) + 30px) clamp(16px, 4vw, 48px) 40px; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a:hover { color: var(--gold); }
.crumbs span { color: #dfe5ff; }
.item-layout { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(20px, 4vw, 50px); align-items: start; }
.item-visual { --rc: var(--r-rare); position: sticky; top: calc(var(--nav-h) + 24px); aspect-ratio: 1; border-radius: 28px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--rc) 30%, #0c1438), #070b1f 72%); border: 1px solid color-mix(in srgb, var(--rc) 40%, transparent); box-shadow: 0 0 80px -20px var(--rc), var(--shadow); }
.item-visual img { width: 70%; position: relative; z-index: 2; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .6)); animation: float 4s ease-in-out infinite; border-radius: 18px; }
.iv-rays { position: absolute; inset: -30%; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 35%, transparent) 0 8deg, transparent 8deg 22deg); animation: spin 30s linear infinite; opacity: .35; mask: radial-gradient(circle, #000 20%, transparent 65%); -webkit-mask: radial-gradient(circle, #000 20%, transparent 65%); }
.iv-ring { position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--rc) 60%, transparent); animation: spin 40s linear infinite reverse; }
.item-visual.is-out { --rc: #555c74; }
.item-visual.is-out .iv-rays, .item-visual.is-out img { animation: none; }
.ii-head h1 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); color: #141a36; }
.ii-en { margin: 2px 0 0; font-family: var(--latin); color: #4b5a8f; }
.ii-rarity { display: inline-block; font: 700 .72rem var(--latin); letter-spacing: .12em; text-transform: uppercase; padding: 3px 10px; border-radius: 6px; color: #fff; background: var(--rc); margin-bottom: 6px; text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.ii-rarity.r-legend, .ii-rarity.r-common { color: #2a1900; text-shadow: none; }
.ii-price { margin: 14px 0; font: 700 2.2rem var(--display); color: #a8670e; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ii-price em { font: 400 .95rem var(--font); color: #5b6690; font-style: normal; }
.ii-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 14px; }
.ii-stats div { padding: 10px 12px; border-radius: 10px; background: rgba(62, 95, 184, .1); border: 1px solid rgba(62, 95, 184, .25); }
.ii-stats dt { font-size: .78rem; color: #5b6690; }
.ii-stats dd { margin: 0; font: 600 1rem var(--display); color: #1c2340; }
.ii-stats .qty-ok { color: #0d8a52; } .ii-stats .qty-out { color: #c4283c; }
.ii-desc { padding: 14px 16px; border-radius: 10px; background: #fff; border: 1px solid #b9c6ea; color: #2a3358; min-height: 80px; }
.ii-order { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.ii-order .btn { flex: 1; }
.stepper { display: flex; align-items: stretch; border-radius: 12px; overflow: hidden; border: 1px solid #8ea6e6; background: #fff; }
.stepper button { width: 44px; border: 0; background: linear-gradient(180deg, #fff, #d5dff7); font: 700 1.2rem var(--display); color: #2c4fc4; }
.stepper input { width: 56px; border: 0; text-align: center; font: 600 1.05rem var(--display); color: #1c2340; outline: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper.disabled { opacity: .45; pointer-events: none; }
.ii-note { font-size: .82rem; color: #5b6690; margin: 10px 0 0 !important; }
.credits-sec, .related { margin-top: 70px; }

/* ---------- contact CTA ---------- */
.cta-box { position: relative; display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; padding: clamp(24px, 4vw, 44px); border-radius: 28px; overflow: hidden;
  background: linear-gradient(120deg, rgba(44, 79, 196, .45), rgba(176, 123, 255, .25)), url('../media/sky.webp') center/cover; border: 1px solid rgba(243, 201, 105, .35); box-shadow: var(--shadow); }
.cta-box::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6, 10, 28, .5), rgba(6, 10, 28, .85)); }
.cta-box > * { position: relative; }
.cta-npc { width: 200px; margin: 0 auto; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .6)); animation: npcIdle 2.6s ease-in-out infinite; }
.cta-box h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); margin-bottom: 8px; }
.cta-box p { color: #d6def9; margin: 0 0 18px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, rgba(4, 7, 20, .9)); margin-top: 40px; }
.footer-inner { max-width: 1320px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 48px) 24px; display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-brand { display: flex; gap: 14px; align-items: center; max-width: 520px; }
.footer-brand img { width: 70px; filter: drop-shadow(0 0 10px rgba(79, 124, 255, .6)); }
.footer-brand b { font: 700 1.2rem var(--latin); color: var(--gold); }
.footer-brand p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; font: 500 .95rem var(--display); color: #c6cff5; }
.footer-links a:hover { color: var(--gold); }
.foot-admin { color: var(--muted) !important; font-size: .85rem; padding: 6px 12px; border-radius: 8px; border: 1px dashed var(--line); }
.footer-credit { max-width: 1320px; margin: 0 auto; padding: 16px clamp(16px, 4vw, 48px) calc(22px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); border-top: 1px solid rgba(255, 255, 255, .05); }
.webzy { font-weight: 600; background: linear-gradient(90deg, #8fb0ff, #f3c969); -webkit-background-clip: text; background-clip: text; color: transparent; transition: filter .3s; }
.webzy:hover { filter: brightness(1.3); text-decoration: underline; text-decoration-color: var(--gold); }

/* ---------- chat ---------- */
.chat { position: fixed; left: 16px; bottom: 16px; z-index: 900; width: 340px; border-radius: 10px; overflow: hidden; background: rgba(0, 0, 0, .55); border: 1px solid rgba(140, 170, 255, .35); backdrop-filter: blur(8px); box-shadow: var(--shadow); font-size: .82rem; transition: .3s; }
.chat-head { all: unset; display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; padding: 6px 10px; background: linear-gradient(180deg, var(--ro-bar1), var(--ro-bar2)); color: #fff; font: 600 .8rem var(--display); }
.chat-head i { margin-left: auto; font-style: normal; transition: transform .3s; }
.chat-head .dot { width: 8px; height: 8px; border-radius: 50%; background: #5fe0a0; box-shadow: 0 0 8px #5fe0a0; animation: pulse 1.4s infinite; }
.chat-body { height: 128px; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 3px; scrollbar-width: thin; }
.chat.collapsed .chat-body { height: 0; padding: 0 10px; }
.chat.collapsed .chat-head i { transform: rotate(180deg); }
.chat.collapsed { width: 220px; }
.cl { animation: clIn .4s both; line-height: 1.45; color: #fff; text-shadow: 0 1px 1px #000; }
.cl b { font-weight: 600; }
.cl a { text-decoration: underline; }
.cl-sys { color: #9effc0; } .cl-shop { color: #ffd77a; } .cl-trade { color: #fff; } .cl-trade b { color: #8fd0ff; }
.cl-warn { color: #ffb0bb; } .cl-credit { color: #ffe9a0; }
@keyframes clIn { from { opacity: 0; transform: translateX(-8px); } }

.fab-fb { position: fixed; right: 18px; bottom: 18px; z-index: 900; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #3d8bff, #1658d6); box-shadow: 0 10px 30px -6px #3d8bff; transition: transform .3s; }
.fab-fb::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid #3d8bff; animation: ring 2s infinite; }
@keyframes ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.fab-fb svg { width: 28px; height: 28px; fill: #fff; }
.fab-fb:hover { transform: scale(1.1) rotate(-8deg); }

/* ---------- tooltip ---------- */
.ro-tooltip { position: fixed; left: 0; top: 0; z-index: 2000; pointer-events: none; width: 280px; border-radius: 8px; background: rgba(10, 14, 36, .96); border: 1px solid #7d9ae0; box-shadow: 0 0 0 1px #000, 0 16px 40px rgba(0, 0, 0, .6); font-size: .85rem; overflow: hidden; }
.tt-title { padding: 6px 10px; font: 600 .92rem var(--display); background: linear-gradient(180deg, var(--ro-bar1), var(--ro-bar2)); color: #fff; }
.tt-title.r-legend { color: #ffe9a0; } .tt-title.r-mythic { color: #ffc0cc; } .tt-title.r-epic { color: #e6d4ff; }
.tt-en { padding: 6px 10px 0; color: #8fa2dc; font-family: var(--latin); font-size: .78rem; }
.tt-body { padding: 6px 10px 8px; color: #e4e9ff; }
.tt-foot { display: flex; justify-content: space-between; padding: 6px 10px; border-top: 1px solid rgba(255, 255, 255, .08); color: var(--gold); font-size: .78rem; }

/* ---------- lightbox / toast ---------- */
.lightbox { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px; background: rgba(3, 5, 15, .92); backdrop-filter: blur(6px); animation: fade .25s; }
.lightbox[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.lightbox figure { margin: 0; max-width: min(92vw, 1000px); max-height: 88vh; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-height: 80vh; border-radius: 12px; box-shadow: 0 0 0 1px var(--line), var(--shadow); animation: zoomIn .3s; }
@keyframes zoomIn { from { transform: scale(.92); opacity: 0; } }
.lightbox figcaption { margin-top: 10px; color: #dfe5ff; text-align: center; font-size: .92rem; }
.lb-close { position: absolute; top: 14px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .08); color: #fff; font-size: 1.6rem; line-height: 1; }
.lb-nav { width: 48px; height: 48px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .08); color: #fff; font-size: 1.8rem; line-height: 1; }
.toast { position: fixed; left: 50%; bottom: 96px; z-index: 3100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 12px; background: rgba(10, 14, 36, .95); border: 1px solid var(--gold); color: #fff; box-shadow: var(--shadow); transition: .35s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- click FX ---------- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 4000; overflow: hidden; }
.dmg { position: absolute; transform: translate(-50%, -50%); font: 800 1.5rem/1 var(--latin); color: #fff; -webkit-text-stroke: 1.5px #b31d2f; paint-order: stroke fill; text-shadow: 0 2px 0 #5a0d16; animation: dmg 1s cubic-bezier(.2, .6, .3, 1) forwards; }
.dmg.crit { color: #ffe066; -webkit-text-stroke-color: #a15c00; font-size: 2.1rem; text-shadow: 0 0 18px rgba(255, 200, 60, .9); }
.dmg.crit::before { content: '✸'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(2.4); color: rgba(255, 90, 60, .55); z-index: -1; -webkit-text-stroke: 0; }
.dmg.miss { color: #cfe0ff; -webkit-text-stroke-color: #2c4fc4; font-size: 1.3rem; font-style: italic; }
@keyframes dmg { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.4); } 15% { opacity: 1; transform: translate(-50%, -80%) scale(1.25); } 30% { transform: translate(-50%, -100%) scale(1); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), -260%) scale(.9); } }
.spark { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff6c8; box-shadow: 0 0 10px #f3c969, 0 0 20px #f3c969; animation: spark .7s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; } }
.levelup { position: fixed; left: 50%; top: 38%; z-index: 4100; transform: translate(-50%, -50%); pointer-events: none; }
.levelup span { display: block; font: 800 clamp(2rem, 6vw, 3.6rem) var(--latin); letter-spacing: .04em; white-space: nowrap; background: linear-gradient(180deg, #fff 10%, #ffe08a 50%, #ff9a2f); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #6b3a00) drop-shadow(0 0 30px rgba(255, 200, 80, .9)); animation: lvl 1.8s cubic-bezier(.2, .8, .2, 1) forwards; }
.levelup::before { content: ''; position: absolute; left: 50%; top: 50%; width: 360px; height: 360px; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(255, 220, 120, .45), transparent 60%); animation: lvlGlow 1.8s forwards; }
@keyframes lvl { 0% { opacity: 0; transform: scale(.4) translateY(30px); } 20% { opacity: 1; transform: scale(1.1); } 35% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40px); } }
@keyframes lvlGlow { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } }

#app { min-height: 60vh; }
#app.page-in > * { animation: pageIn .5s both; }
@keyframes pageIn { from { opacity: 0; } }
.notfound { padding-top: calc(var(--nav-h) + 80px); max-width: 520px; text-align: center; }
.nf-big { font: 800 4rem var(--latin) !important; color: #3e5fb8; margin: 0 !important; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav-fb span { display: none; }
  .nav-fb { padding: 10px 12px; }
}
@media (max-width: 920px) {
  :root { --nav-h: 64px; }
  .burger { display: flex; }
  .nav-links { position: fixed; top: calc(var(--nav-h) + 6px); left: 12px; right: 12px; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px; border-radius: 16px;
    background: rgba(8, 13, 36, .97); border: 1px solid var(--line); box-shadow: var(--shadow); transform: translateY(-12px); opacity: 0; visibility: hidden; transition: .25s; }
  body.menu-open .nav-links { transform: none; opacity: 1; visibility: visible; }
  .nav-links a { padding: 14px 16px; font-size: 1.05rem; }
  .nav-links a.on::after { left: auto; right: 16px; top: 50%; transform: translateY(-50%); }
  .nav-admin span { display: inline; }
  .nav { gap: 10px; }
  .brand-logo { width: 46px; height: 46px; }
  .about, .item-layout { grid-template-columns: 1fr; }
  .item-visual { position: relative; top: 0; max-width: 520px; margin: 0 auto; width: 100%; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step:nth-child(2)::after { display: none; }
  .sec-head .link-more { position: static; display: inline-block; margin-top: 8px; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .brand-text small { display: none; }
  .brand-text b { font-size: 1rem; }
  .item-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ic-info { padding: 10px 11px 12px; }
  .ic-info h3 { font-size: .95rem; }
  .ic-price { font-size: 1.1rem; }
  .ic-meta { flex-direction: column; align-items: flex-start; gap: 4px; font-size: .76rem; }
  .ic-rarity { font-size: .55rem; left: 6px; top: 6px; padding: 2px 6px; }
  .ic-hot { right: 6px; top: 6px; }
  .stamp { font-size: .9rem; padding: 3px 10px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cat-tile { padding: 14px 6px 12px; }
  .cat-ico { width: 46px; height: 46px; } .cat-ico .ico { width: 22px; height: 22px; }
  .cat-tile b { font-size: .85rem; line-height: 1.3; }
  .cat-tile span { font-size: .7rem; }
  .credit-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .art-grid { grid-template-columns: 1fr; }
  .npc-wrap { grid-template-columns: 1fr; gap: 0; }
  .npc-sprite img { width: 140px; }
  .npc-emote { right: calc(50% - 80px); }
  .steps { grid-template-columns: 1fr; }
  .step::after { display: none; }
  .hero-stats div { min-width: 0; flex: 1; padding: 10px 8px; }
  .hero-stats b { font-size: 1.3rem; }
  .hero-stats span { font-size: .72rem; }
  .hero-cta .btn { flex: 1; min-width: 0; padding: 13px 14px; }
  .cta-box { grid-template-columns: 1fr; text-align: center; }
  .cta-npc { width: 130px; }
  .cta-box .btn { white-space: normal; }
  .ii-stats { grid-template-columns: 1fr 1fr 1fr; }
  .ii-stats div { padding: 8px; }
  .ii-price { font-size: 1.8rem; }
  .ii-order .btn { flex-basis: 100%; }
  .chat { left: 10px; bottom: 10px; width: calc(100vw - 96px); max-width: 320px; }
  .chat.collapsed { width: 170px; }
  .fab-fb { width: 52px; height: 52px; right: 12px; bottom: 12px; }
  .lb-nav { position: absolute; bottom: 20px; } .lb-prev { left: 30%; } .lb-next { right: 30%; }
  .footer-credit { justify-content: center; text-align: center; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .shop-bar { top: calc(var(--nav-h) + 6px); padding: 10px; }
  .expbar-label { display: none; }
  .dmg { font-size: 1.2rem; } .dmg.crit { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
@media (hover: none) { :root, a, button { cursor: auto; } }

/* ===== ขายแล้ว: การ์ดเป็นสีเทาทั้งใบ + ป้าย "ขายแล้ว" สีแดง ===== */
.item-card.is-out { border-color: #3a3f52 !important; box-shadow: none; }
.item-card.is-out .ic-slot { background: #23252e !important; }
.item-card.is-out .ic-info { background: #1f2129; }
.item-card.is-out .ic-info h3, .item-card.is-out .ic-info small, .item-card.is-out .ic-en, .item-card.is-out .ic-price, .item-card.is-out .ic-price em, .item-card.is-out .ic-code { color: #7d8191 !important; }
.item-card.is-out .ic-rarity { filter: grayscale(1); opacity: .6; }
.item-card.is-out .qty-out { color: #ff4d5e; font-weight: 700; }
.item-visual.is-out { background: #23252e !important; }
.item-visual.is-out .iv-rays, .item-visual.is-out .iv-ring { display: none; }
.stamp { font-family: var(--display), var(--font), sans-serif; letter-spacing: .04em; color: #fff; background: #d9142b; border: 3px solid #fff;
  outline: 2px solid #d9142b; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); box-shadow: 0 6px 18px rgba(217, 20, 43, .45); white-space: nowrap; }
.credits-top { margin-bottom: 28px; }

/* ===== เครดิต: การ์ดไอเทมที่ขายแล้ว (กรอบแดง) ขนาดเท่ารูปเครดิต วางซ้อนอยู่ด้านหลัง ===== */
.credit-grid:has(.has-item) { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 26px 22px; }
.credit-tile.has-item { overflow: visible; background: transparent; border: 0; }
.credit-tile.has-item:not([disabled]):hover { border-color: transparent; }
.ct-stack { position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: start; padding: 8px 6px 4px; }
.ct-stack > * { grid-row: 1; }
.ct-item.item-card { grid-column: 1; position: relative; z-index: 0; margin-right: -18%; aspect-ratio: 3/4; display: flex; flex-direction: column; overflow: hidden;
  border: 3px solid #e3192f !important; border-radius: 14px; background: #1c1e27; box-shadow: 0 10px 26px -8px rgba(227, 25, 47, .55) !important;
  transform: rotate(-4deg); transform-origin: 80% 90%; transition: transform .35s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.ct-item.item-card::before { display: none; }
.ct-item .ic-slot { flex: 1 1 auto; aspect-ratio: auto; min-height: 0; }
.ct-item .ic-slot img { width: 70%; height: 70%; }
.ct-item .stamp { font-size: .95rem; padding: 3px 10px; }
.ct-item .ic-rarity { font-size: .55rem; left: 7px; top: 7px; padding: 2px 6px; }
.ct-item .ic-info { flex: none; padding: 8px 10px 10px; gap: 0; }
.ct-item .ic-info small { font-size: .68rem; }
.ct-item .ic-info h3 { font-size: .9rem; margin: 1px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-item .ic-en { font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-item .ic-price { font-size: 1rem; margin-top: 4px; }
.ct-stack .ct-img { grid-column: 2; z-index: 1; border-radius: 14px; border: 1px solid var(--line); transform: rotate(3deg) translateY(6px);
  box-shadow: -10px 6px 24px -8px rgba(0, 0, 0, .85); transition: transform .35s cubic-bezier(.2, .8, .2, 1), border-color .3s; }
.credit-tile.has-item:hover .ct-item { transform: rotate(-7deg) translateX(-6px); }
.credit-tile.has-item:hover .ct-stack .ct-img { transform: rotate(1deg) translateY(0); border-color: rgba(243, 201, 105, .6); }
.credit-tile.has-item:hover .ct-img img { transform: none; }
.credit-tile.has-item .ct-info { padding: 14px 8px 0; text-align: center; align-items: center; }
@media (max-width: 760px) { .credit-grid:has(.has-item) { grid-template-columns: 1fr; } }

/* ===== หมวดหมู่: จัดกลางเสมอ ไม่ว่าจะมีกี่หมวด ===== */
.cat-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.cat-grid > .cat-tile { flex: 0 1 160px; min-width: 140px; }
@media (max-width: 760px) {
  .cat-grid { gap: 8px; }
  .cat-grid > .cat-tile { flex: 0 0 calc((100% - 16px) / 3); min-width: 0; }
}
