/* THE SALTY MAN — SALTY BLUEVERSE. Tokens and rules: DESIGN.md. Light is the default; dark = [data-theme="dark"]. */

@font-face { font-family: "Kanit"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/kanit-thai-400.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/kanit-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/fonts/kanit-thai-600.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/fonts/kanit-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("/assets/fonts/kanit-thai-800.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("/assets/fonts/kanit-latin-800.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Kanit"; font-style: italic; font-weight: 800; font-display: swap;
  src: url("/assets/fonts/kanit-thai-800i.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Kanit"; font-style: italic; font-weight: 800; font-display: swap;
  src: url("/assets/fonts/kanit-latin-800i.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* brand (style guide) */
  --sky: #73aeff;
  --royal: #2458f5;
  --deep: #10265c;
  --navy: #0a1538;
  --ice: #f4f8ff;
  --white: #fff;
  --gold: #ffd23f;
  --gold-edge: #d9a300;
  --royal-edge: #1638b0;

  /* roles: light */
  --text: #14254a;
  --muted: #4a5b80;
  --line: #d3e1fb;
  --surface: #fff;
  --surface-2: #eef4ff;
  --field: #f6f9ff;
  --field-line: #c9d8f5;
  --panel-light: rgb(255 255 255 / 94%);
  --panel-light-line: #fff;
  --panel-blue: linear-gradient(155deg, #10265c 0%, #173c9f 58%, #2458f5 100%);
  --panel-blue-line: rgb(115 174 255 / 45%);
  --on-blue-muted: #e6eeff;
  --action: var(--royal);
  --focus: #10265c;
  --ok: #0e7038;
  --ok-soft: #dcf5e6;
  --danger: #d33a40;
  --danger-soft: #ffe3e4;
  --page:
    linear-gradient(180deg, #4d8dff 0, #73aeff 560px, #b9d5ff 1200px, #dce9ff 2000px, #eef4ff 100%);
  --hero-sky: linear-gradient(180deg, #1d4fe6 0%, #2e66f6 55%, #4f8cff 100%);
  --icon-a: #2458f5;
  --shadow: 0 10px 24px rgb(16 38 92 / 14%);
  --shadow-lift: 0 18px 36px rgb(16 38 92 / 24%);
  --bg: #f4f8ff;
  --elevated: #eef4ff;
  --heading: #10265c;
  --placeholder: #5d6d93;
  --topbar-bg: rgb(255 255 255 / 94%);
  --topbar-bg-scrolled: rgb(255 255 255 / 80%);
  --topbar-line: #fff;
  --icon-btn-ink: #10265c;
  --btn2-bg: #fff;
  --btn2-ink: #10265c;
  --btn2-ring: #2458f5;
  --btn2-edge: #b9cdf7;
  --card-line: #c9dcff;
  --card-hover-line: #2458f5;
  --card-glow: 0 18px 36px rgb(16 38 92 / 24%);
  --hero-glow: rgb(255 255 255 / 55%);
  --brand-card-bg: linear-gradient(135deg, #10265c, #2458f5 70%, #73aeff);
  --footer-bg: #0a1538;
  --footer-line: #2458f5;
  --demo-tint: rgb(255 210 63 / 18%);
  --price-row: rgb(255 210 63 / 22%);

  --font: "Kanit", "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  --r-panel: 24px;
  --r-card: 16px;
  --r-ctl: 12px;
  --gutter: 16px;
  --topbar-h: 76px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  /* True dark gaming theme (user brief): near-black + deep navy, royal-blue interaction, gold accents only */
  --bg: #080d1b;
  --bg-2: #0d1630;
  --surface: #121d38;          /* cards */
  --elevated: #19284a;         /* raised: chips, tabs, inner rows */
  --surface-2: #19284a;
  --line: #2b3d63;
  --text: #f5f8ff;
  --heading: #f5f8ff;
  --muted: #a8bcea;
  --placeholder: #8fa5d6;
  --field: #0d1630;
  --field-line: #2b3d63;
  --action: #82aaff;           /* highlight blue: links, focus borders, small accents */
  --focus: #ffd23f;
  --ok: #4ade80;
  --ok-soft: rgb(74 222 128 / 12%);
  --danger: #ff8a8f;
  --danger-soft: rgb(255 138 143 / 12%);
  --on-blue-muted: #a8bcea;
  --panel-light: #0d1630;
  --panel-light-line: #2b3d63;
  --panel-blue:
    radial-gradient(900px 320px at 0% 0%, rgb(36 88 245 / 22%), transparent 70%),
    linear-gradient(160deg, #0d1630 0%, #0f1b3c 60%, #13224a 100%);
  --panel-blue-line: #2b3d63;
  --page:
    radial-gradient(1200px 600px at 75% 0%, rgb(36 88 245 / 16%), transparent 70%),
    linear-gradient(180deg, #080d1b 0, #0b1226 1200px, #080d1b 100%);
  --hero-sky:
    radial-gradient(ellipse 55% 70% at 72% 38%, rgb(36 88 245 / 42%), transparent 70%),
    radial-gradient(ellipse 40% 40% at 15% 90%, rgb(130 170 255 / 10%), transparent 70%),
    linear-gradient(180deg, #04070f 0%, #080d1b 45%, #0d1630 100%);
  --icon-a: #4c7bff;
  --shadow: 0 10px 24px rgb(0 0 0 / 45%);
  --shadow-lift: 0 18px 36px rgb(0 0 0 / 55%);
  --topbar-bg: rgb(8 13 27 / 90%);
  --topbar-bg-scrolled: rgb(8 13 27 / 72%);
  --topbar-line: #2b3d63;
  --icon-btn-ink: #ffd23f;
  --btn2-bg: #19284a;
  --btn2-ink: #f5f8ff;
  --btn2-ring: #82aaff;
  --btn2-edge: #04070f;
  --card-line: #2b3d63;
  --card-hover-line: #4c7bff;
  --card-glow: 0 0 0 1px rgb(36 88 245 / 55%), 0 16px 34px rgb(36 88 245 / 22%), 0 18px 36px rgb(0 0 0 / 50%);
  --hero-glow: rgb(36 88 245 / 50%);
  --brand-card-bg:
    radial-gradient(500px 260px at 85% 40%, rgb(36 88 245 / 40%), transparent 70%),
    linear-gradient(135deg, #0d1630, #121d38);
  --footer-bg: #04070f;
  --footer-line: #2b3d63;
  --demo-tint: rgb(255 210 63 / 9%);
  --price-row: rgb(255 210 63 / 10%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font: 400 1rem/1.65 var(--font); color: var(--text);
  background: var(--ice); background-image: var(--page);
  caret-color: var(--action);
  scrollbar-color: var(--action) var(--surface-2);
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] body { background-color: var(--bg); }
::selection { background: var(--gold); color: #14254a; }
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.hero :focus-visible, .panel-blue :focus-visible, .footer :focus-visible, .brand-card :focus-visible { --focus: #ffd23f; }
.panel-blue .card :focus-visible { --focus: #10265c; }
:root[data-theme="dark"] .panel-blue .card :focus-visible { --focus: #ffd23f; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.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; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 10px; background: var(--gold); color: #14254a; font-weight: 600; text-decoration: none; }
.skip:focus { top: 10px; }
.wrap { width: min(1240px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.muted { color: var(--muted); }
.loading, .empty { color: var(--muted); padding: 24px 0; }
.panel-blue .loading, .panel-blue .empty { color: var(--on-blue-muted); }
.notice { padding: 12px 16px; border-radius: var(--r-ctl); background: var(--surface-2); border: 1px solid var(--line); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.i { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- buttons ---------- */
.btn {
  --edge: var(--gold-edge);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .55em 1.25em; border: 0; border-radius: 14px;
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: 0 4px 0 var(--edge), 0 10px 18px rgb(16 38 92 / 22%);
  transition: transform .15s ease-out, box-shadow .15s ease-out, background-color .15s;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 0 var(--edge), 0 14px 24px rgb(16 38 92 / 26%); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge), 0 4px 10px rgb(16 38 92 / 22%); }
.btn:disabled { cursor: not-allowed; opacity: .6; transform: none; }
.btn .i-go { transition: transform .2s; }
.btn:hover .i-go { transform: translateX(4px); }
.btn-gold { background: var(--gold); color: #14254a; }
.btn-blue { --edge: var(--royal-edge); background: var(--royal); color: #fff; }
.btn-white { --edge: var(--btn2-edge); background: var(--btn2-bg); color: var(--btn2-ink); box-shadow: inset 0 0 0 2px var(--btn2-ring), 0 4px 0 var(--edge), 0 10px 18px rgb(16 38 92 / 18%); }
.btn-white:hover { box-shadow: inset 0 0 0 2px var(--btn2-ring), 0 6px 0 var(--edge), 0 14px 24px rgb(16 38 92 / 22%); }
.btn-white .i-play { color: var(--btn2-ring); width: 1.5em; height: 1.5em; }
.btn-lg { font-size: clamp(1.1rem, 2vw, 1.35rem); min-height: 56px; padding: .6em 1.5em; border-radius: 16px; }
.btn-sm { min-height: 40px; padding: .4em 1em; font-size: .95rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn.is-loading .btn-label::after { content: ""; display: inline-block; width: .9em; height: .9em; margin-left: .5em; vertical-align: -.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px;
  background: var(--surface-2); color: var(--icon-btn-ink); cursor: pointer; transition: background-color .18s, transform .18s;
}
.icon-btn:hover { background: var(--line); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; padding-top: 10px; }
.topbar-inner {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 8px 8px 16px;
  border-radius: 18px; background: var(--topbar-bg); border: 2px solid var(--topbar-line);
  box-shadow: 0 10px 28px rgb(16 38 92 / 22%);
  transition: background-color .25s, backdrop-filter .25s;
}
.topbar.is-scrolled .topbar-inner { background: var(--topbar-bg-scrolled); backdrop-filter: blur(12px) saturate(1.3); }

.logo { display: inline-flex; align-items: center; text-decoration: none; line-height: 1; flex: none; margin: 0; }
.logo-img { display: block; height: 52px; width: auto; }
.logo-img.on-dark, :root[data-theme="dark"] .logo-img.on-light { display: none; }
:root[data-theme="dark"] .logo-img.on-dark { display: block; }

.nav { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.nav a {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px;
  color: var(--heading); font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color .18s;
}
.nav a:hover { background: var(--surface-2); }
.nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 3px; border-radius: 3px;
  background: var(--gold); transform: scaleX(0); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.nav a.is-active::after { transform: scaleX(1); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.theme-btn .i-moon, :root[data-theme="dark"] .theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: block; }
.menu-btn { display: none; }

.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #9fb2d6; flex: none; }
.live-dot.is-on { background: #22c55e; box-shadow: 0 0 0 0 rgb(34 197 94 / 60%); }

@media (max-width: 1023px) {
  .menu-btn { display: inline-grid; }
  .nav {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); display: none; flex-direction: column; align-items: stretch;
    padding: 8px; border-radius: 16px; background: var(--surface); border: 2px solid var(--panel-light-line); box-shadow: var(--shadow-lift);
  }
  .topbar.is-open .nav { display: flex; }
  .nav a { padding: 12px 14px; }
  .nav a::after { left: 14px; right: auto; width: 28px; }
}
@media (max-width: 479px) {
  .topbar-inner { padding-left: 12px; gap: 6px; }
  .logo-img { height: 38px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn-sm { padding-inline: .8em; }
}
@media (max-width: 389px) {
  .logo-img { height: 32px; }
  .icon-btn { width: 40px; height: 40px; }
  .topbar-actions .btn-sm .i { display: none; }
}

/* ---------- hero ---------- */
.hero { --hero-pb: 72px; position: relative; margin-top: calc(-1 * var(--topbar-h) - 10px); padding: calc(var(--topbar-h) + 40px) 0 var(--hero-pb); overflow: hidden; isolation: isolate; }
.hero-grid { min-height: 520px; }
/* layered scene (shop asset pack): sky → far city → near city, day/night pairs cross-fade with the theme */
.hero-world { position: absolute; inset: 0; z-index: -1; background: var(--hero-sky); }
.scene { position: absolute; opacity: 0; transition: opacity .35s ease; pointer-events: none; }
:root:not([data-theme="dark"]) .scene[data-scene="day"], :root[data-theme="dark"] .scene[data-scene="night"] { opacity: 1; }
.scene.sky { inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 0; }
.scene-layer { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; pointer-events: none; }
/* cities: anchored to the bottom edge at their own aspect ratio, never stretched */
.scene.city { left: 50%; bottom: 0; width: max(100%, 1180px); height: auto; transform: translateX(-50%); }
.layer-far .scene.city { bottom: 10px; opacity: 0; }
:root:not([data-theme="dark"]) .layer-far .scene[data-scene="day"] { opacity: .9; }
.hero-noob { position: absolute; left: max(8px, calc(50% - 720px)); bottom: -28px; width: 128px; height: auto; transform: rotate(4deg); filter: drop-shadow(0 8px 10px rgb(4 7 15 / 35%)); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 24px; }
.hero-copy { position: relative; z-index: 2; display: grid; gap: 18px; justify-items: start; }

.display { padding-left: .08em; font-style: italic; font-weight: 800; font-size: clamp(2.5rem, 6vw, 5.2rem); line-height: 1; letter-spacing: -.01em; }
.d-line {
  display: block; color: #fff; line-height: 1.18;
  -webkit-text-stroke: .16em var(--deep); paint-order: stroke fill;
  text-shadow: 0 .09em 0 var(--deep), 0 .2em .3em rgb(10 21 56 / 35%);
}
.d-2 { position: relative; display: inline-flex; align-items: center; gap: .1em; font-size: 1.42em; line-height: 1.05; color: var(--gold); margin-block: -.05em; }
.d-3 { font-size: .64em; }
.d-star { width: .62em; height: .62em; flex: none; transform: rotate(-12deg); }
.d-crown { position: absolute; right: -.15em; top: -.32em; width: .5em; height: .42em; transform: rotate(14deg); }
/* 1.2rem/600 counts as large text (3:1); it sits on the mid sky (4.8:1) on desktop, the lower sky (3.2:1) on phones */
.lead { max-width: 30em; color: #fff; font-size: 1.2rem; font-weight: 600; line-height: 1.5; text-shadow: 0 1px 2px rgb(10 21 56 / 55%); }
.trust { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.trust li {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 8px; border-radius: 999px;
  background: rgb(16 38 92 / 72%); color: #fff; font-weight: 600; font-size: .95rem; border: 1.5px solid rgb(255 255 255 / 35%);
}
.trust svg { width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: #22c55e; color: #fff; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }

.hero-art { position: relative; align-self: stretch; min-height: 440px; }
/* light behind the mascot (code layer, no rim-light asset yet): white bloom by day, royal-blue light at night */
.hero-art::before {
  content: ""; position: absolute; inset: -10% -14% -18% -4%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side at 58% 52%, var(--hero-glow), transparent);
}
/* mascot: true-alpha PNG, sized by height and standing on the hero's bottom edge (the art ends at the legs) */
.hero-media { position: absolute; right: -1%; bottom: calc(-1 * var(--hero-pb)); height: clamp(480px, 46vw, 640px); aspect-ratio: 1122 / 1402; }
.mascot, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
/* the art is shown whole: the left sleeve keeps its own outline (no edge fade) */
/* shadow on the wrapper, so it is cast by the already-masked art (on the img itself Chrome draws a seam) */
.hero-media { filter: drop-shadow(0 18px 28px rgb(4 7 15 / 30%)); }
.hero-video { object-fit: cover; }
.props { position: absolute; inset: 0; pointer-events: none; }
.prop { position: absolute; }
.sticker img { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 8px rgb(4 7 15 / 30%)); }
.p1 { right: 2%; top: -6%; width: 78px; transform: rotate(12deg); }
.p2 { left: 6%; top: 4%; width: 54px; transform: rotate(-10deg); }
.p3 { right: 34%; bottom: 10%; width: 34px; }
.p4 { left: -4%; bottom: 30%; width: 40px; transform: rotate(8deg); }
.cube {
  width: 42px; height: 42px; border-radius: 8px; border: 3px solid var(--deep);
  background: linear-gradient(135deg, #73aeff 0 48%, #2458f5 48% 100%);
  box-shadow: inset 0 0 0 4px rgb(255 255 255 / 25%), 0 6px 8px rgb(4 7 15 / 25%);
}
.p6 { left: 14%; bottom: 4%; transform: rotate(-14deg); }
.p7 { right: 40%; top: -4%; width: 28px; height: 28px; transform: rotate(20deg); }
:root[data-theme="dark"] .cube { border-color: #04070f; background: linear-gradient(135deg, #4c7bff 0 48%, #1a3a9e 48% 100%); }
:root[data-theme="dark"] .sticker img { filter: drop-shadow(0 6px 10px rgb(0 0 0 / 55%)) brightness(.95); }

/* short glints on the gold stickers: a 4-point sparkle that flashes once every few seconds */
.glint { position: absolute; left: 62%; top: 18%; width: 30%; aspect-ratio: 1; transform: scale(0); pointer-events: none;
  background: radial-gradient(closest-side, #fff 0 18%, transparent 19%), conic-gradient(from 45deg, transparent 0 20deg, #fff 22deg 24deg, transparent 26deg 110deg, #fff 112deg 114deg, transparent 116deg 200deg, #fff 202deg 204deg, transparent 206deg 290deg, #fff 292deg 294deg, transparent 296deg);
  mask-image: radial-gradient(closest-side, #000 40%, transparent); }

@media (prefers-reduced-motion: no-preference) {
  .glint { animation: glint 6.5s ease-out infinite; }
  .p2 .glint { animation-delay: 2.2s; animation-duration: 7.4s; }
  .p4 .glint { animation-delay: 4.1s; animation-duration: 8.2s; }
  :root[data-theme="dark"] .hero-art::before { animation: glow-breathe 6.5s ease-in-out infinite alternate; }
  .live-dot.is-on { animation: ping 1.8s ease-out infinite; }
}
@keyframes glint { 0%, 90% { transform: scale(0) rotate(0); opacity: 0; } 94% { transform: scale(1) rotate(25deg); opacity: 1; } 100% { transform: scale(0) rotate(45deg); opacity: 0; } }
@keyframes glow-breathe { from { opacity: .62; } to { opacity: 1; } }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 8px rgb(34 197 94 / 0%); } }
/* motion.js marks sections that are off screen (or a hidden tab): CSS loops pause there */
.is-offscreen *, .is-offscreen *::before, .is-offscreen *::after, .tab-hidden * { animation-play-state: paused !important; }

@media (max-width: 899px) {
  .hero { --hero-pb: 36px; padding-top: calc(var(--topbar-h) + 18px); }
  .hero-grid { min-height: 0; grid-template-columns: 1fr; gap: 0; }
  .hero-noob { width: 88px; left: -10px; bottom: -18px; }
  .hero-art { order: -1; min-height: 0; height: min(108vw, 470px); margin-inline: calc(-1 * var(--gutter)); }
  .hero-media { right: 50%; bottom: 0; height: 100%; transform: translateX(50%); }
  /* the art stops at the legs: fade that edge into the headline below */
  .mascot { mask-image: linear-gradient(#000 68%, transparent 90%); }
  .hero-copy { margin-top: -34px; justify-items: center; text-align: center; }
  .trust { justify-content: center; }
  .hero-cta { justify-content: center; width: 100%; }
  .p1 { right: 6%; top: 2%; width: 60px; }
  .p2 { left: 6%; top: 6%; width: 42px; }
  .p3, .p7 { display: none; }
  .p4 { left: 4%; bottom: 34%; width: 32px; }
  .p6 { left: auto; right: 6%; bottom: 22%; width: 34px; height: 34px; }
}
@media (max-width: 479px) {
  .hero-cta .btn { flex: 1 1 100%; }
  .trust li { font-size: .88rem; }
}

/* ---------- sections + panels ---------- */
.section { position: relative; padding: 14px 0; }
.section-last { padding-bottom: 40px; }
.panel { position: relative; border-radius: var(--r-panel); padding: clamp(16px, 2.6vw, 26px); }
.panel-light { background: var(--panel-light); border: 2px solid var(--panel-light-line); box-shadow: 0 18px 40px rgb(16 38 92 / 16%); }
.panel-blue { background: var(--panel-blue); border: 2px solid var(--panel-blue-line); color: #fff; box-shadow: 0 18px 40px rgb(10 21 56 / 30%); }
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.section-icon { width: 52px; height: 52px; flex: none; filter: drop-shadow(0 3px 0 rgb(10 21 56 / 25%)); }
.section-head h2, .box-title { font-style: italic; font-weight: 800; font-size: clamp(1.45rem, 3vw, 2.05rem); color: var(--heading); line-height: 1.2; }
.section-head p { color: var(--muted); font-size: .98rem; }
.panel-blue .section-head h2 { color: #fff; text-shadow: 0 3px 0 rgb(10 21 56 / 60%); }
.panel-blue .section-head p { color: var(--on-blue-muted); }
/* sticker accents on panel corners (style guide: crowns + stars) */
.deco { position: absolute; z-index: 1; pointer-events: none; filter: drop-shadow(0 4px 0 rgb(10 21 56 / 25%)); }
.deco-crown { top: -22px; right: 28px; width: 58px; height: 48px; transform: rotate(12deg); }
.deco-star-a { top: -18px; left: -12px; width: 46px; height: 46px; transform: rotate(-14deg); }
.deco-star-b { bottom: 22px; right: -14px; width: 34px; height: 34px; transform: rotate(18deg); }
.deco-star-c { top: -16px; right: 40px; width: 38px; height: 38px; transform: rotate(10deg); }
@media (max-width: 599px) { .deco-crown { width: 44px; height: 36px; top: -16px; } .deco-star-a { width: 34px; height: 34px; left: -6px; } .deco-star-b { right: -6px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); color: var(--text); }

/* price pill: gold = money */
.price-pill {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 10px;
  background: var(--gold); color: #14254a; font-weight: 600; font-size: .9rem; line-height: 1.2; white-space: nowrap;
  font-variant-numeric: tabular-nums; box-shadow: inset 0 -3px 0 rgb(217 163 0 / 55%);
}
.price-pill strong { font-size: 1.35em; font-weight: 800; font-style: italic; }
.price-pill.is-quote { font-weight: 800; font-style: italic; }

/* ---------- games ---------- */
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 18px); }
@media (min-width: 1000px) { .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* a single game: one centred card instead of a lone quarter-width column */
.game-grid:has(> .game:only-child) { grid-template-columns: minmax(0, 420px); justify-content: center; }
.game {
  --game: var(--royal);
  display: flex; flex-direction: column; gap: 10px; padding: 8px 8px 12px;
  background: var(--surface); border: 2px solid var(--card-line); border-radius: 18px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%), var(--shadow);
  transition: transform .16s ease-out, box-shadow .16s ease-out, border-color .16s ease-out;
}
.game:hover, .game:focus-within { transform: translateY(-3px) scale(1.02); box-shadow: var(--card-glow); border-color: var(--card-hover-line); }
.game:active { transform: translateY(-1px) scale(1.01); }
.game-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 12px; background: var(--surface-2); }
.game-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.game:hover .game-cover img { transform: scale(1.06); }
.game-cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 -40px 30px -20px rgb(10 21 56 / 35%); }
.game-body { display: grid; gap: 2px; padding-inline: 4px; text-align: center; }
.game h3 { font-weight: 800; font-size: clamp(1rem, 1.5vw, 1.12rem); color: var(--heading); }
.game-desc { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.game-link { justify-self: center; display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--action); font-size: .85rem; font-weight: 600; text-decoration: none; }
.game-link:hover { text-decoration: underline; }
.game-link svg { width: 14px; height: 14px; }
.game-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: auto; padding-inline: 4px; }
.game-foot .btn { flex: 1 1 auto; }
@media (max-width: 599px) {
  .game-desc { display: none; }
  .game-foot { flex-direction: column; align-items: stretch; }
  .game-foot .price-pill { justify-content: center; }
  .game-foot .btn { min-height: 40px; font-size: .92rem; padding-inline: .6em; }
}

/* ---------- live dashboard ---------- */
.live-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.live-stat { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 12px; border-radius: 999px; background: rgb(255 255 255 / 12%); border: 1px solid rgb(255 255 255 / 20%); font-size: .9rem; }
.live-stat dt { color: var(--on-blue-muted); }
.live-stat dd { margin: 0; font-weight: 600; }
.live-stat.is-on dd { color: #86efac; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.live-card {
  --game: var(--royal);
  display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px;
  background: var(--surface); color: var(--text); border-radius: var(--r-card); border: 1px solid var(--line); box-shadow: 0 8px 18px rgb(5 12 38 / 30%);
}
a.live-card.is-link { color: var(--text); text-decoration: none; cursor: pointer; transition: transform .16s ease-out, box-shadow .16s ease-out, border-color .16s; }
a.live-card.is-link:hover, a.live-card.is-link:focus-visible { transform: translateY(-3px); border-color: var(--card-hover-line); box-shadow: var(--card-glow); }
a.live-card.is-link .live-top h3::after { content: " ›"; color: var(--gold); }
.live-3d { position: absolute; bottom: 4px; right: 4px; z-index: 2; padding: 1px 7px; border-radius: 999px; background: #0a1538; color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .04em; border: 1px solid rgb(255 255 255 / 40%); }
.live-hint { margin: -6px 0 12px; font-size: .85rem; color: var(--on-blue-muted); }
.live-avatar { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: linear-gradient(180deg, #cfe2ff, #fff); border: 2px solid var(--line); }
:root[data-theme="dark"] .live-avatar { filter: saturate(.9) brightness(.92); }
.live-avatar[data-scene="egg"] { background: linear-gradient(180deg, #fff1b8, #ffd23f); }
.live-avatar[data-scene="anime"] { background: linear-gradient(180deg, #c9d8ff, #6f8fff); }
.live-avatar[data-scene="garden"] { background: linear-gradient(180deg, #d7f7d9, #7fd18a); }
.live-avatar[data-scene="ants"] { background: linear-gradient(180deg, #ffe0c2, #e8935a); }
.live-avatar[data-scene="sea"] { background: linear-gradient(180deg, #cfe8ff, #4f9bff); }
.live-avatar[data-scene="pets"] { background: linear-gradient(180deg, #e6dcff, #a993ff); }
.live-avatar .rbx { position: absolute; left: 50%; bottom: -4px; width: 64px; height: 86px; transform: translateX(-50%); }
.live-avatar .rbx-img { width: 120%; height: 120%; max-width: none; left: 50%; bottom: -14%; object-fit: contain; }
.live-body { display: grid; gap: 4px; min-width: 0; }
.live-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.live-top { flex-wrap: wrap; row-gap: 2px; }
.live-top h3 { font-size: 1rem; font-weight: 600; white-space: nowrap; }
.live-badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.live-badge.is-done { background: var(--surface-2); color: var(--action); }
.live-badge:is([data-s="pending"], [data-s="starting"], [data-s="paused"]) { background: var(--surface-2); color: var(--muted); }
.live-badge:is([data-s="slow"], [data-s="lost"]) { background: rgb(255 210 63 / 26%); color: #7a4b00; }
:root[data-theme="dark"] .live-badge:is([data-s="slow"], [data-s="lost"]) { background: rgb(255 210 63 / 16%); color: #ffd98a; }
.live-badge:is([data-s="slow"], [data-s="lost"]) .live-dot { background: #f0a020; }
.live-silent { margin: 2px 0 0; padding-left: 8px; border-left: 3px solid #f0a020; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.live-badge.is-done .live-dot { background: var(--action); animation: none; }
.live-game { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-uid { font-size: .82rem; color: var(--muted); }
.live-uid strong { color: var(--text); font-variant-numeric: tabular-nums; }
.live-progress { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.live-bar { flex: 1; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.live-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--royal), var(--sky)); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.live-bar.is-indeterminate span { width: 100% !important; background: repeating-linear-gradient(-45deg, var(--royal) 0 10px, var(--sky) 10px 20px); background-size: 28px 28px; opacity: .55; }
@media (prefers-reduced-motion: no-preference) { .live-bar.is-indeterminate span { animation: stripes 1s linear infinite; } }
@keyframes stripes { to { background-position: 28px 0; } }
.live-pct { font-weight: 600; font-size: .88rem; font-variant-numeric: tabular-nums; }
.live-meta { display: flex; gap: 12px; margin: 0; font-size: .86rem; color: var(--muted); }
.live-meta div { display: flex; gap: 4px; }
.live-meta dd { margin: 0; color: var(--text); font-weight: 600; }
.live-loot { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; padding: 0; list-style: none; }
.live-loot li { padding: 1px 8px; border-radius: 8px; background: var(--surface-2); font-size: .84rem; }
.live-loot strong { color: var(--action); margin-right: 3px; }
.live-pop {
  position: absolute; left: 50%; top: 8px; z-index: 2; padding: 0 6px; border-radius: 6px; background: var(--gold); color: #14254a;
  font-size: .7rem; font-weight: 600; white-space: nowrap; transform: translateX(-50%); animation: pop 2.2s ease-out forwards; pointer-events: none;
}
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -14px); } }
.live-more { margin-top: 14px; }
.live-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.nav-ext { width: .85em; height: .85em; opacity: .6; }
.live-demo { margin-bottom: 12px; background: var(--demo-tint); border-color: rgb(255 210 63 / 45%); color: #fff; }
.live-empty { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; padding: 16px; }
.live-empty .live-avatar .rbx { width: 72px; height: 96px; }
.live-empty-copy { display: grid; gap: 8px; justify-items: start; }
.live-empty-copy h3 { font-size: 1.1rem; }
@media (max-width: 479px) { .live-empty { grid-template-columns: 72px 1fr; } }

/* blocky avatar parts (live.js); origins in SVG user units */
.rbx-shadow { fill: rgb(10 21 56 / 25%); }
.rbx-arm-l, .rbx-arm-r, .rbx-body, .rbx-head { transform-box: view-box; }
.rbx-arm-l { transform-origin: 30px 60px; }
.rbx-arm-r { transform-origin: 90px 60px; }
.rbx-head { transform-origin: 60px 54px; }
@media (prefers-reduced-motion: no-preference) {
  .live-card:not(.is-done, .is-still) .rbx-body { animation: rbx-bob .55s ease-in-out infinite alternate; }
  .live-card:not(.is-done, .is-still) .rbx-arm-r { animation: rbx-swing 1.1s cubic-bezier(.5, 0, .3, 1) infinite; }
  .live-card:not(.is-done, .is-still) .rbx-arm-l { animation: rbx-counter 1.1s ease-in-out infinite; }
  .live-card.is-done .rbx-arm-r { animation: rbx-cheer 1.4s ease-in-out infinite alternate; }
  .live-empty .rbx-arm-r { animation: rbx-wave 1.6s ease-in-out infinite; }
  .rbx-glow { animation: rbx-glow 1.1s ease-in-out infinite alternate; }
}
@keyframes rbx-bob { to { transform: translateY(-2px); } }
@keyframes rbx-swing { 0%, 100% { transform: rotate(14deg); } 45% { transform: rotate(-120deg); } 60% { transform: rotate(-125deg); } }
@keyframes rbx-counter { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(18deg); } }
@keyframes rbx-cheer { from { transform: rotate(-150deg); } to { transform: rotate(-170deg); } }
@keyframes rbx-wave { 0%, 100% { transform: rotate(-150deg); } 50% { transform: rotate(-175deg); } }
@keyframes rbx-glow { to { opacity: .8; } }

/* ---------- packages ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin: 0 0 16px; border-radius: 14px; background: var(--surface-2); width: fit-content; max-width: 100%; scrollbar-width: thin; }
.tab { flex: none; min-height: 40px; padding: 6px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; transition: background-color .18s, color .18s; }
.tab:hover { color: var(--text); }
.tab[aria-pressed="true"] { background: var(--royal); color: #fff; box-shadow: 0 3px 0 var(--royal-edge); }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pkg {
  --game: var(--royal);
  position: relative; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 12px;
  background: var(--surface); border: 2px solid var(--card-line); border-radius: var(--r-card); box-shadow: var(--shadow);
  transition: transform .16s ease-out, box-shadow .16s ease-out, border-color .16s ease-out;
}
.pkg:hover, .pkg:focus-within { transform: translateY(-3px); box-shadow: var(--card-glow); border-color: var(--card-hover-line); }
.pkg.is-popular { border-color: var(--gold); }
.pkg-thumb { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.pkg-body { display: grid; gap: 4px; align-content: start; }
.pkg-game { color: var(--muted); font-size: .85rem; font-weight: 600; }
.pkg h3 { font-size: 1.02rem; font-weight: 600; }
.badge { position: absolute; top: -10px; right: 12px; padding: 1px 10px; border-radius: 999px; background: var(--gold); color: #14254a; font-size: .78rem; font-weight: 600; box-shadow: 0 3px 0 var(--gold-edge); }
.pkg ul { margin: 2px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: .88rem; color: var(--muted); }
.pkg li { display: flex; gap: 6px; align-items: baseline; }
.pkg li svg { width: 14px; height: 14px; flex: none; color: var(--action); transform: translateY(2px); }
.pkg-meta { font-size: .85rem; color: var(--muted); }
.pkg-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.pkg-go { width: 44px; min-height: 44px; padding: 0; }
.pkg-go svg { width: 20px; height: 20px; }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.steps li { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; padding: 16px 14px 16px 16px; border-radius: var(--r-card); background: var(--surface); color: var(--text); border: 1px solid var(--card-line); box-shadow: 0 8px 18px rgb(5 12 38 / 30%); }
.step-no { position: absolute; left: -6px; top: -8px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--royal); color: #fff; font-weight: 800; border: 3px solid #fff; box-shadow: 0 3px 0 var(--royal-edge); }
:root[data-theme="dark"] .step-no { border-color: var(--surface); }
.step-icon { width: 56px; height: 56px; }
.steps h3 { font-size: 1.02rem; font-weight: 600; color: var(--heading); }
.steps p { font-size: .9rem; color: var(--muted); line-height: 1.5; }
@media (max-width: 1099px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .steps { grid-template-columns: 1fr; gap: 14px; } }

/* ---------- order ---------- */
.order-panel { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.order-panel.is-discord { grid-template-columns: minmax(0, 1fr); }
.order-head { flex-wrap: wrap; }
.order-discord { max-width: 40rem; padding: clamp(16px, 2.4vw, 22px); display: grid; gap: 14px; }
.order-discord h3 { font-weight: 800; font-size: 1.15rem; }
.order-need { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.order-need li { display: flex; align-items: flex-start; gap: 10px; }
.order-need svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.order-note { color: var(--muted); font-size: .92rem; }
@media (min-width: 900px) {
  .order-discord { max-width: none; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 32px; align-items: center; }
  .order-discord > :not(.btn, .muted) { grid-column: 1; }
  .order-discord > .btn { grid-column: 2; grid-row: 1 / span 3; }
  .order-discord > .muted { grid-column: 2; grid-row: 3; align-self: end; text-align: center; }
}
.order-head > div { flex: 1 1 0; min-width: 12em; }
.pw-warn {
  display: inline-flex; align-items: center; gap: 8px; margin-left: auto; padding: 6px 14px 6px 10px; border-radius: 12px;
  background: #c9343a; color: #fff; font-weight: 600; font-size: .95rem; box-shadow: 0 3px 0 #8f1f24;
}
.pw-warn svg { width: 22px; height: 22px; flex: none; }
.form { padding: clamp(16px, 2.4vw, 22px); display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); grid-auto-flow: column; gap: 14px 18px; align-items: start; }
@media (max-width: 699px) { .form-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; } }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-weight: 600; font-size: .95rem; color: var(--heading); padding: 0; }
.optional { color: var(--muted); font-weight: 400; }
.field input[type="text"], .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--field-line); border-radius: 10px;
  background: var(--field); color: var(--text); transition: border-color .18s, box-shadow .18s;
}
.field textarea { resize: vertical; min-height: 46px; }
.field select { appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("/assets/img/select-chev.svg");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); opacity: 1; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--action); box-shadow: 0 0 0 4px rgb(36 88 245 / 22%); }
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 4px var(--danger-soft) !important; }
.hint { font-size: .82rem; color: var(--muted); }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid var(--field-line); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: grid; place-items: center; min-height: 36px; border-radius: 8px; font-weight: 600; font-size: .92rem; color: var(--muted); cursor: pointer; transition: background-color .18s, color .18s; }
.segmented input:checked + label { background: var(--royal); color: #fff; box-shadow: 0 3px 0 var(--royal-edge); }
.segmented input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.form-error { padding: 10px 14px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.turnstile { min-height: 65px; }
.result { padding: 22px; display: grid; gap: 12px; justify-items: start; }
.result-kicker { font-weight: 800; font-style: italic; font-size: 1.3rem; color: var(--ok); }
.result-label { color: var(--muted); }
.code-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.order-code { font-weight: 800; font-size: 2rem; letter-spacing: .06em; color: var(--heading); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .order-code { color: var(--gold); }
.result-summary { font-weight: 600; }

.summary { position: sticky; top: calc(var(--topbar-h) + 20px); display: grid; gap: 10px; }
.summary h3 { display: flex; align-items: center; gap: 8px; font-style: italic; font-weight: 800; font-size: 1.35rem; color: #fff; text-shadow: 0 2px 0 rgb(10 21 56 / 60%); }
.summary h3 svg { width: 30px; height: 30px; }
.summary dl { margin: 0; padding: 14px 16px; display: grid; gap: 6px; }
.summary dl div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 8px; font-size: .92rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.summary .s-price { margin: 4px -8px; padding: 6px 8px; border-radius: 10px; background: var(--price-row); }
:root[data-theme="dark"] .summary .s-price dd { color: var(--gold); }
.summary .s-price dd { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.summary-details { margin: 0; padding: 0 4px; list-style: none; display: grid; gap: 4px; color: var(--on-blue-muted); font-size: .9rem; }
.summary-details li::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 2px; background: var(--gold); transform: rotate(45deg) translateY(-2px); }
@media (max-width: 999px) {
  .order-panel { grid-template-columns: 1fr; }
  .summary { position: static; }
  .pw-warn { margin-left: 0; }
}

/* ---------- safety ---------- */
.tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.tips li { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 14px; align-items: center; padding: 16px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tip-icon { width: 60px; height: 60px; }
.tips h3 { font-size: 1rem; font-weight: 600; color: var(--heading); }
.tips p { font-size: .9rem; color: var(--muted); line-height: 1.5; }
@media (max-width: 899px) { .tips { grid-template-columns: 1fr; } }

/* ---------- FAQ / contact / brand ---------- */
.bottom-grid { display: grid; grid-template-columns: 1.15fr .85fr 1.1fr; gap: 14px; align-items: stretch; }
.box-title { font-size: 1.3rem; margin-bottom: 12px; }
.faq { display: grid; gap: 8px; }
.faq details { border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 10px 14px; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 18px; height: 18px; flex: none; color: var(--action); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq summary:hover { background: var(--surface-2); }
.faq .faq-a { padding: 0 14px 14px; color: var(--muted); }
.contact-list { display: grid; gap: 8px; }
.contact-btn { justify-content: flex-start; gap: 12px; width: 100%; min-height: 52px; padding: 8px 14px; border-radius: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; font-weight: 600; transition: transform .18s; }
.contact-btn:hover { transform: translateX(3px); }
.contact-btn svg { width: 28px; height: 28px; flex: none; }
.contact-btn[data-type="discord"] svg { color: #5865f2; }
.contact-btn[data-type="line"] svg { color: #06c755; }
.contact-btn[data-type="facebook"] svg { color: #1877f2; }
.contact-btn small { display: block; color: var(--muted); font-weight: 400; }
.panel-blue .contact-list .muted, .result .contact-list .muted { color: var(--muted); }
.hours { margin-top: 12px; font-size: .92rem; }
.brand-card {
  position: relative; overflow: hidden; display: grid; align-content: center; gap: 6px; min-height: 220px; padding: 22px;
  border-radius: var(--r-panel); background: var(--brand-card-bg); border: 2px solid var(--panel-blue-line);
  box-shadow: 0 18px 40px rgb(16 38 92 / 25%); color: #fff;
}
.brand-card-mascot { position: absolute; right: -8%; bottom: -2px; height: 112%; width: auto; max-width: none; object-fit: contain; }
.brand-card-logo, .brand-card-line { position: relative; max-width: 50%; }
.brand-card-logo { width: min(240px, 100%); height: auto; }
.brand-card-line { font-weight: 800; font-size: 1.1rem; line-height: 1.3; text-shadow: 0 2px 0 rgb(10 21 56 / 60%); }
@media (max-width: 1099px) { .bottom-grid { grid-template-columns: 1fr 1fr; } .brand-card { grid-column: 1 / -1; } }
@media (max-width: 699px) { .bottom-grid { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.footer { background: var(--footer-bg); color: #dbe6ff; padding: 26px 0; border-top: 3px solid var(--footer-line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer .logo-img { height: 52px; }
.footer-tag { font-size: .82rem; line-height: 1.4; color: #a9bde6; letter-spacing: .02em; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-nav a { color: #fff; text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: var(--gold); }
.footer-meta { display: grid; gap: 4px; justify-items: end; font-size: .88rem; }
.footer .muted { color: #a9bde6; }
.socials { display: flex; gap: 8px; }
.socials a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgb(255 255 255 / 10%); color: #fff; }
.socials a:hover { background: var(--royal); }
.socials svg { width: 20px; height: 20px; }
@media (max-width: 799px) { .footer-inner { flex-direction: column; align-items: flex-start; } .footer-meta { justify-items: start; } }

/* motion.js adds .theme-switching for ~0.4 s while the theme flips: a soft cross-fade, not a flash */
@media (prefers-reduced-motion: no-preference) {
  .theme-switching *, .theme-switching *::before, .theme-switching *::after {
    transition: background-color .35s ease, border-color .35s ease, color .35s ease, fill .35s ease, box-shadow .35s ease !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* theme.js adds .motion before paint; the GSAP intro (motion.js) brings these in, then drops the class.
   The headline, buttons and badges are never hidden: they render straight away. */
.motion .mascot, .motion .prop, .motion .hero-noob { visibility: hidden; }

/* order confirmed (motion.js, only after the API returns 201) */
.confetti { position: fixed; inset: 0; z-index: 80; pointer-events: none; overflow: hidden; }
.confetti-bit { position: absolute; left: 50%; top: 30%; border-radius: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .order-code.is-sparkling { animation: code-shine 1.2s ease-out 1; }
}
@keyframes code-shine { 0% { text-shadow: none; } 30% { text-shadow: 0 0 18px rgb(255 210 63 / 85%), 0 0 2px #fff; } 100% { text-shadow: none; } }

/* ---------- press effect (motion.js): a light sweep through the button + a sparkle burst at the press point ---------- */
.btn, .icon-btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after, .icon-btn::after {
  content: ""; position: absolute; top: -30%; bottom: -30%; left: -60%; width: 45%; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 85%) 45%, rgb(255 255 255 / 95%) 50%, rgb(255 255 255 / 85%) 55%, transparent);
  transform: skewX(-20deg); opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .btn.is-flash::after, .icon-btn.is-flash::after { animation: btn-shine .6s cubic-bezier(.45, 0, .25, 1); }
  .btn.is-flash, .icon-btn.is-flash { animation: btn-bright .45s ease-out; }
}
@keyframes btn-shine { 0% { opacity: 0; transform: translateX(0) skewX(-20deg); } 10%, 75% { opacity: 1; } 100% { opacity: 0; transform: translateX(400%) skewX(-20deg); } }
@keyframes btn-bright { 0% { filter: brightness(1.35) saturate(1.15); } 100% { filter: none; } }
.spark-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
/* the outline (drop-shadow on the wrapper-less star) keeps gold/white sparks readable on the bright sky too */
.spark { position: absolute; left: 0; top: 0; width: 18px; height: 18px; filter: drop-shadow(0 0 1.5px rgb(16 38 92 / 90%)) drop-shadow(0 0 6px rgb(255 255 255 / 70%)); }
.spark::before { content: ""; position: absolute; inset: 0; background: var(--spark, #ffd23f);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }
.spark-ring { position: absolute; left: 0; top: 0; width: 64px; height: 64px; border-radius: 50%;
  border: 3px solid #ffd23f; box-shadow: 0 0 0 1.5px rgb(16 38 92 / 55%), 0 0 16px rgb(255 255 255 / 80%), inset 0 0 12px rgb(255 210 63 / 60%); }

/* ---------- account: "Log in with Discord" (account.js) ---------- */
.account { position: relative; display: flex; }
.account-login-icon { width: 1.25em; height: 1.25em; flex: none; }
.account-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 15rem; padding: 4px 10px 4px 5px;
  border: 0; border-radius: 12px; background: var(--surface-2); color: var(--heading); font: 600 .95rem/1 var(--font);
  cursor: pointer; transition: background-color .18s;
}
.account-btn:hover { background: var(--line); }
.account-avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--surface); }
.account-avatar.is-blank { background: var(--line); }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chev { width: 16px; height: 16px; flex: none; transform: rotate(90deg); transition: transform .18s; }
.account-btn[aria-expanded="true"] .account-chev { transform: rotate(-90deg); }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; min-width: 230px; padding: 8px;
  border-radius: 16px; background: var(--surface); border: 2px solid var(--panel-light-line); box-shadow: var(--shadow-lift);
}
.account-who { display: grid; gap: 2px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); color: var(--heading); }
.account-who small { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }
.account-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; color: var(--heading); font: 600 1rem/1.3 var(--font); text-align: left; text-decoration: none; cursor: pointer;
}
.account-item:hover { background: var(--surface-2); }
.account-item svg { width: 22px; height: 22px; flex: none; }
.account-hint { color: var(--ok); }

.account-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; max-width: min(92vw, 30rem); padding: 12px 18px;
  border-radius: var(--r-ctl); background: var(--surface); color: var(--heading); border: 2px solid var(--panel-light-line);
  box-shadow: var(--shadow-lift); font-weight: 600; opacity: 0; pointer-events: none; transform: translate(-50%, 12px);
}
.account-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: no-preference) { .account-toast { transition: opacity .25s, transform .3s cubic-bezier(.2, .8, .2, 1); } }

/* ---------- my orders ---------- */
.my-orders { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.my-order {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 6px 16px; padding: 14px 16px;
  border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.my-order-main { display: grid; gap: 2px; min-width: 0; }
.my-order-code { color: var(--heading); font-weight: 800; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.my-order-title { color: var(--text); font-weight: 600; }
.my-order-meta { color: var(--muted); font-size: .9rem; }
.my-order-meta span { white-space: nowrap; }
.my-order-meta span + span::before { content: " · "; }
.status-pill {
  justify-self: end; padding: 4px 12px; border-radius: 999px; font-size: .88rem; font-weight: 700; white-space: nowrap;
  background: var(--surface-2); color: var(--heading); box-shadow: inset 0 0 0 1px var(--line);
}
.status-pill.is-run { background: var(--royal); color: #fff; box-shadow: none; }
.status-pill.is-done { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px currentColor; }
.status-pill.is-off { color: var(--muted); }
.my-order-farm { grid-column: 1 / -1; display: grid; gap: 6px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.my-order-farm-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; color: var(--heading); font-weight: 600; }
.my-order-farm-head small { color: var(--muted); font-weight: 400; }
.my-order-farm-head span { display: inline-flex; align-items: center; gap: 6px; }
.my-order-warn { width: 18px; height: 18px; flex: none; }
/* Lost contact: keep the last known % but grey it out so it doesn't read as live. */
.my-order-farm.is-stale .my-order-farm-head > span { color: var(--muted); }
.my-order-farm.is-stale .live-bar span { background: var(--muted); opacity: .45; }
.my-order-farm.is-stale .my-order-pct { color: var(--muted); }
.my-order-pct { min-width: 3.2em; text-align: right; color: var(--heading); font-variant-numeric: tabular-nums; }
.my-orders-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; color: var(--muted); }
.my-orders-empty p { max-width: 60ch; }
.my-orders-preview { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; border-color: var(--gold, #ffd23f); border-style: dashed; }
.my-orders-preview p { display: grid; gap: 2px; max-width: 62ch; }
.my-orders-preview span { color: var(--muted); }
.my-orders-error { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

@media (max-width: 599px) {
  .account-name, .account-chev { display: none; }
  /* Anchor the menu to the whole top bar (like the mobile nav) so it never runs off screen. */
  .account { position: static; }
  .account-menu { left: 8px; right: 8px; min-width: 0; }
  .account-btn { padding: 4px; }
  .my-order { grid-template-columns: minmax(0, 1fr); }
  .status-pill { justify-self: start; }
}
@media (max-width: 479px) {
  .account-login-label { display: none; }
  .account-login { padding-inline: .6em; }
}

/* ---------- my orders: party block (public/assets/js/party.js) ---------- */
.party { --party-danger: #a82329; grid-column: 1 / -1; display: grid; gap: 10px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
:root[data-theme="dark"] .party { --party-danger: var(--danger); }
.party-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); color: var(--heading); font-weight: 600; cursor: pointer; text-align: left;
}
.party-toggle:hover { border-color: var(--card-hover-line); }
.party-chev { width: 1.1em; height: 1.1em; flex: none; transition: transform .15s ease-out; }
.party.is-open .party-chev { transform: rotate(90deg); }
.party-body { display: grid; gap: 12px; }
.party-content { display: grid; gap: 12px; }
.party .btn { min-height: 44px; }
.party .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; transform: none; }
.party .btn-danger { --edge: var(--party-danger); background: var(--danger-soft); color: var(--party-danger); box-shadow: inset 0 0 0 2px var(--party-danger), 0 4px 0 var(--edge); }
.party .btn-danger:hover, .party .btn-danger:focus-visible { box-shadow: inset 0 0 0 2px var(--party-danger), 0 6px 0 var(--edge); }
.party .btn-danger.is-armed { background: var(--party-danger); color: #fff; }
:root[data-theme="dark"] .party .btn-danger.is-armed { color: #14254a; }
.party .btn-white { white-space: normal; }
.party-status { padding: 10px 14px; border-radius: var(--r-ctl); background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: .95rem; }
.party-status.is-ok { background: var(--ok-soft); color: var(--ok); border-color: currentColor; }
.party-status.is-error { background: var(--danger-soft); color: var(--party-danger); border-color: currentColor; }
.party-status.is-pending::before { content: ""; display: inline-block; width: .85em; height: .85em; margin-right: .5em; vertical-align: -.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.party-offline { padding: 10px 14px; border-radius: var(--r-ctl); background: var(--price-row); border: 1px solid var(--gold-edge); color: var(--text); font-weight: 600; }
.party-muted { color: var(--muted); }
.party-start { display: flex; flex-wrap: wrap; gap: 10px; }
.party-join { display: grid; gap: 6px; }
.party-join label { font-weight: 600; color: var(--heading); }
.party-join-row { display: flex; flex-wrap: wrap; gap: 10px; }
.party-code-input {
  flex: 1 1 11ch; min-width: 0; min-height: 46px; padding: 8px 12px; border: 1.5px solid var(--field-line); border-radius: 10px; background: var(--field); color: var(--text);
  font-size: 1.3rem; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.party-code-input:focus-visible { outline: none; border-color: var(--action); box-shadow: 0 0 0 4px rgb(36 88 245 / 22%); }
.party-teams { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 0 14px; }
.party-teams summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--heading); cursor: pointer; }
.party-teams[open] summary { border-bottom: 1px dashed var(--line); margin-bottom: 8px; }
.party-teams > .party-muted { padding-bottom: 12px; }
.party-team-list { display: grid; margin: 0 0 8px; padding: 0; list-style: none; }
.party-team { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px 12px; padding: 8px 0; }
.party-team + .party-team { border-top: 1px solid var(--line); }
.party-team-name { font-weight: 600; color: var(--heading); overflow-wrap: anywhere; }
.party-team-seats { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.party-team-extra { grid-column: 1 / -1; color: var(--muted); }
/* team power card: tier badge + three bars + what the team still wants (only when the API sends `power`) */
.party-team.has-power { grid-template-columns: auto minmax(0, 1fr) auto auto; padding: 12px 0; }
.party-team.has-power .party-team-extra { grid-column: 2 / -1; }
.party-tier { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-weight: 800; line-height: 1; background: var(--surface-2); color: var(--action); box-shadow: inset 0 0 0 1px var(--line); }
.party-tier.is-s { background: var(--gold); color: #14254a; box-shadow: inset 0 -3px 0 var(--gold-edge); }
.party-tier.is-a { background: var(--royal); color: #fff; box-shadow: inset 0 -3px 0 var(--royal-edge); }
.party-tier.is-c { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--field-line); }
.party-power { grid-column: 2 / -1; display: grid; gap: 6px; min-width: 0; margin-top: 2px; }
.party-power-score { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.party-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; max-width: 560px; }
.party-bar { display: grid; gap: 3px; min-width: 0; }
.party-bar-label { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: .85rem; }
.party-bar-label b { color: var(--heading); font-weight: 600; font-variant-numeric: tabular-nums; }
.party-bar-track { display: block; height: 6px; border-radius: 999px; background: var(--elevated); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.party-bar-track i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--action); }
.party-power-lacks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 2px 0 0; color: var(--text); font-size: .95rem; }
.party-power-facts { display: flex; flex-wrap: wrap; gap: 0 16px; margin: 0; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
/* "ทีมที่เหมาะกับคุณ" (fit, view only) */
.party-fit { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); }
.party-fit-head { margin: 0; font-size: 1rem; color: var(--heading); }
.party-fit-me { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 4px 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.party-fit-team { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; }
.party-fit-facts { grid-column: 2 / -1; }
.party-fit-main { display: grid; gap: 6px; min-width: 0; }
.party-fit-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; color: var(--heading); }
.party-fit-list { display: grid; margin: 0; padding: 0; list-style: none; }
.party-fit-team { padding: 8px 0; }
.party-fit-team + .party-fit-team { border-top: 1px solid var(--line); }
.party-tier.is-none { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.party-gain { padding: 1px 10px; border-radius: 999px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--ok-soft); color: var(--ok); }
.party-fit-note { margin: 0; color: var(--muted); font-size: .85rem; }
.party-badge { padding: 1px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.party-badge.is-open { background: var(--ok-soft); color: var(--ok); }
.party-badge.is-full { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.party-name { margin: 0; font-size: 1.1rem; color: var(--heading); overflow-wrap: anywhere; }
.party-code { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: var(--r-ctl); background: var(--surface-2); border: 1px dashed var(--field-line); }
.party-code small { display: block; color: var(--muted); }
.party-code-val { display: block; font: inherit; font-size: 1.6rem; font-weight: 800; letter-spacing: .25em; color: var(--heading); font-variant-numeric: tabular-nums; user-select: all; }
:root[data-theme="dark"] .party-code-val { color: var(--gold); }
.party-expiry { color: var(--muted); font-size: .92rem; }
.party-seats { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.party-seat { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 4px 12px; padding: 10px 14px; border-radius: var(--r-ctl); background: var(--surface-2); border: 1px solid var(--line); }
.party-seat.is-me { border-color: var(--action); }
.party-seat.is-empty { background: transparent; border-style: dashed; color: var(--muted); }
.party-seat-main { display: grid; gap: 2px; min-width: 0; }
.party-seat-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--heading); overflow-wrap: anywhere; }
.party-seat-state { color: var(--text); }
.party-seat-note { color: var(--muted); font-size: .9rem; }
.party-seat-stats { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.party-seat-act { align-self: center; }
.party-dot { width: 12px; height: 12px; margin-top: .5em; border-radius: 50%; background: var(--muted); }
.party-dot.is-play { background: var(--ok); }
.party-dot.is-lobby { background: var(--action); }
.party-dot.is-wait, .party-dot.is-empty { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
.party-dot.is-hold { border-radius: 3px; background: var(--gold-edge); }
.party-tag { padding: 0 8px; border-radius: 6px; font-size: .8rem; font-weight: 700; white-space: nowrap; background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.party-tag.is-leader { background: var(--royal); color: #fff; box-shadow: none; }
.party-tag.is-carry { background: var(--gold); color: #14254a; box-shadow: none; }
.party-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (prefers-reduced-motion: no-preference) { .party-status.is-pending::before { animation: spin .8s linear infinite; } }
@media (prefers-reduced-motion: reduce) { .party-chev { transition: none; } }
@media (max-width: 479px) {
  .party-power, .party-team.has-power .party-team-extra { grid-column: 1 / -1; }
  .party-seat-act { grid-column: 2 / -1; }
  .party-seat-act .btn { width: 100%; }
  .party-actions .btn, .party-start .btn { flex: 1 1 100%; }
  .party-join-row .btn { flex: 1 1 100%; }
}
.my-order-farmlink { justify-self: start; min-height: 44px; }

/* ---- "ทีมของฉัน" (#my-teams, team.js). Scoped; rarity = frame colour via --rc. ---- */
#my-teams .team-cards { display: grid; gap: 16px; }
#my-teams .team-customer { margin: 20px 0 10px; color: var(--heading); font-size: 1.1rem; }
#my-teams .team-customer:first-child { margin-top: 0; }
#my-teams .team-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--card-line); border-radius: var(--r-ctl); background: var(--surface); min-width: 0; }
#my-teams .team-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
#my-teams .team-head h4 { margin: 0; color: var(--heading); font-size: 1.05rem; overflow-wrap: anywhere; }
#my-teams .team-head small, #my-teams .team-label small { color: var(--muted); font-weight: 400; }
#my-teams .team-label { margin: 6px 0 0; color: var(--heading); font-weight: 700; font-size: .95rem; }
#my-teams .team-empty { margin: 0; color: var(--muted); font-size: .95rem; }
#my-teams ul { list-style: none; margin: 0; padding: 0; }
#my-teams .team-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#my-teams .team-bag { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; max-height: 460px; overflow-y: auto; padding: 4px; }
/* in-game card: dark in both themes, the portrait fills it, text sizes follow the card's own width */
#my-teams .team-tile {
  --rc: #46506a;
  container-type: inline-size; position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden;
  border: 2px solid var(--rc); border-radius: 10px; background: linear-gradient(160deg, #16213c, #0a0f1e); color: #fff;
  font: inherit; font-weight: 700; line-height: 1.15; text-align: left; text-shadow: 0 1px 2px #000, 0 0 3px #000; cursor: pointer;
}
#my-teams .team-tile.is-static { cursor: default; }
#my-teams .team-tile.is-empty { display: grid; place-items: center; border-color: #2a3350; background: #0c1120; box-shadow: inset 0 0 0 4px #10172a; color: #a9b4cf; font-size: .8rem; text-shadow: none; cursor: default; }
#my-teams .team-tile.is-gone .team-art { opacity: .4; }
#my-teams .team-tile:disabled { opacity: .45; cursor: not-allowed; }
#my-teams .team-tile:not(:disabled):not(.is-static):not(.is-empty):hover { box-shadow: 0 0 0 2px var(--rc); }
#my-teams .team-tile:focus-visible, #my-teams .team-search:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
#my-teams .team-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#my-teams .team-art.is-letter { display: grid; place-items: center; padding-bottom: 12%; font-weight: 800; font-size: 2rem; font-size: 34cqw; color: #8f9cc0; text-shadow: none; }
#my-teams .team-lv { position: absolute; top: 4%; left: 5%; font-size: .75rem; font-size: clamp(.66rem, 13cqw, 1rem); }
#my-teams .team-marks { position: absolute; top: 22%; left: 5%; display: grid; justify-items: start; gap: 2px; }
#my-teams .team-mark { display: grid; place-items: center; width: 16px; height: 16px; font-size: .85rem; line-height: 1; }
#my-teams .team-mark.is-shiny, #my-teams .team-mark.is-evolved { color: #ffd23f; }
#my-teams .team-mark.is-in { position: absolute; left: calc(100% + 2px); top: 1px; border-radius: 50%; background: #177a3c; color: #fff; font-size: .68rem; font-weight: 800; text-shadow: none; }
#my-teams .team-trait { width: clamp(16px, 18cqw, 24px); height: clamp(16px, 18cqw, 24px); }
#my-teams .team-trait.is-text { display: inline-grid; place-items: center; width: auto; min-width: 16px; height: 16px; padding: 0 2px; border-radius: 6px; background: var(--royal); color: #fff; font-size: .62rem; }
#my-teams .team-types { position: absolute; top: 4%; right: 4%; display: grid; justify-items: end; gap: 2px; }
#my-teams .team-type { width: 24px; height: 24px; }
#my-teams .team-type.is-text { display: grid; place-items: center; border-radius: 50%; background: #5b6475; color: #fff; font-size: .64rem; font-weight: 800; text-shadow: none; }
#my-teams .team-tile .team-type { width: clamp(18px, 21cqw, 32px); height: clamp(18px, 21cqw, 32px); }
#my-teams .team-check { position: absolute; left: 0; right: 0; top: 44%; background: #8a4b00; color: #fff; font-size: .72rem; text-align: center; text-shadow: none; }
#my-teams .team-foot { position: absolute; left: 0; right: 0; bottom: 0; display: grid; padding: 14% 5% 3%; background: linear-gradient(transparent, rgb(5 8 18 / .88) 55%); text-align: right; }
#my-teams .team-foot-row { display: flex; align-items: baseline; justify-content: flex-end; gap: 4px; }
#my-teams .team-qt { margin-right: auto; padding: 0 5px; border-radius: 8px; background: #1a2c66; font-size: .72rem; text-shadow: none; }
#my-teams .team-cost { color: #ffc93c; font-size: .7rem; font-size: clamp(.64rem, 12cqw, .95rem); }
#my-teams .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; font-size: clamp(.66rem, 11.5cqw, .95rem); }
#my-teams .team-tools { display: flex; flex-wrap: wrap; gap: 8px; }
#my-teams .team-tools .team-search { flex: 1 1 200px; width: auto; min-width: 0; }
#my-teams .team-sorts { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; }
#my-teams .team-sort { min-height: 40px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: 12px; background: var(--field); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
#my-teams .team-sort[aria-pressed="true"] { background: #ffd23f; border-color: var(--gold-edge); color: #1b1400; }
#my-teams .team-sort:focus-visible, #my-teams .team-load:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
#my-teams .team-bag-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
#my-teams .team-new { scroll-margin-top: 110px; }
/* saved teams: the in-game "Switch Team" popup */
html:has(.team-dialog[open]) { overflow: hidden; }
#my-teams .team-dialog { width: min(660px, calc(100vw - 32px)); max-width: none; max-height: min(86dvh, 820px); padding: 0; border: 2px solid #2b3552; border-radius: 16px; background: #0b1020; color: #fff; overflow: hidden; }
#my-teams .team-dialog[open] { display: flex; }
#my-teams .team-dialog::backdrop { background: rgb(3 6 16 / .72); }
#my-teams .team-dialog-box { display: flex; flex-direction: column; width: 100%; min-height: 0; }
#my-teams .team-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #2b3552; }
#my-teams .team-dialog-head h3 { margin: 0; color: #fff; font-size: 1.1rem; }
#my-teams .team-dialog-head small { color: #a9b4cf; font-size: .8rem; font-weight: 400; overflow-wrap: anywhere; }
#my-teams .team-dialog-x { flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: #c62828; color: #fff; font: inherit; font-size: 1.1rem; font-weight: 800; cursor: pointer; }
#my-teams .team-dialog-x:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }
#my-teams .team-presets { display: grid; gap: 8px; padding: 12px; overflow-y: auto; overscroll-behavior: contain; }
#my-teams .team-preset { display: grid; gap: 8px 12px; padding: 8px; border: 2px solid #2b3552; border-radius: 14px; background: #131b33; }
#my-teams .team-preset.is-on { border-color: #2fb15a; }
#my-teams .team-preset-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; padding: 2px 10px; border-radius: 10px; background: #0c1120; min-height: 30px; }
#my-teams .team-preset-name { color: #fff; font-weight: 700; overflow-wrap: anywhere; }
#my-teams .team-preset-name small { color: #a9b4cf; }
#my-teams .team-preset.is-on .team-preset-name small { color: #59d884; }
#my-teams .team-preset-types { display: flex; flex-wrap: wrap; gap: 4px; }
#my-teams .team-load { background: #1f8a3f; border-color: #1f8a3f; box-shadow: 0 4px 0 #125a28; color: #fff; }
@media (max-width: 639px) {
  #my-teams .team-dialog { width: 100vw; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
}
#my-teams .team-load:disabled { opacity: .5; cursor: not-allowed; }
#my-teams .team-tile[data-r="common"] { --rc: #9aa3b5; }
#my-teams .team-tile[data-r="rare"] { --rc: #1a8cff; }
#my-teams .team-tile[data-r="epic"] { --rc: #7a2cf5; }
#my-teams .team-tile[data-r="legendary"] { --rc: #f5a500; }
#my-teams .team-tile[data-r="vintage"] { --rc: #c49a1c; }
#my-teams .team-tile[data-r="mythic"] { --rc: #ff5f86; }
#my-teams .team-tile[data-r="exclusive"] { --rc: #e02bd4; }
#my-teams .team-tile[data-r="secret"] { --rc: #ff2b2b; }
#my-teams .team-tile[data-r="limited"] { --rc: #ff8a00; }
#my-teams .team-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#my-teams .team-search { width: 100%; min-height: 40px; padding: 6px 12px; border: 1px solid var(--field-line); border-radius: 12px; background: var(--field); color: var(--text); font: inherit; }
#my-teams .team-note { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: .92rem; }
#my-teams .team-note.is-ok { background: var(--ok-soft); color: var(--ok); }
#my-teams .team-note.is-warn { border-color: #b36b00; }
#my-teams .team-note.is-error { background: var(--danger-soft); color: var(--danger); }
@media (min-width: 640px) {
  #my-teams .team-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #my-teams .team-bag { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  #my-teams .team-preset { grid-template-columns: minmax(0, 1fr) 84px; }
  #my-teams .team-preset.is-none { grid-template-columns: minmax(0, 1fr); }
  #my-teams .team-preset > .team-row, #my-teams .team-preset-foot { grid-column: 1; }
  #my-teams .team-load { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  #my-teams .team-cards { grid-template-columns: minmax(0, 1fr); }
}
