/* Flok's bright, playful visual system. Loaded after the legacy component styles. */
:root {
  color-scheme: light;
  --bg: #fbf9f5;
  --surface: #ffffff;
  --surface-2: #f3efff;
  --text: #292442;
  --muted: #77738d;
  --accent: #7558e8;
  --accent-2: #35b99a;
  --line: #e9e5f1;
  --shadow-card: 0 14px 40px rgba(62, 47, 111, .08);
  --shadow-float: 0 22px 60px rgba(62, 47, 111, .13);
  --radius-card: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 4% 0%, rgba(231, 223, 255, .72), transparent 28rem),
    radial-gradient(ellipse at 100% 18%, rgba(217, 248, 239, .62), transparent 27rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before, body::after {
  position: fixed;
  z-index: -1;
  width: 25rem;
  height: 25rem;
  border-radius: 50%;
  content: "";
  filter: blur(90px);
  opacity: .28;
  pointer-events: none;
}
body::before { top: 23rem; left: -18rem; background: #d5c8ff; }
body::after { top: 64rem; right: -19rem; background: #b9f1df; }

a { color: inherit; text-decoration: none; }
a, button, summary, select { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; }
button, .button { transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover, button.button:hover { transform: translateY(-2px); }
button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(117, 88, 232, .32); outline-offset: 3px; }
::selection { color: #352866; background: #e3dcff; }

header.app-header, main.app-main, footer {
  width: min(1200px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.app-header {
  position: sticky;
  z-index: 50;
  top: 12px;
  height: 76px;
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 44px);
  margin-top: 12px;
  padding: 0 18px 0 16px;
  border: 1px solid rgba(231, 226, 240, .9);
  border-radius: 22px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 26px rgba(53, 41, 92, .055);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 11px; min-width: 0; color: var(--text); }
.brand-avatar { width: 44px; height: 44px; border: 2px solid #fff; border-radius: 15px; object-fit: cover; box-shadow: 0 5px 14px rgba(91, 66, 173, .2); }
.brand > span { display: grid; gap: 0; line-height: 1.05; }
.brand > span b { font-size: 1.14rem; font-weight: 850; letter-spacing: -.045em; }
.brand > span small { margin-top: 5px; color: var(--muted); font-size: .65rem; font-weight: 650; letter-spacing: .025em; }

.primary-nav { display: flex; align-items: center; gap: 6px; color: #66617c; font-size: .88rem; font-weight: 650; }
.primary-nav > a, .primary-nav > details > summary { display: inline-flex; min-height: 40px; align-items: center; gap: 6px; padding: 0 13px; border-radius: 13px; cursor: pointer; list-style: none; transition: color .16s ease, background .16s ease; }
.primary-nav > details > summary::-webkit-details-marker { display: none; }
.primary-nav > a:hover, .primary-nav > details > summary:hover, .primary-nav > details[open] > summary { color: var(--accent); background: #f3efff; }
.primary-nav > a[aria-current="page"], .primary-nav > details > summary[aria-current="page"] { background: #f1edff; color: #624bc3; }
.primary-nav > details { position: relative; padding: 0; border: 0; }
.primary-nav > details > div { position: absolute; top: calc(100% + 10px); left: 0; z-index: 10; display: grid; min-width: 190px; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-float); }
.primary-nav > details > div a { padding: 10px 12px; border-radius: 10px; }
.primary-nav > details > div a:hover { color: var(--accent); background: #f5f2ff; }
.header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; margin-left: auto; }
.header-actions > .button { min-height: 42px; padding: 0 16px; }

.language-picker { position: relative; display: block; margin: 0; padding: 0; border: 0; }
.language-picker > summary { display: flex; width: 54px; min-width: 54px; height: 44px; align-items: center; justify-content: center; gap: 5px; padding: 0 6px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 4px 12px rgba(62,47,111,.04); cursor: pointer; list-style: none; }
.language-picker > summary::-webkit-details-marker { display: none; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.language-flag { display: block; width: 27px; height: 18px; flex: 0 0 auto; border-radius: 3px; object-fit: cover; box-shadow: 0 1px 3px rgba(29,23,47,.24); }
.language-chevron { color: #89849a; font-size: .68rem; line-height: 1; }
.language-picker::after { display: none; content: none; }
.language-menu-options { position: absolute; top: calc(100% + 9px); right: 0; z-index: 70; display: grid; width: 205px; gap: 3px; padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-float); }
.language-option-form { min-width: 0; margin: 0; }
.language-option { display: flex; width: 100%; min-height: 42px; align-items: center; justify-content: flex-start; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: #5f5a75; font-size: .82rem; font-weight: 680; text-align: left; cursor: pointer; }
.language-option:hover, .language-option[aria-checked="true"] { background: #f3efff; color: #624bc3; transform: none; }
.language-option img { display: block; width: 25px; height: 17px; flex: 0 0 auto; border-radius: 3px; object-fit: cover; box-shadow: 0 1px 3px rgba(29,23,47,.2); }
.language-option b { margin-left: auto; color: #39a889; }
.language-picker:has(select) { display: flex; align-items: center; }
.language-picker:has(select) select { width: 54px; min-width: 54px; max-width: 54px; height: 44px; min-height: 44px; padding: 0 17px 0 5px; appearance: none; border: 1px solid var(--line) !important; border-radius: 14px !important; background-color: #fff !important; background-position: 7px center !important; background-repeat: no-repeat !important; background-size: 27px 18px !important; color: transparent !important; font-size: 0 !important; cursor: pointer; }
.language-picker:has(select)::before { position: absolute; top: 5px; left: 4px; z-index: 2; width: 31px; height: 32px; border-radius: 8px; background-color: #fff; background-position: center; background-repeat: no-repeat; background-size: 27px 18px; content: ""; pointer-events: none; }
.language-picker:has(select option[value="pt-BR"]:checked) select { background-image: url("/static/flags/br.svg") !important; }
.language-picker:has(select option[value="en-US"]:checked) select { background-image: url("/static/flags/us.svg") !important; }
.language-picker:has(select option[value="es-ES"]:checked) select { background-image: url("/static/flags/es.svg") !important; }
.language-picker:has(select option[value="pt-BR"]:checked)::before { background-image: url("/static/flags/br.svg"); }
.language-picker:has(select option[value="en-US"]:checked)::before { background-image: url("/static/flags/us.svg"); }
.language-picker:has(select option[value="es-ES"]:checked)::before { background-image: url("/static/flags/es.svg"); }
.language-picker:has(select)::after { position: absolute; top: 50%; right: 6px; display: block; color: #89849a; content: "⌄"; font-size: .68rem; pointer-events: none; transform: translateY(-50%); }

.account-menu { position: relative; padding: 0; border: 0; }
.account-menu > summary { display: flex; align-items: center; gap: 9px; max-width: 190px; min-height: 44px; padding: 4px 10px 4px 5px; border: 1px solid var(--line); border-radius: 15px; background: #fff; cursor: pointer; list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary img { width: 32px; height: 32px; border-radius: 11px; object-fit: cover; }
.account-menu > summary span { overflow: hidden; color: var(--text); font-size: .83rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.account-menu > summary b { color: #8a85a0; font-size: .77rem; }
.account-menu > div { position: absolute; top: calc(100% + 9px); right: 0; z-index: 20; display: grid; width: 240px; max-height: min(70vh, 540px); gap: 3px; overflow: auto; padding: 9px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-float); }
.account-menu > div a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px; color: #5f5a75; font-size: .85rem; font-weight: 620; }
.account-menu > div a:hover { color: var(--accent); background: #f5f2ff; }
.account-menu > div a span { width: 22px; text-align: center; }
.account-menu > div .menu-danger { margin-top: 3px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; color: #c65e70; }

.app-main { min-height: 66vh; padding: 24px 0 76px; }
main.game-stage { width: auto; min-width: 0; margin: 0; padding: 0; }
footer { display: flex; align-items: center; gap: 24px; margin-top: 32px; padding: 25px 0 32px; border-top: 1px solid #e8e4ee; color: #858097; font-size: .78rem; }
.footer-brand { font-size: .95rem; }
.footer-brand .brand-avatar { width: 36px; height: 36px; border-radius: 12px; }
.footer-brand > span small { font-size: .61rem; }
footer > div { display: flex; flex-wrap: wrap; gap: 18px; margin-left: auto; }
footer a:hover { color: var(--accent); }

.button, .badge-action, .text-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.12rem;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #8065eb, #6c51d4);
  box-shadow: 0 8px 19px rgba(112, 83, 218, .2);
  color: #fff;
  font-size: .87rem;
  font-weight: 760;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}
.button:hover { box-shadow: 0 12px 24px rgba(112, 83, 218, .25); }
.button-small { min-height: 38px; padding: .58rem .85rem; border-radius: 12px; font-size: .8rem; }
.button-ghost { border: 1px solid #e4def6; background: #fff; box-shadow: 0 4px 12px rgba(62, 47, 111, .04); color: #5f4bab; }
.button-ghost:hover { border-color: #cfc4f4; background: #f8f6ff; }
.button-discord { background: #5865f2; box-shadow: 0 8px 19px rgba(88, 101, 242, .2); }
.text-button { min-height: auto; padding: 0; background: transparent; box-shadow: none; color: #c35b70; }
.app-main form button:not(.button):not(.text-button) { min-height: 42px; padding: .66rem 1rem; border: 0; border-radius: 12px; background: linear-gradient(135deg, #8065eb, #6c51d4); box-shadow: 0 7px 17px rgba(112,83,218,.18); color: #fff; font-weight: 740; cursor: pointer; }
button:disabled, .button:disabled, .badge-action:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.eyebrow { margin: 0 0 12px; color: #765be2; font-size: .72rem; font-weight: 820; letter-spacing: .13em; text-transform: uppercase; }
.lead, .page-heading > p { max-width: 64ch; color: var(--muted); font-size: 1.04rem; line-height: 1.75; }
.page-heading { padding: 52px 0 28px; }
.page-heading h1, .legal h1 { margin: 0; color: #292442; font-size: clamp(2.25rem, 5vw, 4rem); font-weight: 850; letter-spacing: -.065em; line-height: 1.02; text-wrap: balance; }
.page-heading > p { margin: 14px 0 0; }
.page-heading.compact { padding-top: 36px; padding-bottom: 23px; }
.legal { max-width: 790px; padding: 50px 0 80px; }
.legal h1 { margin-bottom: 25px; }
.legal h2 { margin: 34px 0 10px; font-size: 1.2rem; letter-spacing: -.025em; }
.legal p, .legal li { color: #6e6a80; line-height: 1.8; }

/* Homepage */
.home-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); align-items: center; gap: clamp(34px, 6vw, 86px); min-height: 540px; padding: 54px 0 48px; }
.home-hero::before { position: absolute; z-index: 0; top: 3%; left: -8%; width: min(58vw, 620px); height: 84%; border-radius: 48% 52% 57% 43% / 50% 42% 58% 50%; background: linear-gradient(140deg, rgba(232,224,255,.78), rgba(237,250,245,.4)); content: ""; filter: blur(2px); pointer-events: none; }
.home-copy { position: relative; z-index: 2; }
.home-copy .eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; padding: 8px 13px; border: 1px solid #ded5fa; border-radius: 999px; background: #f1edff; color: #6b52cf; font-size: .68rem; letter-spacing: .1em; }
.home-copy .eyebrow::before { display: none; }
.home-copy .eyebrow span { color: #e9a832; font-size: .9rem; }
.home-copy h1 { max-width: 11ch; margin: 0; background: linear-gradient(105deg, #3d326d 3%, #7558e8 57%, #329a83 100%); background-clip: text; color: transparent; font-size: clamp(3.2rem, 6.5vw, 5.7rem); font-weight: 880; letter-spacing: -.078em; line-height: .98; text-wrap: balance; -webkit-background-clip: text; }
.home-copy .lead { max-width: 50ch; margin: 20px 0 0; font-size: clamp(1rem, 1.3vw, 1.11rem); }
.home-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 26px; }
.home-actions .button { min-height: 50px; padding: 0 19px; }
.home-highlights { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 23px; color: #77728b; font-size: .79rem; font-weight: 650; }
.home-highlights > span { color: #3bb896; font-size: .68rem; text-shadow: 0 0 10px rgba(59, 184, 150, .35); }
.home-visual { position: relative; z-index: 1; isolation: isolate; min-width: 0; aspect-ratio: 1.05; overflow: hidden; border: 7px solid #fff; border-radius: 34px; background: #211a42; box-shadow: var(--shadow-float); transform: rotate(1.4deg); }
.home-visual > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 63% center; transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.home-visual:hover > img { transform: scale(1.045); }
.home-visual::after { position: absolute; z-index: 1; inset: 45% 0 0; background: linear-gradient(transparent, rgba(27, 20, 52, .55)); content: ""; pointer-events: none; }
.home-visual-glow { position: absolute; z-index: 2; top: 11%; left: 8%; width: 55px; height: 55px; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; box-shadow: 0 0 0 12px rgba(255,255,255,.08), 0 0 0 24px rgba(255,255,255,.045); pointer-events: none; }
.home-sticker { position: absolute; z-index: 3; top: 18px; right: 18px; display: flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.62); border-radius: 999px; background: rgba(255,255,255,.88); box-shadow: 0 5px 16px rgba(34, 24, 62, .12); color: #37304f; font-size: .75rem; font-weight: 800; backdrop-filter: blur(10px); }
.home-sticker span { font-size: 1rem; }
.home-status { position: absolute; z-index: 3; bottom: 17px; left: 17px; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 34px); padding: 11px 15px; border: 1px solid rgba(255,255,255,.46); border-radius: 15px; background: rgba(255,255,255,.94); box-shadow: 0 7px 22px rgba(21, 15, 42, .16); backdrop-filter: blur(12px); }
.home-status .status-dot { flex: 0 0 auto; width: 9px; height: 9px; margin: 0; border-radius: 50%; background: #37bd96; box-shadow: 0 0 0 4px rgba(55,189,150,.13); }
.home-status strong, .home-status small { display: block; }
.home-status strong { color: #302b46; font-size: .78rem; }
.home-status small { margin-top: 2px; color: #77728b; font-size: .68rem; }
.home-spark { position: absolute; z-index: 3; color: #fff2a8; text-shadow: 0 2px 12px rgba(30,20,50,.5); pointer-events: none; }
.home-spark-one { top: 26%; right: 11%; font-size: 1.8rem; }
.home-spark-two { top: 42%; left: 8%; color: #c4fff1; font-size: 1.2rem; }
.home-metrics-wrap { margin: 8px 0 88px; padding: 19px 21px 21px; border: 1px solid #ebe6f2; border-radius: 22px; background: rgba(255,255,255,.76); box-shadow: 0 10px 32px rgba(62,47,111,.045); }
.home-metrics-label { margin: 0 0 12px; color: #817b96; font-size: .68rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.home-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0; }
.home-metrics article { min-width: 0; padding: 4px 18px; border: 0; border-left: 1px solid #efedf3; border-radius: 0; background: transparent; box-shadow: none; }
.home-metrics article:first-child { padding-left: 0; border-left: 0; }
.home-metrics strong { display: block; color: #493b88; font-size: clamp(1.3rem, 2.3vw, 1.8rem); font-weight: 850; letter-spacing: -.06em; }
.home-metrics span { display: block; margin-top: 2px; color: #817c91; font-size: .72rem; line-height: 1.35; }
.feature-section { margin-bottom: 82px; }
.home-section-heading { max-width: 670px; margin: 0 auto 27px; text-align: center; }
.home-section-heading .eyebrow { margin-bottom: 8px; }
.home-section-heading h2 { margin: 0; color: #2d2945; font-size: clamp(1.8rem, 3.8vw, 2.8rem); font-weight: 850; letter-spacing: -.06em; line-height: 1.08; text-wrap: balance; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0; }
.feature-grid article { min-height: 208px; padding: 25px; border: 1px solid #ece8f2; border-radius: 22px; background: linear-gradient(145deg, #fff, #f8f5ff); box-shadow: var(--shadow-card); transition: transform .2s ease, box-shadow .2s ease; }
.feature-grid .feature-safety { background: linear-gradient(145deg, #fff, #effaf5); }
.feature-grid .feature-setup { background: linear-gradient(145deg, #fff, #fff8e9); }
.feature-grid article:hover { transform: translateY(-4px); box-shadow: var(--shadow-float); }
.feature-grid article > span { display: grid; width: 47px; height: 47px; place-items: center; border-radius: 15px; background: #f1edff; font-size: 1.35rem; }
.feature-grid .feature-safety > span { background: #e8f8f2; }
.feature-grid .feature-setup > span { background: #fff5df; }
.feature-grid h2 { margin: 19px 0 7px; color: #302b47; font-size: 1.05rem; font-weight: 800; letter-spacing: -.025em; }
.feature-grid p { margin: 0; color: #7d788f; font-size: .87rem; line-height: 1.65; }
.account-hub { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 70px; padding: 24px; border: 1px solid #e8e1fc; border-radius: 22px; background: linear-gradient(115deg, #f0ecff, #f8f6ff 58%, #edfaf5); box-shadow: none; }
.account-hub .eyebrow { margin: 0 0 5px; }
.account-hub h2 { margin: 0 0 4px; font-size: 1.3rem; letter-spacing: -.04em; }
.account-hub p { margin: 0; color: #77728b; font-size: .84rem; }
.account-shortcuts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.account-shortcuts .button { min-height: 38px; padding: .55rem .75rem; border: 1px solid #e2dcf0; border-radius: 12px; background: #fff; box-shadow: none; color: #554b75; font-size: .75rem; }
.account-shortcuts .button:hover { border-color: #cfc4f4; background: #faf9ff; }
.rank-section { margin: 0 0 45px; }
.rank-heading { margin-bottom: 22px; }
.rank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; }
.rank-grid article { min-width: 0; padding: 22px 24px; border: 1px solid #ece8f2; border-radius: 22px; background: #fff; box-shadow: var(--shadow-card); }
.rank-card-heading { display: flex; align-items: center; gap: 11px; }
.rank-card-heading > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: #fff5df; font-size: 1.2rem; }
.rank-grid article:nth-child(2) .rank-card-heading > span { background: #e9f8f2; }
.rank-card-heading h3 { margin: 0; color: #302b47; font-size: 1rem; letter-spacing: -.025em; }
.rank-grid ol { margin: 13px 0 0; padding: 0; list-style: none; }
.rank-grid li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f0edf4; color: #716c81; font-size: .82rem; }
.rank-grid li:last-child { border-bottom: 0; }
.rank-grid li strong { flex: 0 0 auto; color: #398d78; font-size: .78rem; }
.rank-user { display: flex; min-width: 0; align-items: center; gap: 8px; color: #514b66; }
.rank-user img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* Shared page surfaces: guides, dashboard, profiles, moderation, commerce and games. */
.notice, .settings-card, .moderation-section, .profile-card, .daily-card, .rank-grid article,
.cluster-card, .dev-metrics article, .command-list article, .guild-card, .market-card,
.offer-row, .calendar-event, .adventure-product, .settings-sidebar, .profile-panel {
  border-color: #e9e5f0;
  background-color: #fff;
  box-shadow: var(--shadow-card);
}
.notice, .settings-card, .moderation-section, .profile-card, .daily-card { padding: clamp(18px, 3vw, 27px); border: 1px solid #e9e5f0; border-radius: var(--radius-card); }
.profile-card:not(.account-hub) { display: block; margin: 0 0 18px; }
.notice h1, .notice h2, .settings-card h2, .moderation-section h2 { color: #302b47; letter-spacing: -.035em; }
.notice p, .settings-card p, .moderation-section p { color: #77728a; line-height: 1.7; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; margin: 18px 0 34px; }
.metrics article { min-width: 0; padding: 18px; border: 1px solid #eae6f1; border-radius: 18px; background: #fff; box-shadow: var(--shadow-card); }
.metrics strong { display: block; color: #5945a8; font-size: 1.65rem; font-weight: 850; letter-spacing: -.06em; }
.metrics span { color: #7b768d; font-size: .78rem; }
.cluster-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 13px; margin: 0 0 34px; }
.cluster-heading { display: flex; flex-direction: column; justify-content: center; padding: 12px; }
.cluster-heading h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.04em; }
.cluster-card { min-width: 0; display: flex; align-items: center; gap: 11px; padding: 16px; border: 1px solid #e9e5f0; border-radius: 18px; }
.cluster-card strong, .cluster-card small { display: block; }
.cluster-card strong { font-size: .88rem; }
.cluster-card small { margin-top: 3px; color: #858096; font-size: .74rem; }
.settings-layout { display: grid; grid-template-columns: 225px minmax(0, 1fr); gap: 24px; padding: 38px 0 60px; }
.settings-sidebar { position: sticky; top: 102px; display: grid; align-content: start; gap: 4px; height: max-content; padding: 12px; border: 1px solid #e9e5f0; border-radius: 20px; }
.settings-sidebar strong { margin: 5px 9px 8px; color: #39334f; font-size: .83rem; }
.settings-sidebar a { padding: 10px 11px; border-radius: 11px; color: #716c83; font-size: .82rem; }
.settings-sidebar a:hover, .settings-sidebar a.active { background: #f2efff; color: #6c53d2; }
.settings-main .settings-card, .settings-main .moderation-section { max-width: none; margin: 0 0 17px; }
.settings-main input, .settings-main select, .settings-main textarea, input, select, textarea {
  min-height: 44px;
  border: 1px solid #e2deea !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #312d46 !important;
}
input, select, textarea { padding: .7rem .85rem; }
input::placeholder, textarea::placeholder { color: #a5a1b1; }
textarea { min-height: 110px; resize: vertical; }
label { display: grid; align-content: start; gap: 7px; color: #565169; font-size: .84rem; font-weight: 680; }
.settings-card form, .panel form, .card form { display: grid; gap: 13px; }
.settings-card form > .button, .panel form > .button, .card form > .button { justify-self: start; }
.table-wrap { overflow: auto; border: 1px solid #ebe7f0; border-radius: 16px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th, td { padding: 12px 14px; border-bottom: 1px solid #efedf3; text-align: left; }
th { background: #f8f7fb; color: #77728b; font-size: .72rem; font-weight: 780; }
td { color: #514d62; vertical-align: top; }
code { padding: .13em .38em; border-radius: 6px; background: #f1edff; color: #684fce; font-size: .9em; }
.ban-list { margin: 0; padding: 0; list-style: none; }
.ban-list li, .offer-row { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 12px 0; border-bottom: 1px solid #efedf3; }
.ban-list li:last-child { border-bottom: 0; }
.guild-list { max-width: 850px; padding-bottom: 50px; }
.guild-card { display: flex; align-items: center; gap: 14px; margin: 11px 0; padding: 15px; border: 1px solid #e9e5f0; border-radius: 17px; transition: transform .16s ease, border-color .16s ease; }
.guild-card:hover { transform: translateY(-2px); border-color: #cfc4f4; }
.guild-icon { display: grid; width: 46px; height: 46px; flex: 0 0 auto; place-items: center; border-radius: 15px; background: #f1edff; color: #6e55d5; font-weight: 820; }
.guild-card span { display: block; margin-top: 3px; color: #89849a; font-size: .77rem; }
.guild-card b { margin-left: auto; color: #38977e; font-size: .77rem; }
.command-group { padding: 20px 0; border-top: 1px solid #e9e5f0; }
.command-group > div:first-child { display: flex; align-items: center; gap: 11px; }
.command-group h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.03em; }
.command-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 12px; margin-top: 14px; }
.command-list article { padding: 17px; border: 1px solid #ebe7f1; border-radius: 17px; background: #fff; box-shadow: 0 8px 24px rgba(62,47,111,.045); }
.command-list h3 { margin: 0 0 8px; font-size: .94rem; }
.command-list p { margin: 0 0 9px; color: #79748a; font-size: .81rem; line-height: 1.55; }
.command-list small { color: #8d889e; font-size: .73rem; }
.rank-grid li .rank-user { color: #514d62; }
.daily-card { max-width: 670px; margin: 54px auto; padding: clamp(24px, 5vw, 44px); text-align: center; }
.daily-card h1 { margin: 0 0 12px; font-size: clamp(2.2rem, 6vw, 3.4rem); letter-spacing: -.06em; }
.daily-card p { color: #77728a; line-height: 1.7; }
.dev-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.dev-metrics article { padding: 18px; border: 1px solid #e9e5f0; border-radius: 18px; }
.dev-metrics strong { display: block; color: #5945a8; font-size: 1.7rem; }
.dev-metrics span { color: #7b768d; font-size: .77rem; }
.dev-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.dev-grid .moderation-section { margin: 0 0 16px; }
details { border-color: #ece8f1; }
summary { color: #454058; }
.status-dot.offline { background: #e56979; }
.settings-layout .page-heading { padding-top: 0; }
.metrics-top { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); margin: 22px 0 28px; }
.settings-card form, .profile-card form, .character-form { align-items: end; }
.market-grid, .market-columns, .calendar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.market-card, .calendar-event { padding: 18px; border: 1px solid #e9e5f0; border-radius: 19px; }
.market-card-copy small, .offer-row small { color: #858096; }
.market-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.market-actions form, .offer-row form { display: flex; flex-wrap: wrap; gap: 7px; }
.market-actions input { max-width: 150px; }
.event-chip { padding: .35rem .65rem; border-radius: 999px; background: #f1edff; color: #634dc3; font-size: .76rem; }
.tabs, .tab-list, [role="tablist"] { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; width: fit-content; max-width: 100%; padding: 5px; border: 1px solid #e9e5f0; border-radius: 15px; background: #f3f0f8; }
.tabs button, .tab-list button, [role="tablist"] button, [role="tab"] { min-height: 37px; padding: .5rem .82rem; border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: #77728a; font-size: .79rem; font-weight: 720; cursor: pointer; }
.tabs button.active, .tab-list button.active, [role="tab"][aria-selected="true"] { background: #fff; box-shadow: 0 2px 8px rgba(53,41,92,.09); color: #634dc3; }
.tabs button:hover, .tab-list button:hover, [role="tab"]:hover { background: rgba(255,255,255,.75); color: #634dc3; transform: none; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 13px; }
.module-toggle, .permission-list, .rules-list, .onboarding-guide, .setup-progress { padding: 16px; border: 1px solid #e9e5f0; border-radius: 17px; background: #fff; }
.module-toggle { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px; }
.module-toggle input { width: 19px; min-height: 19px; margin: 2px 0 0; accent-color: var(--accent); }
.module-toggle strong, .module-toggle small { display: block; }
.module-toggle small, .muted { color: #858096; }
.permission-list, .rules-list { display: grid; gap: 9px; margin: 0; list-style: none; }
.permission-list li, .role-option-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #eeebf3; border-radius: 12px; background: #fcfbfe; }
.permission-missing, .empty-state { padding: 18px; border: 1px dashed #d9d2e8; border-radius: 15px; background: #faf9fc; color: #827d92; }
.notification-preview { border-color: #d9d0f5; border-radius: 16px; background: #f8f6ff; }
.notification-preview p { color: #514b66 !important; }
.profile-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 9px; }
.profile-metrics > * { padding: 12px; border: 1px solid #ebe7f1; border-radius: 14px; background: #fff; }
.profile-item-grid, .public-profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.public-profile { padding: 18px 0 45px; }
.public-profile-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 22px; min-height: 230px; margin-bottom: 14px; padding: clamp(20px, 4vw, 36px); overflow: hidden; border: 1px solid color-mix(in srgb, var(--profile-accent, #7558e8) 25%, #e9e5f0); border-radius: 27px; background: radial-gradient(circle at 82% 12%, color-mix(in srgb, var(--profile-accent, #7558e8) 20%, transparent), transparent 20rem), linear-gradient(120deg, #fff, #f7f4ff); background-size: auto; animation: none; }
.public-profile-avatar { display: grid; width: 126px; height: 126px; place-items: center; overflow: hidden; border: 5px solid #fff; border-radius: 38px; background: #f1edff; box-shadow: 0 12px 30px rgba(44,34,81,.14); }
.public-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.public-profile-identity h1 { margin: 0; color: #302b47; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.065em; line-height: 1; }
.profile-handle { margin: 7px 0; color: #858096; font-size: .82rem; }
.profile-title { color: #5d5675; font-weight: 680; }
.profile-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin: 14px 0; }
.profile-metrics article { display: grid; gap: 4px; padding: 16px; border: 1px solid #e9e5f0; border-radius: 17px; background: #fff; box-shadow: var(--shadow-card); }
.profile-metrics article span { color: #858096; font-size: .73rem; }
.profile-metrics article strong { color: #51408f; font-size: 1.3rem; letter-spacing: -.04em; }
.profile-panel { min-width: 0; padding: 20px; }
.panel-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.panel-heading > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: #f1edff; font-size: 1.2rem; }
.panel-heading h2, .panel-heading p { margin: 0; }
.panel-heading h2 { color: #302b47; font-size: 1rem; }
.panel-heading p { color: #858096; font-size: .75rem; }
.profile-item-grid { margin: 0; padding: 0; list-style: none; }
.public-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.public-badge { padding: 7px 10px; border: 1px solid #e7e1f2; border-radius: 999px; background: #f6f3ff; color: #62529e; font-size: .76rem; font-weight: 720; }
.inventory-sale-grid, .equipment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 11px; }
.inventory-sale { display: grid; align-content: start; gap: 9px; padding: 15px; }
.inventory-icon, .product-icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; background: #f1edff; font-size: 1.25rem; }
.badge-manager, .badge-admin-card { padding: 17px; border: 1px solid #e9e5f0; border-radius: 18px; background: #fff; }
.badge-manager-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.badge-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 11px; }
.badge-rule { padding: 12px; border-radius: 13px; background: #f8f6fc; }
.badge-target { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.role-option-row input { width: 18px; min-height: 18px; accent-color: var(--accent); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 14px 0; }
.choice-card { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; gap: 3px 10px; padding: 14px; border: 1px solid #e9e5f0; border-radius: 16px; background: #fff; cursor: pointer; }
.choice-card input { position: absolute; top: 12px; right: 12px; width: 18px; min-height: 18px; accent-color: var(--accent); }
.choice-card > span { display: grid; width: 40px; height: 40px; grid-row: 1 / 3; place-items: center; border-radius: 13px; background: #f1edff; font-size: 1.2rem; }
.choice-card small { color: #858096; }
.cosmetic-choice { display: grid; align-content: start; gap: 9px; padding: 14px; border: 1px solid #e9e5f0; border-radius: 17px; background: #fff; }
.cosmetic-choice.active { border-color: #9884e6; box-shadow: 0 0 0 3px rgba(117,88,232,.1); }
.cosmetic-swatch { height: 78px; border-radius: 13px; }
.cosmetic-choice form { margin-top: auto; }
.cosmetic-choice button { width: 100%; }
.visual-template-card { display: grid; grid-template-columns: minmax(0, .8fr) minmax(280px, 1.2fr); gap: 18px; padding: 20px; border: 1px solid #e9e5f0; border-radius: 21px; background: #fff; box-shadow: var(--shadow-card); }
.visual-template-card > .eyebrow, .visual-template-card > h2, .visual-template-card > p { grid-column: 1 / -1; }
.welcome-preview { min-height: 210px; padding: 24px; border: 1px solid #e7e1f2; border-radius: 18px; background: radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--preview-color, #7558e8) 34%, transparent), transparent 45%), linear-gradient(145deg, #f7f4ff, #effaf5); color: #302b47; }
.welcome-preview span { color: var(--preview-color, #7558e8); }
.system-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 11px; margin: 0 0 40px; }
.system-shortcuts a { display: grid; align-content: start; gap: 6px; min-height: 124px; padding: 17px; border: 1px solid #e9e5f0; border-radius: 18px; background: #fff; box-shadow: var(--shadow-card); }
.system-shortcuts a:hover { transform: translateY(-3px); border-color: #cfc4f4; }
.system-shortcuts a > span { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; background: #f1edff; font-size: 1.2rem; }
.system-shortcuts small { color: #858096; }
.status-dot { background: #35b99a; }
.event-ready { color: #27866d; }
.event-disconnect { color: #c65e70; }

/* The adventure canvas remains a dark, immersive game surface. */
.adventure-game { --text: #f7f5ff; --muted: #aaa6bd; --surface: #1c1a2b; --surface-2: #26233a; --line: rgba(255,255,255,.12); color: #f7f5ff; color-scheme: dark; }
.adventure-game input, .adventure-game select, .adventure-game textarea { border-color: rgba(255,255,255,.15) !important; background: #14111e !important; color: #f7f5ff !important; }
.character-form, .cosmetic-card, .inventory-sale, .adventure-wallet, .adventure-product, .storage-product, .pet-product {
  border: 1px solid #e9e5f0;
  border-radius: 19px;
  background: #fff;
  box-shadow: var(--shadow-card);
  color: var(--text);
}
.character-form { padding: 22px; }
.character-form label { color: #565169; }
.character-form input, .character-form select { border-color: #e2deea; background: #fff; color: var(--text); }
.cosmetic-card { padding: 14px; }
.inventory-capacity i { background: #eeebf3; }
.adventure-wallet { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; padding: 17px 20px; }
.adventure-wallet span { color: #77728a; }
.adventure-wallet strong { color: #55429e; }
.adventure-store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.adventure-product { overflow: hidden; }
.product-actions button, .product-actions .button { width: 100%; }
.profile-panel { border: 1px solid #e9e5f0; border-radius: 20px; background: #fff; box-shadow: var(--shadow-card); }

.mobile-dock { display: none; }

@media (max-width: 900px) {
  header.app-header, main.app-main, footer { width: min(100% - 28px, 720px); }
  .app-header { height: 68px; gap: 12px; padding: 0 12px; }
  .brand > span small { display: none; }
  .primary-nav { display: none; }
  .language-picker { display: flex; }
  .app-main { padding-top: 14px; padding-bottom: 100px; }
  .home-hero { grid-template-columns: 1fr; gap: 30px; padding: 42px 0 34px; }
  .home-copy h1 { max-width: 12ch; font-size: clamp(3.3rem, 10vw, 5.5rem); }
  .home-visual { width: min(100%, 590px); justify-self: center; aspect-ratio: 1.18; }
  .home-metrics-wrap { margin-bottom: 68px; }
  .home-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 17px; }
  .home-metrics article:nth-child(4) { padding-left: 0; border-left: 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article { min-height: 0; }
  .account-hub { align-items: flex-start; flex-direction: column; }
  .account-shortcuts { justify-content: flex-start; }
  .settings-layout { display: block; padding-top: 24px; }
  .settings-sidebar { position: static; display: flex; overflow: auto; margin-bottom: 16px; padding: 8px; }
  .settings-sidebar strong { display: none; }
  .settings-sidebar a { flex: 0 0 auto; white-space: nowrap; }
  .mobile-dock { position: fixed; z-index: 55; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 7px; border: 1px solid rgba(228, 222, 239, .95); border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: 0 12px 36px rgba(44,34,81,.16); backdrop-filter: blur(20px); }
  .mobile-dock a { display: grid; min-width: 0; place-items: center; gap: 2px; padding: 5px 2px; border-radius: 13px; color: #77728a; font-size: .62rem; font-weight: 680; text-align: center; }
  .mobile-dock a:hover { background: #f2efff; color: #6b52cf; }
  .mobile-dock a[aria-current="page"] { background: #f1edff; color: #624bc3; }
  .mobile-dock a span { color: #6854bd; font-size: 1.1rem; }
  footer { padding-bottom: 100px; }
}

@media (max-width: 600px) {
  header.app-header, main.app-main, footer { width: calc(100% - 24px); }
  .app-header { top: 7px; height: 62px; margin-top: 7px; border-radius: 18px; }
  .brand-avatar { width: 39px; height: 39px; border-radius: 13px; }
  .brand > span b { font-size: 1.05rem; }
  .header-actions { gap: 7px; }
  .header-actions > .button { min-height: 39px; padding: 0 11px; font-size: .78rem; }
  .language-picker > summary { width: 48px; min-width: 48px; height: 39px; }
  .language-picker:has(select) select { width: 48px; min-width: 48px; max-width: 48px; height: 39px; min-height: 39px; }
  .language-picker:has(select)::before { top: 4px; left: 3px; width: 28px; height: 29px; background-size: 24px 16px; }
  .account-menu > summary { min-height: 39px; padding-right: 6px; }
  .account-menu > summary img { width: 29px; height: 29px; }
  .account-menu > summary span, .account-menu > summary b { display: none; }
  .home-hero { gap: 24px; padding: 34px 0 27px; }
  .home-copy h1 { font-size: clamp(2.9rem, 14vw, 4.4rem); }
  .home-copy .lead { margin-top: 15px; font-size: .97rem; }
  .home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 21px; }
  .home-actions .button { min-height: 46px; padding: 0 10px; font-size: .76rem; }
  .home-visual { width: 100%; aspect-ratio: .98; border-width: 5px; border-radius: 27px; }
  .home-sticker { top: 12px; right: 12px; padding: 7px 10px; }
  .home-status { bottom: 12px; left: 12px; padding: 9px 11px; }
  .home-metrics-wrap { margin-bottom: 54px; padding: 16px; border-radius: 18px; }
  .home-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 15px; }
  .home-metrics article, .home-metrics article:nth-child(4) { padding: 2px 10px; border-left: 1px solid #efedf3; }
  .home-metrics article:nth-child(odd) { padding-left: 0; border-left: 0; }
  .home-metrics strong { font-size: 1.45rem; }
  .feature-section { margin-bottom: 55px; }
  .home-section-heading { margin-bottom: 19px; text-align: left; }
  .home-section-heading h2 { font-size: 1.9rem; }
  .feature-grid article { padding: 20px; }
  .account-hub { margin-bottom: 48px; padding: 19px; }
  .account-shortcuts { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-shortcuts .button { width: 100%; white-space: normal; }
  .rank-grid, .dev-grid { grid-template-columns: 1fr; }
  .rank-grid article { padding: 18px; }
  .page-heading { padding: 35px 0 22px; }
  .page-heading h1, .legal h1 { font-size: clamp(2.2rem, 11vw, 3.2rem); }
  .metrics, .metrics-top, .dev-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .profile-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics article, .dev-metrics article { padding: 14px; }
  .cluster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cluster-heading { grid-column: 1 / -1; }
  .command-list { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-wrap: wrap; gap: 13px; }
  footer > div { order: 3; width: 100%; margin-left: 0; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
