:root {
  --bg-deep: #070913;
  --bg-panel: rgba(15, 20, 38, 0.84);
  --bg-card: rgba(24, 31, 56, 0.72);
  --border-subtle: rgba(148, 163, 184, 0.18);
  --border-gold: rgba(250, 204, 21, 0.42);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --gold: #facc15;
  --gold-soft: #fde68a;
  --crimson: #ef4444;
  --emerald: #22c55e;
  --sky: #38bdf8;
  --violet: #a855f7;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  user-select: none;
}

h1, h2, h3, .brand-mini, .hero-name {
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.04em;
}

.hidden {
  display: none !important;
}

.screen {
  position: fixed;
  inset: 0;
  display: none;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.glass-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

/* ==================== TITLE & HERO FORGE ==================== */
#title-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.title-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
  overflow-y: auto;
}

.title-hero {
  text-align: center;
  padding-top: 6px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin-bottom: 6px;
}

.title-hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 36px rgba(250, 204, 21, 0.35);
}

.title-hero h1 span {
  background: linear-gradient(135deg, #fde047, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  max-width: 720px;
  margin: 6px auto 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.forge-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.forge-create {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.forge-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.forge-sidebar > section {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 190px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.panel-header h2, .panel-header h3 {
  font-size: 15px;
  color: var(--gold-soft);
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.14);
  color: var(--gold);
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.class-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  text-align: left;
  color: var(--text-main);
}

.class-card:hover {
  transform: translateY(-2px);
  border-color: rgba(250, 204, 21, 0.55);
}

.class-card.selected {
  border-color: var(--gold);
  background: rgba(45, 36, 18, 0.65);
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.2);
}

.class-card .cc-name {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}

.class-card .cc-title {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.forge-preview-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
  background: rgba(8, 12, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
}

.hero-preview-box {
  width: 180px;
  flex-shrink: 0;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 60%, rgba(56, 189, 248, 0.14), rgba(6, 9, 20, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-stats-roll {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.selected-class-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.selected-class-head h3 {
  font-size: 20px;
}

.accent-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: var(--sky);
}

.muted-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.rolled-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 7px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.stat-chip strong {
  font-size: 15px;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
}

.exper-coords {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.exper-coords input {
  width: 82px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
}

.forge-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  flex-wrap: wrap;
}

#hero-name-input {
  flex: 1;
  min-width: 150px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-subtle);
  background: rgba(5, 8, 18, 0.85);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  outline: none;
}

#hero-name-input:focus {
  border-color: var(--gold);
}

.btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

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

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #dc2626);
  color: #fff;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

.btn-secondary {
  background: rgba(51, 65, 85, 0.8);
  color: #e2e8f0;
  border: 1px solid var(--border-subtle);
}

.btn-danger {
  background: rgba(185, 28, 28, 0.85);
  color: #fff;
}

.scroll-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding-right: 4px;
}

.saved-hero-row, .score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13px;
}

.saved-hero-row:hover {
  border-color: rgba(250, 204, 21, 0.45);
}

/* ==================== MAIN GAME HUD ==================== */
.top-hud {
  min-height: 54px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 8px;
  background: rgba(9, 13, 26, 0.95);
  border-bottom: 1px solid var(--border-gold);
  flex-shrink: 0;
}

.hud-left, .hud-right, .hud-bars {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.brand-mini {
  font-weight: 900;
  font-size: 15px;
  color: var(--gold);
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hero-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.rank-pill, .lvl-pill, .circle-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.rank-pill {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
}

.lvl-pill {
  background: rgba(250, 204, 21, 0.18);
  color: var(--gold);
}

.location-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  white-space: nowrap;
}

.coords {
  font-family: monospace;
  color: var(--sky);
  white-space: nowrap;
}

.circle-tag {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
}

.bar-group {
  width: clamp(70px, 7.4vw, 106px);
}

.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.bar-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 50%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.bar-fill.hp { background: linear-gradient(90deg, #16a34a, #4ade80); }
.bar-fill.mp { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.bar-fill.xp { background: linear-gradient(90deg, #d97706, #facc15); }

.wealth-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 9px;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.25);
  color: var(--gold-soft);
  white-space: nowrap;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(30, 41, 59, 0.7);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--gold);
  background: rgba(51, 65, 85, 0.9);
}

.icon-btn.muted {
  opacity: 0.45;
}

/* ==================== GAME MAIN LAYOUT ==================== */
.game-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 315px;
  gap: 14px;
  padding: 14px;
  min-height: 0;
}

.stage-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.canvas-frame {
  position: relative;
  flex: 1;
  min-height: 340px;
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid var(--border-gold);
  background: #060811;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}

.canvas-frame canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#world-canvas {
  cursor: crosshair;
}

.stage-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(8, 12, 24, 0.78);
  border: 1px solid rgba(250, 204, 21, 0.45);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
  pointer-events: none;
}

.stage-badge.battle {
  left: 50%;
  transform: translateX(-50%);
  border-color: rgba(239, 68, 68, 0.7);
  color: #fca5a5;
  background: rgba(69, 10, 10, 0.85);
}

.announcer-banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 28px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(127, 29, 29, 0), rgba(15, 10, 26, 0.92) 18%, rgba(15, 10, 26, 0.92) 82%, rgba(127, 29, 29, 0));
  border-top: 2px solid rgba(250, 204, 21, 0.85);
  border-bottom: 2px solid rgba(239, 68, 68, 0.85);
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fef08a;
  text-shadow: 0 0 22px rgba(239, 68, 68, 0.9), 0 4px 12px rgba(0, 0, 0, 0.95);
  pointer-events: none;
  z-index: 15;
  white-space: nowrap;
  animation: announcerSlam 0.24s cubic-bezier(0.2, 1.3, 0.4, 1);
}

@keyframes announcerSlam {
  from { opacity: 0; transform: translate(-50%, -50%) scale(1.45); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.status-effects-bar {
  position: absolute;
  bottom: 14px;
  left: 14px;
  display: flex;
  gap: 6px;
  pointer-events: none;
}

.effect-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==================== ACTION DOCKS ==================== */
.action-dock {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.action-dock.combat {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  border-color: rgba(239, 68, 68, 0.45);
}

.dpad-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.dpad-mid {
  display: flex;
  gap: 3px;
}

.dpad-btn {
  width: 34px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font-size: 12px;
  cursor: pointer;
}

.dpad-btn:hover {
  border-color: var(--gold);
  background: rgba(51, 65, 85, 0.95);
}

.dpad-btn.center {
  background: rgba(124, 45, 18, 0.7);
}

.dock-buttons, .combat-actions-row {
  display: flex;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1;
  min-width: 102px;
  padding: 9px 10px;
  border-radius: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.82);
  color: #f8fafc;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--gold);
}

.action-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.action-btn.danger { background: linear-gradient(180deg, rgba(153, 27, 27, 0.85), rgba(88, 16, 16, 0.9)); border-color: rgba(248, 113, 113, 0.4); }
.action-btn.info { background: linear-gradient(180deg, rgba(3, 105, 161, 0.85), rgba(12, 74, 110, 0.9)); border-color: rgba(56, 189, 248, 0.4); }
.action-btn.magic { background: linear-gradient(180deg, rgba(107, 33, 168, 0.85), rgba(59, 7, 100, 0.9)); border-color: rgba(192, 132, 252, 0.4); }
.action-btn.heal { background: linear-gradient(180deg, rgba(21, 128, 61, 0.85), rgba(20, 83, 45, 0.9)); border-color: rgba(74, 222, 128, 0.4); }
.action-btn.gold { background: linear-gradient(180deg, rgba(161, 98, 7, 0.85), rgba(113, 63, 18, 0.9)); border-color: rgba(250, 204, 21, 0.45); }

.act-icon { font-size: 18px; }
.act-label { font-size: 12px; font-weight: 700; }
.act-sub { font-size: 10px; color: rgba(255, 255, 255, 0.7); }
.act-key {
  position: absolute;
  top: 5px;
  right: 7px;
  font-size: 10px;
  font-family: monospace;
  color: rgba(255, 255, 255, 0.45);
}

.spell-tray {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.spell-btn {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(192, 132, 252, 0.35);
  background: rgba(30, 20, 58, 0.9);
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spell-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(59, 25, 102, 0.95);
}

.spell-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.spell-btn .sp-head {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 12px;
}

.spell-btn .sp-meta {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== SIDE INSPECTOR ==================== */
.side-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.stats-panel {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sheet-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.sheet-item span { color: var(--text-muted); }
.sheet-item strong { color: #f8fafc; font-variant-numeric: tabular-nums; }

.relics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.relic-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: var(--gold-soft);
}

.log-panel {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.chronicle-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.log-entry {
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #64748b;
}

.log-entry.gold { border-left-color: #facc15; color: #fef08a; }
.log-entry.danger { border-left-color: #ef4444; color: #fecaca; }
.log-entry.magic { border-left-color: #a855f7; color: #e9d5ff; }
.log-entry.heal { border-left-color: #22c55e; color: #bbf7d0; }
.log-entry.combat { border-left-color: #38bdf8; color: #e0f2fe; }
.log-entry.warn { border-left-color: #f97316; color: #fed7aa; }

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(3, 5, 14, 0.76);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px 24px;
  border-color: var(--border-gold);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: modalPop 0.2s ease;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-icon {
  font-size: 32px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.shop-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-row {
  display: grid;
  grid-template-columns: 1.5fr 95px 86px 74px;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.shop-row input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-weight: 700;
}

.modal-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.modal-input-row input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 14px;
}

@media (max-width: 1020px) {
  .forge-grid { grid-template-columns: 1fr; }
  .game-main { grid-template-columns: 1fr; }
  .side-column { display: none; }
}

/* ==================== KEELDRAGGER AUTH, SOCIAL, FEEDBACK & ADMIN ==================== */
.auth-gate {
  max-width: 470px;
  margin: 0 auto;
  padding: 22px 24px;
}

.oauth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: transform 0.12s ease, filter 0.15s ease;
}

.oauth-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.oauth-btn.google { background: #ffffff; color: #111827; }
.oauth-btn.apple { background: #000000; color: #ffffff; border-color: rgba(255, 255, 255, 0.32); }
.oauth-icon { font-weight: 900; font-size: 15px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 10px 0 12px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.auth-tabs, .social-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.auth-tab, .social-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.auth-tab.active, .social-tab.active {
  background: rgba(250, 204, 21, 0.16);
  border-color: var(--border-gold);
  color: var(--gold-soft);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form input, .dark-select, .dark-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.52);
  color: #f8fafc;
  font-size: 14px;
  font-family: inherit;
}

.dark-textarea { resize: vertical; }

.auth-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.link-btn {
  background: none;
  border: none;
  color: #7dd3fc;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0;
}
.link-btn:hover { text-decoration: underline; }

.form-err { color: #fca5a5; font-size: 12px; min-height: 14px; }
.form-info { color: #86efac; font-size: 12px; }
.name-status { font-size: 12px; color: var(--text-muted); }
.name-status.ok { color: #4ade80; font-weight: 700; }
.name-status.err { color: #fca5a5; font-weight: 600; }

.account-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(10, 14, 28, 0.78);
  border: 1px solid var(--border-gold);
}

.badge-host { position: relative; }
.nav-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 1.5px solid #090c18;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.85);
}

.has-unread {
  border-color: #facc15 !important;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.55);
  animation: mailPulse 1.8s ease-in-out infinite;
}

@keyframes mailPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(250, 204, 21, 0.45); }
  50% { box-shadow: 0 0 18px rgba(250, 204, 21, 0.9), 0 0 6px rgba(239, 68, 68, 0.7); }
}

.mail-toast {
  position: fixed;
  top: 66px;
  right: 18px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 12px;
  background: rgba(11, 16, 34, 0.96);
  border: 1.5px solid #facc15;
  color: #fef08a;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.78), 0 0 18px rgba(250, 204, 21, 0.28);
  animation: modalPop 0.22s ease;
}

.mail-toast-icon {
  font-size: 17px;
}

.mail-toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 2px 4px;
}
.mail-toast-close:hover { color: #fff; }

.broadcast-toast {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 78%;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(24, 14, 6, 0.94);
  border: 1.5px solid #facc15;
  color: #fef08a;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.7);
}
.broadcast-toast button {
  background: none;
  border: none;
  color: #fde047;
  cursor: pointer;
  font-weight: 800;
}

.social-body {
  max-height: 430px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.section-subhead {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7dd3fc;
  margin: 8px 0 4px;
}
.dm-compose {
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.msg-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
}
.msg-card {
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12.5px;
}
.msg-card.broadcast { border-color: rgba(250, 204, 21, 0.65); background: rgba(66, 32, 6, 0.45); }
.msg-card.admin-msg { border-color: rgba(168, 85, 247, 0.7); background: rgba(59, 7, 100, 0.35); }
.msg-card.sent { opacity: 0.85; }
.msg-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.feedback-kinds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fb-kind {
  padding: 9px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.fb-kind.active {
  background: rgba(250, 204, 21, 0.18);
  border-color: var(--border-gold);
  color: #fef08a;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.origin-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 6px;
}
.origin-tag.new { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.origin-tag.existing { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
