/* ============================================================================
   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:            #110a08;
  --cc-surface:       #150c0a;
  --cc-card-grad:     linear-gradient(165deg, #2c1914, #1a0f0c);   /* solid: photo must not bleed through panels */
  --cc-nav-bg:        rgba(20,11,9,.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, #140b09, #04090e);   /* solid footer */

  /* Accent */
  --cc-accent:        linear-gradient(135deg, #e8a078, #d68c5a);
  --cc-accent-100:    linear-gradient(100deg, rgba(232,160,120,.18), rgba(21,140,200,.1) 58%, rgba(20,11,9,.4));
  --cc-teal:          #e8a078;
  --cc-cyan:          #d68c5a;
  --cc-bright:        #f3cdb7;
  --cc-gold-grad:     linear-gradient(135deg, #e6d28a, #d4a843);

  /* Text */
  --cc-t-bright:      #fbefe4;
  --cc-t-head:        #f6e8dc;
  --cc-t-body:        #c8b0a2;
  --cc-t-body-2:      #bba092;
  --cc-muted:         #a98272;
  --cc-muted-2:       #b89a8c;
  --cc-on-accent:     #120b0a;

  /* Lines */
  --cc-hair:          rgba(214,150,122,.14);
  --cc-hair-2:        rgba(214,150,122,.12);
  --cc-hair-strong:   rgba(214,150,122,.2);

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

  /* Geometry */
  --cc-r-card:        14px;
  --cc-r-control:     9px;

  /* Form controls (update 2.28) — see FORM CONTROL SYSTEM below */
  --cc-field-h:          46px;
  --cc-field-r:          12px;
  --cc-field-px:         14px;
  --cc-field-fs:         14px;
  --cc-field-bg:         rgba(18,10,8,.72);
  --cc-field-bg-hover:   rgba(24,14,11,.8);
  --cc-field-bg-focus:   rgba(26,15,12,.92);
  --cc-field-line:       rgba(214,150,122,.2);
  --cc-field-line-hover: rgba(214,150,122,.36);
  --cc-field-line-focus: rgba(232,160,120,.7);
  --cc-field-ring:       0 0 0 3px rgba(232,160,120,.16);
  --cc-field-inset:      inset 0 1px 2px rgba(0,0,0,.28);
  --cc-field-text:       #ffe7cf;
  --cc-field-ph:         #87766a;
  --cc-field-ic:         #886252;
  --cc-r-btn:            12px;
  --cc-r-btn-sm:         10px;
  --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; } }
/* Reversed twins for the admin "Particle Direction" switch (Homepage & Branding). */
@keyframes dustLift     { 0% { transform: translate(0,0); opacity: 0; } 10% { opacity: .9; } 88% { opacity: .6; } 100% { transform: translate(-16px,-408px); opacity: 0; } }
@keyframes dustSink     { 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: #d6bba7; 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(232,160,120,.5); }
.crystal .cc-navlink.is-active { color: var(--cc-teal); text-shadow: 0 0 14px rgba(232,160,120,.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(232,165,115,.08); border: 1px solid rgba(232,165,115,.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(22,12,10,.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(14,8,7,.6); border: 1px solid rgba(214,150,122,.3);
}
.crystal .cc-icon-btn {
  width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(30,17,14,.5); border: 1px solid var(--cc-hair-strong); color: #e9cbb6;
  cursor: pointer; transition: all .25s; font-size: .95rem;
}
.crystal .cc-icon-btn:hover { border-color: rgba(232,160,120,.4); color: var(--cc-teal); box-shadow: 0 0 14px rgba(232,160,120,.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(18,10,8,.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(232,160,120,.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(232,160,120,.07); border-color: rgba(232,160,120,.22); }
.crystal .cc-rich-item.is-active { background: linear-gradient(135deg, rgba(232,160,120,.16), rgba(232,160,120,.04)); border-color: rgba(232,160,120,.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(22,12,10,.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(232,160,120,.12); border-color: rgba(232,160,120,.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: #b89a8c; 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(34,18,14,.7), rgba(20,11,9,.82));
  border: 1px solid rgba(214,150,122,.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(232,160,120,.4) 35%, rgba(214,140,90,.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(232,160,120,.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(214,150,122,.14);
  background: rgba(20,11,9,.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: #fbefe4;
  text-transform: uppercase; letter-spacing: 0.14em; display: flex; align-items: center; gap: 0.7rem;
}
.crystal .ds-header-title i { color: #e8a078; filter: drop-shadow(0 0 10px rgba(232,160,120,.5)); font-size: 1.05rem; }
.crystal .ds-header-title .ds-gem-mark {
  display: inline-block; width: 8px; height: 8px;
  background: linear-gradient(135deg, #e8a078, #d68c5a);
  transform: rotate(45deg); box-shadow: 0 0 12px rgba(232,160,120,.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(232,165,115,.08); border: 1px solid rgba(232,165,115,.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: #f3cdb7; letter-spacing: 0.02em; }
.crystal .ds-balance-pill .ds-balance-label { font-size: 0.65rem; color: #a98272; 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(232,160,120,.18), rgba(214,140,90,.12));
  border: 1px solid rgba(232,160,120,.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(232,160,120,.28), rgba(214,140,90,.2));
  transform: translateY(-1px); color: #fbefe4;
}
.crystal .ds-topup-btn i { font-size: 0.75rem; filter: drop-shadow(0 0 4px rgba(232,160,120,.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: #e6b098; 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(22,12,10,.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(232,160,120,.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: #a98272; }
.crystal .cc-coin-pill--accent { color: var(--cc-on-accent); background: var(--cc-accent); border-color: transparent; box-shadow: 0 6px 16px rgba(214,150,110,.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(232,160,120,.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(232,160,120,.08), transparent 55%),
    linear-gradient(180deg, rgba(23,13,11,0), rgba(17,10,8,.55));
}
.crystal .cc-sidebar {
  background: var(--cc-card-grad); border: 1px solid rgba(214,150,122,.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: #ceb4a1; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .2s, color .2s;
}
.crystal .cc-sidelink:hover { background: rgba(232,160,120,.06); color: var(--cc-t-head); }
.crystal .cc-sidelink.is-active {
  background: linear-gradient(135deg, rgba(232,160,120,.16), rgba(232,160,120,.04));
  border: 1px solid rgba(232,160,120,.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(34,18,14,.62), rgba(20,11,9,.78));
  border: 1px solid rgba(214,150,122,.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(232,160,120,.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(214,150,122,.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(214,150,122,.13); border-radius: 18px;
  background: rgba(26,14,12,.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(214,150,122,.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(214,150,122,.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(232,160,120,.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(232,160,120,.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(232,160,120,.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: #fcdcc5;
  background: rgba(30,17,14,.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(36,20,16,.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(232,160,120,.08); border: 1px solid rgba(232,160,120,.25); cursor: pointer; transition: all .2s;
}
.crystal .cc-pill:hover { background: rgba(232,160,120,.14); }
.crystal .cc-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 8px;
  background: rgba(22,12,10,.6); border: 1px solid rgba(214,150,122,.15); font-size: 11px; color: #e6d4c8;
}

/* ---- 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(232,160,120,.16);  border: 1px solid rgba(232,160,120,.4);  box-shadow: 0 0 8px rgba(232,160,120,.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(232,160,120,.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) --------------------------------- */
/* Full-screen modal overlay. The centring lives HERE and not in an inline
   style on purpose: Alpine's x-show removes the inline `display` property when
   it shows an element, so an inline display:flex is silently dropped and the
   panel lands top-left. Pair with x-show/x-cloak and a teleport to <body>. */
.crystal .cc-overlay {
  position: fixed; inset: 0; z-index: 10050;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.crystal .cc-overlay-backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(0,0,0,.72), rgba(2,8,14,.94));
  backdrop-filter: blur(6px);
}

.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(20,11,9,.4)); border: 1px solid rgba(47,230,160,.3); color: #7fe6c0; }
.crystal .cc-banner-info    { background: linear-gradient(135deg, rgba(232,160,120,.1), rgba(20,11,9,.4));  border: 1px solid rgba(232,160,120,.25); color: #f3cdb7; }
.crystal .cc-banner-warn    { background: linear-gradient(135deg, rgba(224,160,123,.12), rgba(20,11,9,.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(20,11,9,.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(14,8,7,.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: #886252; }
.crystal .cc-input:focus, .crystal .cc-select:focus, .crystal .cc-textarea:focus {
  outline: none; border-color: rgba(232,160,120,.5); box-shadow: 0 0 0 3px rgba(232,160,120,.12);
}
.crystal .cc-field-error { font-size: 11.5px; color: var(--cc-danger); margin-top: 6px; }

/* The text-field palette, states, autofill and the classic .form-input wrapper
   live in the FORM CONTROL SYSTEM block further down (update 2.28). */

/* ---- 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(34,18,14,.97), rgba(20,11,9,.98));
  border: 1px solid rgba(214,150,122,.22);
  box-shadow: 0 25px 60px -10px rgba(0,0,0,.7), 0 0 40px rgba(232,160,120,.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(232,160,120,.06); border-color: rgba(232,160,120,.25); }
.crystal .trm-cat-row-default { background: rgba(232,160,120,.04); border-color: rgba(232,160,120,.14); }
.crystal .trm-cat-amount, .crystal .trm-cat-amount i { color: var(--cc-gold); }
.crystal .trm-default-card { background: linear-gradient(135deg, rgba(232,160,120,.1), rgba(20,11,9,.4)); border-color: rgba(232,160,120,.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(232,160,120,.08); border-color: rgba(232,160,120,.22); color: #f3cdb7; }
.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(232,160,120,.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(232,160,120,.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: #e6d4c8; }
.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(30,17,14,.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(232,160,120,.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: #e8a078; 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(30,17,14,.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(232,160,120,.4); transform: translateY(-2px); }
.crystal .cc-footer-colh { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #a98272; margin: 0 0 16px; }
.crystal .cc-footer-collist { display: flex; flex-direction: column; gap: 11px; }
.crystal .cc-footer-navlink { font-size: 13px; color: #c8b0a2; 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: #c8b0a2; 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(22,12,10,.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(232,160,120,.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(232,160,120,.18), rgba(21,140,200,.1) 58%, rgba(20,11,9,.55));
  border-bottom: 1px solid rgba(232,160,120,.25);
  font-family: 'Manrope', system-ui, sans-serif; color: #c8b0a2; position: relative; z-index: 60;
}
.cc-bs-announce .cc-bs-spark {
  width: 34px; height: 34px; border-radius: 9px; background: rgba(232,160,120,.14);
  border: 1px solid rgba(232,160,120,.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: #fbefe4; display: block; }
.cc-bs-announce .cc-bs-copy span { font-size: 12.5px; color: #c8b0a2; }
.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: #120b0a; background: linear-gradient(135deg, #e8a078, #d68c5a); box-shadow: 0 8px 20px rgba(214,150,110,.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: #b89a8c; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cc-bs-dismiss:hover { color: #e6d4c8; 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, #e8a078, #d68c5a); color: #120b0a;
  box-shadow: 0 14px 34px rgba(214,150,110,.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(22,12,10,.85); border-bottom: 1px solid rgba(214,150,122,.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: #120b0a; background: linear-gradient(135deg, #e8a078, #d68c5a); flex-shrink: 0;
}
.cc-bs-return .cc-bs-msg { flex: 1; font-size: 12.5px; line-height: 1.5; color: #c8b0a2; min-width: 0; }
.cc-bs-back {
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: #fcdcc5; padding: 9px 16px; border-radius: 8px;
  background: rgba(30,17,14,.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(14,8,7,.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: #120b0a; background: linear-gradient(135deg, #e8a078, #d68c5a); box-shadow: 0 0 12px rgba(232,160,120,.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(232,160,120,.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(232,160,120,.55) !important; }
.crystal .cc-btn:disabled, .crystal button.cc-btn:disabled { box-shadow: none !important; }
/* ============================================================================
   FORM CONTROL SYSTEM (update 2.28) — one look for every player-facing control
   ----------------------------------------------------------------------------
   Modelled on the registration fields: 46px single-line fields, 12px corners, a
   soft dark well, a brighter hairline on hover and a teal border + soft 3px
   teal ring on focus. Covers text fields, selects (teal chevron), textareas,
   icon slots, checkboxes/radios, file pickers + drop zones, buttons
   (.cc-btn / .cc-btn-secondary / .cc-btn-danger) and the Trix editor
   (.cc-trix + the .cc-composer reply box). Replaces the old "site-wide field
   palette" and "INPUT FIELDS — DEFINITIVE override" blocks.

   WHY THE LONG SELECTORS. The classic stylesheet (resources/sass/app.scss,
   "2. INPUT FIELDS" and "4. BUTTONS") is still loaded first on every crystal
   page and styles everything inside a <form> with !important:
     form input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),
     form textarea, form select
         { height:46px; border-radius:10px; padding:0 12px; gold caret + gold
           focus glow; transition:all .3s; ... }               (0,4,2) / (0,0,2)
         :hover / :focus                                       (0,5,2) / (0,1,2)
     form button[type=submit], form button.default-button,
     .internal-form/.auth-card/.login-form button[type=submit]
         { gold gradient; height:46px; width:100%; radius:10px } (0,1,2) / (0,2,1)
         :hover (gold glow)                                    (0,2,2) / (0,3,1)
   Every rule below out-specifies those (numbers in the comments), so a
   textarea is no longer squashed to 46px, a <select> keeps its chevron and no
   submit button turns gold.

   TUNING A FIELD WITHOUT A SPECIFICITY WAR. The rules read geometry and
   colours from custom properties. A page sets the property — plain,
   low-specificity CSS is enough, no !important:
       .my-field { --cc-field-h: 40px; --cc-field-pl: 40px; }
   --cc-field-h (height) · --cc-field-r (radius) · --cc-field-pl / --cc-field-pr
   (left/right padding) · --cc-field-bg · --cc-field-line(-hover/-focus) ·
   --cc-field-ring · --cc-trix-min (editor min height).

   SCOPE. body.crystal:not(.wk) — the site, the launcher page host and the
   simple/presentation layouts. The wiki (body.crystal.wk) has its own field
   look in public/wiki/wiki.css; it keeps the previous palette (block W at the
   end) and none of the new geometry. Filament admin never has .crystal.
   ============================================================================ */

/* ---- A. Text fields: palette + states — every text control on the page ---------
   TEXT = input:not(checkbox/radio/submit/button) minus file/range/color/hidden/
   image/reset and the "embedded" inputs that sit borderless inside their own
   wrapper box (inline border:none, e.g. the /streams search). The :where() list
   adds no specificity. (0,6,2) beats the classic (0,4,2) AND its :hover/:focus
   arms (0,5,2), so no gold ever shows. */
body.crystal:not(.wk) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):where(:not([type="file"], [type="range"], [type="color"], [type="hidden"], [type="image"], [type="reset"], [style*="border:none"], [style*="border: none"])),
body.crystal:not(.wk) textarea,
body.crystal:not(.wk) select {
  background-color: var(--cc-field-bg) !important;
  background-image: none !important;
  border: 1px solid var(--cc-field-line) !important;
  color: var(--cc-field-text) !important;
  caret-color: var(--cc-teal) !important;
  box-shadow: var(--cc-field-inset) !important;
  color-scheme: dark;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease !important;
}
body.crystal:not(.wk) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):where(:not([type="file"], [type="range"], [type="color"], [type="hidden"], [type="image"], [type="reset"], [style*="border:none"], [style*="border: none"])):hover,
body.crystal:not(.wk) textarea:hover,
body.crystal:not(.wk) select:hover {
  border-color: var(--cc-field-line-hover) !important;
  background-color: var(--cc-field-bg-hover) !important;
}
/* Focus comes after hover at the same specificity, so it wins while both apply. */
body.crystal:not(.wk) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):where(:not([type="file"], [type="range"], [type="color"], [type="hidden"], [type="image"], [type="reset"], [style*="border:none"], [style*="border: none"])):focus,
body.crystal:not(.wk) textarea:focus,
body.crystal:not(.wk) select:focus {
  outline: none !important;
  border-color: var(--cc-field-line-focus) !important;
  background-color: var(--cc-field-bg-focus) !important;
  box-shadow: var(--cc-field-ring), var(--cc-field-inset) !important;
}
body.crystal:not(.wk) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):where(:not([type="file"], [type="range"], [type="color"], [type="hidden"], [type="image"], [type="reset"], [style*="border:none"], [style*="border: none"])):disabled,
body.crystal:not(.wk) textarea:disabled,
body.crystal:not(.wk) select:disabled {
  opacity: .55; cursor: not-allowed;
  border-color: var(--cc-field-line) !important;
  background-color: rgba(18,10,8,.45) !important;
  box-shadow: none !important;
}
/* Placeholder: (0,6,3) beats the classic ::placeholder (0,4,3). */
body.crystal:not(.wk) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"])::placeholder,
body.crystal:not(.wk) textarea::placeholder {
  color: var(--cc-field-ph) !important; opacity: 1 !important; font-weight: 400 !important;
}
/* Autofill: browsers paint a pale fill + dark text; keep the dark well (inset
   shadow trick) and the teal caret. (0,7,2) beats the classic autofill (0,5,2). */
body.crystal:not(.wk) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):-webkit-autofill,
body.crystal:not(.wk) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):-webkit-autofill:hover,
body.crystal:not(.wk) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):-webkit-autofill:focus,
body.crystal:not(.wk) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #170d0a inset !important;
          box-shadow: 0 0 0 1000px #170d0a inset !important;
  -webkit-text-fill-color: var(--cc-field-text) !important;
  caret-color: var(--cc-teal) !important;
  transition: background-color 99999s ease-out 0s !important;
}
/* Embedded inputs inside a <form> (inline border:none) are left out of A, so
   re-neutralise the classic look on them here; outside forms their own inline
   styles already apply. (0,6,3) / :focus (0,7,3). */
body.crystal:not(.wk) form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):is([style*="border:none"], [style*="border: none"]),
body.crystal:not(.wk) form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):is([style*="border:none"], [style*="border: none"]):focus {
  background: transparent !important; border: 0 !important; box-shadow: none !important; outline: none !important;
}

/* ---- B. Single-line geometry ---------------------------------------------------
   The system classes anywhere, and every field the classic form rule reaches.
   form + TEXT = (0,6,3) > classic (0,4,2); form select (0,2,3) > (0,0,2). */
body.crystal:not(.wk) .cc-input,
body.crystal:not(.wk) .cc-select,
body.crystal:not(.wk) form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):where(:not([type="file"], [type="range"], [type="color"], [type="hidden"], [type="image"], [type="reset"], [style*="border:none"], [style*="border: none"])),
body.crystal:not(.wk) form select {
  height: var(--cc-field-h) !important;
  min-height: 0 !important;
  padding: 0 var(--cc-field-pr, var(--cc-field-px)) 0 var(--cc-field-pl, var(--cc-field-px)) !important;
  border-radius: var(--cc-field-r) !important;
  line-height: 1.25 !important;
  font-family: inherit;
  font-size: var(--cc-field-fs);
}
body.crystal:not(.wk) .cc-input,
body.crystal:not(.wk) .cc-select,
body.crystal:not(.wk) .cc-textarea { width: 100%; }

/* Icon slot: an absolutely-placed glyph right before the input (login, register,
   forgot/reset password, the account panel). The input makes room for it and
   the glyph lights up teal while the field has focus (inline colours too). */
body.crystal:not(.wk) i + input.cc-input,
body.crystal:not(.wk) i + input[style*="padding-left"] { --cc-field-pl: 40px; }
body.crystal:not(.wk) i:has(+ input) { transition: color .16s ease; }
body.crystal:not(.wk) i:has(+ input:focus) { color: var(--cc-teal) !important; }

/* ---- C. Select: teal chevron that survives -------------------------------------
   The palette above clears background-image (the classic gold gradient lived
   there), which used to wipe page chevrons too (.ub-select, .ds-modal__select).
   One chevron for every single-value select. (0,4,2) beats A and B. A page
   can tune it with --cc-chev (size), --cc-chev-x (offset), --cc-chev-pr (lane). */
body.crystal:not(.wk) select:not([multiple]):not([size]) {
  -webkit-appearance: none !important; appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235fc8cd' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right var(--cc-chev-x, 14px) center !important;
  background-size: var(--cc-chev, 15px) var(--cc-chev, 15px) !important;
  padding-right: var(--cc-chev-pr, 40px) !important;
  cursor: pointer;
}
/* Compact selects (small filter pickers) take a smaller chevron lane. */
body.crystal:not(.wk) select.evc2-hours { --cc-chev-x: 9px; --cc-chev: 12px; --cc-chev-pr: 28px; }
body.crystal:not(.wk) select:not([multiple]):not([size]):focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232fe6c0' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E") !important;
}
body.crystal:not(.wk) select option { background-color: #1f110e; color: #f6e8dc; }

/* ---- D. Textarea: grows, never squashed -----------------------------------------
   form textarea (0,2,3) > classic (0,0,2). */
body.crystal:not(.wk) .cc-textarea,
body.crystal:not(.wk) form textarea {
  height: auto !important;
  min-height: var(--cc-ta-min, 104px) !important;
  padding: 12px var(--cc-field-px) !important;
  border-radius: var(--cc-field-r) !important;
  line-height: 1.55 !important;
  font-family: inherit;
  font-size: var(--cc-field-fs);
  resize: vertical;
}

/* ---- E. Invalid state ----------------------------------------------------------
   Only custom properties change, so these need no specificity. A field turns red
   when the page marks it (aria-invalid / .is-invalid / a .has-error parent), when
   its wrapper holds a .cc-field-error, or once the browser finds it invalid
   after the player touched it (:user-invalid). The :has() and :user-invalid
   rules are separate so a browser without them only drops that one rule. */
body.crystal:not(.wk) :is(input, select, textarea, .cc-trix, .cc-composer__box):is([aria-invalid="true"], .is-invalid),
body.crystal:not(.wk) .has-error :is(.cc-input, .cc-select, .cc-textarea, .cc-trix, .cc-composer__box) {
  --cc-field-line: rgba(224,138,138,.55);
  --cc-field-line-hover: rgba(224,138,138,.72);
  --cc-field-line-focus: rgba(224,138,138,.85);
  --cc-field-ring: 0 0 0 3px rgba(224,138,138,.16);
}
body.crystal:not(.wk) :has(> .cc-field-error) > :is(input, select, textarea),
body.crystal:not(.wk) :has(> .cc-field-error) > div > :is(input, select, textarea),
body.crystal:not(.wk) :has(> .cc-field-error) .cc-trix {
  --cc-field-line: rgba(224,138,138,.55);
  --cc-field-line-hover: rgba(224,138,138,.72);
  --cc-field-line-focus: rgba(224,138,138,.85);
  --cc-field-ring: 0 0 0 3px rgba(224,138,138,.16);
}
body.crystal:not(.wk) :is(input, textarea):user-invalid {
  --cc-field-line: rgba(224,138,138,.55);
  --cc-field-line-hover: rgba(224,138,138,.72);
  --cc-field-line-focus: rgba(224,138,138,.85);
  --cc-field-ring: 0 0 0 3px rgba(224,138,138,.16);
}
/* The message under a field: small danger text with a matching glyph (pages that
   already put an <i> in it keep theirs). */
body.crystal .cc-field-error { display: block; font-size: 11.5px; line-height: 1.45; color: var(--cc-danger); margin-top: 7px; }
body.crystal .cc-field-error:not(:has(> i))::before {
  content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 6px; vertical-align: -2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e08a8a' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---- F. Classic <x-form.input> wrapper (.form-input > label.input > i + input) ---
   The box lives on the wrapper; the inner input is transparent. Inner input
   (0,8,2) beats A (0,6,2), its :focus (0,7,2) and B (0,6,3). */
body.crystal:not(.wk) .form-input .input,
body.crystal:not(.wk) .form-input label.input {
  display: flex !important; align-items: center !important; gap: 10px !important; justify-content: flex-start !important;
  height: auto !important; min-height: var(--cc-field-h) !important;
  background: var(--cc-field-bg) !important; border: 1px solid var(--cc-field-line) !important;
  border-radius: var(--cc-field-r) !important; padding: 0 var(--cc-field-px) !important; overflow: hidden !important;
  box-shadow: var(--cc-field-inset) !important; color: var(--cc-field-text);
  transition: border-color .16s ease, box-shadow .16s ease !important;
}
body.crystal:not(.wk) .form-input .input:hover,
body.crystal:not(.wk) .form-input label.input:hover { border-color: var(--cc-field-line-hover) !important; }
body.crystal:not(.wk) .form-input .input:focus-within,
body.crystal:not(.wk) .form-input label.input:focus-within {
  border-color: var(--cc-field-line-focus) !important; box-shadow: var(--cc-field-ring), var(--cc-field-inset) !important;
}
body.crystal:not(.wk) .form-input .input.has-error { --cc-field-line: rgba(224,138,138,.55); --cc-field-line-focus: rgba(224,138,138,.85); --cc-field-ring: 0 0 0 3px rgba(224,138,138,.16); }
body.crystal:not(.wk) .form-input .input > i,
body.crystal:not(.wk) .form-input label.input > i {
  flex: 0 0 auto !important; width: 20px !important; text-align: center !important; margin: 0 !important;
  color: var(--cc-field-ic) !important; transition: color .16s ease;
}
body.crystal:not(.wk) .form-input .input:focus-within > i,
body.crystal:not(.wk) .form-input label.input:focus-within > i { color: var(--cc-teal) !important; }
body.crystal:not(.wk) .form-input .input > input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
body.crystal:not(.wk) .form-input label.input > input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]) {
  flex: 1 1 auto !important; min-width: 0 !important; height: calc(var(--cc-field-h) - 2px) !important;
  padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important;
  color: var(--cc-field-text) !important; caret-color: var(--cc-teal) !important;
}
body.crystal:not(.wk) .form-input .text.danger { font-size: 11.5px; color: var(--cc-danger); margin-top: 6px; }

/* ---- G. Checkboxes, radios, ranges ---------------------------------------------
   Native ones get the teal accent + a dark colour scheme; the registration terms
   box and .cc-check get the full custom box. */
body.crystal:not(.wk) input[type="checkbox"],
body.crystal:not(.wk) input[type="radio"],
body.crystal:not(.wk) input[type="range"] { accent-color: var(--cc-teal); color-scheme: dark; }
body.crystal:not(.wk) input[type="checkbox"]:focus-visible,
body.crystal:not(.wk) input[type="radio"]:focus-visible { outline: 2px solid rgba(127,243,220,.85); outline-offset: 2px; }
body.crystal:not(.wk) .cc-check,
body.crystal:not(.wk) .cc-reg-tos input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; flex: 0 0 18px; margin: 1px 0 0; padding: 0;
  border-radius: 6px; border: 1px solid rgba(214,150,122,.42);
  background: var(--cc-field-bg) center / 12px 12px no-repeat;
  box-shadow: var(--cc-field-inset);
  cursor: pointer; vertical-align: middle;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
body.crystal:not(.wk) .cc-check:hover,
body.crystal:not(.wk) .cc-reg-tos input[type="checkbox"]:hover { border-color: rgba(232,160,120,.65); }
body.crystal:not(.wk) .cc-check:checked,
body.crystal:not(.wk) .cc-reg-tos input[type="checkbox"]:checked {
  border-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304141e' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"), linear-gradient(135deg, #e8a078, #d68c5a);
  background-size: 12px 12px, 100% 100%;
  box-shadow: 0 0 10px rgba(232,160,120,.35);
}
body.crystal:not(.wk) .cc-check:focus-visible,
body.crystal:not(.wk) .cc-reg-tos input[type="checkbox"]:focus-visible { outline: 2px solid rgba(127,243,220,.85); outline-offset: 2px; }

/* ---- H. File pickers -----------------------------------------------------------
   .cc-visually-hidden keeps an <input type=file> reachable by keyboard (Tab +
   Space opens the picker) instead of display:none. .cc-file is the "Attach
   files" pill, .cc-file-chip one chosen file, .cc-dropzone the dashed upload
   area. A visible native picker gets a pill button and no classic 46px box
   ((0,6,2) > classic (0,4,2)). */
body.crystal .cc-visually-hidden,
body.crystal input.cc-visually-hidden:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]) {
  position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important; border: 0 !important;
  clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; opacity: 0 !important;
}
body.crystal:not(.wk) input[type="file"]:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not(.cc-visually-hidden) {
  height: auto !important; padding: 6px !important; border-radius: var(--cc-field-r) !important;
  background: var(--cc-field-bg) !important; border: 1px dashed rgba(232,160,120,.3) !important;
  box-shadow: none !important; color: var(--cc-t-body-2) !important; font-size: 12.5px; line-height: normal !important;
}
body.crystal:not(.wk) input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 8px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid rgba(232,160,120,.32); background: rgba(232,160,120,.09); color: #f3cdb7;
  font: 700 12px/1.2 'Manrope', system-ui, sans-serif; letter-spacing: .02em;
}
body.crystal:not(.wk) .cc-file {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 4px 14px 4px 5px; border-radius: 999px;
  background: rgba(232,160,120,.06); border: 1px solid rgba(232,160,120,.24);
  color: #f3cdb7; font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 1.2;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
body.crystal:not(.wk) .cc-file:hover { background: rgba(232,160,120,.11); border-color: rgba(232,160,120,.45); color: #fbefe4; }
body.crystal:not(.wk) .cc-file:focus-within { outline: 2px solid rgba(127,243,220,.85); outline-offset: 2px; }
body.crystal:not(.wk) .cc-file__ic {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(232,160,120,.13); color: var(--cc-teal);
}
body.crystal:not(.wk) .cc-file.is-filled { background: rgba(232,160,120,.12); border-color: rgba(232,160,120,.45); color: #fbefe4; }
body.crystal:not(.wk) .cc-file.is-filled .cc-file__ic { background: var(--cc-accent); color: var(--cc-on-accent); }
body.crystal:not(.wk) .cc-file-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px; min-width: 0;
  padding: 5px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 600; color: #e6d4c8;
  background: rgba(22,12,10,.6); border: 1px solid rgba(214,150,122,.16);
}
body.crystal:not(.wk) .cc-file-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
body.crystal:not(.wk) .cc-file-chip > svg { flex-shrink: 0; color: var(--cc-teal); }
body.crystal:not(.wk) .cc-dropzone {
  position: relative; display: block; text-align: center; padding: 2.75rem 1.75rem;
  border-radius: 16px; background: rgba(14,8,7,.42); border: 1.5px dashed rgba(232,160,120,.3);
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
body.crystal:not(.wk) .cc-dropzone:hover { border-color: rgba(232,160,120,.55); background: rgba(232,160,120,.045); }
body.crystal:not(.wk) .cc-dropzone:focus-within { border-color: rgba(232,160,120,.7); box-shadow: 0 0 0 3px rgba(232,160,120,.14); }
@media (max-width: 640px) { body.crystal:not(.wk) .cc-dropzone { padding: 2rem 1.1rem; } }

/* ---- I. Buttons ----------------------------------------------------------------
   .cc-btn (accent) keeps its colours from the defensive block above; here it
   gets the softer 12px corner and, on <button>, guards against the classic
   46px / 10px / weight-600 submit rule ((0,3,2) > (0,1,2)/(0,2,1)).
   .cc-btn-secondary is the quiet outline button, .cc-btn-danger its red twin
   (use both: class="cc-btn-secondary cc-btn-danger"). Base rules are not
   !important, so inline colour tweaks on a page still work; only real
   <button type=submit>s inside forms get the !important guard. */
body.crystal:not(.wk) .cc-btn { border-radius: var(--cc-r-btn); line-height: 1.2; }
body.crystal:not(.wk) button.cc-btn {
  height: auto !important; border-radius: var(--cc-r-btn) !important;
  font-weight: 800 !important; letter-spacing: .12em !important; text-shadow: none !important;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, opacity .18s ease !important;
}
body.crystal:not(.wk) .cc-btn-block { min-height: var(--cc-field-h); }
body.crystal:not(.wk) .cc-btn.cc-btn-sm { border-radius: var(--cc-r-btn-sm) !important; }
body.crystal:not(.wk) .cc-btn:disabled,
body.crystal:not(.wk) .cc-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; transform: none; }
/* Success flash (e.g. "Copied!"): the accent colours above are !important, so an
   inline background never showed — toggle .is-ok instead. */
body.crystal:not(.wk) .cc-btn.is-ok { background: linear-gradient(135deg, #2fe6a0, #19c79b) !important; }

body.crystal:not(.wk) .cc-btn-secondary,
body.crystal:not(.wk) .cc-btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 8px 16px; border-radius: var(--cc-r-btn-sm); cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; line-height: 1.2;
  color: #fcdcc5; background: rgba(30,17,14,.55); border: 1px solid rgba(120,225,210,.28);
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
body.crystal:not(.wk) .cc-btn-secondary:hover { border-color: rgba(120,225,210,.55); background: rgba(232,160,120,.08); color: var(--cc-t-bright); }
body.crystal:not(.wk) .cc-btn-danger,
body.crystal:not(.wk) .cc-btn-secondary.cc-btn-danger { color: #f0a9a9; background: rgba(224,138,138,.06); border-color: rgba(224,138,138,.34); }
body.crystal:not(.wk) .cc-btn-danger:hover,
body.crystal:not(.wk) .cc-btn-secondary.cc-btn-danger:hover { color: #ffd6d6; background: rgba(224,138,138,.13); border-color: rgba(224,138,138,.62); }
body.crystal:not(.wk) :is(.cc-btn-secondary, .cc-btn-danger):disabled { opacity: .5; cursor: not-allowed; }
/* Secondary / danger used as a <button type=submit> inside a form: (0,4,3). */
body.crystal:not(.wk) form button:is(.cc-btn-secondary, .cc-btn-danger) {
  height: auto !important; border-radius: var(--cc-r-btn-sm) !important;
  background: rgba(30,17,14,.55) !important; border: 1px solid rgba(120,225,210,.28) !important; color: #fcdcc5 !important;
  font-weight: 700 !important; letter-spacing: .06em !important; text-shadow: none !important; box-shadow: none !important;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease !important;
}
body.crystal:not(.wk) form button.cc-btn-danger { background: rgba(224,138,138,.06) !important; border-color: rgba(224,138,138,.34) !important; color: #f0a9a9 !important; }
body.crystal:not(.wk) form button:is(.cc-btn-secondary, .cc-btn-danger):hover { box-shadow: none !important; transform: none; filter: none; }

/* Any other <button type=submit> in a form (page-local classes such as .ub-btn,
   .rc-btn, or none at all) gets the accent look instead of the classic gold.
   The :where() exclusions add no specificity: (0,3,3) beats the classic base
   and hover arms. Buttons that carry an inline transparent background (icon
   closers such as the site message ×) are made plain instead. */
body.crystal:not(.wk) form button:is([type="submit"], .default-button):where(:not(.cc-btn, .cc-btn-gold, .cc-btn-secondary, .cc-btn-danger, .cc-icon-btn, .cc-pill, .gld-btn, .cc-bs-back, .cc-bs-cta, .cc-seg > button, .ds-topup-partner__btn, [style*="background:none"], [style*="background: none"], [style*="background:transparent"], [style*="background: transparent"])) {
  background: var(--cc-accent) !important;
  border: 0 !important;
  color: var(--cc-on-accent) !important;
  height: auto !important;
  min-height: 42px;
  border-radius: var(--cc-r-btn) !important;
  font-weight: 800 !important;
  letter-spacing: .08em !important;
  text-shadow: none !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 16px rgba(232,160,120,.28) !important;
  transition: filter .16s ease, box-shadow .16s ease, transform .16s ease, opacity .16s ease !important;
  cursor: pointer;
}
body.crystal:not(.wk) form button:is([type="submit"], .default-button):where(:not(.cc-btn, .cc-btn-gold, .cc-btn-secondary, .cc-btn-danger, .cc-icon-btn, .cc-pill, .gld-btn, .cc-bs-back, .cc-bs-cta, .cc-seg > button, .ds-topup-partner__btn, [style*="background:none"], [style*="background: none"], [style*="background:transparent"], [style*="background: transparent"])):hover {
  filter: brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 0 24px rgba(232,160,120,.45) !important;
}
body.crystal:not(.wk) form button:is([type="submit"], .default-button):where(:not(.cc-btn, .cc-btn-gold, .cc-btn-secondary, .cc-btn-danger, .cc-icon-btn, .cc-pill, .gld-btn, .cc-bs-back, .cc-bs-cta, .cc-seg > button, .ds-topup-partner__btn, [style*="background:none"], [style*="background: none"], [style*="background:transparent"], [style*="background: transparent"])):disabled {
  opacity: .55; cursor: not-allowed; filter: none; transform: none; box-shadow: none !important;
}
body.crystal:not(.wk) form button[type="submit"]:is([style*="background:none"], [style*="background: none"], [style*="background:transparent"], [style*="background: transparent"]) {
  background: transparent !important; border: 0 !important; box-shadow: none !important; color: inherit !important;
  height: auto !important; width: auto !important; border-radius: 6px !important;
  font-weight: inherit !important; letter-spacing: normal !important; text-shadow: none !important;
  filter: none !important; transform: none !important;
}

/* Button rows: a button right after a field matches the field height; .cc-actions
   evens out a row of mixed primary/secondary buttons. */
body.crystal:not(.wk) .cc-input + :is(.cc-btn, .cc-btn-secondary, .cc-btn-danger) { min-height: var(--cc-field-h); }
body.crystal:not(.wk) .cc-actions :is(.cc-btn, .cc-btn-secondary, .cc-btn-danger) { min-height: 42px; }

/* Keyboard focus: one clear teal outline on every button. */
body.crystal:not(.wk) :is(.cc-btn, .cc-btn-secondary, .cc-btn-danger, .cc-pill, .cc-lang-btn):focus-visible,
body.crystal:not(.wk) form button[type="submit"]:focus-visible {
  outline: 2px solid rgba(127,243,220,.9) !important; outline-offset: 2px !important;
}

/* ---- J. Rich-text editor (Trix) ------------------------------------------------
   <x-frontend.components.trix> wraps toolbar + editor in .cc-trix: one rounded
   box, the toolbar integrated on top, soft rounded tool buttons with teal hover
   and active states, a comfortable writing area and the focus ring on the box.
   Replaces the global app.scss "Trix Editor Dark Theme" (gold focus) and the
   ticket-create page's own copy. Trix's own trix.css is pushed after this file,
   so these rules carry the specificity ((0,3,2)+) rather than relying on order. */
body.crystal:not(.wk) .cc-trix {
  position: relative;
  background: var(--cc-field-bg);
  border: 1px solid var(--cc-field-line);
  border-radius: 14px;
  box-shadow: var(--cc-field-inset);
  transition: border-color .16s ease, box-shadow .16s ease;
}
body.crystal:not(.wk) .cc-trix:hover { border-color: var(--cc-field-line-hover); }
body.crystal:not(.wk) .cc-trix:focus-within { border-color: var(--cc-field-line-focus); box-shadow: var(--cc-field-ring), var(--cc-field-inset); }
body.crystal:not(.wk) .cc-trix trix-toolbar {
  display: block; margin: 0 !important; padding: 7px 8px;
  background: rgba(255,255,255,.018); border: 0; border-bottom: 1px solid var(--cc-hair-2);
  border-radius: 13px 13px 0 0;
}
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px; overflow: visible;
}
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button-group {
  display: flex; align-items: center; gap: 2px; margin: 0; border: 0; border-radius: 0;
}
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button-group + .trix-button-group {
  margin-left: 2px; padding-left: 6px; border-left: 1px solid var(--cc-hair-2);
}
/* Attachments go through the separate "Attach files" picker: Trix's own paperclip
   embeds a file in the text that is never uploaded, so it is hidden. */
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button-group--file-tools,
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button-group-spacer { display: none; }
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button-group--history-tools { margin-left: auto; }
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button {
  position: relative; float: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 30px; max-width: none; margin: 0; padding: 0;
  border: 1px solid transparent !important; border-radius: 8px;
  background: transparent !important; color: var(--cc-t-body); filter: none;
  text-indent: -9999px; overflow: hidden; cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease;
}
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button::before {
  top: 0; right: 0; bottom: 0; left: 0;
  background-size: 18px 18px; background-position: center;
  filter: invert(1); opacity: .62;
  transition: opacity .14s ease;
}
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button:not(:disabled):hover {
  background: rgba(232,160,120,.08) !important; border-color: rgba(232,160,120,.2) !important;
}
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button:not(:disabled):hover::before { opacity: .95; }
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button.trix-active {
  background: rgba(232,160,120,.15) !important; border-color: rgba(232,160,120,.42) !important;
}
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button.trix-active::before {
  opacity: 1;
  filter: invert(78%) sepia(47%) saturate(640%) hue-rotate(108deg) brightness(102%) contrast(94%);
}
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button:disabled { cursor: default; }
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button:disabled::before { opacity: .2; }
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button:focus-visible { outline: 2px solid rgba(127,243,220,.85); outline-offset: 1px; }
/* Link dialog: a dark floating card with a compact field and pill buttons. */
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-dialog {
  top: 4px; left: 6px; right: 6px; padding: 10px; font-size: 13px;
  background: #21130f; border: 1px solid var(--cc-hair-strong); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.55);
  --cc-field-h: 38px; --cc-field-r: 10px;
}
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-dialog__link-fields { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-dialog__link-fields .trix-input { flex: 1 1 200px; min-width: 0; margin: 0; }
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-dialog .trix-button-group { gap: 6px; border: 0; padding: 0; margin: 0; }
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-dialog .trix-button--dialog {
  width: auto; height: 38px; padding: 0 14px; text-indent: 0; overflow: visible;
  border: 1px solid rgba(232,160,120,.32) !important; border-radius: 10px;
  background: rgba(232,160,120,.09) !important; color: #f3cdb7;
  font: 700 12px/1 'Manrope', system-ui, sans-serif; letter-spacing: .03em;
}
body.crystal:not(.wk) .cc-trix trix-toolbar .trix-dialog .trix-button--dialog:hover { background: rgba(232,160,120,.16) !important; color: #fbefe4; }
/* Writing area. */
body.crystal:not(.wk) .cc-trix trix-editor {
  display: block; margin: 0;
  min-height: var(--cc-trix-min, 180px); max-height: min(60vh, 560px); overflow-y: auto;
  padding: 14px 16px !important;
  background: transparent !important; border: 0 !important; border-radius: 0 0 13px 13px;
  color: var(--cc-field-text) !important; caret-color: var(--cc-teal);
  font-family: inherit; font-size: 14px; line-height: 1.6; outline: none !important;
}
body.crystal:not(.wk) .cc-trix trix-editor:focus { background: transparent !important; }
body.crystal:not(.wk) .cc-trix trix-editor:empty:not(:focus)::before { color: var(--cc-field-ph); }
body.crystal:not(.wk) .cc-trix trix-editor a { color: var(--cc-teal); text-decoration: underline; text-underline-offset: 2px; }
body.crystal:not(.wk) .cc-trix trix-editor h1 { font-size: 1.15em; font-weight: 800; color: var(--cc-t-bright); margin: 0 0 .3em; }
body.crystal:not(.wk) .cc-trix trix-editor blockquote { margin: .3em 0; padding: .1em 0 .1em .8em; border-left: 3px solid rgba(232,160,120,.45); color: var(--cc-t-body); }
body.crystal:not(.wk) .cc-trix trix-editor pre {
  margin: .4em 0; padding: .7em .9em; border-radius: 9px; font-size: .9em;
  background: rgba(0,0,0,.35); color: #fcdcc5; border: 1px solid var(--cc-hair-2);
}
body.crystal:not(.wk) .cc-trix trix-editor ul,
body.crystal:not(.wk) .cc-trix trix-editor ol { padding-left: 1.4em; margin: .3em 0; }
body.crystal:not(.wk) .cc-trix trix-editor ul { list-style: disc; }
body.crystal:not(.wk) .cc-trix trix-editor ol { list-style: decimal; }
@media (max-width: 640px) {
  body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button { width: 34px; height: 32px; }
}

/* ---- K. Reply composer (ticket page) -------------------------------------------
   One rounded box: toolbar, writing area, then a footer bar with the "Attach
   files" pill, the chosen files and the Close / Send buttons. Messages sit
   under the box. .has-error on .cc-composer turns the box red. */
body.crystal:not(.wk) .cc-composer { display: flex; flex-direction: column; gap: 8px; --cc-trix-min: 150px; }
body.crystal:not(.wk) .cc-composer__box {
  position: relative;
  background: var(--cc-field-bg);
  border: 1px solid var(--cc-field-line);
  border-radius: 14px;
  box-shadow: var(--cc-field-inset);
  transition: border-color .16s ease, box-shadow .16s ease;
}
body.crystal:not(.wk) .cc-composer__box:hover { border-color: var(--cc-field-line-hover); }
body.crystal:not(.wk) .cc-composer__box:has(trix-editor:focus) { border-color: var(--cc-field-line-focus); box-shadow: var(--cc-field-ring), var(--cc-field-inset); }
body.crystal:not(.wk) .cc-composer__box .cc-trix,
body.crystal:not(.wk) .cc-composer__box .cc-trix:hover,
body.crystal:not(.wk) .cc-composer__box .cc-trix:focus-within { background: transparent; border: 0; border-radius: 14px 14px 0 0; box-shadow: none; }
body.crystal:not(.wk) .cc-composer__foot {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  padding: 9px 10px 9px 10px; border-top: 1px solid var(--cc-hair-2);
  background: rgba(0,0,0,.14); border-radius: 0 0 13px 13px;
}
body.crystal:not(.wk) .cc-composer__files { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
body.crystal:not(.wk) .cc-composer__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
body.crystal:not(.wk) .cc-composer__actions :is(.cc-btn, .cc-btn-secondary, .cc-btn-danger) { min-height: 40px; }
body.crystal:not(.wk) .cc-composer__actions .cc-btn { padding: 0 20px; }
body.crystal:not(.wk) .cc-composer__actions .cc-btn-danger,
body.crystal:not(.wk) .cc-composer__actions .cc-btn-secondary { padding: 0 15px; }
body.crystal:not(.wk) .cc-composer__notes { display: flex; flex-direction: column; gap: 2px; }
body.crystal:not(.wk) .cc-composer__notes .cc-field-error { margin-top: 0; }
body.crystal:not(.wk) .cc-composer__hint { font-size: 11px; color: var(--cc-muted); }
@media (max-width: 560px) {
  body.crystal:not(.wk) .cc-composer__actions { width: 100%; margin-left: 0; }
  body.crystal:not(.wk) .cc-composer__actions > * { flex: 1 1 0; }
}

/* ---- L. Page adapters ----------------------------------------------------------
   Page-local controls that fought the classic rule. */
/* Dragon Shop partner code: the applied-code box, the field and its Apply /
   remove buttons share the field height and corner. */
body.crystal:not(.wk) .ds-topup-partner > .ds-topup-partner__input,
body.crystal:not(.wk) .ds-topup-partner > .ds-topup-partner__btn { height: var(--cc-field-h); border-radius: var(--cc-field-r); }
/* flex:1 means a 0 basis; once the row stacks on phones (flex-direction:column)
   that squashed the field to a sliver. An auto basis keeps the full height. */
body.crystal:not(.wk) .ds-topup-partner > .ds-topup-partner__input { flex: 1 1 auto; min-width: 0; }
body.crystal:not(.wk) form button.ds-topup-partner__btn {
  height: var(--cc-field-h) !important; border-radius: var(--cc-field-r) !important; padding: 0 18px;
  background: linear-gradient(135deg, rgba(232,160,120,.2), rgba(214,140,90,.13)) !important;
  border: 1px solid rgba(232,160,120,.36) !important; color: #f6e8dc !important;
  font-weight: 800 !important; letter-spacing: .08em !important; text-shadow: none !important; box-shadow: none !important;
  transition: background-color .16s ease, border-color .16s ease !important;
}
body.crystal:not(.wk) form button.ds-topup-partner__btn:hover {
  background: linear-gradient(135deg, rgba(232,160,120,.32), rgba(214,140,90,.22)) !important;
  border-color: rgba(232,160,120,.6) !important; box-shadow: none !important; filter: none; transform: none;
}
/* Unbug-character: the Rescue button is meant to span the card (.ub-btn width:100%),
   which the defensive width:auto submit rule above (0,5,2) undid. (0,5,3). */
body.crystal:not(.wk) form button.ub-btn[type="submit"]:not(.cc-icon-btn) { width: 100% !important; }

/* ---- M. Phones and reduced motion ----------------------------------------------
   16px text in fields on touch phones stops iOS from zooming the page on focus.
   Players with "reduce motion" get no transitions and no hover lift. */
@media (max-width: 640px) and (pointer: coarse) {
  body.crystal:not(.wk) .cc-input,
  body.crystal:not(.wk) .cc-select,
  body.crystal:not(.wk) .cc-textarea,
  body.crystal:not(.wk) form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):where(:not([type="file"], [type="range"], [type="color"], [type="hidden"], [type="image"], [type="reset"])),
  body.crystal:not(.wk) form select,
  body.crystal:not(.wk) form textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  body.crystal:not(.wk) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):where(:not([type="file"], [type="range"], [type="color"], [type="hidden"], [type="image"], [type="reset"], [style*="border:none"], [style*="border: none"])),
  body.crystal:not(.wk) textarea,
  body.crystal:not(.wk) select,
  body.crystal:not(.wk) button.cc-btn,
  body.crystal:not(.wk) form button:is([type="submit"], .default-button, .cc-btn-secondary, .cc-btn-danger, .ds-topup-partner__btn),
  body.crystal:not(.wk) .form-input .input,
  body.crystal:not(.wk) .form-input label.input { transition: none !important; }
  body.crystal:not(.wk) :is(.cc-btn, .cc-btn-secondary, .cc-btn-danger, .cc-file, .cc-file-chip, .cc-dropzone, .cc-trix, .cc-composer__box, .cc-check),
  body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button,
  body.crystal:not(.wk) .cc-trix trix-toolbar .trix-button::before,
  body.crystal:not(.wk) i:has(+ input) { transition: none !important; }
  body.crystal:not(.wk) :is(.cc-btn, .cc-btn-gold, .cc-btn-secondary, .cc-btn-danger):is(:hover, :active),
  body.crystal:not(.wk) form button[type="submit"]:is(:hover, :active) { transform: none !important; }
}

/* ---- W. Wiki (body.wk) — unchanged palette ---------------------------------------
   The wiki styles its own fields in public/wiki/wiki.css; until 2.28 it also got
   the teal palette below from this file. Kept as it was so the wiki looks the
   same. */
body.wk input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]),
body.wk textarea, body.wk select {
  background: rgba(14,8,7,.62) !important;
  border: 1px solid rgba(214,150,122,.20) !important;
  color: #fcdcc5 !important;
  caret-color: #e8a078 !important;
  box-shadow: none !important;
}
body.wk input[style*="border:none"]:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]),
body.wk 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;
}
body.wk input[style*="border:none"]:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):focus,
body.wk 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;
}
body.wk input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):focus,
body.wk textarea:focus, body.wk select:focus {
  border-color: rgba(232,160,120,.65) !important;
  box-shadow: 0 0 0 3px rgba(232,160,120,.16) !important;
  outline: none !important;
}
body.wk input::placeholder, body.wk textarea::placeholder { color: #8b796d; }
body.wk input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):-webkit-autofill,
body.wk input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):-webkit-autofill:hover,
body.wk input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):-webkit-autofill:focus,
body.wk 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(20,12,9,.97) inset !important;
  box-shadow: 0 0 0 1000px rgba(20,12,9,.97) inset !important;
  -webkit-text-fill-color: #fcdcc5 !important;
  caret-color: #e8a078 !important;
  border: 1px solid rgba(214,150,122,.20) !important;
  transition: background-color 99999s ease-out 0s !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, #e8a078, #d68c5a) !important; color: #120b0a !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(232,160,120,.5) !important; }
.cc-bs-announce form button.cc-bs-cta, .cc-bs-cta { background: linear-gradient(135deg, #e8a078, #d68c5a) !important; color: #120b0a !important; border: 0 !important; }
.cc-bs-back { background: rgba(30,17,14, .6); color: #fcdcc5; }

/* 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(30,17,14,.7) !important;
  color: #fcdcc5 !important;
  border: 1px solid rgba(214,150,122,.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(232,160,120,.5) !important; color: #fbefe4 !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, #e8a078, #d68c5a) !important;
  color: #120b0a !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(21,12,10,.6) !important;
  border: 1px solid rgba(214,150,122,.16) !important;
  color: #e6d4c8 !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(232,160,120,.8); }
                        50%      { opacity: .55; box-shadow: 0 0 10px rgba(232,160,120,.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: #120b0a;
  background: linear-gradient(135deg, #e8a078, #d68c5a);
  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: #e8a078;
  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, #a98272); white-space: nowrap;
}
.crystal .cc-sg.is-staff .cc-sg-lab { color: #c98080; }
.crystal .cc-sg-line { flex: 1; height: 1px; background: rgba(214,150,122,.1); }
.crystal .cc-sg-chev { color: #a98272; 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: #765548; 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: #765548;
}
.crystal .cc-up-div i { flex: 1; height: 1px; background: rgba(214,150,122,.1); }
.crystal .cc-upg { position: relative; }
.crystal .cc-upg .cc-up-chev { color: #a98272; 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(18,10,8,.97);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(214,150,122,.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: #765548; 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(232,160,120,.07); }
.crystal .cc-up-fly-link svg { color: #a98272; 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: #e4c7b3; }
.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(14,8,7,.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; }
