/* Elemental Origins portal + portal-admin. Same tokens as home.html / download.html; mobile-first from 360 px.
   Strict CSP: no inline styles anywhere, so every dynamic colour is a class (.r-*, .el-*) setting a custom property. */
:root {
  --bg: #070b16; --bg-2: #0a1122; --panel: #0e1629; --panel-2: #121d36; --panel-3: #18264a;
  --line: rgba(224, 180, 92, .28); --line-soft: rgba(164, 176, 200, .15); --line-strong: rgba(224, 180, 92, .6);
  --gold: #e0b45c; --gold-hi: #ffe3a3; --text: #e8edf7; --text-2: #c3cde0; --muted: #a4b0c8; --faint: #7c88a2;
  --ok: #6fd3a8; --warn: #ffcf7a; --bad: #ff8f8f; --info: #8fc4ff;
  --radius: 14px; --radius-sm: 10px; --gutter: clamp(16px, 4vw, 40px); --bar: 60px;
  --font: 'Chakra Petch', 'Noto Sans Thai', 'Leelawadee UI', Thonburi, Tahoma, sans-serif;
  --font-body: 'Noto Sans Thai', 'Chakra Petch', 'Leelawadee UI', Thonburi, Tahoma, sans-serif;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --rc: #b8c0cc; --ec: #a4b0c8;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 12px); }
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column; overflow-x: hidden;
  color: var(--text); font: 500 16px/1.6 var(--font);
  background: radial-gradient(1100px 520px at 50% -160px, rgba(58, 88, 160, .2), transparent 70%), var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--gold-hi); }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin: 0 auto; }
.nw { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--gold); color: #2a1604; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; font: 700 16px/1.2 var(--font); white-space: nowrap; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: filter .15s ease, background .15s ease, border-color .15s ease, transform .15s ease; }
.btn .i { width: 20px; height: 20px; }
.btn-primary { color: #2a1604; background: linear-gradient(180deg, #ffe7a6, #f0be55 48%, #c98a2b); border-color: #ffefc2; box-shadow: 0 6px 22px rgba(240, 190, 85, .24), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary .i-play, .btn .i-fill { fill: currentColor; stroke: none; }
.btn-ghost { color: var(--gold-hi); background: rgba(9, 15, 30, .78); border-color: var(--line-strong); }
.btn-ghost:hover { background: rgba(24, 38, 72, .92); }
.btn-quiet { color: var(--text-2); background: transparent; border-color: var(--line-soft); }
.btn-quiet:hover { color: var(--gold-hi); border-color: var(--line); }
.btn-danger { color: #fff; background: linear-gradient(180deg, #d9505e, #a8303e); border-color: #ff9aa5; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-small { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn-tiny { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; filter: grayscale(.7) brightness(.75); box-shadow: none; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(7, 11, 22, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar-inner { display: flex; align-items: center; gap: 10px; min-height: var(--bar); }
.brand { display: flex; align-items: center; gap: 8px; flex: none; color: var(--gold-hi); text-decoration: none; }
.brand img { width: auto; height: 42px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6)); }
.brand-tag { display: none; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .2em; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.top-actions .btn { min-height: 42px; padding: 0 12px; font-size: 15px; }
.account-btn { max-width: 190px; }
.account-btn .account-label { overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: inline-grid; place-content: center; gap: 5px; width: 44px; height: 44px; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: rgba(9, 15, 30, .78); cursor: pointer; }
.menu-btn span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--gold-hi); transition: transform .2s ease, opacity .2s ease; }
.topbar.is-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar.is-open .menu-btn span:nth-child(2) { opacity: 0; }
.topbar.is-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.site-nav { display: none; }
.topbar.is-open .site-nav { position: absolute; left: 0; right: 0; top: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px var(--gutter) 16px; background: rgba(9, 14, 28, .98); border-bottom: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, .55); max-height: calc(100svh - var(--bar)); overflow-y: auto; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-size: 15.5px; border: 1px solid var(--line-soft); background: rgba(18, 29, 54, .6); }
.nav-link .i { color: var(--gold); }
.nav-link:hover { color: var(--gold-hi); border-color: var(--line); }
.nav-link[aria-current="page"] { color: var(--gold-hi); border-color: var(--line-strong); background: rgba(40, 52, 88, .7); }
@media (max-width: 479px) {
  .account-btn { width: 42px; padding: 0; }
  .account-btn .account-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .brand img { height: 38px; }
}
@media (min-width: 480px) { .brand-tag { display: inline-block; } }
@media (min-width: 1120px) {
  .menu-btn { display: none; }
  .site-nav, .topbar.is-open .site-nav { position: static; display: flex; gap: 2px; padding: 0; margin-left: 12px; background: none; border: 0; box-shadow: none; max-height: none; overflow: visible; }
  .nav-link { min-height: 40px; padding: 0 10px; border: 0; background: none; font-size: 15px; border-radius: 8px; }
  .nav-link .i { display: none; }
  .nav-link[aria-current="page"] { background: rgba(224, 180, 92, .12); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 8px 8px 0 0; }
  .top-actions { margin-left: auto; }
}

/* Page frame */
#view { flex: 1 0 auto; outline: none; }
.view { padding-bottom: clamp(36px, 7vw, 72px); animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.boot { display: grid; place-items: center; min-height: 50svh; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(224, 180, 92, .25); border-top-color: var(--gold); animation: spin .9s linear infinite; }
.page-head { display: grid; gap: 6px; padding: clamp(20px, 4vw, 40px) 0 clamp(14px, 2.6vw, 24px); }
.eyebrow { color: var(--gold); font-size: 12.5px; font-weight: 600; letter-spacing: .3em; }
.page-title { font-size: clamp(26px, 5vw, 38px); color: var(--gold-hi); text-shadow: 0 3px 0 #3d2306, 0 0 22px rgba(240, 190, 90, .25); outline: none; }
.page-sub { max-width: 46em; color: var(--muted); font-size: 15.5px; text-wrap: pretty; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding-top: 16px; color: var(--faint); font-size: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--gold-hi); }
.crumbs [aria-current] { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.crumbs + .page-head { padding-top: 10px; }
.sec { padding-top: clamp(26px, 5vw, 48px); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { font-size: clamp(20px, 3.4vw, 26px); color: var(--gold-hi); }
.sec-head .more { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; color: var(--gold); text-decoration: none; font-size: 15px; white-space: nowrap; }
.sec-head .more .i { width: 18px; height: 18px; }
.sec-head .more:hover { color: var(--gold-hi); }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel-2), var(--panel)); padding: clamp(16px, 3vw, 24px); }
.panel + .panel, .panel + .notice, .notice + .panel { margin-top: 14px; }
.panel-title { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-bottom: 12px; font-size: 19px; color: var(--gold-hi); }
.panel-title .i { color: var(--gold); }
.panel-title small { margin-left: auto; color: var(--faint); font-size: 13.5px; font-weight: 500; }
.grid-auto { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.prose { font-family: var(--font-body); font-weight: 400; color: var(--text-2); line-height: 1.75; }
.sec-gap { margin-top: 14px; }
.sec-gap-sm { margin-top: 10px; }
.span-all, .state { grid-column: 1 / -1; }
.prose p + p { margin-top: .7em; }

/* Hero (portal home) */
.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: center; min-height: clamp(380px, 62svh, 560px); padding: clamp(28px, 6svh, 64px) 0; }
.hero picture { position: absolute; inset: 0; z-index: -2; }
.hero-bg { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; transform: scale(1.04); animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { to { transform: scale(1.1) translateY(-1.5%); } }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 64% 60% at 50% 46%, rgba(7, 11, 22, .4), rgba(7, 11, 22, .84) 74%), linear-gradient(180deg, rgba(7, 11, 22, .5), rgba(7, 11, 22, 0) 26%, rgba(7, 11, 22, .1) 70%, var(--bg)); }
.hero-inner { display: grid; justify-items: center; gap: 10px; text-align: center; }
.hero-logo { width: min(340px, 64vw); height: auto; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .65)); }
.hero-title { font-size: clamp(24px, 5vw, 40px); color: var(--gold-hi); text-shadow: 0 3px 0 #3d2306, 0 0 26px rgba(240, 190, 90, .4); outline: none; }
.hero-lead { max-width: 34em; color: #d9e2f2; font-size: clamp(15px, 2vw, 18px); text-shadow: 0 2px 6px #000; text-wrap: balance; }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; width: 100%; }
.hero-cta .btn { min-width: 220px; min-height: 52px; font-size: 17px; }
@media (max-width: 559px) { .hero-cta .btn { width: 100%; min-width: 0; } }

/* Tags, chips, badges */
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(224, 180, 92, .08); color: var(--gold-hi); font-size: 12.5px; font-weight: 600; }
.ver { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 6px; background: var(--gold); color: #2a1604; font-size: 12.5px; font-weight: 700; }
.rarity { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--rc) 55%, transparent); background: color-mix(in srgb, var(--rc) 12%, transparent); color: var(--rc); font-size: 13px; font-weight: 700; }
.rc { color: var(--rc); }
.r-Common { --rc: #b8c0cc; } .r-Uncommon { --rc: #6fd18b; } .r-Rare { --rc: #5aa9ff; } .r-Epic { --rc: #b57bff; }
.r-Legendary { --rc: #ffb547; } .r-Mythic { --rc: #ff5f7a; } .r-Event { --rc: #ffd84d; }
.el-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13.5px; white-space: nowrap; }
.el-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--ec); box-shadow: 0 0 8px var(--ec); }
.el-neutral { --ec: #a4b0c8; } .el-fire { --ec: #ff7a3d; } .el-lava { --ec: #ff8a2a; } .el-water { --ec: #5fc4ff; } .el-ice { --ec: #a6ecff; }
.el-wind { --ec: #7fe8a8; } .el-lightning { --ec: #ffe35a; } .el-earth { --ec: #c9a35c; } .el-metal { --ec: #c8d3e2; } .el-wood { --ec: #6fd36a; }
.el-dark { --ec: #b07cff; } .el-light { --ec: #ffe27a; }
.enh { margin-left: 6px; padding: 0 6px; border-radius: 6px; background: rgba(255, 227, 163, .14); color: var(--gold-hi); font-size: .82em; font-weight: 700; }
.amt { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt-ico { width: 16px; height: 16px; stroke: none; }
.amt.is-strong { color: var(--gold-hi); font-weight: 700; font-size: 1.05em; }

/* Item icons (fallback letter tile in the rarity colour) */
.ico-tile { position: relative; display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--rc) 60%, transparent); background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--rc) 26%, transparent), rgba(10, 16, 32, .92) 72%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 0 14px color-mix(in srgb, var(--rc) 18%, transparent); overflow: hidden; }
.ico-tile img { width: 86%; height: 86%; object-fit: contain; image-rendering: pixelated; }
.ico-letter { color: var(--rc); font-weight: 700; font-size: 20px; text-shadow: 0 2px 0 rgba(0, 0, 0, .6); }
.ico-tile.is-sm { width: 40px; height: 40px; border-radius: 9px; }
.ico-tile.is-sm .ico-letter { font-size: 17px; }
.ico-tile.is-lg { width: 64px; height: 64px; border-radius: 12px; }
.ico-tile.is-lg .ico-letter { font-size: 26px; }
.ico-tile.is-xl { width: clamp(96px, 26vw, 128px); height: clamp(96px, 26vw, 128px); border-radius: 16px; }
.ico-tile.is-xl .ico-letter { font-size: 44px; }

/* States */
.state { display: grid; justify-items: center; gap: 8px; padding: clamp(28px, 6vw, 48px) 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); background: rgba(14, 22, 41, .55); }
.state-ico { width: 40px; height: 40px; color: var(--gold); stroke-width: 1.6; }
.state-title { font-size: 18px; font-weight: 700; color: var(--text); text-wrap: balance; }
.state-sub { max-width: 34em; color: var(--muted); font-size: 15px; text-wrap: balance; }
.state .btn { margin-top: 6px; }
.state-error .state-ico { color: var(--bad); }
.state-soon { border-style: solid; background: radial-gradient(ellipse at 50% 0, rgba(224, 180, 92, .14), transparent 70%), rgba(14, 22, 41, .7); }
.state-soon .state-title { color: var(--gold-hi); font-size: 22px; }
.sk-wrap { display: grid; gap: 10px; }
.sk { border-radius: 12px; background: linear-gradient(90deg, rgba(30, 44, 78, .55) 0, rgba(52, 70, 112, .55) 40%, rgba(30, 44, 78, .55) 80%); background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-row { height: 64px; }
.sk-line { height: 16px; border-radius: 6px; }
.sk-card { height: 220px; }
.sk-tile { height: 78px; }
.sk-board { height: 280px; }
.sk-chart { height: 300px; }
.is-stale { opacity: .55; transition: opacity .15s ease; pointer-events: none; }

/* Notices */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(224, 180, 92, .07); color: var(--text-2); font-size: 15px; }
.notice > .i { margin-top: 2px; color: var(--gold); }
.notice b { color: var(--gold-hi); }
.notice-warn { border-color: rgba(255, 207, 122, .45); background: rgba(255, 207, 122, .08); color: #f6e3bd; }
.notice-warn > .i { color: var(--warn); }
.notice-bad { border-color: rgba(255, 143, 143, .45); background: rgba(255, 110, 110, .08); color: #ffd9d9; }
.notice-bad > .i { color: var(--bad); }
.notice-ok { border-color: rgba(111, 211, 168, .45); background: rgba(111, 211, 168, .08); color: #d3f3e5; }
.notice-ok > .i { color: var(--ok); }
.notice-info { border-color: rgba(143, 196, 255, .35); background: rgba(90, 169, 255, .07); color: #dbe9fb; }
.notice-info > .i { color: var(--info); }
.notice p + p { margin-top: 4px; }

/* News */
.news-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.news-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
a.news-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.news-cover { position: relative; aspect-ratio: 16 / 8; background: #0b1020; overflow: hidden; }
.news-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 30% 20%, rgba(224, 180, 92, .3), transparent 60%), radial-gradient(ellipse at 80% 90%, rgba(90, 169, 255, .25), transparent 60%), linear-gradient(135deg, #16244a, #0b1226); color: var(--gold-hi); font-size: clamp(26px, 6vw, 34px); font-weight: 700; letter-spacing: .06em; text-shadow: 0 3px 0 #3d2306; }
.news-body { display: grid; gap: 6px; padding: 14px 16px 18px; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.news-body h3 { font-size: 18px; color: var(--text); }
a.news-card:hover h3 { color: var(--gold-hi); }
.news-sum { color: var(--text-2); font: 400 14.5px/1.65 var(--font-body); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-list { display: grid; gap: 14px; }
.news-list .news-card { display: grid; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .news-list .news-card { grid-template-columns: 300px 1fr; }
  .news-list .news-cover { aspect-ratio: auto; min-height: 170px; }
}
/* minmax(0, 1fr): a wide data table must scroll inside .table-wrap, not widen the article past the screen */
.article { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.article-cover { margin: calc(-1 * clamp(16px, 3vw, 24px)) calc(-1 * clamp(16px, 3vw, 24px)) 4px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; aspect-ratio: 16 / 7; background: #0b1020; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article h2 { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 20px; color: var(--gold-hi); }
.article h2::before { content: ''; width: 6px; height: 20px; border-radius: 3px; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); flex: none; }
.article .lede { color: var(--text); font: 500 16.5px/1.75 var(--font-body); }
.bullets { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font: 400 15.5px/1.7 var(--font-body); color: var(--text-2); }
.bullets li { position: relative; padding-left: 22px; }
.bullets li::before { content: ''; position: absolute; left: 4px; top: .7em; width: 7px; height: 7px; transform: rotate(45deg); background: var(--gold); border-radius: 1px; }
.pn { display: grid; gap: 10px; grid-template-columns: 1fr; margin-top: 16px; }
.pn a { display: grid; gap: 2px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--text); text-decoration: none; }
.pn a:hover { border-color: var(--line); }
.pn small { color: var(--muted); font-size: 13px; }
.pn .next { text-align: right; }
@media (min-width: 640px) { .pn { grid-template-columns: 1fr 1fr; } .pn .next { grid-column: 2; } }

/* Content blocks (guides / info) */
.blocks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; font: 400 15.5px/1.7 var(--font-body); color: var(--text-2); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #1d2a48; border: 1px solid var(--line-strong); color: var(--gold-hi); font: 700 15px var(--font); }
.keys { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.keys li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: rgba(18, 29, 54, .7); border: 1px solid var(--line-soft); color: var(--text-2); font-size: 15px; }
kbd { display: inline-grid; place-items: center; min-width: 38px; min-height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid #4a5b80; border-bottom-width: 3px; background: #22304f; color: #fff; font: 700 14px var(--font); white-space: nowrap; }
.figure { margin: 0; overflow: hidden; border-radius: 12px; border: 1px solid var(--line-soft); background: #0b1020; }
.figure img { width: 100%; height: auto; }
.figure figcaption { padding: 8px 12px; color: var(--muted); font-size: 13.5px; }
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line-soft); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.data-table th { position: sticky; top: 0; background: #16223f; color: var(--gold-hi); font-weight: 600; white-space: nowrap; }
.data-table tbody tr:nth-child(even) { background: rgba(18, 29, 54, .45); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td { min-width: 6.5em; }
.data-table td:first-child { min-width: 4.5em; }
@media (max-width: 559px) { .data-table { font-size: 14px; } .data-table th, .data-table td { padding: 9px 10px; } }
.wrap-narrow { width: min(960px, 100% - 2 * var(--gutter)); }
.guide-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.dcards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.dcard { display: grid; gap: 4px; align-content: start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(18, 29, 54, .7); }
.dcard b { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 16px; }
.dcard b i { width: 10px; height: 10px; border-radius: 50%; background: var(--ec); box-shadow: 0 0 8px var(--ec); flex: none; }
.dcard small { color: var(--muted); font-size: 13px; }
.dcard p { color: var(--text-2); font: 400 14.5px/1.6 var(--font-body); }
.data-sub { margin: 6px 0 -4px; font-size: 17px; color: var(--gold-hi); }
.dcard-ico { width: 32px; height: 32px; border-radius: 8px; image-rendering: pixelated; flex: none; }
.dcard-list { font-size: 13.5px; gap: 4px; margin-top: 4px; }
.crumbs + .state { margin-top: 14px; }

/* Home boards / trending / quick links */
.boards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.board { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel-2), var(--panel)); overflow: hidden; }
.board-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); background: rgba(224, 180, 92, .06); }
.board-head .i { color: var(--gold); }
.board-head h3 { font-size: 16.5px; color: var(--gold-hi); }
.board-head a { margin-left: auto; color: var(--muted); font-size: 13.5px; text-decoration: none; }
.board-head a:hover { color: var(--gold-hi); }
.board ol { margin: 0; padding: 6px 0; list-style: none; }
.board li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; min-height: 44px; padding: 4px 14px; }
.board li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board li span:last-child { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 14.5px; white-space: nowrap; }
.board .state { border: 0; background: none; padding: 26px 14px; }
.medal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #1d2a48; border: 1px solid #3b4b6e; color: var(--text-2); font-size: 13px; font-weight: 700; }
.medal.m1 { background: linear-gradient(180deg, #ffe7a6, #d9a03a); border-color: #ffefc2; color: #2a1604; }
.medal.m2 { background: linear-gradient(180deg, #eef2f8, #9aa6b8); border-color: #fff; color: #1b2230; }
.medal.m3 { background: linear-gradient(180deg, #f2b98a, #a8622e); border-color: #ffd4b0; color: #2a1404; }
.trend-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.trend { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel); color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.trend:hover { border-color: color-mix(in srgb, var(--rc) 60%, transparent); transform: translateY(-1px); }
.trend-text { display: grid; gap: 2px; min-width: 0; }
/* only the name truncates: the +N badge tells the sword +0 from the sword +7 */
.trend-text b, .lrow-name { display: flex; align-items: baseline; min-width: 0; }
.trend-name, .lrow-name .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-text b .enh, .lrow-name .enh { flex: none; }
.trend-text small { color: var(--muted); font-size: 13px; }
.trend-price { display: grid; justify-items: end; gap: 0; text-align: right; }
.trend-price small { color: var(--faint); font-size: 12px; white-space: nowrap; }
@media (max-width: 719px) { .trend-grid > .trend:nth-child(n+6) { display: none; } }
@media (max-width: 639px) {
  .news-grid .news-card + .news-card { display: grid; grid-template-columns: 116px 1fr; }
  .news-grid .news-card + .news-card .news-cover { aspect-ratio: auto; min-height: 100%; }
  .news-grid .news-card + .news-card .news-cover img { position: absolute; inset: 0; }
  .news-grid .news-card + .news-card .cover-fallback { font-size: 18px; }
  .news-grid .news-card + .news-card .news-body { padding: 10px 12px; gap: 4px; }
  .news-grid .news-card + .news-card h3 { font-size: 15.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .news-grid .news-card + .news-card .news-sum, .news-grid .news-card + .news-card .tags { display: none; }
}
.quick { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .quick { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .quick { grid-template-columns: repeat(6, 1fr); } }
.quick a { display: grid; justify-items: start; align-content: start; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--line-soft); background: linear-gradient(180deg, rgba(24, 38, 74, .8), rgba(14, 22, 41, .9)); color: var(--text); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.quick a:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.quick .i { width: 28px; height: 28px; color: var(--gold); }
.quick b { font-size: 16px; }
.quick small { color: var(--muted); font-size: 13px; line-height: 1.45; }

/* Tabs (link tabs + button tabs) */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 0 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font: 700 15px var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; }
.tab .i { width: 18px; height: 18px; }
.tab:hover { color: var(--gold-hi); }
.tab[aria-current="page"], .tab[aria-selected="true"] { color: #2a1604; background: linear-gradient(180deg, #ffe7a6, #e7b04c); border-color: #ffefc2; }
.tab small { font-weight: 600; font-size: 12.5px; opacity: .85; }
@media (max-width: 559px) { .tabs.fit .tab { flex: 1 1 0; justify-content: center; padding: 0 6px; gap: 6px; } }

/* Rankings */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; margin-bottom: 14px; }
.pod { display: grid; justify-items: center; gap: 4px; min-width: 0; padding: 14px 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--panel)); text-align: center; }
.pod .medal { width: 34px; height: 34px; font-size: 16px; }
.pod b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.pod small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.pod .pod-val { color: var(--gold-hi); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.pod.p1 { padding-top: 22px; border-color: var(--line-strong); background: radial-gradient(ellipse at 50% 0, rgba(255, 210, 120, .22), transparent 70%), linear-gradient(180deg, #1a2850, var(--panel)); box-shadow: 0 10px 30px rgba(240, 190, 85, .12); }
.pod.p1 .medal { width: 42px; height: 42px; font-size: 19px; }
.pod.p1 b { font-size: 17px; color: var(--gold-hi); }
@media (max-width: 420px) { .pod { padding: 12px 4px 10px; } .pod b { font-size: 14px; } .pod.p1 b { font-size: 15px; } .pod .el-chip { font-size: 12px; } }
.rank-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.rank-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 4px 12px; min-height: 60px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); }
.rank-row:last-child { border-bottom: 0; }
.rank-row:nth-child(even) { background: rgba(18, 29, 54, .5); }
.rank-no { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.rank-who { display: grid; gap: 1px; min-width: 0; }
.rank-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rank-who small { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; color: var(--muted); font-size: 13px; }
.rank-val { text-align: right; color: var(--gold-hi); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-val small { display: block; color: var(--faint); font-size: 12px; font-weight: 500; }
.updated { margin-top: 10px; color: var(--faint); font-size: 13px; text-align: right; }
.guild { color: var(--info); }

/* Forms */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { color: var(--text-2); font-size: 14.5px; font-weight: 600; }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid #34456b; background: #0b1222; color: var(--text); font: 500 16px var(--font); transition: border-color .15s ease, box-shadow .15s ease; }
.field textarea { min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.6; font-family: var(--font-body); }
.field select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224, 180, 92, .22); }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.field small { color: var(--faint); font-size: 13px; }
.field-row { display: grid; gap: 12px; }
@media (min-width: 640px) { .field-row.two { grid-template-columns: 1fr 1fr; } }
.input-ico { position: relative; }
.input-ico .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-ico input { padding-left: 44px; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-soft); background: rgba(11, 18, 34, .7); color: var(--text-2); font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--gold); cursor: pointer; }
.check:has(input:checked) { border-color: var(--line); color: var(--text); }
.form { display: grid; gap: 14px; }
.form-error { min-height: 1.4em; color: var(--bad); font-size: 14.5px; font-weight: 600; }
.form-error:empty { min-height: 0; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.counter { margin-left: auto; color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radios label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-soft); background: rgba(11, 18, 34, .7); cursor: pointer; }
.radios input { accent-color: var(--gold); width: 18px; height: 18px; }
.radios label:has(input:checked) { border-color: var(--line-strong); color: var(--gold-hi); }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 76px; }
.pass-toggle { position: absolute; right: 6px; top: 6px; min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-soft); background: #16223f; color: var(--text-2); font-size: 13.5px; cursor: pointer; }

/* Market */
.stats { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }
@media (min-width: 860px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { display: grid; gap: 2px; align-content: start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: linear-gradient(180deg, rgba(24, 38, 74, .7), rgba(14, 22, 41, .85)); min-width: 0; }
.stat small { color: var(--muted); font-size: 13px; }
.stat b { color: var(--text); font-size: clamp(18px, 3.2vw, 22px); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat b.gold { color: var(--gold-hi); }
.stat em { color: var(--faint); font-size: 12.5px; font-style: normal; }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin: 14px 0 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line-soft); background: rgba(14, 22, 41, .8); }
.filters .search { grid-column: 1 / -1; }
.filters .field > span { font-size: 13px; color: var(--muted); }
@media (min-width: 860px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr; align-items: end; } .filters .search { grid-column: auto; } }
.filters .check { min-height: 48px; align-items: center; grid-column: 1 / -1; }
@media (min-width: 860px) { .filters.has-check { grid-template-columns: 2fr 1fr 1fr auto; } .filters .check { grid-column: auto; } }
@media (max-width: 859px) {
  /* phones: the selects' first option names the filter, so the visible labels go (kept for screen readers) */
  .filters { gap: 8px; padding: 10px; }
  .filters .field > span:first-child:not(.input-ico) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .filters .field-sort { grid-column: 1 / -1; }
}
.result-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 4px 0 10px; color: var(--muted); font-size: 14px; }
.listings { display: grid; gap: 8px; transition: opacity .15s ease; }
.lrow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 68px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel); color: inherit; text-decoration: none; transition: border-color .15s ease, background .15s ease; }
a.lrow:hover { border-color: color-mix(in srgb, var(--rc) 55%, transparent); background: #111c35; }
.lrow-main { display: grid; gap: 2px; min-width: 0; }
.lrow-name { font-size: 16px; }
/* every part carries its own leading dot; the clip hides the dot of whatever starts a line (also after wrapping) */
.lrow-meta { display: flex; flex-wrap: wrap; row-gap: 2px; margin-left: -14px; clip-path: inset(-6px -6px -6px 14px); color: var(--muted); font-size: 13px; }
.lrow-meta span { min-width: 0; max-width: 100%; padding-left: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow-meta span::before { content: '·'; display: inline-block; width: 14px; margin-left: -14px; text-align: center; color: var(--faint); }
@media (min-width: 1024px) { .listings { grid-template-columns: 1fr 1fr; } .listings > .state { grid-column: 1 / -1; } }
.lrow.offer .medal { margin: 0 4px; }
.lrow-price { display: grid; justify-items: end; gap: 1px; text-align: right; }
.lrow-price small { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.lrow.is-head { min-height: 0; padding: 0 12px; border: 0; background: none; color: var(--faint); font-size: 13px; }
/* Market rows with "ซื้อในเกม": the item link stretches over the whole row, the game button sits above it */
.lrow.has-game { position: relative; grid-template-columns: auto minmax(0, 1fr) auto auto; }
.lrow.has-game:hover { border-color: color-mix(in srgb, var(--rc) 55%, transparent); background: #111c35; }
.lrow-link { color: inherit; text-decoration: none; }
.lrow-link::after { content: ''; position: absolute; inset: 0; border-radius: 12px; }
.lrow-link:focus-visible { outline: none; }
/* the ring sits on the stretched area, so it shows without :has() (older Firefox / WebViews) */
.lrow-link:focus-visible::after { outline: 3px solid var(--gold-hi); outline-offset: 3px; }
.lrow-game { position: relative; z-index: 1; }
@media (max-width: 599px) {
  .lrow.has-game { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ico main price" "ico main game"; row-gap: 6px; }
  .lrow.has-game > .ico-tile { grid-area: ico; }
  .lrow.has-game > .lrow-main { grid-area: main; }
  .lrow.has-game > .lrow-price { grid-area: price; }
  .lrow.has-game > .lrow-game { grid-area: game; justify-self: end; }
  .lrow-game { min-height: 44px; } /* phone tap target */
}
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.game-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.game-cta small { flex: 1 1 220px; color: var(--muted); font-size: 13.5px; }
.left-soon { color: var(--warn); }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; }
.pager span { min-width: 92px; text-align: center; color: var(--muted); font-size: 14.5px; font-variant-numeric: tabular-nums; }

/* Item page */
.item-hero { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 640px) { .item-hero { grid-template-columns: auto 1fr; gap: 22px; } }
.item-hero .ico-tile.is-xl { justify-self: center; }
.item-head { display: grid; gap: 8px; min-width: 0; }
.item-name { font-size: clamp(24px, 4.6vw, 34px); color: var(--rc); text-shadow: 0 2px 0 rgba(0, 0, 0, .5), 0 0 22px color-mix(in srgb, var(--rc) 30%, transparent); overflow-wrap: anywhere; outline: none; }
@media (max-width: 639px) { .item-head { justify-items: center; text-align: center; } .item-head .chips { justify-content: center; } }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 8px; background: rgba(36, 50, 79, .8); border: 1px solid #3b4b6e; color: var(--text-2); font-size: 13.5px; white-space: nowrap; }
.chip b { color: var(--text); }
.chip-ok { border-color: rgba(111, 211, 168, .5); color: var(--ok); background: rgba(111, 211, 168, .08); }
.chip-no { border-color: rgba(255, 143, 143, .45); color: var(--bad); background: rgba(255, 110, 110, .07); }
.item-desc { font: 400 15.5px/1.7 var(--font-body); color: var(--text-2); }
.item-opt { color: var(--ok); font-size: 15px; font-weight: 600; }
.item-prices { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 14px; }
.variants { margin-bottom: 12px; }
.variants .tab { min-width: 64px; justify-content: center; }
.chart-card { margin-top: 14px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -2px 0 10px; color: var(--text-2); font-size: 13.5px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend svg { width: 22px; height: 12px; }
.chart { position: relative; width: 100%; min-height: 220px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart svg:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 4px; border-radius: 6px; }
.chart-empty { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: max-content; max-width: 86%; padding: 8px 14px; border-radius: 10px; background: rgba(9, 15, 30, .9); border: 1px solid var(--line-soft); color: var(--muted); font-size: 14px; text-align: center; pointer-events: none; }
/* asks but no trades: the note sits above the plot so it never covers the ask diamonds */
.chart-empty.is-inline { position: static; transform: none; width: auto; max-width: none; margin: 0 0 8px; }
.ch-grid { stroke: rgba(164, 176, 200, .14); stroke-width: 1; }
.ch-base { stroke: rgba(164, 176, 200, .3); stroke-width: 1; }
.ch-tick { fill: #8692ab; font: 500 11.5px var(--font); font-variant-numeric: tabular-nums; }
.ch-day { fill: #c3cde0; font: 600 12.5px var(--font); }
.ch-wd { fill: #7c88a2; font: 500 11px var(--font); }
.ch-today { fill: var(--gold); }
.ch-band { fill: rgba(181, 133, 42, .2); }
.ch-bar { fill: rgba(181, 133, 42, .32); }
.ch-line { fill: none; stroke: #c9962f; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-pt { fill: #c9962f; stroke: var(--panel); stroke-width: 2; }
.ch-ask { fill: #3d8fe8; stroke: var(--panel); stroke-width: 2; }
.ch-npc { stroke: #8a96ad; stroke-width: 1.5; stroke-dasharray: 5 4; }
.ch-npc-label { fill: #a4b0c8; font: 600 11.5px var(--font); }
.ch-vol { fill: #33415f; }
.ch-vol.is-sel { fill: #56688f; }
.ch-vol-label { fill: #7c88a2; font: 500 11px var(--font); }
.ch-sel { fill: rgba(224, 180, 92, .08); stroke: rgba(224, 180, 92, .35); stroke-width: 1; }
.ch-hit { fill: transparent; cursor: pointer; }
.ch-end { fill: var(--gold-hi); font: 700 12.5px var(--font); font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--panel); stroke-width: 4px; stroke-linejoin: round; }
.lg-line { stroke: #c9962f; stroke-width: 2; }
.lg-band { fill: rgba(181, 133, 42, .35); }
.lg-ask { fill: #3d8fe8; }
.lg-npc { stroke: #8a96ad; stroke-width: 1.5; stroke-dasharray: 4 3; }
.readout { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(11, 18, 34, .8); border: 1px solid var(--line-soft); color: var(--text-2); font-size: 14px; }
.readout b { color: var(--text); }
.readout .rd-day { width: 100%; color: var(--gold-hi); font-weight: 700; }
.chart-table { margin-top: 10px; }
.chart-table summary { display: inline-flex; align-items: center; min-height: 40px; color: var(--gold); cursor: pointer; font-size: 14.5px; }
.chart-table .table-wrap { margin-top: 6px; }

/* Catalogue */
.cat-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.cat-item { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel); color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.cat-item:hover { border-color: color-mix(in srgb, var(--rc) 60%, transparent); transform: translateY(-1px); }
.cat-text { display: grid; gap: 2px; min-width: 0; }
.cat-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.cat-text small { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; color: var(--muted); font-size: 13px; }
.mk { color: var(--ok); }
.ev { color: #ffd84d; }
.more-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }

/* Login */
.auth { display: grid; place-items: center; padding: clamp(24px, 6vw, 56px) 0; }
.auth-card { width: min(440px, 100%); display: grid; gap: 16px; padding: clamp(20px, 4vw, 30px); border-radius: 18px; border: 1px solid var(--line-strong); background: radial-gradient(ellipse at 50% 0, rgba(224, 180, 92, .14), transparent 60%), linear-gradient(180deg, #14213f, var(--panel)); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 227, 163, .12); }
.auth-card .auth-logo { width: 150px; height: auto; justify-self: center; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .6)); }
.auth-card h1 { text-align: center; font-size: 24px; color: var(--gold-hi); outline: none; }
.auth-card .page-sub { text-align: center; margin: -8px auto 0; font-size: 14.5px; }
.auth-alt { text-align: center; color: var(--muted); font-size: 15px; }
.auth-alt a { font-weight: 700; }
.check.inline { padding: 0; border: 0; background: none; align-items: center; }

/* Profile */
.profile-grid { display: grid; gap: 14px; margin-top: 14px; }
.profile-grid > .panel + .panel { margin-top: 0; }
@media (min-width: 1024px) { .profile-grid { grid-template-columns: 1fr 1fr; align-items: start; } .profile-grid > .span-2 { grid-column: 1 / -1; } }
.pdpa p, .prose p, .adm-msg { overflow-wrap: anywhere; min-width: 0; }
.rank-wrap { max-width: 900px; }
.acct { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.avatar { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 16px; background: linear-gradient(180deg, #ffe7a6, #c98a2b); color: #2a1604; font-size: 28px; font-weight: 700; box-shadow: 0 6px 18px rgba(240, 190, 85, .25); }
.acct-name { font-size: 22px; color: var(--gold-hi); overflow-wrap: anywhere; outline: none; }
.acct-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 14px; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chars { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.char { display: grid; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line-soft); background: rgba(18, 29, 54, .7); }
.char-top { display: flex; align-items: center; gap: 10px; }
.char-top b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.char-slot { margin-left: auto; padding: 1px 8px; border-radius: 6px; background: #22304f; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.char-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px 12px; margin: 0; }
.char-stats div { display: grid; gap: 0; }
.char-stats dt { color: var(--faint); font-size: 12.5px; }
.char-stats dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.kv { display: grid; gap: 0; margin: 0; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.kv div { display: grid; grid-template-columns: minmax(100px, 34%) 1fr; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: 14.5px; }
.kv dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pdpa { display: grid; gap: 8px; max-height: 340px; overflow-y: auto; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(9, 15, 30, .8); font: 400 14.5px/1.7 var(--font-body); color: var(--text-2); }
.pdpa h3 { font: 700 16px var(--font); color: var(--gold-hi); }
.req-list { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 8px; }
.req { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-soft); background: rgba(18, 29, 54, .6); font-size: 14.5px; }
.req time { margin-left: auto; color: var(--faint); font-size: 13px; }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; border: 1px solid currentColor; white-space: nowrap; }
.st-open, .st-pending, .st-reserved { color: var(--warn); }
.st-done, .st-active, .st-paid, .st-sold, .st-credited { color: var(--ok); }
.st-rejected, .st-cancelled, .st-expired { color: var(--faint); }
.sub-h { margin: 18px 0 10px; font-size: 16px; color: var(--text); }

/* Top-up */
.packs { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .packs { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.pack { position: relative; display: grid; justify-items: center; gap: 6px; padding: 22px 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 0, rgba(111, 196, 255, .14), transparent 65%), linear-gradient(180deg, #15234a, var(--panel)); text-align: center; }
.pack.is-hot { border-color: var(--line-strong); box-shadow: 0 10px 30px rgba(240, 190, 85, .12); }
.pack-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); padding: 2px 12px; border-radius: 999px; background: linear-gradient(180deg, #ffe7a6, #e7b04c); color: #2a1604; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pack-gem { width: 54px; height: 54px; stroke: none; filter: drop-shadow(0 6px 12px rgba(80, 180, 255, .35)); }
.pack-amt { font-size: clamp(22px, 5vw, 28px); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.2; }
.pack-bonus { color: var(--ok); font-size: 13.5px; font-weight: 600; min-height: 1.4em; }
.pack-label { color: var(--muted); font-size: 13.5px; }
.pack-price { margin: 4px 0 6px; color: var(--gold-hi); font-size: 20px; font-weight: 700; }
.pack .btn { width: 100%; }
.orders { display: grid; gap: 8px; }
.order { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel); }
.order b { font-size: 15px; }
.order small { color: var(--muted); font-size: 13px; }

/* Dialog + toast */
.dlg { width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 16px; background: linear-gradient(180deg, #16244a, var(--panel)); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.dlg::backdrop { background: rgba(3, 6, 14, .72); }
.dlg-box { display: grid; gap: 12px; padding: 20px; }
.dlg-box h2 { font-size: 20px; color: var(--gold-hi); }
.dlg-box p { color: var(--text-2); font-size: 15px; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60; width: max-content; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px; background: #13213f; border: 1px solid var(--line-strong); color: var(--text); text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); transform: translate(-50%, 16px); opacity: 0; visibility: hidden; transition: transform .25s ease, opacity .25s ease, visibility 0s linear .25s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .25s ease, opacity .25s ease; }
.toast.toast-bad { border-color: rgba(255, 143, 143, .6); }
.toast.toast-ok { border-color: rgba(111, 211, 168, .6); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0 calc(26px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 14px; background: linear-gradient(180deg, rgba(10, 17, 34, .4), var(--bg)); }
.foot { display: grid; gap: 16px; }
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand img { width: 64px; height: auto; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px; }
.foot-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-soft); color: var(--text); text-decoration: none; }
.foot-links a:hover { border-color: var(--line-strong); color: var(--gold-hi); }
.foot-links .i { width: 18px; height: 18px; }
.foot-links .i-fill { fill: currentColor; stroke: none; }
@media (min-width: 860px) { .foot { grid-template-columns: 1fr auto; align-items: center; } }

/* Redeem codes (#/redeem). The home quick tile of it spans the row on 2-3 column grids and sits in a 7-column row on wide ones. */
.quick a.is-feature { grid-column: 1 / -1; border-color: var(--line); background: linear-gradient(180deg, rgba(58, 46, 22, .7), rgba(14, 22, 41, .92)); }
@media (min-width: 1040px) { .quick { grid-template-columns: repeat(7, 1fr); } .quick a.is-feature { grid-column: auto; } }
.panel-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.rd-grid { display: grid; gap: 14px; }
@media (min-width: 960px) { .rd-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; } }
.rd-side { display: grid; gap: 14px; }
.rd-side .panel + .panel { margin-top: 0; }
.rd-chars { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.rd-chars legend { margin-bottom: 8px; padding: 0; color: var(--text-2); font-size: 14.5px; font-weight: 600; }
@media (min-width: 560px) { .rd-chars { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
.rd-char { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(11, 18, 34, .7); cursor: pointer; }
.rd-char input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--gold); cursor: pointer; }
.rd-char:has(input:checked) { border-color: var(--line-strong); background: rgba(40, 52, 88, .6); }
.rd-char-body { display: grid; gap: 4px; min-width: 0; }
.rd-char-body b { color: var(--text); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-char-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.rd-online { justify-self: start; padding: 1px 9px; border-radius: 999px; border: 1px solid rgba(111, 211, 168, .55); color: var(--ok); font-size: 12.5px; }
.rd-char.is-online { border-style: dashed; }
.rd-char.is-online .rd-char-body b { color: var(--text-2); }
.notice .btn-tiny { margin-top: 8px; }
.form input[name="code"] { font-family: 'Chakra Petch', monospace; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.form input[name="code"]::placeholder { letter-spacing: .02em; text-transform: none; font-weight: 500; }
.rd-result:empty { display: none; }
.rd-result { margin-top: 16px; }
.rd-success { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; padding: 16px; border-radius: 14px; border: 1px solid rgba(111, 211, 168, .5); background: linear-gradient(135deg, rgba(30, 72, 54, .45), rgba(14, 22, 41, .9)); }
.rd-success h2 { color: var(--gold-hi); font-size: 18px; }
.rd-success .rd-success-ico { width: 36px; height: 36px; color: var(--ok); }
.rd-rewards { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.rd-rewards li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--text); }
.rd-rewards .tag { margin-left: 6px; }
.rd-history-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rd-history-list li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-soft); background: rgba(11, 18, 34, .6); }
.rd-history-list span { color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; }
.rd-history-list small { color: var(--faint); font-size: 12.5px; }
.rd-code { color: var(--gold-hi); font-family: 'Chakra Petch', monospace; letter-spacing: .06em; }
.rd-tips { display: grid; gap: 6px; margin: 0; padding-left: 20px; color: var(--text-2); font-size: 14.5px; }

/* ---------- portal-admin ---------- */
html.adm { visibility: hidden; }
html.adm.adm-ok { visibility: visible; }
.adm body { background: #070b16; }
.adm-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 var(--gutter); background: rgba(7, 11, 22, .95); border-bottom: 1px solid var(--line); }
.adm-bar h1 { font-size: 17px; color: var(--gold-hi); }
.adm-bar h1 small { margin-left: 8px; color: var(--muted); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
@media (max-width: 479px) { .adm-bar h1 small { display: none; } }
.adm-bar .btn { margin-left: auto; }
.adm-main { width: min(1280px, 100% - 2 * var(--gutter)); margin: 0 auto; padding: 18px 0 48px; }
.adm-login { display: grid; place-items: center; min-height: 100svh; padding: 24px var(--gutter); }
.adm-login .auth-card h1 { font-size: 22px; }
.adm-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 14px; }
.adm-tools .field { flex: 1 1 200px; }
.adm-tools .field.narrow { flex: 0 1 180px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th, .adm-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.adm-table th { background: #16223f; color: var(--gold-hi); font-weight: 600; white-space: nowrap; }
.adm-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-table tr.is-open td { background: rgba(224, 180, 92, .07); }
.adm-table .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-table small { color: var(--faint); }
.adm-detail { margin-top: 14px; }
/* minmax(0, ...): the package table scrolls inside its wrapper instead of widening the settings form on phones */
.adm-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 900px) { .adm-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.adm-flags { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.adm-nums { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.adm-packs input { min-height: 40px; padding: 0 8px; font-size: 14px; min-width: 72px; }
.adm-note { color: var(--faint); font-size: 13.5px; }
.adm-msg { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-body); color: var(--text-2); }
.adm-hist { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }
.adm-save { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 0; background: linear-gradient(180deg, rgba(7, 11, 22, 0), var(--bg) 30%); }
