:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --border: #262626;
  --text: #ffffff;
  --muted: #9a9a9a;
  --gold: #d4af37;
  --gold-light: #f4e5a1;
  --gold-dark: #a17d1f;
  --red: #e63946;
  --green: #22c55e;
  --radius: 14px;
}

* { box-sizing: border-box; }

html {
  /* overflow-x: clip is safer than hidden — doesn't break position: fixed */
  overflow-x: hidden;   /* fallback for older browsers */
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  font-size: 14px;
  overflow-x: hidden;   /* safety belt */
  overflow-x: clip;
}

/* ---------- Brand / logo ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
}

.brand-icon {
  height: 80px;
  width: auto;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  font-family: "Georgia", serif;
}

.brand-royal {
  font-size: 32px;
  font-weight: bold;
  letter-spacing: 4px;
  background: linear-gradient(180deg, #f4e5a1, #d4af37);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-lounge {
  font-size: 22px;
  letter-spacing: 6px;
  color: #9a9a9a;
  margin-top: 2px;
}

/* ---------- Nav (sticky) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.3s ease;
}

.nav-search-wrapper {
  flex: 1;
  max-width: 420px;
  margin: 0 30px;
}

.nav .search {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
}

.nav .search:focus {
  outline: none;
  border-color: var(--gold);
}

.nav-right { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
}

.user-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--border);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #444, #222);
}
.user-name { font-size: 13px; font-weight: 600; }
.user-tier { font-size: 11px; color: var(--gold); }

/* Mobile-only elements — hidden on desktop */
.mobile-status-pill,
.avatar-dropdown,
.mobile-bottom-nav {
  display: none;
}

/* ---------- Ticker (sticky under nav) ---------- */
.ticker {
  position: sticky;
  top: 108px;
  z-index: 999;
  overflow: hidden;
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
  white-space: nowrap;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 25s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-group {
  display: flex;
  gap: 40px;
  padding: 10px 28px;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item span { margin-right: 6px; }

/* ---------- Layout ---------- */
.layout {
  display: flex; gap: 20px;
  padding: 20px 28px;
  max-width: 1400px; margin: 0 auto;
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex; flex-direction: column; gap: 6px;
  width: 220px; flex-shrink: 0;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  color: var(--muted); text-decoration: none;
  border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 500;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }

/* ---------- Content ---------- */
.content {
  flex: 1; display: flex; flex-direction: column; gap: 20px;
  min-width: 0;
}

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(212, 175, 55, 0.08), transparent 60%),
    var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.eyebrow {
  font-size: 11px; letter-spacing: 2px; color: var(--muted);
}

.hero h1 {
  font-size: 46px; margin: 6px 0 10px; letter-spacing: 2px;
  background: linear-gradient(180deg, #f4e5a1, #d4af37);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: "Georgia", serif;
}

.hero-sub { color: var(--muted); margin: 0 0 16px; }

.hero-badges {
  display: flex; gap: 16px; margin-bottom: 22px;
  font-size: 12px; color: var(--muted);
}

.hero-right { display: flex; align-items: center; justify-content: center; }

.hero-art {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dots { display: flex; gap: 6px; margin-top: 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #333; }
.dot.active { background: var(--gold); width: 22px; border-radius: 999px; }

/* ---------- Buttons ---------- */
.btn {
  border: none; cursor: pointer;
  padding: 10px 18px; border-radius: 999px;
  font-weight: 600; font-size: 13px;
  text-decoration: none; display: inline-block;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-gold { background: var(--gold); color: #000; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-white { background: #fff; color: #000; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid var(--border); }
.btn-lg { padding: 14px 28px; font-size: 14px; }

/* ---------- Category pills ---------- */
.pills {
  display: flex; gap: 10px;
  overflow-x: auto; padding-bottom: 4px;
}
.pill {
  padding: 8px 16px; border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text); font-size: 12px;
  white-space: nowrap; cursor: pointer;
}
.pill:hover { border-color: var(--gold); }
.pill.active {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
  font-weight: 600;
}

/* ---------- Promo cards ---------- */
.promo-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.promo-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.promo-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.promo-card > div:nth-child(2) { flex: 1; }
.promo-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.promo-sub { font-size: 12px; color: var(--muted); }
.gold { color: var(--gold); }

/* ---------- Games ---------- */
.games-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.games h2 { margin: 0; font-size: 18px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
}

.game-card[hidden] {
  display: none !important;
}

.game-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  background: #0a0a0a;
}
.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.game-card:hover .game-thumb img {
  transform: scale(1.06);
}

.game-meta {
  padding: 10px 12px;
  display: flex; justify-content: space-between;
}
.game-name { font-size: 13px; font-weight: 600; }
.game-tag { font-size: 11px; color: var(--muted); }

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Auth Pages ---------- */
.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 60px 20px;
  min-height: 60vh;
  align-items: flex-start;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-family: "Georgia", serif;
  text-align: center;
  background: linear-gradient(180deg, #f4e5a1, #d4af37);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-sub {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 13px;
  text-align: center;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.btn-google:hover {
  background: #f7f7f7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 22px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span { padding: 0 12px; }

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-form label {
  font-size: 12px;
  color: var(--text);
  margin-top: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.auth-form input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}

.auth-form input::placeholder { color: #666; }

.auth-form input:focus {
  outline: none;
  border-color: var(--gold);
  background: #202020;
}

.auth-form .btn {
  margin-top: 20px;
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

.auth-foot {
  text-align: center;
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}

.auth-foot a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.auth-foot a:hover { text-decoration: underline; }

/* ---------- Flash Messages ---------- */
.flash-wrap {
  max-width: 1400px;
  margin: 16px auto 0;
  padding: 0 28px;
}

.flash {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 8px;
  border: 1px solid;
}

.flash-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.flash-error {
  background: rgba(230, 57, 70, 0.1);
  border-color: rgba(230, 57, 70, 0.4);
  color: #fca5a5;
}

/* ---------- Admin Dashboard ---------- */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-header h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-family: "Georgia", serif;
  color: var(--gold);
}

.status-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.status-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse-green 2s infinite;
}

.status-dot.offline {
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.7);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70%  { box-shadow: 0 0 0 14px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes pulse-red {
  0%   { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.7); }
  70%  { box-shadow: 0 0 0 14px rgba(230, 57, 70, 0); }
  100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0); }
}

.status-label {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.status-desc {
  font-size: 12px;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.stat-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-icon { font-size: 22px; }
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  font-family: "Georgia", serif;
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.admin-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.admin-panel {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 20px;
}

.admin-two-col .admin-panel {
  margin-top: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
}

.panel-badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.panel-badge.soon {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.4);
  color: var(--gold);
}

.convo-list, .user-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.convo-item, .user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.convo-item:hover, .user-row:hover {
  background: var(--surface-2);
}

.convo-info, .user-info {
  flex: 1;
  min-width: 0;
}

.convo-name, .user-name-row {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.convo-preview, .user-email-row {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.convo-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.convo-time { font-size: 11px; color: var(--muted); }

.convo-badge {
  background: var(--red);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
}

.user-tier-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tier-bronze { background: #4a2e1a; color: #d69b6b; }
.tier-silver { background: #2a2d33; color: #c0c7d1; }
.tier-gold   { background: rgba(212, 175, 55, 0.15); color: var(--gold); }
.tier-vip    { background: rgba(230, 57, 70, 0.15); color: #fca5a5; }

.panel-empty {
  text-align: center;
  padding: 30px 20px;
}

.panel-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.panel-empty p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-empty-sub {
  font-size: 11px !important;
  opacity: 0.7;
}

.coming-soon {
  border-style: dashed;
  opacity: 0.9;
}

.coming-soon-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.password-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
}

.password-form input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
}

.password-form input:focus {
  outline: none;
  border-color: var(--gold);
}

/* ---------- Small Floating Chat Widget ---------- */
.chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f4e5a1, #d4af37);
  color: #000;
  border: 2px solid rgba(0, 0, 0, 0.15);
  font-size: 30px;
  cursor: grab;
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.55),
              0 0 0 4px rgba(212, 175, 55, 0.12);
  z-index: 2147483646;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.chat-bubble:hover {
  box-shadow: 0 14px 40px rgba(212, 175, 55, 0.75),
              0 0 0 4px rgba(212, 175, 55, 0.2);
}

.chat-bubble:active,
.chat-bubble.dragging {
  cursor: grabbing;
  transition: none;
}

.chat-bubble.active:not(.dragging) { transform: rotate(90deg); }


.chat-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 340px;
  height: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: none;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  z-index: 2147483645;
}

.chat-window.open {
  display: flex;
  animation: chatSlideUp 0.2s ease-out;
}

@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, #1a1a1a, #222);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  font-family: "Georgia", serif;
  letter-spacing: 0.5px;
}

.chat-status {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.chat-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.chat-close:hover { background: rgba(255,255,255,0.05); color: var(--text); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #101010;
}

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.chat-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 30px;
  padding: 16px;
  background: rgba(212, 175, 55, 0.05);
  border-radius: 10px;
  line-height: 1.5;
}

.chat-msg {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-msg-user {
  align-self: flex-end;
  background: var(--gold);
  color: #000;
  border-bottom-right-radius: 4px;
}

.chat-msg-admin,
.chat-msg-bot {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-text { margin-bottom: 3px; }
.chat-time { font-size: 9.5px; opacity: 0.7; }

.chat-img {
  max-width: 220px;
  max-height: 220px;
  width: auto;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: zoom-in;
  display: block;
  border: 1px solid var(--border);
  transition: transform 0.15s, border-color 0.15s;
}

.chat-img:hover {
  transform: scale(1.03);
  border-color: var(--gold);
}

/* Larger on wide admin chat page */
.admin-chat-panel .chat-img {
  max-width: 280px;
  max-height: 280px;
}

.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.chat-attach {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-attach:hover { border-color: var(--gold); }

.chat-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-family: inherit;
  min-width: 0;
}

.chat-input:focus { outline: none; border-color: var(--gold); }

.chat-send {
  background: var(--gold);
  color: #000;
  border: none;
  padding: 0 14px;
  height: 34px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-send:hover { background: var(--gold-dark); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-preview {
  position: relative;
  padding: 8px 10px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.chat-preview img {
  max-height: 60px;
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.chat-preview-remove {
  position: absolute;
  top: 4px;
  right: 8px;
  background: var(--red);
  color: #fff;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Admin Chat Page ---------- */
.admin-chat-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 240px);
  min-height: 500px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 20px;
  overflow: hidden;
}

.admin-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #101010;
}

.admin-chat-messages::-webkit-scrollbar { width: 8px; }
.admin-chat-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

.admin-chat-panel .chat-msg {
  font-size: 13.5px;
  padding: 10px 14px;
}

.admin-chat-panel .chat-input-wrap { padding: 14px; }

/* ---------- Admin notification UI ---------- */
.sound-enable-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: var(--gold);
  color: #000;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.5);
  z-index: 2147483646;
  animation: soundPulse 2s infinite;
  font-family: inherit;
}

.sound-enable-btn:hover { background: var(--gold-dark); }

@keyframes soundPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

.admin-toast {
  position: fixed;
  top: 110px;
  right: 24px;
  background: var(--surface);
  border: 2px solid var(--gold);
  color: var(--text);
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 2147483646;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  animation: slideInRight 0.3s ease-out;
  max-width: 320px;
  font-weight: 600;
}

.admin-toast:hover { border-color: var(--gold-light); }
.admin-toast strong { color: var(--gold); font-size: 16px; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---------- Banner Ticker ---------- */
.ticker.ticker-banners {
  padding: 0;
  background: rgba(10, 10, 10, 0.94);
  font-size: 0;
  height: 110px;
  display: flex;
  align-items: center;
  /* Clip horizontally so track doesn't widen the doc,
     but allow vertical overflow so 2X zoom can escape */
  overflow-x: clip;
  overflow-y: visible;
}

.ticker-banners .ticker-track {
  animation-duration: 18s;
}

.ticker-banners .ticker-group {
  gap: 60px;
  padding: 0 35vw;
  align-items: center;
  height: 110px;
}

.ticker-banner-link {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
  border-radius: 12px;
  transform-origin: center top;
  transition: transform 0.35s ease-out;
  position: relative;
  z-index: 1;
}

.ticker-banner-link:hover {
  transform: scale(2);
  z-index: 100;
}

.ticker-banners:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-banner-img {
  height: 110px;
  width: auto;
  max-width: none;
  border-radius: 12px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #0a0a0a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.ticker-banner-link:hover .ticker-banner-img {
  box-shadow: 0 8px 40px rgba(212, 175, 55, 0.8);
  border-color: var(--gold);
}

/* ---------- Admin Banners Page ---------- */
.banner-upload-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 20px;
}

.banner-upload-card h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.banner-upload-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.banner-upload-form .full-row { grid-column: 1 / -1; }

.banner-upload-form label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.banner-upload-form input[type="text"],
.banner-upload-form textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.banner-upload-form textarea { min-height: 70px; }

.banner-upload-form input[type="file"] {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
}

.banner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.banner-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.banner-tile.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold) inset;
}

.banner-tile-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0a0a0a;
  display: block;
}

.banner-tile-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.banner-tile-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.banner-tile-msg {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  max-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-tile-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.banner-tile-actions button {
  flex: 1;
  font-size: 11px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
}

.banner-tile-actions .btn-activate {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

.banner-tile-actions .btn-deactivate {
  background: transparent;
  color: var(--muted);
}

.banner-tile-actions .btn-delete {
  background: transparent;
  color: #fca5a5;
  border-color: rgba(230, 57, 70, 0.4);
  flex: 0 0 auto;
  padding: 7px 12px;
}

.banner-tile-actions .btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 7px 12px;
  text-decoration: none;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.banner-tile-actions .btn-download:hover {
  background: var(--gold);
  color: #000;
}

.banner-tile-actions button:hover { filter: brightness(1.1); }

.banner-counter {
  font-size: 13px;
  color: var(--muted);
  margin-left: 8px;
  font-weight: 400;
}

.banner-counter.full { color: var(--gold); }

.banner-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--muted);
  font-size: 13px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 12px;
}

/* ============================================================
   MOBILE RESPONSIVE — everything below 900px
   ============================================================ */

@media (max-width: 900px) {

  /* --- iOS auto-zoom prevention (needs 16px min) --- */
  .chat-input,
  .auth-form input,
  .banner-upload-form input[type="text"],
  .banner-upload-form textarea,
  .password-form input,
  .nav .search {
    font-size: 16px;
  }

  /* --- Layout --- */
  .layout {
    padding: 12px;
    gap: 12px;
    /* leave room at bottom for the fixed bottom nav */
    padding-bottom: 84px;
  }

  /* Hide the desktop sidebar on mobile */
  .sidebar { display: none; }

  /* --- Nav: compact --- */
  .nav {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 8px;
  }

  .brand-icon { height: 44px; }
  .brand-text { display: none; }

  .nav-search-wrapper {
    order: 3;
    max-width: 100%;
    width: 100%;
    margin: 8px 0 0 0;
  }

  .nav-right {
    gap: 6px;
    margin-left: auto;
  }

  .nav-btn-text { display: none; }
  .nav-admin-btn { padding: 8px 10px; }

  .user-pill {
    padding: 4px;
    cursor: pointer;
  }
  .user-pill-text { display: none; }
  .user-pill .avatar { width: 36px; height: 36px; }

  .nav-logout { display: none; }

  .icon-btn {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .nav-signup, .nav-login {
    padding: 8px 12px;
    font-size: 12px;
  }

  /* --- Mobile status pill (admin only) --- */
  .mobile-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    flex-shrink: 0;
  }
  .mobile-status-pill:disabled { opacity: 0.6; cursor: wait; }

  .mobile-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    flex-shrink: 0;
  }
  .mobile-status-dot.online { background: var(--green); }
  .mobile-status-dot.offline { background: var(--red); }

  /* --- Avatar dropdown (mobile) --- */
  .avatar-dropdown {
    display: block;
    position: fixed;
    top: 62px;
    right: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    min-width: 210px;
    z-index: 2147483647;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  }
  .avatar-dropdown[hidden] { display: none; }

  .avatar-dropdown-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 4px;
  }
  .avatar-dropdown-header strong {
    color: var(--gold);
    font-size: 13px;
  }
  .avatar-dropdown-header .tier-tag {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  .avatar-dropdown-item {
    display: block;
    padding: 10px 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
  }
  .avatar-dropdown-item:hover {
    background: var(--surface-2);
  }


  /* --- Hero --- */
  .hero {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 16px;
  }
  .hero h1 { font-size: 32px; letter-spacing: 1px; }
  .hero-sub { font-size: 13px; }
  .hero-badges {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    margin-bottom: 16px;
  }
  .btn-lg { padding: 12px 22px; font-size: 13px; }

  /* --- Promo cards --- */
  .promo-grid { grid-template-columns: 1fr; gap: 12px; }
  .promo-card {
    padding: 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .promo-card .btn { width: 100%; text-align: center; }
  .promo-title { font-size: 14px; }

  /* --- Games grid: 2 columns on phones --- */
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .game-meta { padding: 8px 10px; }
  .game-name { font-size: 12px; }
  .game-tag { font-size: 10px; }

  /* --- Pills --- */
  .pills { gap: 8px; }
  .pill { padding: 7px 14px; font-size: 12px; }

  /* --- Auth pages --- */
  .auth-wrap { padding: 24px 14px; }
  .auth-card { padding: 28px 20px; border-radius: 12px; }
  .auth-card h1 { font-size: 22px; }

  /* --- Flash messages --- */
  .flash-wrap { padding: 0 14px; }
  .flash { font-size: 12px; padding: 10px 14px; }

  /* --- Admin dashboard --- */
  .admin-header {
    padding: 18px 20px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .admin-header h1 { font-size: 20px; }

  .status-card {
    padding: 18px 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .status-left { gap: 14px; }
  .status-label { font-size: 14px; }
  .status-desc { font-size: 11px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 11px; }

  .admin-two-col { grid-template-columns: 1fr; gap: 12px; }
  .admin-panel { padding: 16px; margin-top: 12px; }
  .panel-header h2 { font-size: 15px; }

  .password-form { grid-template-columns: 1fr; gap: 8px; }
  .password-form .btn { width: 100%; padding: 12px; }

  /* --- Admin chat page --- */
  .admin-chat-panel {
    height: calc(100dvh - 220px);
    min-height: 400px;
    margin-top: 12px;
  }
  .admin-chat-messages { padding: 14px; }
  .admin-chat-panel .chat-input-wrap { padding: 10px; }
  .admin-chat-panel .chat-msg { font-size: 12.5px; padding: 8px 12px; }

  /* --- Admin banners --- */
  .banner-upload-form { grid-template-columns: 1fr; gap: 10px; }
  .banner-grid { grid-template-columns: 1fr; gap: 12px; }
  .banner-upload-card { padding: 16px; }
  .banner-tile-actions { flex-wrap: wrap; }

  /* --- Chat bubble (mobile) --- */
  .chat-bubble {
    width: 66px;
    height: 66px;
    font-size: 30px;
    /* above the fixed bottom nav (64px) + safe area */
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    right: 16px;
  }

  /* --- Chat window: fullscreen on mobile --- */
  .chat-window {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .chat-window.open { animation: none; }

  .chat-header { padding: 14px 16px; }
  .chat-messages { padding: 16px; }

  .chat-input-wrap {
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  /* --- Notification sound button on mobile --- */
  .sound-enable-btn {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    left: 16px;
    padding: 8px 14px;
    font-size: 12px;
  }

  /* --- Toast notifications --- */
  .admin-toast {
    top: auto;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    left: 12px;
    max-width: none;
    font-size: 13px;
    padding: 12px 16px;
  }

  /* =====================================================
     MOBILE BOTTOM NAV (fixed)
     ===================================================== */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    z-index: 2147483644;
    align-items: stretch;
  }

  .mobile-bottom-nav > a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    position: relative;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom-nav > a:hover,
  .mobile-bottom-nav > a:active {
    color: var(--text);
  }

  .mobile-bottom-nav > a.active {
    color: var(--gold);
  }

  .mobile-bottom-nav > a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--gold);
    border-radius: 0 0 4px 4px;
  }

  .mobile-bottom-nav .nav-icon {
    font-size: 20px;
    line-height: 1;
  }

  .mobile-bottom-nav .nav-label {
    font-size: 10px;
    line-height: 1;
  }

  .mobile-bottom-nav .nav-badge {
    position: absolute;
    top: 6px;
    right: 50%;
    transform: translateX(18px);
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  .mobile-bottom-nav .nav-badge[hidden] { display: none; }

} /* end @media max-width: 900px */


/* ============================================================
   EXTRA SMALL PHONES (iPhone SE, older Androids)
   ============================================================ */

@media (max-width: 400px) {

  .brand-icon { height: 40px; }

  .nav { padding: 8px 12px; gap: 6px; }
  .nav-right { gap: 4px; }

  .nav-signup, .nav-login {
    padding: 6px 10px;
    font-size: 11px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .user-pill { padding: 3px; }
  .user-pill .avatar { width: 32px; height: 32px; }

  .hero { padding: 16px; }
  .hero h1 { font-size: 26px; }

  .stat-value { font-size: 20px; }
  .stat-card { padding: 14px; }

  .grid { gap: 8px; }
  .game-meta { padding: 6px 8px; }
  .game-name { font-size: 11px; }
  .game-tag { font-size: 9px; }

  .chat-bubble {
    width: 60px;
    height: 60px;
    font-size: 26px;
  }

  .mobile-bottom-nav { height: 58px; }
  .mobile-bottom-nav .nav-icon { font-size: 18px; }
  .mobile-bottom-nav .nav-label { font-size: 9px; }

}

/* Hide the chat bubble when the chat window is open (keeps position) */
.chat-bubble.bubble-hidden {
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* ============ RBAC & Multi-Admin Styles ============ */

/* Role badges */
.role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: 6px;
}
.role-badge.role-user        { background: #2a2d33; color: #c0c7d1; }
.role-badge.role-admin       { background: rgba(212,175,55,0.15); color: var(--gold); }
.role-badge.role-super_admin { background: rgba(230,57,70,0.15); color: #fca5a5; }
.role-badge.role-developer   { background: linear-gradient(135deg, #d4af37, #a17d1f); color: #000; }

.badge-you {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  background: var(--gold);
  color: #000;
  border-radius: 999px;
  margin-left: 6px;
  font-weight: 700;
}

/* Assignment badge on conversation rows */
.assign-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.assign-mine      { background: rgba(34,197,94,0.15); color: #86efac; }
.assign-available { background: rgba(212,175,55,0.15); color: var(--gold); }
.assign-others    { background: #2a2d33; color: var(--muted); }

/* Admin user management page */
.admin-form { display: block; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.admin-form label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
}
.admin-form input:focus,
.admin-form select:focus { outline: none; border-color: var(--gold); }

.perm-heading {
  font-size: 13px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--text);
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.perm-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  transition: border-color 0.15s;
}
.perm-item:hover { border-color: var(--gold); }
.perm-item input[type="checkbox"] {
  margin-top: 2px;
  width: 16px; height: 16px;
  accent-color: var(--gold);
  flex-shrink: 0;
}
.perm-item span { color: var(--muted); line-height: 1.4; }
.perm-item strong { color: var(--text); display: block; margin-bottom: 2px; }

.admin-card {
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-danger {
  background: transparent;
  color: #fca5a5;
  border: 1px solid rgba(230,57,70,0.4);
}
.btn-danger:hover { background: rgba(230,57,70,0.1); }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .perm-grid { grid-template-columns: 1fr; }
  .admin-card-header { flex-direction: column; align-items: flex-start; }
}

/* ============ ADMIN UPLOADS GALLERY ============ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  min-width: 220px;
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--gold); }

.upload-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.upload-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.15s;
}
.upload-tile:hover { border-color: var(--gold); }

.upload-tile a { display: block; line-height: 0; }

.upload-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #0a0a0a;
  display: block;
}

.upload-tile-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.upload-user {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}
.upload-user a {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-user a:hover { text-decoration: underline; }

.sender-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.sender-user  { background: rgba(212,175,55,0.15); color: var(--gold); }
.sender-admin { background: rgba(34,197,94,0.15);  color: #86efac; }
.sender-bot   { background: rgba(100,100,100,0.15); color: var(--muted); }

.upload-time {
  font-size: 10px;
  color: var(--muted);
}

.upload-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.upload-btn:hover {
  border-color: var(--gold);
  background: rgba(212,175,55,0.1);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}
.page-info {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* ============ USER PROFILE — CHAT HISTORY ============ */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 6px;
}
.history-list::-webkit-scrollbar { width: 6px; }
.history-list::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.history-item {
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: 12px;
  border-left: 3px solid var(--border);
}
.history-item.history-user  { border-left-color: var(--gold); }
.history-item.history-admin { border-left-color: var(--green); }
.history-item.history-bot   { border-left-color: var(--muted); }

.history-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  gap: 10px;
}
.history-meta strong {
  color: var(--text);
  font-size: 13px;
}
.history-time {
  color: var(--muted);
  font-size: 11px;
}

.history-body { margin-top: 4px; }

.history-img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 6px;
  cursor: pointer;
}

.history-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

@media (max-width: 700px) {
  .upload-gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .filter-select { width: 100%; }
  .pagination { flex-direction: column; gap: 10px; }
  .history-img { max-width: 100%; }
}

/* ============ CONVERSATION ROW — Color states ============ */

/* Available (unassigned) — white text, no border highlight */
.convo-item.row-available {
  border-left: 3px solid transparent;
}
.convo-item.row-available .convo-name {
  color: #ffffff;
  font-weight: 700;
}

/* Mine (assigned to me) — white text, green left border */
.convo-item.row-mine {
  border-left: 3px solid #22c55e;
  background: rgba(34, 197, 94, 0.04);
}
.convo-item.row-mine .convo-name {
  color: #ffffff;
  font-weight: 700;
}

/* Engaged by other admin — yellow text, yellow left border */
.convo-item.row-others {
  border-left: 3px solid #d4af37;
  background: rgba(212, 175, 55, 0.05);
}
.convo-item.row-others .convo-name {
  color: #f4e5a1;
  font-weight: 700;
}

/* Unread label next to username */
.unread-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e63946;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.3px;
  animation: unread-pulse 2s infinite;
}

@keyframes unread-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.7); }
  50%      { box-shadow: 0 0 0 6px rgba(230, 57, 70, 0); }
}

/* Conversation row base — make the whole row clickable-looking */
.convo-item {
  padding-left: 12px;
  border-radius: 10px;
  transition: background 0.15s, border-color 0.15s;
}
.convo-item:hover {
  background: var(--surface-2);
}

/* ============ IMAGE LIGHTBOX ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}

.lightbox-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 95vw;
  max-height: 95vh;
}

.lightbox-content img {
  max-width: 95vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  background: #000;
}

.lightbox-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.lightbox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  border: none;
  background: var(--gold);
  color: #000;
  transition: background 0.15s, border-color 0.15s;
}
.lightbox-btn:hover { background: var(--gold-dark); }

.lightbox-close {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 700px) {
  .lightbox-content img { max-height: 70vh; }
  .lightbox-btn { padding: 10px 18px; font-size: 12px; }
}

.btn-danger {
  background: rgba(230, 57, 70, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(230, 57, 70, 0.4);
}
.btn-danger:hover {
  background: rgba(230, 57, 70, 0.3);
  color: #fff;
}

/* ---------- Email Verification / Push Banner ---------- */
.verify-banner {
  position: sticky;
  top: 234px;                    /* nav 108 + ticker 110 + 16 gap */
  z-index: 998;                  /* just below ticker (999) */
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1400px;
  margin: 16px auto 0;
  padding: 14px 20px;
  background: rgba(20, 18, 10, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.verify-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.verify-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.verify-text strong {
  color: var(--gold);
  font-size: 14px;
}

.verify-text span {
  color: var(--muted);
  font-size: 12px;
}

.verify-btn {
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .verify-banner {
    top: calc(var(--mobile-nav-h) + 80px + 8px);
    margin: 12px 12px 0;
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .verify-btn { width: 100%; text-align: center; }
}
/* ============================================================
   MOBILE TICKER + STICKY OFFSETS — SINGLE SOURCE OF TRUTH
   Non-sticky on mobile: kills gap above banner + hero overlap.
   ============================================================ */
@media (max-width: 900px) {

  :root { --mobile-nav-h: 122px; }

  /* ---------- Banner ticker ---------- */
  .ticker.ticker-banners {
    /* Not sticky on mobile — scrolls away cleanly with the page */
    position: relative !important;
    top: auto !important;
    height: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-top: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    display: flex !important;
    align-items: stretch !important;   /* was center — stretch fills the strip */
    overflow: hidden !important;
    line-height: 0 !important;
    font-size: 0 !important;
  }

  .ticker.ticker-banners .ticker-track {
    height: 80px !important;
    display: flex !important;
    align-items: stretch !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    animation-duration: 22s !important;
  }

  .ticker.ticker-banners .ticker-group {
    height: 80px !important;
    display: flex !important;
    align-items: stretch !important;   /* stretch, not center */
    gap: 14px !important;
    padding: 0 20vw !important;
    margin: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
  }

  .ticker.ticker-banners .ticker-banner-link {
    height: 80px !important;
    display: block !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    line-height: 0 !important;
    font-size: 0 !important;
    transform: none !important;
  }

  .ticker.ticker-banners .ticker-banner-img {
    height: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    width: auto !important;
    max-width: none !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 8px !important;
    /* cover = fill the 80px strip edge-to-edge, crop sides if needed */
    object-fit: cover !important;
    object-position: center !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
  }

  /* ---------- Plain promo ticker (when no banners) ---------- */
  .ticker {
    position: relative !important;
    top: auto !important;
    font-size: 11px;
  }
  .ticker-group {
    padding: 8px 20px;
    gap: 24px;
  }

  /* ---------- Content clearance below the ticker ---------- */
  .layout {
    padding-top: 16px !important;
  }
}


/* ============ SPINNER ============ */
.spinner-wrap {
  display:flex; flex-direction:column; align-items:center; gap:32px;
  padding:40px 20px 80px;
  position:relative; z-index:1;
}
.wheel-container {
  position:relative;
  width:min(92vw, 520px);
  height:min(92vw, 520px);
  margin:20px auto;
  filter: drop-shadow(0 20px 50px rgba(212,175,55,0.35));
}
.wheel-canvas {
  width:100%; height:100%;
  transition:transform 5.5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  display:block;
  border-radius:50%;
  background:#0a0a0a;
}
.wheel-glow {
  position:absolute; inset:-12px;
  border-radius:50%;
  background: conic-gradient(from 0deg, #d4af37, #f4e5a1, #d4af37, #a17d1f, #d4af37);
  z-index:-1;
  animation: spinGlow 8s linear infinite;
  filter: blur(8px);
  opacity:0.55;
}
@keyframes spinGlow { to { transform: rotate(360deg); } }

.wheel-pointer {
  position:absolute;
  top:-18px; left:50%;
  transform:translateX(-50%);
  width:0; height:0;
  border-left:18px solid transparent;
  border-right:18px solid transparent;
  border-top:34px solid var(--gold);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.9)) drop-shadow(0 0 6px var(--gold));
  z-index:10;
}
.wheel-pointer::after {
  content:'';
  position:absolute;
  top:-30px; left:50%;
  transform:translateX(-50%);
  width:14px; height:14px;
  background:var(--gold);
  border-radius:50%;
  box-shadow: 0 0 12px var(--gold);
}

.spin-btn {
  background: linear-gradient(180deg, #f4e5a1 0%, #d4af37 50%, #a17d1f 100%);
  color:#000;
  border: 2px solid #f4e5a1;
  padding:20px 64px;
  border-radius:999px;
  font-size:22px;
  font-weight:800;
  cursor:pointer;
  letter-spacing:2px;
  box-shadow: 0 12px 32px rgba(212,175,55,0.55), inset 0 -3px 0 rgba(0,0,0,0.2);
  font-family:"Georgia", serif;
  transition: transform 0.15s, box-shadow 0.15s;
  text-transform: uppercase;
}
.spin-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(212,175,55,0.75), inset 0 -3px 0 rgba(0,0,0,0.2); }
.spin-btn:active { transform:scale(0.97) translateY(0); }
.spin-btn:disabled { opacity:0.5; cursor:not-allowed; transform:none; }
.spin-result { min-height:40px; text-align:center; font-size:16px; color:var(--muted); }

.spin-modal { position:fixed; inset:0; background:rgba(0,0,0,0.85); display:none; align-items:center; justify-content:center; z-index:99999; padding:20px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.spin-modal.open { display:flex; animation:fadeIn 0.3s; }
.spin-modal-card { background:var(--surface); border:2px solid var(--gold); border-radius:20px; padding:40px 30px; max-width:440px; width:100%; text-align:center; box-shadow:0 20px 60px rgba(0,0,0,0.8); position:relative; z-index:1; }
.spin-modal-card h2 { margin:0 0 12px; font-size:26px; color:var(--gold); font-family:"Georgia",serif; }
.spin-modal-card .win-amount { font-size:44px; font-weight:800; color:#86efac; margin:14px 0; font-family:"Georgia",serif; }
.spin-modal-card p { color:var(--muted); margin:8px 0 24px; font-size:14px; }
.spin-modal-card .btn { font-size:16px; padding:14px 36px; }
.spin-big-win { border-color:#86efac; box-shadow:0 0 60px rgba(134,239,172,0.6); animation:glowPulse 1s infinite alternate; }
@keyframes glowPulse { from { box-shadow:0 0 40px rgba(134,239,172,0.4);} to { box-shadow:0 0 80px rgba(134,239,172,0.9);} }
@keyframes fadeIn { from { opacity:0;} to { opacity:1;} }

.confetti { position:fixed; top:-50px; z-index:100000; pointer-events:none; animation:confettiFall linear forwards; }
@keyframes confettiFall { to { transform:translateY(110vh) rotate(720deg); opacity:0; } }

@media (max-width:600px) {
  .wheel-container { width:min(88vw, 400px); height:min(88vw, 400px); }
  .spin-btn { padding:16px 48px; font-size:18px; }
}


/* ============ SPINNER MODAL ============ */
.spin-modal {
  position:fixed !important;
  top:0 !important; left:0 !important;
  right:0 !important; bottom:0 !important;
  width:100vw !important;
  height:100vh !important;
  background:rgba(0,0,0,0.92) !important;
  display:none !important;
  z-index:2147483647 !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding:24px 16px !important;
  margin:0 !important;
  -webkit-overflow-scrolling:touch;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.spin-modal.open { display:block !important; }

.spin-modal-card {
  background:var(--surface);
  border:2px solid var(--gold);
  border-radius:22px;
  padding:20px 26px 26px;
  max-width:560px;
  width:100%;
  box-shadow:0 20px 80px rgba(0,0,0,0.9), 0 0 60px rgba(212,175,55,0.25);
  position:relative;
  margin:20px auto 40px;
  display:block;
}
.spin-close {
  position:absolute; top:12px; right:14px;
  background:rgba(255,255,255,0.08); color:#fff;
  border:1px solid rgba(255,255,255,0.15);
  width:34px; height:34px; border-radius:50%;
  cursor:pointer; font-size:16px;
  display:flex; align-items:center; justify-content:center;
  z-index:10;
}
.spin-close:hover { background:var(--red); border-color:var(--red); }

.wheel-container-modal {
  position:relative;
  width:min(82vw, 480px);
  height:min(82vw, 480px);
  margin:12px auto 6px;
  filter: drop-shadow(0 20px 50px rgba(212,175,55,0.35));
}
.wheel-glow {
  position:absolute; inset:-14px; border-radius:50%;
  background: conic-gradient(from 0deg, #d4af37, #f4e5a1, #d4af37, #a17d1f, #d4af37);
  z-index:-1;
  animation: spinGlow 8s linear infinite;
  filter: blur(10px);
  opacity:0.55;
}
@keyframes spinGlow { to { transform: rotate(360deg); } }
.wheel-pointer {
  position:absolute; top:-16px; left:50%;
  transform:translateX(-50%);
  width:0; height:0;
  border-left:16px solid transparent;
  border-right:16px solid transparent;
  border-top:30px solid var(--gold);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.9)) drop-shadow(0 0 6px var(--gold));
  z-index:10;
}
.wheel-canvas {
  width:100%; height:100%; display:block;
  border-radius:50%; background:#0a0a0a;
  transition: transform 5.5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}
.spin-btn {
  background: linear-gradient(180deg, #f4e5a1 0%, #d4af37 50%, #a17d1f 100%);
  color:#000; border:2px solid #f4e5a1;
  padding:16px 52px; border-radius:999px;
  font-size:20px; font-weight:800;
  cursor:pointer; letter-spacing:2px;
  box-shadow: 0 12px 32px rgba(212,175,55,0.55);
  font-family:"Georgia", serif;
  text-transform: uppercase;
  transition: transform 0.15s;
}
.spin-btn:hover { transform:translateY(-2px); }
.spin-btn:disabled { opacity:0.5; cursor:not-allowed; transform:none; }
.spin-result { min-height:20px; text-align:center; font-size:13px; color:var(--muted); margin-top:10px; }

@media (max-width:600px) {
  .wheel-container-modal {
    width:72vw !important;
    height:72vw !important;
    max-width:340px !important;
    max-height:340px !important;
    margin:8px auto !important;
  }
  .wheel-glow {
    inset:-8px !important;
    filter: blur(6px) !important;
    opacity:0.45 !important;
  }
  .wheel-pointer {
    border-left-width:12px !important;
    border-right-width:12px !important;
    border-top-width:22px !important;
    top:-12px !important;
  }
  .spin-btn { padding:14px 40px; font-size:17px; }
  .spin-modal-card {
    padding:14px 12px 18px !important;
    max-width:96vw !important;
    border-radius:16px !important;
  }
  .spin-modal {
    padding:16px 8px !important;
  }
  .spin-close {
    top:8px !important;
    right:8px !important;
    width:30px !important;
    height:30px !important;
    font-size:14px !important;
  }
}

@media (max-width:400px) {
  .wheel-container-modal {
    width:68vw !important;
    height:68vw !important;
    max-width:290px !important;
    max-height:290px !important;
  }
}

/* ============ HERO CAROUSEL ============ */
.hero-carousel {
  position:relative;
  overflow:hidden;
  border-radius: var(--radius);
}
.hero-track {
  display:flex;
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}
.hero-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
}

.hero-dots {
  display:flex; justify-content:center; gap:8px;
  margin-top:14px; padding-bottom:6px;
}
.hero-dot {
  width:10px; height:10px; border-radius:50%;
  background:#333; cursor:pointer; transition:all 0.3s;
}
.hero-dot.active { background: var(--gold); width:26px; border-radius:999px; }

@media (max-width:900px){
  .hero-dot { width:8px; height:8px; }
  .hero-dot.active { width:22px; }
  .hero-track { transition: transform 0.5s ease-out; }
}

/* ============ USER MESSAGE TOAST ============ */
@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 600px) {
  #userMsgToast {
    top: 60px !important;
    padding: 12px 14px !important;
  }
}
