:root{
  /*
    PLUMIN UI theme
    ----------------
    This stylesheet is intentionally self-contained (no external frameworks)
    so it works on static hosting and file://.
  */

  /* Base (dark) */
  --bg: #07040a;
  --bg2: #0b1020;

  --topbar: rgba(10, 12, 18, 0.70);
  --sidebar: rgba(255,255,255,0.035);

  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.045);
  --panel3: rgba(255,255,255,0.035);
  --panel4: rgba(255,255,255,0.028);

  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --muted2: rgba(255,255,255,0.56);

  --border: rgba(255,255,255,0.10);
  --border2: rgba(255,255,255,0.14);

  /* Brand */
  --accent: #8b5cf6;   /* plum */
  --accent2: #ec4899;  /* magenta */
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;

  /* Surfaces */
  --btn: rgba(255,255,255,0.06);
  --btnHover: rgba(255,255,255,0.10);
  --shadow: 0 22px 70px rgba(0,0,0,0.55);
  --shadowSm: 0 14px 34px rgba(0,0,0,0.40);
  --focus: rgba(139,92,246,0.36);

  --radius: 18px;
  --radiusSm: 14px;
  --topbarH: 64px;

  /* Home page (WebGL) layout */
  /* Matches the playable board height so the layout doesn't jump while the WebGL iframe loads. */
  --unityH: clamp(520px, 72vh, 760px);

  /* Fixed height for the home page top-row header (prevents chat resize from changing the row height). */
  --gameHeaderH: 52px;
  --homeTopRowH: calc(var(--unityH) + var(--gameHeaderH));

  /* Chat display preferences (overridden by localStorage via app.js) */
  --chatFontSize: 100%;
  --chatFontFamily: inherit;
}

:root[data-theme="light"]{
  --bg: #f7f6fb;
  --bg2: #eef2ff;

  --topbar: rgba(255, 255, 255, 0.75);
  --sidebar: rgba(15, 23, 42, 0.04);

  --panel: rgba(255,255,255,0.85);
  --panel2: rgba(255,255,255,0.72);
  --panel3: rgba(15, 23, 42, 0.04);
  --panel4: rgba(15, 23, 42, 0.03);

  --text: #0b1220;
  --muted: rgba(15, 23, 42, 0.72);
  --muted2: rgba(15, 23, 42, 0.58);

  --border: rgba(15, 23, 42, 0.12);
  --border2: rgba(15, 23, 42, 0.16);

  --btn: rgba(15, 23, 42, 0.06);
  --btnHover: rgba(15, 23, 42, 0.10);
  --shadow: 0 18px 60px rgba(15, 23, 42, 0.12);
  --shadowSm: 0 12px 30px rgba(15, 23, 42, 0.12);
  --focus: rgba(124,58,237,0.22);
}

* { box-sizing: border-box; }

/*
  Let the root/body grow with the document so the page background does not
  stop part-way down long mobile pages after scrolling.
*/
html, body { min-height: 100%; }

/* Prevent the default white "rubber band" background on mobile overscroll. */
html{
  height: auto;
  background: var(--bg);
}

body {
  height: auto;
  margin: 0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  /* Mobile browsers may treat 100vh inconsistently due to the URL bar.
     Using min-height helps keep the gradient/background consistent. */
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 700px at 18% -10%, rgba(139,92,246,0.38), transparent 58%),
    radial-gradient(900px 600px at 92% 0%, rgba(236,72,153,0.22), transparent 62%),
    radial-gradient(900px 600px at 70% 115%, rgba(34,197,94,0.14), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

/* Subtle board-like texture (very low opacity) */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.70) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.70) 75%, rgba(255,255,255,0.70)),
    linear-gradient(45deg, rgba(255,255,255,0.70) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.70) 75%, rgba(255,255,255,0.70));
  background-position: 0 0, 14px 14px;
  background-size: 28px 28px;
  mix-blend-mode: overlay;
}

:root[data-theme="light"] body::before{
  opacity: 0.035;
  background-image:
    linear-gradient(45deg, rgba(15,23,42,0.90) 25%, transparent 25%, transparent 75%, rgba(15,23,42,0.90) 75%, rgba(15,23,42,0.90)),
    linear-gradient(45deg, rgba(15,23,42,0.90) 25%, transparent 25%, transparent 75%, rgba(15,23,42,0.90) 75%, rgba(15,23,42,0.90));
  mix-blend-mode: multiply;
}

/* Utilities */
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

/* Links */
a { color: inherit; }

/* Topbar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--topbarH);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--topbar);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo{
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 1px solid var(--border2);
  background:
    radial-gradient(16px 16px at 30% 30%, rgba(255,255,255,0.28), transparent 70%),
    linear-gradient(135deg, rgba(139,92,246,0.95), rgba(236,72,153,0.85));
  box-shadow: var(--shadowSm);
  font-weight: 950;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.96);
  user-select: none;
}

:root[data-theme="light"] .logo{
  box-shadow: 0 12px 30px rgba(124,58,237,0.14);
}

.title{
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.98rem;
  line-height: 1.1;
}

.subtitle{
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right,
.topbar-actions{
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 999px;
  box-shadow: var(--shadowSm);
  cursor: pointer;
  user-select: none;
}

.user-badge:hover{ filter: brightness(1.04); }

/* Allow showing a clan name under the player name (smaller). */
#userName{ line-height: 1.05; }
.clan-sub{
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
}


/* Mobile hamburger + off-canvas sidebar (slide-in) */
.btn-hamburger{
  display: none;
  margin-right: 6px;
}

.sidebar-backdrop{
  position: fixed;
  top: var(--topbarH);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 7; /* keep below .modal (10) and the sticky .topbar (1000) */
}

.sidebar-mobile-header{
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-mobile-title{
  font-weight: 950;
  letter-spacing: 0.02em;
}

/* Layout */
.layout{
  display: grid;
  /* Use minmax(0, 1fr) so the main column can shrink without forcing
     horizontal overflow when content is wide. */
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  height: calc(100vh - var(--topbarH));
  height: calc(100svh - var(--topbarH));
  height: calc(100dvh - var(--topbarH));
}

.sidebar{
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--sidebar);
  box-shadow: var(--shadowSm);
  overflow: auto;
}

.main{
  overflow: auto;
  padding: 2px;
}

.sidebar h3{
  margin: 18px 0 10px;
  font-size: 0.82rem;
  color: var(--muted2);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

/* Forms */
.field{
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.field > span{
  font-size: 0.86rem;
  color: var(--muted);
}

.field-help{
  margin-top: 6px;
  line-height: 1.35;
}

input, select, textarea{
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radiusSm);
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  outline: none;
}

/*
  Dropdowns:
  On some browsers the <option> popup keeps a white background while inheriting
  our light text color, resulting in "white on white".
*/
:root[data-theme="dark"] select{ color-scheme: dark; }
:root[data-theme="light"] select{ color-scheme: light; }
select option{
  /* Use a solid background for the OS dropdown popup (translucent panels can
     end up effectively white on some browsers). */
  background: var(--bg2);
  color: var(--text);
}

textarea{ resize: vertical; min-height: 92px; }

input::placeholder,
textarea::placeholder{ color: var(--muted2); }

input:focus, select:focus, textarea:focus{
  border-color: rgba(139,92,246,0.55);
  box-shadow: 0 0 0 4px var(--focus);
}

/* Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radiusSm);
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: transform 120ms ease, background 120ms ease, filter 120ms ease, border-color 120ms ease;
}

.btn:hover{ background: var(--btnHover); }
.btn:active{ transform: translateY(1px); }

.btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

.btn-primary{
  background: linear-gradient(135deg, rgba(139,92,246,0.95), rgba(236,72,153,0.90));
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.96);
  font-weight: 950;
}

.btn-primary:hover{ filter: brightness(1.05); }

.btn-outline{
  background: transparent;
}

.btn-block{ width: 100%; }

.btn-icon{
  padding: 8px 10px;
  line-height: 1;
}

.btn-small{
  padding: 7px 10px;
  font-size: 0.86rem;
  border-radius: 12px;
}

.mode-toggle{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel2);
}

.mode-toggle .btn{
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  background: transparent;
}

.mode-toggle .btn.active{
  background: linear-gradient(135deg, rgba(139,92,246,0.95), rgba(236,72,153,0.90));
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.96);
  font-weight: 950;
  box-shadow: var(--shadowSm);
}

.mode-toggle .btn.active:hover{
  filter: brightness(1.04);
}

.mode-toggle .btn:not(.active):hover{
  background: var(--btnHover);
}

/* Cards / panels */
.card,
.panel{
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadowSm);
}

.card{ padding: 12px; margin-top: 12px; }
.panel{ padding: 14px; }

.card-title{
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.panel-title{
  font-weight: 950;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

/* Panel title row (title + small controls, e.g. Global Chat font options) */
.panel-title-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-title-row .panel-title{ margin-bottom: 0; }

.chat-toolbar{
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chat-toolbar .btn{
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 0.86rem;
}

.chat-font-select{
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel3);
  color: var(--text);
  font-size: 0.86rem;
}

.chat-font-select:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

.compact{ margin: 0; padding-left: 18px; }

/* Home layout */
.page{ display: block; }

/* Home dashboard grid (matches the mockup):
   Row 1: Game (spans 2 columns) | Global chat
   Row 2: Friends list | Direct messages | Leaderboard
*/
#homePage{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 420px;
  /* Force a stable first-row height so the chat font size can change without
     pushing the whole row taller (which caused page-level scrolling). */
  grid-template-rows: var(--homeTopRowH) auto;
  grid-template-areas:
    "game game global"
    "social social leaderboard";
  gap: 16px;
  align-items: stretch;
}

.home-game{ grid-area: game; }
.home-global{ grid-area: global; align-self: stretch; }
.home-leaderboard{ grid-area: leaderboard; }
.home-friends{ grid-area: friends; }
.home-dm{ grid-area: dm; }

/*
  Friends + DM wrappers
  --------------------
  The home page shows either:
    - #friendsLocked (guests), OR
    - #friendsArea   (registered accounts)

  Older Safari versions have been flaky with `display: contents` inside CSS Grid.
  Instead of relying on it, we place the wrapper as a single grid cell
  ("social") and let it lay out Friends + DM as a 2-column grid.
*/
#friendsLocked,
#friendsArea{
  grid-area: social;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "friends dm";
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

/* Game shell */
.game-shell{
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.game-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--gameHeaderH);
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel3);
}

.game-title{ font-weight: 950; }

.unity-container{
  position: relative;
  /* Reserve the full play area height even while the iframe is still loading. */
  height: var(--unityH);
}

.unity-placeholder{
  height: 100%;
  padding: 22px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.unity-placeholder h2{ margin: 0 0 8px; letter-spacing: 0.01em; }

.unity-frame{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.unity-placeholder-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.unity-placeholder-actions .btn{
  flex: 1 1 180px;
  min-height: 46px;
}

.mobile-landscape-quickplay{
  display: none;
  gap: 12px;
  margin-top: 14px;
}

/* --- Mobile helpers for WebGL --- */
.mobile-rotate-overlay{
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  background: rgba(0,0,0,0.40);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

:root[data-theme="light"] .mobile-rotate-overlay{ background: rgba(255,255,255,0.65); }

.mobile-rotate-card{
  width: min(420px, calc(100% - 24px));
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadowSm);
  padding: 16px;
}

.mobile-rotate-icon{ font-size: 44px; line-height: 1; margin-bottom: 10px; }
.mobile-rotate-title{ font-weight: 950; font-size: 1.08rem; letter-spacing: 0.02em; }

.mobile-fs-overlay{
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

:root[data-theme="light"] .mobile-fs-overlay{ background: rgba(15,23,42,0.35); }

.mobile-fs-card{
  width: min(420px, calc(100% - 24px));
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}

.mobile-fs-title{ font-weight: 950; font-size: 1.08rem; }

.mobile-game-controls{
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 6500;
  display: flex;
  gap: 10px;
}

.mobile-game-controls .btn{
  box-shadow: var(--shadowSm);
  border-radius: 14px;
}

/* Right-column stacks panels (used on other pages, e.g. /clan, /settings, /support). */
.grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 0;
}

/*
  Home page Friends + DM wrappers
  ------------------------------
  NOTE: Layout is handled via the #friendsLocked/#friendsArea rules near #homePage.
  We intentionally avoid `display: contents` here for better mobile browser support.
*/
.locked-area,
.friends-area{ display: block; }

/* Generic rows / lists */
.row{ display: flex; gap: 10px; }
.row > input{ flex: 1; }

.list{ display: grid; gap: 10px; }

.item{
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--panel3);
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.item-left{ display: grid; gap: 4px; min-width: 0; flex: 1 1 auto; }
.item-title{ font-weight: 900; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub{ font-size: 0.86rem; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.subsection{ margin-top: 14px; }
.subsection-title{
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Table */
.table{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel3);
}

.leaderboard-table{
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.leaderboard-table thead th{
  background: var(--panel4);
  font-weight: 950;
  color: var(--muted);
}

.leaderboard-table tbody tr:nth-child(odd){
  background: rgba(255,255,255,0.03);
}

:root[data-theme="light"] .leaderboard-table tbody tr:nth-child(odd){
  background: rgba(15,23,42,0.03);
}

.leaderboard-table tbody tr:last-child td{ border-bottom: none; }
.leaderboard-table .right{ text-align: right; }

/* Notices */
.error,
.notice{
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.error{
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: rgba(255, 230, 230, 0.98);
}

:root[data-theme="light"] .error{ color: #7a0d18; }

.notice{
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: rgba(209, 255, 231, 0.98);
}

:root[data-theme="light"] .notice{ color: #0d3a20; }

/* Modal */
.backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9;
}

.modal{
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 24px));
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  z-index: 10;
  box-shadow: var(--shadow);
}

.modal-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel3);
}

.modal-title{ font-weight: 950; }
.modal-body{ padding: 14px; }

.link{
  background: transparent;
  border: none;
  padding: 0;
  margin-top: 10px;
  cursor: pointer;
  color: var(--accent);
  font-weight: 900;
  text-decoration: underline;
}

.link:hover{ filter: brightness(1.07); }

/* Avatars */
.avatar{
  display: block;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel2);
  object-fit: cover;
}

.avatar-sm{ width: 28px; height: 28px; border-radius: 12px; }
.avatar-md{ width: 40px; height: 40px; border-radius: 14px; }
.avatar-lg{ width: 64px; height: 64px; border-radius: 18px; }

/* Public profile page */
.profile-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.profile-header-left{ display: flex; align-items: center; gap: 12px; }
.profile-header-right{ display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.profile-actions{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }


/* Profile: About panel (optional user-filled details) */
.check{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.86rem;
  color: var(--muted);
  user-select: none;
}

.check input{
  width: auto;
  margin: 0;
}

.about-view{
  display: grid;
  gap: 10px;
}

.about-bio{
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radiusSm);
  background: var(--panel4);
}

.about-text{
  margin-top: 6px;
  white-space: pre-wrap;
  line-height: 1.35;
}

.profile-actions .btn{ white-space: nowrap; }

.stat-pill{
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 14px;
  padding: 10px 12px;
  min-width: 96px;
}

.stat-label{ color: var(--muted); font-size: 12px; }
.stat-value{ font-size: 18px; font-weight: 950; margin-top: 4px; }

.stats-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }

.matches-table .table{ margin-top: 10px; }

.player-link{
  color: var(--text);
  font-weight: 950;
  text-decoration: none;
  max-width: 100%;
}

button.player-link{
  display: inline-block;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  max-width: 100%;
}

.player-link:hover{ color: var(--accent); text-decoration: underline; }

.profile-card{
  border: 1px solid var(--border);
  background: var(--panel3);
  border-radius: var(--radius);
  padding: 12px;
}

.profile-row{ display: flex; align-items: center; gap: 12px; }

.profile-name{ font-weight: 950; font-size: 1.05rem; }

.profile-name-row{ display: flex; align-items: center; gap: 8px; }

.badge{
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
}

.badge-blue{ border-color: rgba(90, 160, 230, 0.55); background: rgba(90, 160, 230, 0.18); }
.badge-red{ border-color: rgba(255, 107, 107, 0.55); background: rgba(255, 107, 107, 0.18); }

/* Replay controls */
.replay-controls{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--panel4);
  flex-wrap: wrap;
}

.replay-slider-wrap{ display: flex; flex-direction: column; gap: 4px; min-width: 240px; flex: 1; max-width: 560px; }
.replay-slider{ width: 100%; }

.replay-speed{
  padding: 8px 10px;
  border-radius: var(--radiusSm);
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  outline: none;
}

.replay-controls button:disabled{ opacity: 0.45; cursor: not-allowed; }

/* Avatar picker */
.avatar-picker{ display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; margin-top: 8px; }

.avatar-choice{
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  display: grid;
  gap: 6px;
  justify-items: center;
  box-shadow: 0 0 0 0 rgba(0,0,0,0);
}

.avatar-choice:hover{ filter: brightness(1.05); }

.avatar-choice.selected{
  outline: 2px solid rgba(139,92,246,0.40);
  border-color: rgba(139,92,246,0.65);
}

.avatar-label{ font-size: 0.75rem; color: var(--muted); text-align: center; }

/* Friend rows */
.friend-row{
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--panel3);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.friend-row:hover{ filter: brightness(1.03); }
.friend-row.active{ outline: 2px solid rgba(139,92,246,0.28); }

.friend-main{ display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }

.friend-avatar-wrap{ position: relative; flex: 0 0 auto; }

.presence{
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  border: 2px solid rgba(0,0,0,0.30);
}

:root[data-theme="light"] .presence{ border-color: rgba(255,255,255,0.90); }
.presence.online{ background: var(--success); }

.friend-meta{ min-width: 0; flex: 1; }

.friend-top{ display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }

.friend-name{ font-weight: 950; min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-rating{ color: var(--muted); font-size: 0.9rem; flex: 0 0 auto; }

.friend-sub{ font-size: 0.86rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.friend-actions{ display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.actions{ display: flex; align-items: center; gap: 8px; }
.request-title{ display:flex; align-items:center; gap: 10px; min-width: 0; flex: 1 1 auto; }

/* Chat UI */
/*
  Global chat should grow to fill the (tall) first-row cell next to the Unity game.
  Use flex layout so the messages list expands while keeping the input pinned to
  the bottom.
*/
.global-chat-panel{
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

#globalChatArea{
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* allow the messages list to scroll inside a stretched panel */
}

.global-chat-messages{
  /* Fill available height inside the global chat panel */
  height: auto;
  flex: 1;
  min-height: 0;
  overflow: auto;
  font-size: var(--chatFontSize);
  font-family: var(--chatFontFamily);
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.20);
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

:root[data-theme="light"] .global-chat-messages{ background: rgba(15,23,42,0.03); }

.global-msg{
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: var(--radius);
  padding: 9px 10px;
}

.global-msg.me{ background: var(--panel4); }

.global-top{ display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; min-width: 0; }
.global-author{ display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.global-avatar{ flex: 0 0 auto; }
.global-name{ display: block; font-weight: 950; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%; flex: 1 1 auto; }
.global-time{ font-size: 0.75em; color: var(--muted); flex: 0 0 auto; }
.global-body{ white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }

.global-chat-panel .row > input{ flex: 1; }

.chat-area{
  border: 1px solid var(--border);
  background: var(--panel3);
  border-radius: var(--radius);
  padding: 10px;
}

.chat-header{ display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; min-width: 0; }
.chat-peer{ display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.chat-with{ display: block; font-weight: 950; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-messages{
  /* Taller DM window (scales with viewport, but stays reasonable). */
  height: clamp(240px, 42vh, 520px);
  overflow: auto;
  font-size: var(--chatFontSize);
  font-family: var(--chatFontFamily);
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.20);
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

/* Friends list: keep the panel stable (scroll inside the list when long). */
#friendsList{
  max-height: clamp(240px, 44vh, 520px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

:root[data-theme="light"] .chat-messages{ background: rgba(15,23,42,0.03); }

.chat-msg{
  max-width: 82%;
  padding: 9px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel2);
}

.chat-msg.me{ margin-left: auto; background: var(--panel4); }

.chat-msg .meta{ font-size: 0.75em; color: var(--muted); margin-top: 4px; }

/* Pills */
.pill{
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  font-size: 0.82rem;
  color: var(--muted);
}

:root[data-theme="light"] .pill{ background: rgba(15,23,42,0.04); }

.pill.unread{ background: rgba(34, 197, 94, 0.16); color: rgba(209,255,231,0.98); border-color: rgba(34,197,94,0.35); }
:root[data-theme="light"] .pill.unread{ color: #0d3a20; }

/* Result pills (profile / match history) */
.pill.win{ background: rgba(34, 197, 94, 0.18); color: rgba(209,255,231,0.98); border-color: rgba(34,197,94,0.35); }
.pill.loss{ background: rgba(239, 68, 68, 0.16); color: rgba(255, 230, 230, 0.98); border-color: rgba(239,68,68,0.35); }
.pill.draw{ background: rgba(255, 255, 255, 0.10); color: var(--text); border-color: rgba(255, 255, 255, 0.16); }

/* Leaderboard quick profile popover */
.player-popover{
  position: fixed;
  z-index: 2000;
  width: 300px;
  border: 1px solid var(--border);
  background: rgba(18, 21, 27, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

:root[data-theme="light"] .player-popover{
  background: rgba(255,255,255,0.92);
}

.player-popover .row{ display: flex; gap: 10px; align-items: center; }
.player-popover .name{ font-weight: 950; font-size: 1.05rem; }
.player-popover .meta{ margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.player-popover .actions{ margin-top: 12px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.player-popover .actions.actions-start{ justify-content: flex-start; }

/* Clan helpers */
.clan-header{ display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.clan-actions{ display: grid; gap: 10px; margin-top: 10px; }
.member-actions{ display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* Settings layout */
.settings-header{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadowSm);
  margin-bottom: 16px;
}

.settings-title{ font-weight: 950; font-size: 1.2rem; }

.settings-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.main.narrow{ max-width: 680px; margin: 0 auto; padding: 18px 12px; }

/* ------------------------------------------------------------------
   Mobile game experience (portrait = social, landscape = game only)
   Enabled by app.js via body classes: .is-mobile .mobile-portrait / .mobile-landscape
------------------------------------------------------------------- */

body.has-unity-embed.is-mobile.mobile-portrait{
  /* Reduce the (now non-playable) game tile so chat/social features are easy to reach. */
  --unityH: 200px;
  --homeTopRowH: auto;
}

body.has-unity-embed.is-mobile.mobile-portrait #homePage{
  grid-template-rows: auto;
}

body.has-unity-embed.is-mobile.mobile-portrait #unityPlaceholder,
body.has-unity-embed.is-mobile.mobile-portrait #unityFrame{
  display: none !important;
}

body.has-unity-embed.is-mobile.mobile-portrait #mobileRotateOverlay{
  display: flex;
}

body.has-unity-embed.is-mobile.mobile-landscape{
  overflow: hidden;
}

body.has-unity-embed.is-mobile.mobile-landscape .topbar,
body.has-unity-embed.is-mobile.mobile-landscape .sidebar{
  display: none !important;
}

body.has-unity-embed.is-mobile.mobile-landscape .layout{
  padding: 0 !important;
  gap: 0 !important;
  grid-template-columns: 1fr !important;
  height: 100vh !important;
  height: 100svh !important;
  height: 100dvh !important;
}

body.has-unity-embed.is-mobile.mobile-landscape .main{
  padding: 0 !important;
  overflow: hidden !important;
}

body.has-unity-embed.is-mobile.mobile-landscape #homePage{
  grid-template-columns: 1fr !important;
  grid-template-areas: "game" !important;
  grid-template-rows: 1fr !important;
  gap: 0 !important;
}

body.has-unity-embed.is-mobile.mobile-landscape #globalChatPanel,
body.has-unity-embed.is-mobile.mobile-landscape .home-leaderboard,
body.has-unity-embed.is-mobile.mobile-landscape #friendsLocked,
body.has-unity-embed.is-mobile.mobile-landscape #friendsArea{
  display: none !important;
}

body.has-unity-embed.is-mobile.mobile-landscape .game-shell{
  position: fixed;
  inset: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: #000;
}

body.has-unity-embed.is-mobile.mobile-landscape .game-header{
  display: none !important;
}

body.has-unity-embed.is-mobile.mobile-landscape .unity-container{
  height: 100%;
}

body.has-unity-embed.is-mobile.mobile-landscape #mobileRotateOverlay{
  display: none !important;
}

body.has-unity-embed.is-mobile.mobile-landscape #mobileLandscapeQuickPlay{
  display: grid;
}

body.has-unity-embed.is-mobile.mobile-landscape #mobileLandscapeQuickPlay[aria-hidden="true"]{
  display: grid;
}

body.has-unity-embed.is-mobile.mobile-landscape .unity-placeholder{
  justify-content: flex-start;
  padding: 18px;
}

body.has-unity-embed.is-mobile.mobile-portrait .layout > .game-shell.mobile-standalone-game{
  margin-bottom: 16px;
}

body.has-unity-embed.is-mobile.mobile-portrait.mobile-game-detached #homePage{
  grid-template-areas:
    "global"
    "leaderboard"
    "social";
}

/* Responsive */
@media (max-width: 1180px){
  #homePage{
    grid-template-columns: 1fr;
    /* Once the dashboard becomes a single column, there's no need to keep a
       fixed "first row" height. Let content size naturally. */
    grid-template-rows: auto;
    grid-template-areas:
      "game"
      "global"
      "leaderboard"
      "social";
  }

  /* Friends + DM stack vertically inside their wrapper. */
  #friendsLocked,
  #friendsArea{
    grid-template-columns: 1fr;
    grid-template-areas:
      "friends"
      "dm";
  }

  /* Prevent the global chat list from becoming "infinitely tall" when the
     dashboard is stacked vertically. Keep it scrollable. */
  .global-chat-panel{ height: auto; }
  .global-chat-messages{
    max-height: clamp(220px, 45vh, 520px);
  }
}

@media (max-width: 1100px){
  .layout{
    display: block;
    height: auto;
    background:
      radial-gradient(1100px 420px at 14% 0%, rgba(139,92,246,0.22), transparent 60%),
      radial-gradient(900px 420px at 86% 14%, rgba(236,72,153,0.16), transparent 58%),
      radial-gradient(960px 480px at 18% 56%, rgba(59,130,246,0.11), transparent 60%),
      radial-gradient(980px 500px at 82% 100%, rgba(34,197,94,0.10), transparent 58%);
  }

  /* The main column should scroll naturally with the page on mobile. */
  .main{ overflow: visible; }

  .settings-grid{ grid-template-columns: 1fr; }

  /* The hamburger / drawer menu has been removed. Keep the sidebar visible inline instead. */
  .btn-hamburger,
  .sidebar-mobile-header,
  .sidebar-backdrop,
  .page-menu-dropdown,
  .sidebar-page-links{
    display: none !important;
  }

  .sidebar{
    position: static;
    top: auto;
    left: auto;
    bottom: auto;
    width: auto;
    max-width: none;
    margin-bottom: 16px;
    border-radius: var(--radius);
    transform: none;
    transition: none;
    z-index: auto;
    overflow: auto;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.sidebar-open{ overflow: auto; }
}


@media (max-width: 760px){
  .main,
  #homePage,
  #homePage > *,
  #friendsLocked,
  #friendsLocked > *,
  #friendsArea,
  #friendsArea > *,
  .panel,
  .card,
  .game-shell,
  .friend-row,
  .global-msg,
  .item{
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .panel-title-row,
  .global-top,
  .chat-header{
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .friend-row{
    flex-direction: column;
    align-items: stretch;
  }

  .friend-main{ width: 100%; }

  .item{
    flex-direction: column;
    align-items: stretch;
  }

  .item > .actions{
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .friend-actions{
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .friend-actions .pill{
    margin-right: auto;
  }
}

@media (max-width: 560px){
  .topbar{ padding: 0 12px; }
  .subtitle{ display: none; }
  .topbar-right,
  .topbar-actions{ gap: 6px; }

  /* Keep the account badge available, but collapse it to avatar-only to save space. */
  .user-badge{ padding: 6px 8px; }
  .user-badge #userName{ display: none; }
  .user-badge .clan-sub{ display: none; }

  /* Make topbar buttons slightly more compact on narrow screens. */
  .topbar .btn{ padding: 8px 10px; }
  .topbar .btn.btn-icon{ padding: 8px 10px; }

  /* Rows (input + button) should wrap instead of causing horizontal overflow. */
  .row{ flex-wrap: wrap; }

  /* Allow wide tables (e.g. match history / leaderboards) to scroll horizontally. */
  .table{ overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .layout{ padding: 12px; }
  .unity-frame{ min-height: 460px; }
  .unity-placeholder-actions .btn{ flex-basis: 100%; }
}

@media (max-width: 420px){
  /* Registration is still accessible via the Login modal's "Switch to Register" button. */
  #btnRegister{ display: none !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------
   Game customization (built-in themes + per-slot uploads)
------------------------------------------------------------- */
.panel-span-2{ grid-column: 1 / -1; }

.game-customization-root{ min-width: 0; }

.game-customization-layout{
  display: grid;
  gap: 16px;
}

.game-customization-section{
  display: grid;
  gap: 10px;
}

.game-theme-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.game-theme-card{
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--panel3);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 10px;
  cursor: pointer;
  color: var(--text);
  box-shadow: 0 0 0 0 rgba(0,0,0,0);
}

.game-theme-card:hover{ filter: brightness(1.04); }
.game-theme-card:disabled{ opacity: 0.7; cursor: wait; }
.game-theme-card.selected{
  outline: 2px solid rgba(139,92,246,0.34);
  border-color: rgba(139,92,246,0.70);
  background: linear-gradient(180deg, rgba(139,92,246,0.10), rgba(139,92,246,0.04)), var(--panel3);
}

.game-theme-head,
.game-theme-footer,
.game-quota-head,
.game-asset-title-row,
.game-asset-actions{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.game-theme-title,
.game-asset-title,
.game-quota-main{
  font-weight: 950;
}

.game-theme-preview{
  position: relative;
  min-height: 94px;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}

.game-theme-preview .preview-light,
.game-theme-preview .preview-dark{
  position: absolute;
  width: 44%;
  height: 58%;
  top: 18%;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.game-theme-preview .preview-light{ left: 10%; background: #f3f4f6; }
.game-theme-preview .preview-dark{ right: 10%; background: #111827; }

.game-theme-preview .preview-piece{
  position: absolute;
  font-size: 36px;
  line-height: 1;
  text-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

.game-theme-preview .preview-piece-left{ left: 21%; top: 28%; color: #5aa0e6; }
.game-theme-preview .preview-piece-right{ right: 22%; top: 28%; color: #ff6b6b; }

.theme-preview-default_2 .preview-light{ background: #e8edf5; }
.theme-preview-default_2 .preview-dark{ background: #152238; }
.theme-preview-default_3 .preview-light{ background: #ebe7dc; }
.theme-preview-default_3 .preview-dark{ background: #2a1d17; }

.game-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel2);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.game-pill-muted{ opacity: 0.82; }
.game-pill-selected{
  border-color: rgba(139,92,246,0.65);
  background: rgba(139,92,246,0.16);
}

.game-quota-card{
  border: 1px solid var(--border);
  background: var(--panel3);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.game-quota-bar{
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

:root[data-theme="light"] .game-quota-bar{
  background: rgba(15,23,42,0.08);
  border-color: rgba(15,23,42,0.08);
}

.game-quota-bar > span{
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(90,160,230,0.95), rgba(139,92,246,0.95));
}

.game-guidelines-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.game-guideline-box,
.game-inline-note{
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.game-inline-note{
  color: var(--text);
  line-height: 1.45;
}

.game-asset-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.game-asset-card{
  border: 1px solid var(--border);
  background: var(--panel3);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.game-asset-card.future{
  background: linear-gradient(180deg, rgba(250,204,21,0.08), rgba(250,204,21,0.02)), var(--panel3);
}

.game-asset-preview{
  min-height: 126px;
  border-radius: calc(var(--radius) - 2px);
  border: 1px dashed rgba(255,255,255,0.12);
  background: var(--panel2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

:root[data-theme="light"] .game-asset-preview{
  border-color: rgba(15,23,42,0.12);
}

.game-asset-image{
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
  display: block;
}

.game-asset-audio{
  width: 100%;
}

.game-asset-empty{
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.game-asset-file{
  width: 100%;
  min-width: 0;
}

@media (max-width: 900px){
  .game-theme-grid,
  .game-asset-grid,
  .game-guidelines-grid{
    grid-template-columns: 1fr;
  }
}


/* screenshot-fixes-round-2 */
.btn-hamburger,
.sidebar-mobile-header,
.sidebar-backdrop,
.page-menu-dropdown,
.sidebar-page-links{
  display: none !important;
}

.page-menu-dropdown{
  position: fixed;
  z-index: 1200;
  min-width: 230px;
  max-width: min(86vw, 320px);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(18, 21, 27, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

:root[data-theme="light"] .page-menu-dropdown{
  background: rgba(255,255,255,0.96);
}

.page-menu-label{
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted2);
}

.page-menu-grid,
.sidebar-page-links-grid{
  display: grid;
  gap: 8px;
}

.page-menu-link{
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.page-menu-link.active{
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: white;
  border-color: transparent;
}

.sidebar-page-links{
  display: none;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.chat-msg-card{
  max-width: none;
  width: auto;
  margin-left: 0;
  padding: 9px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel2);
}

.chat-msg-card.me{
  margin-left: 0;
  background: var(--panel4);
}

.chat-msg-card[data-pending="1"] .global-time{
  color: var(--muted2);
  font-style: italic;
}

#profileEmail{
  display: none !important;
}

@media (max-width: 1100px){
  .sidebar-page-links{
    display: block;
  }
}
