/* ============================================================================
   Crystal2 — "Direction B / Crystal Console" beta skin
   Presentation-only design system. Loaded ONLY by the crystal beta layout
   (resources/views/crystal/components/layouts/app.blade.php), so everything is
   scoped under `.crystal` (set on <body>) and cannot bleed into the classic
   site. Tokens + reusable component classes lifted from the design handoff
   (Crystal2 Direction B Full Site.dc.html, README §5–6).
   ============================================================================ */

:root {
  /* Surfaces */
  --cc-bg:            #070d14;
  --cc-surface:       #05111c;
  --cc-card-grad:     linear-gradient(165deg, #0f2236, #0a1623);   /* solid: photo must not bleed through panels */
  --cc-nav-bg:        rgba(6,16,25,.92);
  --cc-card-header:   rgba(0,0,0,.18);
  --cc-frame-radial:  radial-gradient(1100px 560px at 86% 2%, rgba(10,70,120,.16), transparent 60%);
  --cc-footer-bg:     linear-gradient(180deg, #070f18, #04090e);   /* solid footer */

  /* Accent */
  --cc-accent:        linear-gradient(135deg, #2fe6c0, #15b9d6);
  --cc-accent-100:    linear-gradient(100deg, rgba(47,230,192,.18), rgba(21,140,200,.1) 58%, rgba(6,18,30,.4));
  --cc-teal:          #2fe6c0;
  --cc-cyan:          #15b9d6;
  --cc-bright:        #bfeee6;
  --cc-gold-grad:     linear-gradient(135deg, #e6d28a, #d4a843);

  /* Text */
  --cc-t-bright:      #eafdfb;
  --cc-t-head:        #dff7f3;
  --cc-t-body:        #9fc0cb;
  --cc-t-body-2:      #8fb0ba;
  --cc-muted:         #5f97a6;
  --cc-muted-2:       #7fa6b1;
  --cc-on-accent:     #04141e;

  /* Lines */
  --cc-hair:          rgba(95,200,205,.14);
  --cc-hair-2:        rgba(95,200,205,.12);
  --cc-hair-strong:   rgba(95,200,205,.2);

  /* Status */
  --cc-ok:            #2fe6a0;
  --cc-warn:          #e0a07b;
  --cc-danger:        #e08a8a;
  --cc-gold:          #e6d28a;

  /* Geometry */
  --cc-r-card:        14px;
  --cc-r-control:     9px;
  --cc-shell:         1440px;   /* fallback; runtime value comes from BrandingSetting (Layout > Content Width) */
}

/* ---- Base ---------------------------------------------------------------- */
body.crystal {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cc-bg);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  color: var(--cc-t-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Sticky footer: the page <main> grows to absorb spare height so the footer is
   pinned to the viewport bottom on short pages (error/2FA/thin content) instead
   of floating mid-screen. Applies to every crystal layout (app + simple). */
body.crystal > main { flex: 1 0 auto; }
.crystal *,
.crystal *::before,
.crystal *::after { box-sizing: border-box; }
.crystal .cz { font-family: 'Cinzel', Georgia, serif; }
.crystal a { color: inherit; text-decoration: none; }
.crystal img { max-width: 100%; }
[x-cloak] { display: none !important; }

@keyframes pulseDot { 0%,100% { box-shadow: 0 0 0 0 rgba(47,230,176,.5); } 70% { box-shadow: 0 0 0 9px rgba(47,230,176,0); } }
@keyframes spinW   { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes driftGlow { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-12px,-8px); } }

/* Ambient set (homepage hero + page dust). bgDrift is transform-only so the layered
   image keeps its intended opacity. dustFall/dustRise are soft round dust motes
   drifting in the god-ray light — hero dust falls, page-wrapper dust rises. */
@keyframes dustFall     { 0% { transform: translate(0,0); opacity: 0; } 10% { opacity: .9; } 88% { opacity: .6; } 100% { transform: translate(16px,408px); opacity: 0; } }
@keyframes dustRise     { 0% { transform: translate(0,0); opacity: 0; } 16% { opacity: .55; } 84% { opacity: .4; } 100% { transform: translate(-12px,-175px); opacity: 0; } }
@keyframes rayShimmer   { 0%,100% { opacity: .28; transform: translateX(0) skewX(-12deg); } 50% { opacity: .62; transform: translateX(18px) skewX(-12deg); } }
@keyframes bgDrift      { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-26px,12px) scale(1.08); } }

/* ---- Layout shell -------------------------------------------------------- */
.crystal .cc-shell {
  width: min(var(--cc-shell), 100%);
  margin: 0 auto;
  /* Trimmed side padding so the nav + content flow closer to the screen edges
     and line up with the hero panel. Nav, main and footer all use .cc-shell, so
     their left/right bounds stay identical. */
  padding: 0 clamp(14px, 3vw, 28px);
}
.crystal .cc-page { padding: clamp(20px, 4vw, 40px) 0 56px; }

/* ---- Top navigation ------------------------------------------------------ */
.crystal .cc-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--cc-nav-bg);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--cc-hair);
}
.crystal .cc-nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 14px 0;
}
.crystal .cc-brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.crystal .cc-brand-mark { filter: drop-shadow(0 0 9px rgba(47,230,200,.55)); }
.crystal .cc-brand-name {
  font-size: 18px; font-weight: 800; letter-spacing: .12em; color: var(--cc-t-bright);
  white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis;
}
/* flex:1 + min-width:0 lets the link row absorb the leftover space between the
   brand and the right-hand actions. NOTE: overflow MUST stay visible here — these
   links host the Rankings hover dropdown (a .cc-menu that opens downward), and any
   `overflow-x:auto` forces overflow-y to compute to `auto` too, which clips the
   dropdown so it appears not to open. The account/language dropdowns live in the
   un-clipped .cc-nav-actions, which is why only Rankings was affected. */
.crystal .cc-navlinks {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  flex: 1 1 0; min-width: 0; overflow: visible; padding: 4px 10px;
}
.crystal .cc-brand, .crystal .cc-nav-actions { flex-shrink: 0; }
.crystal .cc-navlink {
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: #a7cdd6; white-space: nowrap; transition: color .2s, text-shadow .2s; cursor: pointer;
}
.crystal .cc-navlink:hover { color: var(--cc-t-bright); text-shadow: 0 0 14px rgba(47,230,192,.5); }
.crystal .cc-navlink.is-active { color: var(--cc-teal); text-shadow: 0 0 14px rgba(47,230,192,.45); }
.crystal .cc-nav-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Coin badge in the nav */
.crystal .cc-coin {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--cc-r-control);
  background: rgba(47,230,180,.08); border: 1px solid rgba(47,230,180,.25);
  font-size: 12px; font-weight: 700; color: var(--cc-bright); white-space: nowrap;
}
/* Avatar / account pill */
.crystal .cc-userpill {
  display: inline-flex; align-items: center; gap: 9px; padding: 5px 14px 5px 5px; border-radius: 30px;
  background: rgba(7,20,30,.6); border: 1px solid var(--cc-hair-strong);
  font-size: 12px; font-weight: 700; color: var(--cc-t-head); cursor: pointer;
}
.crystal .cc-userpill .cc-avatar {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(4,12,20,.6); border: 1px solid rgba(95,200,205,.3);
}
.crystal .cc-icon-btn {
  width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(8,24,36,.5); border: 1px solid var(--cc-hair-strong); color: #bcdde2;
  cursor: pointer; transition: all .25s; font-size: .95rem;
}
.crystal .cc-icon-btn:hover { border-color: rgba(47,230,192,.4); color: var(--cc-teal); box-shadow: 0 0 14px rgba(47,230,192,.2); }

/* Dropdown menu panel (account / language) */
.crystal .cc-menu {
  position: absolute; right: 0; top: 100%; margin-top: 10px; min-width: 200px; z-index: 60;
  background: rgba(5,14,22,.97); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--cc-hair-strong); border-radius: 12px; overflow: hidden;
  box-shadow: 0 22px 60px rgba(0,0,0,.6);
}
.crystal .cc-menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 16px; font-size: 13px; font-weight: 600; color: var(--cc-t-body); transition: background .2s, color .2s;
}
.crystal .cc-menu-item:hover { background: rgba(47,230,192,.06); color: var(--cc-t-bright); }
.crystal .cc-menu-head { padding: 12px 16px; border-bottom: 1px solid var(--cc-hair-2); background: rgba(0,0,0,.2); }

/* Rich nav dropdown rows (Rankings: icon box + title + subtitle) */
.crystal .cc-rich-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 10px;
  border: 1px solid transparent; transition: background .18s, border-color .18s;
}
.crystal .cc-rich-item:hover { background: rgba(47,230,192,.07); border-color: rgba(47,230,192,.22); }
.crystal .cc-rich-item.is-active { background: linear-gradient(135deg, rgba(47,230,192,.16), rgba(47,230,192,.04)); border-color: rgba(47,230,192,.3); }
.crystal .cc-rich-ic {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(7,20,30,.6); border: 1px solid var(--cc-hair-strong); color: var(--cc-t-body); transition: all .18s;
}
.crystal .cc-rich-item:hover .cc-rich-ic,
.crystal .cc-rich-item.is-active .cc-rich-ic { color: var(--cc-teal); background: rgba(47,230,192,.12); border-color: rgba(47,230,192,.3); }
.crystal .cc-rich-title { font-size: 13px; font-weight: 700; color: var(--cc-t-head); }
.crystal .cc-rich-sub { font-size: 10.5px; color: #7fa6b1; margin-top: 1px; }

/* Burger (mobile) */
.crystal .cc-burger { display: none; width: 38px; height: 38px; }
.crystal .cc-mobile-nav { display: none; }
.crystal .cc-mobile-nav.is-open { display: block; }

/* ---- Console frame + title row ------------------------------------------ */
.crystal .cc-frame {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--cc-hair);
  background: var(--cc-frame-radial), var(--cc-surface);
  box-shadow: 0 40px 120px rgba(0,0,0,.5);
}
.crystal .cc-titlebar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 22px;
}

/* ---- Shared Dragon-Shop console card (ds-*) ------------------------------------
   Lifted from dragon-shop.blade.php's in-file <style> so account pages (the Fortune
   Wheel) can lead with the SAME seamless header-on-card look the Item Shop uses: the
   header bar IS the top edge of the content card, not a separate banner above it.
   The Dragon Shop keeps its own identical in-file copy, so it is byte-unchanged. */
.crystal .ds-wrapper {
  background: linear-gradient(165deg, rgba(11,30,45,.7), rgba(6,18,30,.82));
  border: 1px solid rgba(95,200,205,.15);
  border-radius: 16px;
  box-shadow: 0 30px 90px -20px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.03);
  position: relative; overflow: hidden; margin-bottom: 1rem;
}
.crystal .ds-wrapper::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47,230,192,.4) 35%, rgba(21,185,214,.4) 65%, transparent);
  z-index: 2;
}
.crystal .ds-wrapper::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(1100px 560px at 86% 2%, rgba(10,70,120,.16), transparent 60%),
    radial-gradient(circle at 15% 0%, rgba(47,230,192,.06), transparent 50%);
  pointer-events: none; z-index: 0;
}
.crystal .ds-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.4rem 1.75rem; border-bottom: 1px solid rgba(95,200,205,.14);
  background: rgba(6,16,25,.55); position: relative; z-index: 1; flex-wrap: wrap; gap: 1rem;
}
.crystal .ds-header-title {
  font-family: 'Cinzel', serif; font-size: 1.15rem; font-weight: 800; color: #eafdfb;
  text-transform: uppercase; letter-spacing: 0.14em; display: flex; align-items: center; gap: 0.7rem;
}
.crystal .ds-header-title i { color: #2fe6c0; filter: drop-shadow(0 0 10px rgba(47,230,192,.5)); font-size: 1.05rem; }
.crystal .ds-header-title .ds-gem-mark {
  display: inline-block; width: 8px; height: 8px;
  background: linear-gradient(135deg, #2fe6c0, #15b9d6);
  transform: rotate(45deg); box-shadow: 0 0 12px rgba(47,230,192,.7); margin: 0 0.35rem 0 0.15rem;
}
.crystal .ds-balance-pill {
  display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.55rem 1rem;
  background: rgba(47,230,180,.08); border: 1px solid rgba(47,230,180,.3);
  border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.crystal .ds-balance-pill .ds-coin-emblem {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle, #fde68a 0%, #e6d28a 60%, #b4861f 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 12px rgba(230,210,138,.4);
  display: inline-flex; align-items: center; justify-content: center;
  color: #3a2a0a; font-size: 0.65rem; font-weight: 900;
}
.crystal .ds-balance-pill .ds-balance-value { font-size: 0.95rem; font-weight: 800; color: #bfeee6; letter-spacing: 0.02em; }
.crystal .ds-balance-pill .ds-balance-label { font-size: 0.65rem; color: #5f97a6; text-transform: uppercase; font-weight: 700; letter-spacing: 0.08em; }
.crystal .ds-topup-btn {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1rem;
  background: linear-gradient(135deg, rgba(47,230,192,.18), rgba(21,185,214,.12));
  border: 1px solid rgba(47,230,192,.4); border-radius: 999px;
  color: #7fe6d2; font-size: 0.8rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; text-decoration: none; transition: all 0.25s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.crystal .ds-topup-btn:hover {
  background: linear-gradient(135deg, rgba(47,230,192,.28), rgba(21,185,214,.2));
  transform: translateY(-1px); color: #eafdfb;
}
.crystal .ds-topup-btn i { font-size: 0.75rem; filter: drop-shadow(0 0 4px rgba(47,230,192,.6)); }
/* Account ds-header title block (breadcrumb + big page title) — used by the upgraded
   wrap-card on every account page AND the Fortune Wheel header. */
.crystal .ds-head-titles { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.crystal .ds-head-titles .cc-breadcrumb { margin-bottom: 0; }
.crystal .ds-page-title { font-size: clamp(20px, 2.6vw, 27px); font-weight: 800; margin: 0; letter-spacing: .02em; color: var(--cc-t-bright); line-height: 1.08; }
.crystal .ds-header-actions { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.crystal .cc-breadcrumb {
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--cc-muted); margin-bottom: 6px;
}
.crystal .cc-breadcrumb b { color: #7fd6cf; font-weight: 600; }
.crystal .cc-title {
  font-size: clamp(22px, 3vw, 30px); font-weight: 800; margin: 0; letter-spacing: .04em; color: var(--cc-t-bright);
}
.crystal .cc-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--cc-muted-2); }

/* Account header actions (shared account-titlebar partial): a Dragon-Shop-style
   Dragon Coins balance pill + Top Up shortcut, so every /user page header matches. */
.crystal .cc-acct-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crystal .cc-coin-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 30px;
  background: rgba(7,20,30,.6); border: 1px solid var(--cc-hair-strong);
  font-size: 13px; font-weight: 800; color: var(--cc-t-head); white-space: nowrap;
  transition: border-color .2s, filter .2s, color .2s;
}
.crystal a.cc-coin-pill:hover { border-color: rgba(47,230,192,.45); color: var(--cc-t-bright); }
.crystal .cc-coin-emblem {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cc-gold-grad); color: #2a1e06; font-size: 12px; font-weight: 900;
}
.crystal .cc-coin-value { color: var(--cc-gold); }
.crystal .cc-coin-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5f97a6; }
.crystal .cc-coin-pill--accent { color: var(--cc-on-accent); background: var(--cc-accent); border-color: transparent; box-shadow: 0 6px 16px rgba(25,200,200,.25); }
.crystal .cc-coin-pill--accent .cc-coin-label { color: var(--cc-on-accent); }
.crystal .cc-coin-pill--accent:hover { filter: brightness(1.06); }
.crystal .cc-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--cc-ok);
  box-shadow: 0 0 8px rgba(47,230,160,.7); animation: pulseDot 2.4s infinite; flex-shrink: 0;
}
.crystal .cc-diamond {
  width: 7px; height: 7px; transform: rotate(45deg);
  background: var(--cc-teal); box-shadow: 0 0 8px rgba(47,230,192,.7); flex-shrink: 0;
}

/* ---- Account layout: sidebar + content ---------------------------------- */
.crystal .cc-account { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 26px; }
/* Ambient fading glow behind every account page — the same luminous teal/blue
   wash the Dragon Shop uses, applied uniformly so the whole /user area feels
   cohesive. Fixed full-viewport, painted behind the (solid) content panels. */
.crystal .cc-account::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 560px at 86% 2%, rgba(10,70,120,.20), transparent 60%),
    radial-gradient(900px 520px at 12% 4%, rgba(47,230,192,.08), transparent 55%),
    linear-gradient(180deg, rgba(7,18,29,0), rgba(5,13,22,.55));
}
.crystal .cc-sidebar {
  background: var(--cc-card-grad); border: 1px solid rgba(95,200,205,.15);
  border-radius: var(--cc-r-card); height: max-content; padding: 8px;
  position: sticky; top: 84px;
}
.crystal .cc-sidelink {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 10px;
  color: #a3c4cd; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .2s, color .2s;
}
.crystal .cc-sidelink:hover { background: rgba(47,230,192,.06); color: var(--cc-t-head); }
.crystal .cc-sidelink.is-active {
  background: linear-gradient(135deg, rgba(47,230,192,.16), rgba(47,230,192,.04));
  border: 1px solid rgba(47,230,192,.3); color: var(--cc-t-head); font-weight: 700;
}
.crystal .cc-sidelink.is-danger { color: var(--cc-danger); }
.crystal .cc-sidelink svg { flex-shrink: 0; }
.crystal .cc-side-sep { height: 1px; background: var(--cc-hair-2); margin: 8px 13px; }
.crystal .cc-content { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ---- Account "wrapper" card (Dragon-Shop-style page shell) --------------
   The ACCOUNT WRAPPER STANDARD frame: one big console card holding the whole
   page, with a header bar (large diamond + section title + optional action/stat)
   and a padded body. Rendered by the <x-account-wrap> component. */
.crystal .cc-wrap-card {
  background: linear-gradient(165deg, rgba(11,30,45,.62), rgba(6,18,30,.78));
  border: 1px solid rgba(95,200,205,.16); border-radius: 16px; overflow: hidden;
}
.crystal .cc-wrap-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 18px 26px; border-bottom: 1px solid var(--cc-hair-2); background: rgba(0,0,0,.2);
}
.crystal .cc-wrap-hd-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.crystal .cc-wrap-hd-title .cz {
  font-size: 18px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--cc-t-bright);
}
.crystal .cc-wrap-hd .cc-diamond { width: 12px; height: 12px; box-shadow: 0 0 9px rgba(47,230,192,.6); }
.crystal .cc-wrap-body { padding: 24px 26px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 640px) { .crystal .cc-wrap-hd, .crystal .cc-wrap-body { padding-left: 16px; padding-right: 16px; } }

/* ---- Console card + header bar ------------------------------------------ */
.crystal .cc-card {
  background: var(--cc-card-grad); border: 1px solid rgba(95,200,205,.15);
  border-radius: var(--cc-r-card); overflow: hidden;
}
.crystal .cc-card-pad { padding: 24px 26px; }

/* ---- Account content panel ----------------------------------------------------
   Shared bordered "wrapper" the account pages sit in (matches the Item Shop panel).
   Wrap a page's content column in this so every account page reads consistently. */
.crystal .cc-content-panel {
  border: 1px solid rgba(95,200,205,.13); border-radius: 18px;
  background: rgba(8,20,31,.6); padding: 24px;
  display: flex; flex-direction: column; gap: 18px;
}
@media (max-width: 640px) { .crystal .cc-content-panel { padding: 16px; } }
.crystal .cc-card-hd {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--cc-hair-2); background: var(--cc-card-header);
}
.crystal .cc-card-hd-title {
  font-size: 13.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cc-t-head);
}
.crystal .cc-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; letter-spacing: .06em; color: var(--cc-t-head);
}

/* ---- Stat tile ----------------------------------------------------------- */
.crystal .cc-stat {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 13px;
  background: var(--cc-card-grad); border: 1px solid rgba(95,200,205,.15);
}
.crystal .cc-stat-ic {
  width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.crystal .cc-stat-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--cc-muted);
}
.crystal .cc-stat-value { font-size: 18px; font-weight: 800; color: var(--cc-t-head); margin-top: 2px; }

/* Detail rows (key/value list inside a card) */
.crystal .cc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid rgba(95,200,205,.08);
}
.crystal .cc-row:last-child { border-bottom: 0; }
.crystal .cc-row-k { font-size: 12.5px; color: var(--cc-t-body-2); }
.crystal .cc-row-v { font-size: 13px; font-weight: 700; color: var(--cc-t-head); }

/* ---- Buttons ------------------------------------------------------------- */
.crystal .cc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 26px; border-radius: 10px; border: 0; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cc-on-accent); background: var(--cc-accent);
  /* Even all-around glow (0 0 …) instead of an offset drop, so the shadow reads
     symmetrically on every side — matching the gold buttons' distribution. */
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 0 18px rgba(47,230,192,.4); transition: transform .2s, box-shadow .2s, filter .2s;
}
.crystal .cc-btn:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 26px rgba(47,230,192,.55); filter: brightness(1.05); }
.crystal .cc-btn:active { transform: translateY(0) scale(.98); }
.crystal .cc-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.crystal .cc-btn-gold { color: var(--cc-on-accent); background: var(--cc-gold-grad); box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 0 18px rgba(47,230,192,.4); }
.crystal .cc-btn-sm { padding: 9px 16px; font-size: 11px; }
.crystal .cc-btn-block { width: 100%; }

.crystal .cc-btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 8px; cursor: pointer; font-family: inherit;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: #cfeef0;
  background: rgba(8,24,36,.5); border: 1px solid rgba(120,225,210,.3); transition: all .2s;
}
.crystal .cc-btn-secondary:hover { border-color: rgba(120,225,210,.55); color: var(--cc-t-bright); background: rgba(8,30,44,.7); }

.crystal .cc-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 7px;
  font-size: 11px; font-weight: 700; color: var(--cc-teal);
  background: rgba(47,230,192,.08); border: 1px solid rgba(47,230,192,.25); cursor: pointer; transition: all .2s;
}
.crystal .cc-pill:hover { background: rgba(47,230,192,.14); }
.crystal .cc-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 8px;
  background: rgba(7,20,30,.6); border: 1px solid rgba(95,200,205,.15); font-size: 11px; color: #cfe6e3;
}

/* ---- Notification badges --------------------------------------------------
   Recolored from the old bright-red to the Crystal palette: teal = general
   counts, gold = vote/prize. Used on the avatar dropdown, the account sidebar,
   and the user-panel rail so a count looks identical everywhere. */
.crystal .cc-badge, .crystal .cc-badge-gold {
  min-width: 18px; height: 18px; padding: 0 6px; border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; line-height: 1; flex-shrink: 0;
}
.crystal .cc-badge      { color: #7fe6d2; background: rgba(47,230,192,.16);  border: 1px solid rgba(47,230,192,.4);  box-shadow: 0 0 8px rgba(47,230,192,.25); }
.crystal .cc-badge-gold { color: #e6d28a; background: rgba(230,210,138,.16); border: 1px solid rgba(230,210,138,.42); box-shadow: 0 0 8px rgba(230,210,138,.25); }
/* tiny dot variant (avatar pill) */
.crystal .cc-dot-badge {
  width: 8px; height: 8px; border-radius: 50%; background: var(--cc-teal);
  box-shadow: 0 0 8px rgba(47,230,192,.7); flex-shrink: 0;
}
.crystal .cc-dot-badge.is-gold { background: var(--cc-gold); box-shadow: 0 0 8px rgba(230,210,138,.7); }

/* ---- Banners (info / success / warning) --------------------------------- */
.crystal .cc-banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-radius: 13px;
  font-size: 13px; line-height: 1.5;
}
.crystal .cc-banner-ok      { background: linear-gradient(135deg, rgba(47,230,160,.12), rgba(6,18,30,.4)); border: 1px solid rgba(47,230,160,.3); color: #7fe6c0; }
.crystal .cc-banner-info    { background: linear-gradient(135deg, rgba(47,230,192,.1), rgba(6,18,30,.4));  border: 1px solid rgba(47,230,192,.25); color: #bfeee6; }
.crystal .cc-banner-warn    { background: linear-gradient(135deg, rgba(224,160,123,.12), rgba(6,18,30,.4)); border: 1px solid rgba(224,160,123,.3); color: #e9c3a6; }
.crystal .cc-banner-danger  { background: linear-gradient(135deg, rgba(224,138,138,.12), rgba(6,18,30,.4)); border: 1px solid rgba(224,138,138,.3); color: #e9b3b3; }
.crystal .cc-banner-ic { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---- Form controls ------------------------------------------------------- */
.crystal .cc-label {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cc-muted); margin-bottom: 8px;
}
.crystal .cc-input, .crystal .cc-select, .crystal .cc-textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--cc-r-control);
  background: rgba(4,12,20,.6); border: 1px solid var(--cc-hair-strong);
  color: var(--cc-t-bright); font-family: inherit; font-size: 13.5px; transition: border-color .2s, box-shadow .2s;
}
.crystal .cc-input::placeholder, .crystal .cc-textarea::placeholder { color: #4f7785; }
.crystal .cc-input:focus, .crystal .cc-select:focus, .crystal .cc-textarea:focus {
  outline: none; border-color: rgba(47,230,192,.5); box-shadow: 0 0 0 3px rgba(47,230,192,.12);
}
.crystal .cc-field-error { font-size: 11.5px; color: var(--cc-danger); margin-top: 6px; }

/* ---- Site-wide field palette --------------------------------------------------
   Every text field on a crystal/beta page uses the teal palette + a teal focus
   ring — even plain or classic-fallback markup that doesn't carry .cc-input — so a
   field never shows the classic gold. Buttons/checkboxes/radios are excluded.
   Specificity stays low enough that inline styles still win. */
.crystal input[type="text"], .crystal input[type="email"], .crystal input[type="password"],
.crystal input[type="search"], .crystal input[type="number"], .crystal input[type="url"],
.crystal input[type="tel"], .crystal input[type="date"], .crystal input[type="datetime-local"],
.crystal input:not([type]), .crystal textarea, .crystal select {
  background: rgba(4,12,20,.6);
  border: 1px solid rgba(95,200,205,.18);
  color: #cfeef0;
}
.crystal input[type="text"]:focus, .crystal input[type="email"]:focus, .crystal input[type="password"]:focus,
.crystal input[type="search"]:focus, .crystal input[type="number"]:focus, .crystal input[type="url"]:focus,
.crystal input[type="tel"]:focus, .crystal input[type="date"]:focus, .crystal input[type="datetime-local"]:focus,
.crystal input:not([type]):focus, .crystal textarea:focus, .crystal select:focus {
  outline: none; border-color: rgba(47,230,192,.6); box-shadow: 0 0 0 3px rgba(47,230,192,.12);
}
.crystal input::placeholder, .crystal textarea::placeholder { color: #5f8a96; }
/* Autofill: browsers force a pale background + blue text/ring on autofilled
   fields, which breaks the dark teal look (the "wrong" filled state). Pin the
   crystal palette via an inset box-shadow + text-fill-color, and freeze the
   bg transition so there's no white flash. */
.crystal input:-webkit-autofill,
.crystal input:-webkit-autofill:hover,
.crystal input:-webkit-autofill:focus,
.crystal textarea:-webkit-autofill,
.crystal select:-webkit-autofill {
  -webkit-text-fill-color: #cfeef0;
  -webkit-box-shadow: 0 0 0 1000px rgba(4,12,20,.92) inset;
          box-shadow: 0 0 0 1000px rgba(4,12,20,.92) inset;
  caret-color: #cfeef0;
  border: 1px solid rgba(95,200,205,.18);
  transition: background-color 9999s ease-out 0s;
}
/* Classic form.input component: the box (border/bg) lives on the `.input` LABEL
   wrapper, not the bare <input>, so the global input rule alone left these
   not-yet-re-skinned fields on the classic style. Give the wrapper the crystal
   teal box and neutralise the inner input so it never double-borders. */
.crystal .form-input .input {
  display: flex; align-items: center; gap: 10px;
  background: rgba(4,12,20,.6);
  border: 1px solid rgba(95,200,205,.18);
  border-radius: var(--cc-r-control);
  padding: 0 14px;
  color: #cfeef0;
  transition: border-color .2s, box-shadow .2s;
}
.crystal .form-input .input:focus-within { border-color: rgba(47,230,192,.6); box-shadow: 0 0 0 3px rgba(47,230,192,.12); }
.crystal .form-input .input.has-error { border-color: rgba(224,138,138,.55); }
.crystal .form-input .input > i { color: #4f7785; flex-shrink: 0; }
.crystal .form-input .input:focus-within > i { color: var(--cc-teal); }
.crystal .form-input .input > input {
  flex: 1; min-width: 0; padding: 12px 0;
  background: transparent !important; border: 0 !important; box-shadow: none !important; color: #cfeef0;
}
.crystal .form-input .input > input:focus { outline: none; box-shadow: none !important; }
.crystal .form-input .text.danger { font-size: 11.5px; color: var(--cc-danger); margin-top: 6px; }

/* ---- Ticket Rewards modal — crystal re-skin -------------------------------
   The modal markup is shared (classic component), so re-color it ONLY under
   .crystal here; the classic site keeps its navy+gold look. Coin amounts stay
   gold (matches the crystal coin treatment); structure/accents become teal. */
.crystal .trm-modal {
  background: linear-gradient(165deg, rgba(11,30,45,.97), rgba(6,18,30,.98));
  border: 1px solid rgba(95,200,205,.22);
  box-shadow: 0 25px 60px -10px rgba(0,0,0,.7), 0 0 40px rgba(47,230,192,.08), inset 0 1px 0 rgba(255,255,255,.05);
}
.crystal .trm-title { color: var(--cc-t-bright); }
.crystal .trm-subtitle { color: var(--cc-teal); }
.crystal .trm-coin { background: var(--cc-gold-grad); color: #2a1e06; box-shadow: 0 0 24px rgba(230,210,138,.3), inset 0 1px 0 rgba(255,255,255,.25); }
.crystal .trm-section-title { color: var(--cc-teal); }
.crystal .trm-cat-row:hover { background: rgba(47,230,192,.06); border-color: rgba(47,230,192,.25); }
.crystal .trm-cat-row-default { background: rgba(47,230,192,.04); border-color: rgba(47,230,192,.14); }
.crystal .trm-cat-amount, .crystal .trm-cat-amount i { color: var(--cc-gold); }
.crystal .trm-default-card { background: linear-gradient(135deg, rgba(47,230,192,.1), rgba(6,18,30,.4)); border-color: rgba(47,230,192,.25); }
.crystal .trm-default-icon { background: rgba(230,210,138,.14); color: var(--cc-gold); }
.crystal .trm-default-amount { color: var(--cc-gold); }
.crystal .trm-note { background: rgba(47,230,192,.08); border-color: rgba(47,230,192,.22); color: #bfeee6; }
.crystal .trm-tips li::before { color: var(--cc-ok); }
.crystal .trm-btn-close {
  background: var(--cc-accent); border: 1px solid transparent; color: var(--cc-on-accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 0 16px rgba(47,230,192,.38);
}
.crystal .trm-btn-close:hover { filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 24px rgba(47,230,192,.52); transform: translateY(-1px); }

/* ---- Generic responsive grids ------------------------------------------- */
.crystal .cc-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.crystal .cc-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.crystal .cc-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ---- Footer -------------------------------------------------------------- */
.crystal .cc-footer {
  border-top: 1px solid var(--cc-hair); background: var(--cc-footer-bg); margin-top: 48px;
}
.crystal .cc-footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 24px 0;
}
.crystal .cc-footer-brand { font-size: 15px; font-weight: 800; letter-spacing: .16em; color: #cfe6e3; }
.crystal .cc-footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.crystal .cc-footer-link { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--cc-muted); transition: color .2s; }
.crystal .cc-footer-link:hover { color: var(--cc-teal); }
.crystal .cc-footer-meta { font-size: 12px; color: var(--cc-muted); }
.crystal .cc-social { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(8,24,36,.5); border: 1px solid var(--cc-hair); color: var(--cc-muted-2); transition: all .25s; }
.crystal .cc-social:hover { color: var(--cc-teal); border-color: rgba(47,230,192,.4); transform: translateY(-2px); }

/* Multi-column footer (HOMEPAGE frame): brand + GAME/COMMUNITY/ACCOUNT columns,
   hairline divider, bottom row (copyright + language/theme controls). */
.crystal .cc-footer-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 30px 48px; padding: 46px 0 34px; flex-wrap: wrap;
}
.crystal .cc-footer-brandcol { flex: 1 1 240px; max-width: 360px; }
.crystal .cc-footer-col { flex: 0 1 auto; min-width: 150px; }
.crystal .cc-footer-brandrow { display: flex; align-items: center; gap: 11px; }
.crystal .cc-footer-tagline { font-size: 13px; line-height: 1.65; color: var(--cc-t-body-2); margin: 15px 0 18px; }
/* Admin-editable rich text (hero subtitle + footer tagline/copyright): tame the
   RichEditor <p> wrapping and theme inline links teal. */
.crystal .cc-hero-sub p, .crystal .cc-footer-tagline p { margin: 0; }
.crystal .cc-footer-meta p { margin: 0; display: inline; }
.crystal .cc-hero-sub a, .crystal .cc-footer-tagline a, .crystal .cc-footer-meta a { color: #2fe6c0; text-decoration: underline; }
.crystal .cc-hero-sub a:hover, .crystal .cc-footer-tagline a:hover, .crystal .cc-footer-meta a:hover { color: #7fe6d2; }
.crystal .cc-footer-social { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(8,24,36,.5); border: 1px solid var(--cc-hair); color: var(--cc-muted-2); transition: all .25s; }
.crystal .cc-footer-social:hover { color: var(--cc-teal); border-color: rgba(47,230,192,.4); transform: translateY(-2px); }
.crystal .cc-footer-colh { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #5f97a6; margin: 0 0 16px; }
.crystal .cc-footer-collist { display: flex; flex-direction: column; gap: 11px; }
.crystal .cc-footer-navlink { font-size: 13px; color: #9fc0cb; transition: color .2s; width: max-content; }
.crystal .cc-footer-navlink:hover { color: var(--cc-teal); }
.crystal .cc-footer-divider { height: 1px; background: var(--cc-hair-2); }
.crystal .cc-footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 0 26px; }
.crystal .cc-footer-bottom-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* The language switcher sits at the page bottom — flip its dropdown to open
   upward so it isn't pushed off-screen below the footer. */
.crystal .cc-footer .cc-menu { top: auto; bottom: calc(100% + 8px); }
/* Admin "More" links — horizontal row in the footer bottom bar (replaces the old 5th column). */
.crystal .cc-footer-morelinks { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; flex: 1; min-width: 0; padding: 0 12px; }
.crystal .cc-footer-morelinks a { font-size: 12px; color: #9fc0cb; transition: color .2s; white-space: nowrap; }
.crystal .cc-footer-morelinks a:hover { color: var(--cc-teal); }
@media (max-width: 760px) { .crystal .cc-footer-morelinks { justify-content: flex-start; flex: 1 1 100%; padding: 8px 0 0; } }
/* Language switcher — labelled pill (diamond + CODE · Name) instead of a bare globe. */
.crystal .cc-lang-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 10px; background: rgba(7,20,30,.6); border: 1px solid var(--cc-hair-strong); color: var(--cc-t-head); font-size: 12.5px; cursor: pointer; transition: border-color .2s; white-space: nowrap; }
.crystal .cc-lang-btn:hover { border-color: rgba(47,230,192,.4); }
.crystal .cc-lang-code { font-weight: 800; letter-spacing: .04em; color: var(--cc-t-bright); }
.crystal .cc-lang-name { font-weight: 600; color: var(--cc-muted); }
.crystal .cc-lang-chev { color: var(--cc-muted); flex-shrink: 0; }
@media (max-width: 520px) { .crystal .cc-lang-name { display: none; } }
@media (max-width: 1150px) { .crystal .cc-footer-brandcol { flex-basis: 100%; max-width: none; } }
@media (max-width: 640px) { .crystal .cc-footer-top { gap: 24px 30px; } .crystal .cc-footer-col { flex-basis: 42%; } }

/* ============================================================================
   BETA TOGGLE UI (README §4.5) — announcement bar, floating button, return
   banner, inline toggle. These render on BOTH classic and crystal, so they are
   intentionally self-contained (the .cc-bs-* set carries its own colors).
   ============================================================================ */
.cc-bs-announce {
  display: flex; align-items: center; gap: 16px; padding: 11px 22px;
  background: linear-gradient(100deg, rgba(47,230,192,.18), rgba(21,140,200,.1) 58%, rgba(6,18,30,.55));
  border-bottom: 1px solid rgba(47,230,192,.25);
  font-family: 'Manrope', system-ui, sans-serif; color: #9fc0cb; position: relative; z-index: 60;
}
.cc-bs-announce .cc-bs-spark {
  width: 34px; height: 34px; border-radius: 9px; background: rgba(47,230,192,.14);
  border: 1px solid rgba(47,230,192,.32); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cc-bs-announce .cc-bs-copy { flex: 1; min-width: 0; }
.cc-bs-announce .cc-bs-copy b { font-family: 'Cinzel', serif; font-size: 15px; font-weight: 700; color: #eafdfb; display: block; }
.cc-bs-announce .cc-bs-copy span { font-size: 12.5px; color: #9fc0cb; }
.cc-bs-cta {
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 22px; border: 0; cursor: pointer;
  border-radius: 9px; font-family: inherit; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: #04141e; background: linear-gradient(135deg, #2fe6c0, #15b9d6); box-shadow: 0 8px 20px rgba(25,200,200,.35); flex-shrink: 0;
}
.cc-bs-cta:hover { filter: brightness(1.05); }
.cc-bs-dismiss { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 7px; color: #7fa6b1; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cc-bs-dismiss:hover { color: #cfe6e3; background: rgba(255,255,255,.05); }

/* Floating "Try the Beta" button */
.cc-bs-fab {
  position: fixed; bottom: 22px; right: 22px; z-index: 70;
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border: 0; cursor: pointer;
  border-radius: 40px; background: linear-gradient(135deg, #2fe6c0, #15b9d6); color: #04141e;
  box-shadow: 0 14px 34px rgba(25,200,200,.45); font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 13px; letter-spacing: .04em;
}
.cc-bs-fab:hover { transform: translateY(-2px); }

/* Return banner (shown in beta) */
.cc-bs-return {
  display: flex; align-items: center; gap: 15px; padding: 11px 22px;
  background: rgba(7,20,30,.85); border-bottom: 1px solid rgba(95,200,205,.22);
  font-family: 'Manrope', sans-serif; position: relative; z-index: 60;
}
.cc-bs-return .cc-bs-tag {
  padding: 5px 11px; border-radius: 7px; font-size: 10px; font-weight: 800; letter-spacing: .12em;
  color: #04141e; background: linear-gradient(135deg, #2fe6c0, #15b9d6); flex-shrink: 0;
}
.cc-bs-return .cc-bs-msg { flex: 1; font-size: 12.5px; line-height: 1.5; color: #9fc0cb; min-width: 0; }
.cc-bs-back {
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: #cfeef0; padding: 9px 16px; border-radius: 8px;
  background: rgba(8,24,36,.6); border: 1px solid rgba(120,225,210,.3); cursor: pointer; flex-shrink: 0; font-family: inherit;
}
.cc-bs-back:hover { border-color: rgba(120,225,210,.55); color: #fff; }

/* Inline Classic/Beta segmented toggle */
.cc-seg { display: inline-flex; align-items: center; padding: 3px; border-radius: 10px; background: rgba(4,12,20,.7); border: 1px solid var(--cc-hair-strong); gap: 4px; }
.cc-seg button {
  padding: 6px 14px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 700; line-height: 1.25; color: var(--cc-t-body);
}
.cc-seg button.is-active { font-weight: 800; color: #04141e; background: linear-gradient(135deg, #2fe6c0, #15b9d6); box-shadow: 0 0 12px rgba(47,230,192,.3); }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 1024px) {
  .crystal .cc-navlinks { display: none; }
  .crystal .cc-burger { display: inline-flex; align-items: center; justify-content: center; }
  .crystal .cc-account { grid-template-columns: 1fr; }
  .crystal .cc-sidebar { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
  .crystal .cc-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .crystal .cc-grid-2,
  .crystal .cc-grid-3,
  .crystal .cc-grid-4 { grid-template-columns: 1fr; }
  .crystal .cc-coin { display: none; }
  .cc-bs-announce .cc-bs-copy span { display: none; }
}

/* ============================================================================
   Defensive resets — the classic theme (app.scss) applies global form-button
   styling (full-width, gold) that bleeds into crystal <button>s. Pin every
   crystal/beta-switch control back to its intended size/shape. Placed last so it
   wins on equal specificity; !important guards against any classic !important.
   ============================================================================ */
.crystal button,
.cc-bs-cta, .cc-bs-fab, .cc-bs-back, .cc-bs-dismiss, .cc-seg > button {
  -webkit-appearance: none; appearance: none;
  font-family: 'Manrope', system-ui, sans-serif;
}
/* The classic app.scss rule (app.scss:2660-2676)
     form/.auth-card/.internal-form/.login-form button { &[type=submit],&.default-button
       { width:100% } }        (NOT !important)
   makes crystal SUBMIT buttons full-width. The old fix was a blanket
   `.crystal button{width:auto!important}` — but that ALSO collapsed every fixed-size
   icon/close button (the /download step nodes, .cc-icon-btn, the modal close .cc-fw-x,
   a w-9 rounded-full popup close) down to its content width → a vertical ellipse
   site-wide. Undo the bleed at the SOURCE instead: only on the submit/.default-button
   buttons it actually targets. No icon/close button is ever [type=submit] (they are
   type=button), so each keeps its real width. Buttons that DO want full width opt in
   with .cc-btn-block; an inline width or .cc-icon-btn is also left untouched. */
.crystal form button[type="submit"]:not(.cc-btn-block):not(.cc-icon-btn):not([style*="width:"]),
.crystal .auth-card button[type="submit"]:not(.cc-btn-block):not(.cc-icon-btn):not([style*="width:"]),
.crystal .internal-form button[type="submit"]:not(.cc-btn-block):not(.cc-icon-btn):not([style*="width:"]),
.crystal .login-form button[type="submit"]:not(.cc-btn-block):not(.cc-icon-btn):not([style*="width:"]),
.crystal form button.default-button:not(.cc-btn-block):not(.cc-icon-btn):not([style*="width:"]) {
  width: auto !important;
}
/* Legacy beta-switch / segment controls keep content-width (unchanged behavior). */
.cc-bs-cta, .cc-bs-fab, .cc-bs-back, .cc-bs-dismiss, .cc-seg > button { width: auto !important; }
.crystal .cc-btn, .crystal .cc-btn-secondary, .crystal .cc-pill,
.crystal .cc-userpill { width: auto !important; }
.crystal .cc-btn-block { width: 100% !important; }
/* The classic app.scss gold form-button style bleeds onto <button class="cc-btn">
   (no inline bg) — e.g. the login submit rendered GOLD instead of teal. Force the
   teal accent back for every cc-btn except the explicit gold variant. The teal <a>
   CTAs were unaffected (only <button> elements got the bleed) but this covers both. */
.crystal button.cc-btn,
.crystal .cc-btn,
.crystal .cc-btn-gold { background: var(--cc-accent) !important; color: var(--cc-on-accent) !important; border: 0 !important;
  /* Override box-shadow too (!important): the classic app.scss submit-button rule
     paints a GOLD glow on :hover with !important (app.scss:2681), which otherwise
     bleeds onto every <button type="submit" class="cc-btn"> (e.g. the LOGIN button)
     because our non-!important base shadow can't beat it. Force an even teal glow. */
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 0 18px rgba(47,230,192,.4) !important; }
.crystal .cc-btn:hover, .crystal .cc-btn-gold:hover { filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 26px rgba(47,230,192,.55) !important; }
.crystal .cc-btn:disabled, .crystal button.cc-btn:disabled { box-shadow: none !important; }
/* ============================================================================
   INPUT FIELDS — DEFINITIVE override (supersedes the old weak block).
   Root cause of the recurring gold-focus + text-under-icon bug: the classic
   app.scss rule
     form input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]){
       height:46px; padding:0 12px; background; border; caret:gold; box-shadow;
       &:focus{ border:gold; box-shadow:glow } } !important
   (app.scss:2497-2538) has specificity (0,4,2) (focus arm (0,5,2)) AND !important —
   so it beats every lower-specificity crystal rule, INCLUDING the login's inline
   style="padding-left:38px" (because !important beats inline). We out-specify it with
   our own .crystal-prefixed :not()x4/x5 chains, all !important, scoped to .crystal so
   the classic site is byte-untouched. */

/* (1) BASE box — teal for every text control. (0,6,1) > classic (0,4,2). */
.crystal input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]),
.crystal textarea, .crystal select {
  background: rgba(4,12,20,.62) !important;
  border: 1px solid rgba(95,200,205,.20) !important;
  color: #cfeef0 !important;
  caret-color: #2fe6c0 !important;
  box-shadow: none !important;
}
/* (1b) EMBEDDED/BARE inputs — a transparent <input> that lives INSIDE a styled
   wrapper box (the site-wide search fields: a flex box with an <i> + an <input>
   carrying inline `background:none;border:none`, e.g. streams / news / shop /
   directory search). Arm (1) repaints them with the teal box → an ugly
   "input inside a box". Honor the inline opt-out at (0,7,1) > (0,6,1) so the
   wrapper stays the only visible box. Keyed on the author's `border:none`. */
.crystal input[style*="border:none"]:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]),
.crystal input[style*="border: none"]:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
/* Focus: keep the embedded input fully transparent — the wrapper is the box, so the
   input must never paint its own ring. (0,8,1) beats arm (2)'s focus ring (0,7,1). */
.crystal input[style*="border:none"]:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):focus,
.crystal input[style*="border: none"]:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):focus {
  border: 0 !important; box-shadow: none !important; outline: none !important;
}
/* (2) FOCUS — kill the gold, force the teal ring. (0,7,1) > classic :focus (0,5,2). */
.crystal input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):focus,
.crystal textarea:focus, .crystal select:focus {
  border-color: rgba(47,230,192,.65) !important;
  box-shadow: 0 0 0 3px rgba(47,230,192,.16) !important;
  outline: none !important;
}
/* (2b) AUTOFILL — browsers paint a pale-yellow bg + dark text on autofilled fields;
   arm (1)'s `box-shadow:none` would otherwise expose that yellow. Repaint dark-teal
   via the inset box-shadow trick + teal text-fill at (0,7,1), beating arm (1) AND the
   classic autofill rule (app.scss:2513). Sets BOTH -webkit- and standard box-shadow. */
.crystal input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):-webkit-autofill,
.crystal input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):-webkit-autofill:hover,
.crystal input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):-webkit-autofill:focus,
.crystal input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px rgba(6,16,26,.97) inset !important;
  box-shadow: 0 0 0 1000px rgba(6,16,26,.97) inset !important;
  -webkit-text-fill-color: #cfeef0 !important;
  caret-color: #2fe6c0 !important;
  border: 1px solid rgba(95,200,205,.20) !important;
  transition: background-color 99999s ease-out 0s !important;
}

/* (3) LOGIN / absolute-icon fields: an <i> sits immediately before
   <input class="cc-input" style="padding-left:38px">; classic padding:0 12px !important
   kills that inline gutter, so the typed text rides under the icon. Restore the left
   gutter at (0,6,2) > classic (0,4,2). Only matches icon-prefixed cc-inputs. */
.crystal i + input.cc-input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]) {
  padding-left: 38px !important;
}
/* (3b) Same bug, non-.cc-input icon fields: an absolute <i> immediately followed by
   an <input> that carries an inline `padding-left` to clear it (e.g. the guilds
   invite search: <i> + <input class="gld-input" style="padding-left:38px">). Classic
   `form input{padding:0 12px !important}` kills that inline gutter so the placeholder
   rides UNDER the glyph. Reassert the 38px gutter (the site convention) for any
   icon-prefixed input that declared one. (0,7,2) > classic (0,4,2). */
.crystal i + input[style*="padding-left"]:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]) {
  padding-left: 38px !important;
}
/* (4) Classic <x-form.input> component (.form-input > label.input > i + input): the
   icon is a FLEX sibling. Make the wrapper a flex row, give the icon a fixed lane and
   let the input fill the rest, so text can never ride under the glyph. The inner input
   is transparent (the box lives on the wrapper); the :not()x5 keeps it above arm (1). */
.crystal .form-input .input,
.crystal .form-input label.input {
  display: flex !important; align-items: center !important; gap: 10px !important;
  justify-content: flex-start !important;
  height: auto !important; min-height: 46px !important;
  background: rgba(4,12,20,.62) !important; border: 1px solid rgba(95,200,205,.20) !important;
  border-radius: var(--cc-r-control, 9px) !important; padding: 0 14px !important; overflow: hidden !important;
}
.crystal .form-input .input:focus-within,
.crystal .form-input label.input:focus-within {
  border-color: rgba(47,230,192,.65) !important; box-shadow: 0 0 0 3px rgba(47,230,192,.16) !important;
}
.crystal .form-input .input > i,
.crystal .form-input label.input > i {
  flex: 0 0 auto !important; width: 20px !important; text-align: center !important; margin: 0 !important; color: #4f7785 !important;
}
.crystal .form-input .input:focus-within > i,
.crystal .form-input label.input:focus-within > i { color: #2fe6c0 !important; }
.crystal .form-input .input > input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]),
.crystal .form-input label.input > input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]) {
  flex: 1 1 auto !important; min-width: 0 !important; height: 44px !important;
  padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important;
  color: #cfeef0 !important; caret-color: #2fe6c0 !important;
}
/* The armory switch is a fixed-size track — keep the global width:auto reset off it. */
.crystal .cc-armory-toggle { width: 42px !important; }
.cc-seg > button { background: transparent; color: var(--cc-t-body); box-shadow: none; }
.cc-seg > button.is-active { background: linear-gradient(135deg, #2fe6c0, #15b9d6) !important; color: #04141e !important; }
/* The classic app.scss styles form buttons gold; that bleeds onto the *inactive*
   segment (e.g. "Classic" rendered gold on the beta site). Force it back to the
   dark/transparent Console look. High specificity + !important beats the classic
   stylesheet rule (the buttons carry no inline background). */
.crystal .cc-seg > button:not(.is-active) { background: transparent !important; color: var(--cc-t-body) !important; border: 0 !important; box-shadow: none !important; }
/* Active segment ("Beta"): the seg buttons are <button type="submit"> in forms, so
   the classic gold submit :hover glow bled onto the active pill. Force an even teal
   glow. (0,3,1)+!important beats the classic (0,2,2) :hover rule. */
.crystal .cc-seg > button.is-active { box-shadow: 0 0 12px rgba(47,230,192,.5) !important; }
.cc-bs-announce form button.cc-bs-cta, .cc-bs-cta { background: linear-gradient(135deg, #2fe6c0, #15b9d6) !important; color: #04141e !important; border: 0 !important; }
.cc-bs-back { background: rgba(8, 24, 36, .6); color: #cfeef0; }

/* Footer Classic/Beta toggle height. The classic app.scss rule
   `form button[type="submit"] { height: 46px !important }` (app.scss:2675) forces
   BOTH seg buttons to 46px (box-sizing:border-box, so prior padding tweaks did
   nothing) → the .cc-seg rendered ~54px vs the ~33px language pill. Pin the seg
   buttons to a fixed 25px line-box so the wrapper (25 + 3px*2 pad + 1px*2 border =
   33px) matches .cc-lang-btn exactly. Specificity (0,3,1)+!important beats the
   classic (0,1,2)+!important rule. */
.crystal .cc-seg > button,
.crystal .cc-seg > button[type="submit"] {
  height: 25px !important;
  min-height: 25px !important;
  max-height: 25px !important;
  line-height: 25px !important;
  padding: 0 14px !important;
  border: 0 !important;
  box-sizing: border-box !important;
  font-size: 12px;
}

/* "Back to Classic" button (beta-return banner) is a <button type="submit"> in a
   <form>, so the classic app.scss gold submit styling bled onto it. Force the dark
   teal-bordered Console look. (0,3,2)/(0,2,2)+!important beats classic (0,1,2). */
.crystal .cc-bs-return form button.cc-bs-back,
.crystal button.cc-bs-back {
  background: rgba(8,24,36,.7) !important;
  color: #cfeef0 !important;
  border: 1px solid rgba(95,200,205,.3) !important;
  height: auto !important; min-height: 0 !important;
  padding: 9px 18px !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}
.crystal .cc-bs-return form button.cc-bs-back:hover,
.crystal button.cc-bs-back:hover { border-color: rgba(47,230,192,.5) !important; color: #eafdfb !important; }

/* Guild page buttons: the classic app.scss gold submit style bled onto
   <button type="submit" class="gld-btn"> ("Found your guild" rendered GOLD,
   46px tall). Force the guild teal identity back at (0,2,1)+!important, then
   re-pin the ghost/danger variants AFTER so they keep their look. */
.crystal button.gld-btn {
  background: linear-gradient(135deg, #2fe6c0, #15b9d6) !important;
  color: #04141e !important;
  border: 0 !important;
  box-shadow: none !important;
  height: auto !important;
  text-shadow: none !important;
}
.crystal button.gld-btn:hover { filter: brightness(1.08); box-shadow: none !important; transform: none; }
.crystal button.gld-btn.gld-btn-ghost {
  background: rgba(7,18,28,.6) !important;
  border: 1px solid rgba(95,200,205,.16) !important;
  color: #cfe6e3 !important;
}
.crystal button.gld-btn.gld-btn-danger {
  background: rgba(224,123,123,.08) !important;
  border: 1px solid rgba(224,123,123,.3) !important;
  color: #e59b9b !important;
}

/* ============================================================================
   ACCOUNT MENU — the grouped navigation shared by the homepage ACCOUNT card
   (design 1c: pinned quick actions + hover flyouts) and the /user/ sidebar
   (design 1d: collapsible groups). Both surfaces render from one source,
   App\Support\AccountMenu, so a new feature joins a GROUP and appears in both.

   Deliberately additive: .cc-sidelink / .cc-side-sep are NOT touched here,
   because the site-wide mobile burger drawer reuses them and any change to
   their box model would silently restyle the nav on every page.
   Count badges reuse the existing .cc-badge / .cc-badge-gold.
   ========================================================================= */

/* ---- shared bits -------------------------------------------------------- */
@keyframes ccAmSheen  { 0%, 72% { left: -60%; } 92%, 100% { left: 130%; } }
@keyframes ccAmDot    { 0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(47,230,192,.8); }
                        50%      { opacity: .55; box-shadow: 0 0 10px rgba(47,230,192,.45); } }

/* Top Up is the one commercial action in this menu, so it gets gold rather than
   the teal everything else shares — and a slow sheen instead of a badge, so it
   reads as premium without nagging. One pass every 6s, nothing for
   reduced-motion users. */
.crystal .cc-am-gold {
  position: relative; overflow: hidden; color: #f6de92; font-weight: 800;
  background: linear-gradient(135deg, rgba(240,193,74,.10), rgba(240,193,74,.03));
  border: 1px solid rgba(240,193,74,.30);
}
.crystal .cc-am-gold svg { color: #f0c14a; }
.crystal .cc-am-gold:hover {
  color: #ffe9a8; border-color: rgba(240,193,74,.55);
  background: linear-gradient(135deg, rgba(240,193,74,.17), rgba(240,193,74,.05));
}
.crystal .cc-am-gold::after {
  content: ""; position: absolute; inset: 0 auto 0 -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,245,214,.20), transparent);
  transform: skewX(-18deg); animation: ccAmSheen 6s ease-in-out infinite; pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .crystal .cc-am-gold::after { animation: none; opacity: 0; }
}

/* NEW pill, € tag, and the teal "something new in here" dot. */
.crystal .cc-am-new {
  font-size: 8.5px; font-weight: 800; letter-spacing: .1em; color: #04141e;
  background: linear-gradient(135deg, #2fe6c0, #15b9d6);
  padding: 2px 7px; border-radius: 20px; line-height: 1.4; white-space: nowrap;
}
.crystal .cc-am-euro {
  font-size: 9px; font-weight: 800; color: #e6d28a; background: rgba(230,210,138,.12);
  border: 1px solid rgba(230,210,138,.3); border-radius: 5px; padding: 1px 5px; line-height: 1.4;
}
.crystal .cc-am-dot {
  width: 5px; height: 5px; border-radius: 50%; background: #2fe6c0;
  flex-shrink: 0; animation: ccAmDot 2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .crystal .cc-am-dot { animation: none; } }

/* ---- 1d: /user/ sidebar groups ------------------------------------------ */
.crystal .cc-sg { display: flex; flex-direction: column; }
.crystal .cc-sg-hd {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 13px 5px; background: none; border: 0; cursor: pointer;
  font-family: inherit; text-align: left; user-select: none; transition: filter .2s;
}
.crystal .cc-sg-hd:hover { filter: brightness(1.35); }
.crystal .cc-sg-lab {
  font-size: 9.5px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--cc-t-muted, #5f97a6); white-space: nowrap;
}
.crystal .cc-sg.is-staff .cc-sg-lab { color: #c98080; }
.crystal .cc-sg-line { flex: 1; height: 1px; background: rgba(95,200,205,.1); }
.crystal .cc-sg-chev { color: #5f97a6; flex-shrink: 0; transition: transform .2s; }
.crystal .cc-sg.is-shut .cc-sg-chev { transform: rotate(-90deg); }
.crystal .cc-sg-body { display: flex; flex-direction: column; }

/* ---- 1c: homepage card groups + flyout ---------------------------------- */
.crystal .cc-up-sec {
  font-size: 9.5px; font-weight: 800; letter-spacing: .15em;
  text-transform: uppercase; color: #3f6a77; padding: 2px 8px 0;
}
.crystal .cc-up-div { display: flex; align-items: center; gap: 8px; padding: 8px 8px 2px; }
.crystal .cc-up-div span:first-child {
  font-size: 9.5px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: #3f6a77;
}
.crystal .cc-up-div i { flex: 1; height: 1px; background: rgba(95,200,205,.1); }
.crystal .cc-upg { position: relative; }
.crystal .cc-upg .cc-up-chev { color: #5f97a6; flex-shrink: 0; }
.crystal .cc-upg .cc-up-ic.is-staff { color: #e08a8a; }

/* The panel is anchored with a 10px padding bridge rather than a margin so the
   pointer never crosses a dead gap on its way from the row into the panel. */
.crystal .cc-up-flyout { position: absolute; left: 100%; top: -8px; padding-left: 10px; z-index: 60; }
.crystal .cc-up-flyout-in {
  width: 238px; background: rgba(5,14,22,.97);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(95,200,205,.2); border-radius: 12px;
  box-shadow: 0 22px 60px rgba(0,0,0,.6); padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.crystal .cc-up-fly-hd {
  font-size: 9.5px; font-weight: 800; letter-spacing: .15em;
  text-transform: uppercase; color: #3f6a77; padding: 6px 10px 4px;
}
.crystal .cc-up-fly-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 8px; text-decoration: none; transition: background .2s;
}
.crystal .cc-up-fly-link:hover { background: rgba(47,230,192,.07); }
.crystal .cc-up-fly-link svg { color: #5f97a6; flex-shrink: 0; }
.crystal .cc-up-fly-link.is-staff svg { color: #e08a8a; }
.crystal .cc-up-fly-lab { font-size: 12px; font-weight: 600; color: #bcd7dd; }
.crystal .cc-up-fly-r { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 1024px) {
  /* The sidebar becomes a tile grid at this width. `display:contents` lets the
     group's rows tile alongside everything else instead of each group becoming
     one cramped cell, while the header spans the full row as a section label. */
  .crystal .cc-sg { display: contents; }
  .crystal .cc-sg-hd { grid-column: 1 / -1; }
  .crystal .cc-sg-body { display: contents; }
}
@media (max-width: 1100px) {
  /* No room to the right of the card — the flyout becomes an inline expansion.
     Same Alpine state, same markup, no JS branch and no breakpoint detection. */
  .crystal .cc-up-flyout { position: static; padding-left: 0; padding-top: 6px; }
  .crystal .cc-up-flyout-in { width: auto; box-shadow: none; background: rgba(4,12,20,.6); }
}

/* The ACCOUNT card is the one .cc-card whose content is designed to escape it:
   design 1c's group flyouts open to the RIGHT of the card. .cc-card sets
   overflow:hidden site-wide (that is what rounds the header strip against the
   card radius), which clipped every flyout away. Opt this one card out, and
   give its header the radius it was borrowing from the clip.

   position+z-index lift the whole card above the rail cards that follow it in
   the DOM — without it an open flyout is painted over by Server Status, which
   comes later and would otherwise win on document order. */
.crystal .cc-card.is-menu { overflow: visible; position: relative; z-index: 30; }
.crystal .cc-card.is-menu > .cc-card-hd { border-radius: var(--cc-r-card) var(--cc-r-card) 0 0; }
