:root {
  --bg: #070911;
  --bg-elev: #0e1320;
  --bg-card: rgba(16, 22, 37, 0.78);
  --bg-card-solid: #111727;
  --bg-hover: rgba(255, 255, 255, 0.045);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --accent-2: #10b981;
  --accent-2-soft: rgba(16, 185, 129, 0.15);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.15);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ==================== AMBIENT BACKGROUND ==================== */

.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 35%, transparent 100%);
}

.ambient-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(110px);
  opacity: 0.28;
}

.orb-1 {
  width: 540px;
  height: 540px;
  top: -220px;
  left: -120px;
  background: var(--accent);
}

.orb-2 {
  width: 480px;
  height: 480px;
  top: -160px;
  right: -120px;
  background: var(--accent-2);
  opacity: 0.18;
}

/* ==================== VISUAL EDIT FLOATING BANNER ==================== */

.visual-edit-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.96), rgba(16, 185, 129, 0.92));
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
}

.ve-banner-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ve-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.ve-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
}

.ve-hint {
  opacity: 0.9;
}

.ve-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.visual-edit-active [data-editable] {
  outline: 2px dashed rgba(99, 102, 241, 0.85);
  outline-offset: 4px;
  border-radius: 6px;
  cursor: text;
  transition: outline-color 0.15s, background 0.15s;
}

body.visual-edit-active [data-editable]:hover {
  outline-color: #34d399;
  background: rgba(99, 102, 241, 0.12);
}

body.visual-edit-active [data-editable]:focus {
  outline: 2px solid #34d399;
  background: rgba(16, 185, 129, 0.14);
}

/* ==================== HEADER & DROPDOWN ==================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 17, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

body.visual-edit-active .site-header {
  top: 49px;
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: 12px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-admin-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(17, 23, 39, 0.9);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.15s;
}

.nav-dropdown-trigger:hover,
.nav-dropdown.open .nav-dropdown-trigger {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.16);
}

.nav-dropdown-trigger .chevron {
  transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-trigger .chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 310px;
  padding: 10px;
  border-radius: 16px;
  background: #101626;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 150;
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-section-label {
  padding: 6px 10px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 11px;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.dropdown-item.active {
  background: var(--accent-soft);
  border-color: rgba(99, 102, 241, 0.4);
}

.dropdown-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.icon-home { background: rgba(99, 102, 241, 0.18); color: #818cf8; }
.icon-mc { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.icon-files { background: rgba(56, 189, 248, 0.18); color: #38bdf8; }
.icon-games { background: rgba(244, 114, 182, 0.18); color: #f472b6; }
.icon-admin { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }

.dropdown-item-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.dropdown-item-text strong {
  font-size: 14px;
  font-weight: 600;
}

.dropdown-item-text small {
  font-size: 12px;
  color: var(--text-muted);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 4px;
}

/* ==================== MAIN CONTAINER & LAYOUT ==================== */

.app-main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.page-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.page-subtitle {
  margin: 0;
  color: var(--text-muted);
  max-width: 680px;
  font-size: 15.5px;
}

/* ==================== CARDS, BUTTONS, INPUTS, BADGES ==================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
}

.card-compact {
  padding: 18px 20px;
  border-radius: var(--radius-md);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, background 0.16s, border-color 0.16s, opacity 0.16s;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.28);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-success {
  background: var(--accent-2);
  color: #032217;
  font-weight: 700;
}

.btn-success:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-danger {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.28);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 13px;
  border-radius: 9px;
}

.btn-xs {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-accent {
  background: var(--accent-soft);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.3);
}

.badge-success {
  background: var(--accent-2-soft);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

.badge-warn {
  background: var(--warn-soft);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: var(--danger-soft);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.badge-neutral {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border-color: var(--border);
}

.input, .textarea, .select {
  width: 100%;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(7, 10, 20, 0.85);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}

.checkbox-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.mono {
  font-family: var(--font-mono);
}

/* ==================== HOME PAGE ==================== */

/* Top Admin Broadcast Message Box */
.broadcast-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 28px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(16, 185, 129, 0.08) 55%, rgba(15, 20, 34, 0.92));
  border: 1px solid rgba(99, 102, 241, 0.38);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.broadcast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.broadcast-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.broadcast-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
}

.broadcast-heading {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c7d2fe;
}

.broadcast-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.broadcast-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 600;
  font-size: 12.5px;
}

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

.broadcast-body.has-media {
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 340px);
  align-items: start;
}

@media (max-width: 780px) {
  .broadcast-body.has-media {
    grid-template-columns: 1fr;
  }
}

.broadcast-text {
  font-size: 16px;
  line-height: 1.65;
  color: #f8fafc;
  white-space: pre-wrap;
  word-break: break-word;
}

.broadcast-media {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  cursor: zoom-in;
  position: relative;
}

.broadcast-media img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
}

.media-type-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.broadcast-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Welcome Hero */
.hero-card {
  position: relative;
  border-radius: 24px;
  padding: 40px 36px;
  margin-bottom: 32px;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.2), transparent 55%),
              var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 820px;
}

.hero-subtitle {
  margin: 0 0 26px;
  color: var(--text-muted);
  font-size: 16.5px;
  max-width: 720px;
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.quick-link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 15px;
  background: rgba(15, 21, 37, 0.85);
  border: 1px solid var(--border);
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
}

.quick-link-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* News Feed */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px;
}

.news-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.18s, border-color 0.18s;
}

.news-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.news-card-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.news-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.news-card-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.3;
}

.news-card-summary {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 14px;
  flex: 1;
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ==================== MC SERVER TRACKER ==================== */

.mc-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
}

@media (max-width: 480px) {
  .mc-grid {
    grid-template-columns: 1fr;
  }
}

.mc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.18s;
}

.mc-card.is-online {
  border-color: rgba(16, 185, 129, 0.28);
}

.mc-card-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mc-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: #090d18;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.mc-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.mc-info {
  flex: 1;
  min-width: 0;
}

.mc-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.mc-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.mc-sub-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.status-dot.offline {
  background: #ef4444;
}

.mc-motd-box {
  background: #080b13;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  padding: 13px 15px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  min-height: 58px;
  overflow-wrap: anywhere;
}

.mc-players-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mc-players-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}

/* ==================== FILE SHARE ==================== */

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  margin-bottom: 36px;
}

.file-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.file-card.secret-revealed {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(155deg, rgba(16, 185, 129, 0.12), rgba(16, 22, 37, 0.88));
}

.file-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.file-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 18px;
}

.file-filename {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
}

.file-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  flex: 1;
}

.file-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.countdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.secret-portal-card {
  border-radius: 22px;
  padding: 28px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 27, 75, 0.55));
  border: 1px dashed rgba(129, 140, 248, 0.45);
}

.secret-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  max-width: 580px;
}

.key-input {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  font-size: 15px;
  font-weight: 600;
}

/* ==================== GAMES PANEL PLACEHOLDER ==================== */

.games-hero {
  border-radius: 24px;
  padding: 36px;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.12), rgba(99, 102, 241, 0.14), rgba(15, 20, 34, 0.9));
  border: 1px solid rgba(244, 114, 182, 0.25);
  margin-bottom: 24px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.game-slot-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-slot-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: rgba(244, 114, 182, 0.16);
  border: 1px solid rgba(244, 114, 182, 0.3);
}

/* ==================== ADMIN PANEL ==================== */

.admin-login-wrap {
  max-width: 440px;
  margin: 48px auto;
}

.admin-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

@media (max-width: 920px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
}

.admin-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  position: sticky;
  top: 86px;
}

.admin-profile-box {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.admin-profile-box strong {
  display: block;
  font-size: 14.5px;
}

.admin-profile-box small {
  color: var(--text-muted);
  font-size: 12px;
}

.admin-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  margin-bottom: 4px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.admin-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.admin-nav-btn.active {
  background: var(--accent-soft);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.35);
}

.admin-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 700;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Visual Editor Studio Split Layout */
.ve-studio-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 1100px) {
  .ve-studio-grid {
    grid-template-columns: 1fr;
  }
}

.ve-preview-frame-wrap {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #070911;
}

.ve-preview-topbar {
  padding: 10px 14px;
  background: #101626;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.ve-preview-canvas {
  padding: 20px;
  max-height: 680px;
  overflow-y: auto;
}

.ve-field-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(7, 10, 20, 0.55);
  margin-bottom: 10px;
}

.ve-field-card.focused {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}

.ve-clickable-block {
  border: 1.5px dashed rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.ve-clickable-block:hover,
.ve-clickable-block.selected {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.12);
}

.media-preview-thumb {
  max-width: 240px;
  max-height: 150px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  object-fit: cover;
  display: block;
  margin-top: 8px;
}

.file-check-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(7, 10, 20, 0.65);
}

/* ==================== MODAL & TOASTS ==================== */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(3, 6, 14, 0.78);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-box {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: #101626;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.modal-box.modal-lg {
  max-width: 760px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
}

.toast-root {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast {
  padding: 12px 16px;
  border-radius: 12px;
  background: #121a2e;
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.2s ease;
}

.toast-success { border-color: rgba(16, 185, 129, 0.5); }
.toast-error { border-color: rgba(239, 68, 68, 0.5); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== FOOTER & MISC ==================== */

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: rgba(7, 9, 17, 0.72);
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a:hover {
  color: var(--text);
}

.loading-shell {
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 46px 24px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  background: rgba(15, 20, 34, 0.5);
  color: var(--text-muted);
}

/* ==================== THEME SWITCHER & TOKEN PILL ==================== */

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(17, 23, 39, 0.86);
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}

.theme-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.theme-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

@media (max-width: 640px) {
  .theme-btn-label {
    display: none;
  }
  .theme-btn {
    padding: 7px 8px;
  }
}

.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.token-pill.low {
  background: var(--warn-soft);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

/* ==================== LIGHT MODE THEME ==================== */

[data-theme="light"] {
  --bg: #f3f6fc;
  --bg-elev: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-solid: #ffffff;
  --bg-hover: rgba(15, 23, 42, 0.05);
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --accent-2-soft: rgba(16, 185, 129, 0.13);
  --danger-soft: rgba(239, 68, 68, 0.11);
  --warn-soft: rgba(245, 158, 11, 0.14);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .ambient-grid {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
}

[data-theme="light"] .ambient-orb {
  opacity: 0.16;
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.84);
}

[data-theme="light"] .site-footer {
  background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .theme-switcher,
[data-theme="light"] .nav-dropdown-trigger {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
}

[data-theme="light"] .nav-dropdown-menu,
[data-theme="light"] .modal-box,
[data-theme="light"] .toast {
  background: #ffffff;
  color: var(--text);
}

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

[data-theme="light"] .input,
[data-theme="light"] .textarea,
[data-theme="light"] .select,
[data-theme="light"] .file-check-list,
[data-theme="light"] .ve-field-card {
  background: #ffffff;
  color: var(--text);
}

[data-theme="light"] .form-label {
  color: #334155;
}

[data-theme="light"] .card,
[data-theme="light"] .mc-card,
[data-theme="light"] .file-card,
[data-theme="light"] .news-card,
[data-theme="light"] .game-slot-card,
[data-theme="light"] .admin-sidebar {
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .broadcast-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(16, 185, 129, 0.08) 55%, rgba(255, 255, 255, 0.96));
  border-color: rgba(99, 102, 241, 0.34);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .broadcast-heading {
  color: #4338ca;
}

[data-theme="light"] .broadcast-author {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

[data-theme="light"] .broadcast-text {
  color: #0f172a;
}

[data-theme="light"] .broadcast-footer {
  border-top-color: rgba(15, 23, 42, 0.09);
}

[data-theme="light"] .broadcast-media {
  border-color: rgba(15, 23, 42, 0.12);
  background: #e2e8f0;
}

[data-theme="light"] .media-type-pill {
  color: #fff;
}

[data-theme="light"] .hero-card {
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.14), transparent 55%),
              rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .hero-badge {
  color: #4338ca;
}

[data-theme="light"] .quick-link-card {
  background: #f8fafc;
}

[data-theme="light"] .quick-link-card:hover {
  background: rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .secret-portal-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(99, 102, 241, 0.09));
}

[data-theme="light"] .file-card.secret-revealed {
  background: linear-gradient(155deg, rgba(16, 185, 129, 0.11), rgba(255, 255, 255, 0.96));
}

[data-theme="light"] .games-hero {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.12), rgba(99, 102, 241, 0.12), rgba(255, 255, 255, 0.96));
}

/* Keep MC MOTD box crisp dark slate so Minecraft § colors stay vibrant & readable */
[data-theme="light"] .mc-motd-box {
  background: #0f172a;
  color: #f8fafc;
  border-color: rgba(15, 23, 42, 0.22);
}

[data-theme="light"] .mc-icon {
  background: #f1f5f9;
}

[data-theme="light"] .empty-state {
  background: rgba(255, 255, 255, 0.72);
}

[data-theme="light"] .badge-accent {
  color: #4338ca;
}

[data-theme="light"] .badge-success {
  color: #047857;
}

[data-theme="light"] .badge-warn {
  color: #b45309;
}

[data-theme="light"] .badge-danger {
  color: #b91c1c;
}

[data-theme="light"] .btn-danger {
  color: #b91c1c;
}

[data-theme="light"] .btn-ghost {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

[data-theme="light"] .countdown-pill {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="light"] .token-pill {
  color: #4338ca;
}

[data-theme="light"] .token-pill.low {
  color: #b45309;
}

[data-theme="light"] .admin-profile-box {
  background: #f8fafc;
}

[data-theme="light"] .admin-nav-btn.active {
  color: #3730a3;
}

[data-theme="light"] .admin-table tr:hover td {
  background: rgba(15, 23, 42, 0.025);
}

[data-theme="light"] .ve-preview-frame-wrap {
  background: #f3f6fc;
}

[data-theme="light"] .ve-preview-topbar {
  background: #ffffff;
}

/* ==================== DEVICE KEY MEMORY DROPDOWN ==================== */

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

.keys-dropdown {
  position: relative;
}

.keys-dropdown-trigger .chevron {
  transition: transform 0.18s ease;
}

.keys-dropdown.open .keys-dropdown-trigger {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.keys-dropdown.open .keys-dropdown-trigger .chevron {
  transform: rotate(180deg);
}

.keys-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(490px, calc(100vw - 32px));
  max-height: 72vh;
  overflow-y: auto;
  padding: 18px;
  border-radius: 16px;
  background: #101626;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.985);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 140;
}

.keys-dropdown.open .keys-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

@media (max-width: 640px) {
  .keys-dropdown-panel {
    left: 0;
    right: auto;
  }
}

[data-theme="light"] .keys-dropdown-panel {
  background: #ffffff;
  color: var(--text);
}

.device-memory-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.device-hash-chip {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.device-keys-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.device-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(7, 10, 20, 0.45);
  border: 1px solid var(--border);
}

[data-theme="light"] .device-key-row {
  background: #f8fafc;
}

/* ==================== KEY REUSE MODE TOGGLE ==================== */

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: rgba(7, 10, 20, 0.72);
  width: fit-content;
  flex-wrap: wrap;
}

.mode-toggle-btn {
  padding: 7px 13px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mode-toggle-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.mode-toggle-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

[data-theme="light"] .mode-toggle {
  background: #f1f5f9;
}

/* ==================== SERVER STORAGE BAR & DEVICES ==================== */

.storage-summary-card {
  margin-bottom: 4px;
}

.storage-active-box {
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(7, 10, 20, 0.52);
  border: 1px solid var(--border);
}

[data-theme="light"] .storage-active-box {
  background: #f8fafc;
}

.storage-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.storage-bar-numbers {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.storage-bar-track {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
  border: 1px solid var(--border);
}

.storage-bar-wrap.compact .storage-bar-track {
  height: 9px;
}

.storage-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
  min-width: 2px;
}

.storage-bar-fill.warn {
  background: linear-gradient(90deg, #f59e0b, #fb923c);
}

.storage-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.storage-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

@media (max-width: 480px) {
  .storage-device-grid {
    grid-template-columns: 1fr;
  }
}

.storage-device-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(7, 10, 20, 0.5);
  border: 1px solid var(--border);
  transition: border-color 0.16s;
}

.storage-device-card.active-device {
  border-color: rgba(16, 185, 129, 0.55);
  background: linear-gradient(155deg, rgba(16, 185, 129, 0.1), rgba(16, 22, 37, 0.72));
}

[data-theme="light"] .storage-device-card {
  background: #f8fafc;
}

[data-theme="light"] .storage-device-card.active-device {
  background: linear-gradient(155deg, rgba(16, 185, 129, 0.1), #ffffff);
}

/* ==================== SITE-WIDE ACCOUNT, PROFILE & LEADERBOARD ==================== */

.icon-profile {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
}

.header-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(17, 23, 39, 0.9);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.16s, background 0.16s;
  max-width: 175px;
}

.header-account-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

[data-theme="light"] .header-account-btn {
  background: rgba(255, 255, 255, 0.96);
}

.header-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
}

.header-account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 540px) {
  .header-account-name {
    display: none;
  }
  .header-account-btn {
    padding: 5px;
  }
}

.profile-hero-card {
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.16), transparent 55%), var(--bg-card);
}

.profile-hero-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.profile-avatar-img {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.profile-avatar-fallback {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.danger-zone-card {
  border-color: rgba(239, 68, 68, 0.35);
  background: linear-gradient(160deg, rgba(239, 68, 68, 0.08), var(--bg-card));
}

.lb-player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
}

.lb-avatar-fallback {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

/* ==================== MESSAGE BOARDS ==================== */

.icon-boards {
  background: rgba(14, 165, 233, 0.18);
  color: #38bdf8;
}

.boards-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 860px) {
  .boards-shell {
    grid-template-columns: 1fr;
  }
}

.boards-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.boards-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.boards-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.board-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.board-nav-item:hover {
  background: var(--bg-hover);
}

.board-nav-item.active {
  background: var(--accent-soft);
  border-color: rgba(99, 102, 241, 0.45);
}

.board-nav-icon {
  font-size: 20px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.board-nav-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.board-nav-meta strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-nav-meta small {
  font-size: 11.5px;
  color: var(--text-dim);
}

.boards-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.boards-main-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.board-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, 0.35);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.boards-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.board-view-pane {
  display: flex;
  flex-direction: column;
}

.board-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 340px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 6px 4px 12px 2px;
}

.board-msg {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(7, 10, 20, 0.45);
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s;
}

.board-msg:hover {
  border-color: var(--border-strong);
}

.board-msg-mentioned {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.14), rgba(7, 10, 20, 0.45) 45%);
}

.board-msg-flash {
  border-color: var(--accent-2) !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
}

[data-theme="light"] .board-msg {
  background: #f8fafc;
}

[data-theme="light"] .board-msg-mentioned {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.12), #f8fafc 45%);
}

.board-reply-quote {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-muted);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.board-reply-quote:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.board-reply-quote.deleted {
  cursor: default;
  opacity: 0.65;
  font-style: italic;
}

.board-reply-elbow {
  color: var(--accent);
  font-weight: 800;
}

.board-reply-snippet {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.board-msg-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.board-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.board-avatar-img {
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-strong);
  display: block;
}

.board-avatar-fallback {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.board-presence-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #0d1220;
}

[data-theme="light"] .board-presence-dot {
  border-color: #ffffff;
}

.board-presence-dot.online {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
}

.board-presence-dot.offline {
  background: #64748b;
}

.board-msg-body {
  flex: 1;
  min-width: 0;
}

.board-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.board-msg-author {
  font-size: 14.5px;
}

.board-msg-username {
  font-size: 12px;
  color: var(--text-dim);
}

.board-msg-time {
  font-size: 11.5px;
  color: var(--text-dim);
}

.board-msg-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.board-act-btn {
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.board-act-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.board-act-btn.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

[data-theme="light"] .board-act-btn.danger:hover {
  color: #b91c1c;
}

.board-msg-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  font-size: 14.5px;
}

.board-link {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

[data-theme="light"] .board-link {
  color: #0284c7;
}

.board-mention {
  display: inline-block;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-weight: 600;
  cursor: pointer;
}

.board-mention:hover {
  background: rgba(99, 102, 241, 0.34);
}

.board-mention-self {
  background: rgba(245, 158, 11, 0.24);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

[data-theme="light"] .board-mention {
  background: rgba(79, 70, 229, 0.14);
  color: #4338ca;
}

[data-theme="light"] .board-mention-self {
  background: rgba(245, 158, 11, 0.2);
  color: #92400e;
}

.board-attachments-grid {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.board-att-media-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  max-width: 340px;
  max-height: 260px;
  background: rgba(0, 0, 0, 0.3);
}

.board-att-media-card img {
  display: block;
  max-width: 340px;
  max-height: 260px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.board-att-video-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.4);
  max-width: 440px;
  width: 100%;
}

.board-att-video-card video {
  display: block;
  width: 100%;
  max-height: 300px;
  background: #000;
}

.board-att-video-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(7, 10, 20, 0.72);
}

[data-theme="light"] .board-att-video-foot {
  background: #f1f5f9;
}

.board-att-file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  max-width: 380px;
  width: 100%;
}

.board-att-file-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}

.board-composer-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.board-guest-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(99, 102, 241, 0.08);
}

.board-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.1);
  font-size: 13px;
}

.board-pending-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.board-pending-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: rgba(148, 163, 184, 0.1);
  font-size: 12.5px;
  max-width: 240px;
}

.board-pending-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-pending-rm {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
}

.board-pending-rm:hover {
  color: #fca5a5;
}

.board-composer-box {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: rgba(7, 10, 20, 0.55);
  transition: border-color 0.15s;
}

.board-composer-box:focus-within,
.board-composer-box.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.22);
}

[data-theme="light"] .board-composer-box {
  background: #ffffff;
}

.board-attach-btn {
  padding: 8px 11px;
  flex-shrink: 0;
}

.board-textarea {
  flex: 1;
  min-height: 40px;
  max-height: 140px;
  resize: none;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.45;
  padding: 8px 4px;
  outline: none;
}

.board-composer-hint {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
}

.board-mention-popover {
  position: absolute;
  left: 8px;
  bottom: calc(100% + 6px);
  width: min(320px, calc(100% - 16px));
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 12px;
  background: #101626;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

[data-theme="light"] .board-mention-popover {
  background: #ffffff;
}

.board-mention-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.board-mention-opt:hover,
.board-mention-opt.active {
  background: var(--accent-soft);
}

.board-participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.board-participant-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: rgba(7, 10, 20, 0.45);
}

[data-theme="light"] .board-participant-card {
  background: #f8fafc;
}

/* Discord-Style Link Embeds & Login-Locked Board Pane */

.board-embeds-stack {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
}

.board-embed-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--embed-accent, var(--accent));
  background: rgba(15, 23, 42, 0.72);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.16s, background 0.16s, transform 0.14s;
}

.board-embed-card:hover {
  border-color: var(--border-strong);
  border-left-color: var(--embed-accent, var(--accent));
  background: rgba(30, 41, 59, 0.78);
}

[data-theme="light"] .board-embed-card {
  background: #ffffff;
}

[data-theme="light"] .board-embed-card:hover {
  background: #f1f5f9;
}

.board-embed-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.board-embed-site {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-embed-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #38bdf8;
  line-height: 1.35;
}

[data-theme="light"] .board-embed-title {
  color: #0284c7;
}

.board-embed-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board-embed-media {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  max-height: 240px;
  background: rgba(0, 0, 0, 0.35);
  width: fit-content;
  max-width: 100%;
}

.board-embed-media img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  width: auto;
  height: auto;
  object-fit: cover;
}

.board-embed-yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 36px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.board-locked-pane {
  margin: auto;
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
