/* ==========================================================================
   DIGIDREAMS CITY — 3D COMMUNITY HUB & 5 CLUSTERS STYLESHEET
   ========================================================================== */

:root {
  --bg-dark: #030712;
  --panel-bg: rgba(15, 23, 42, 0.82);
  --panel-border: rgba(56, 189, 248, 0.22);
  --accent-cyan: #00f0ff;
  --accent-blue: #38bdf8;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-violet: #a855f7;
  --accent-rose: #f43f5e;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  font-family: var(--font-sans);
  color: #f8fafc;
  user-select: none;
}

#canvas-container {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

#canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ==========================================================================
   FLOATING UI OVERLAYS
   ========================================================================== */
#ui-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
}

.hud-top-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  flex-wrap: wrap;
}

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

.btn-glass {
  background: rgba(15, 23, 42, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.btn-glass:hover {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.25);
}

.btn-glass.btn-back {
  background: rgba(30, 41, 59, 0.72);
  color: #cbd5e1;
}

.btn-glass.btn-back:hover {
  color: #ffffff;
  border-color: #38bdf8;
}

.btn-glass.btn-accent-emerald {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.btn-glass.btn-accent-emerald:hover {
  background: rgba(16, 185, 129, 0.28);
  color: #ffffff;
}

.btn-glass.btn-ktp {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.88), rgba(37, 99, 235, 0.88));
  border-color: rgba(56, 189, 248, 0.55);
  color: #ffffff;
}

.btn-glass.btn-ktp:hover {
  background: linear-gradient(135deg, #0284c7, #2563eb);
}

.btn-glass.btn-exit {
  background: rgba(225, 29, 72, 0.2);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.btn-glass.btn-exit:hover {
  background: rgba(225, 29, 72, 0.35);
  color: #ffffff;
}

.btn-glass.btn-espresso {
  background: linear-gradient(135deg, #d97706, #b45309);
  border-color: #f59e0b;
  color: #fff;
  font-weight: 700;
}

.btn-glass.btn-espresso:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.btn-glass.active {
  background: rgba(14, 165, 233, 0.22) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

.brand-pill {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 7px 13px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.brand-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #ffffff;
}

.badge-tag {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.32);
}

.stats-pill {
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 7px 13px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #cbd5e1;
}

.stats-pill .divider {
  color: #475569;
  font-family: var(--font-mono);
}

.stats-pill .stat-mayor {
  color: #38bdf8;
  font-weight: 700;
}

.online-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* ==========================================================================
   CLUSTER QUICK NAVIGATOR SUB-BAR
   ========================================================================== */
.cluster-nav-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 6px 10px;
  border-radius: 12px;
  pointer-events: auto;
  align-self: flex-start;
  flex-wrap: wrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.cluster-nav-label {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #64748b;
  letter-spacing: 0.6px;
  padding: 0 4px;
}

.cluster-pill {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.cluster-pill:hover {
  background: rgba(51, 65, 85, 0.85);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.4);
}

.cluster-pill.active {
  background: rgba(14, 165, 233, 0.22);
  border-color: #38bdf8;
  color: #ffffff;
}

.cluster-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  display: inline-block;
}

/* ==========================================================================
   MEGATRON & RUANG NONGKRONG FEED PANEL (LEFT SIDE)
   ========================================================================== */
.megatron-feed-card {
  position: fixed;
  top: 108px;
  left: 16px;
  width: 310px;
  background: rgba(15, 23, 42, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  padding: 10px 12px;
  pointer-events: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  z-index: 25;
  transition: all 0.22s ease;
}

.megatron-feed-card.collapsed .megatron-feed-list {
  display: none;
}

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

.megatron-feed-card.collapsed .megatron-feed-header {
  padding-bottom: 0;
  border-bottom: none;
}

.megatron-title-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.megatron-title {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: 0.6px;
  color: #e2e8f0;
}

.btn-collapse-feed {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-collapse-feed:hover {
  color: #ffffff;
  border-color: #38bdf8;
}

.megatron-feed-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 2px;
}

.megatron-feed-item {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid #38bdf8;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 11px;
}

.megatron-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.megatron-item-author {
  font-weight: 800;
  color: #f8fafc;
  font-size: 11px;
}

.megatron-item-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  padding: 1px 5px;
  border-radius: 4px;
}

.megatron-item-msg {
  color: #cbd5e1;
  line-height: 1.38;
  word-break: break-word;
}

.megatron-item-tag {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   HUD BOTTOM DOCKS (RUANG NONGKRONG LIVE BAR & APARTMENT DOCK)
   ========================================================================== */
.hud-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  width: 100%;
}

.nongkrong-bar {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.32);
  padding: 8px 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.65);
  max-width: 780px;
  width: 100%;
  flex-wrap: wrap;
}

.chat-input-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 240px;
}

.chat-input-field {
  flex: 1;
  background: rgba(3, 7, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 9px;
  outline: none;
  transition: border-color 0.18s ease;
}

.chat-input-field:focus {
  border-color: #38bdf8;
}

.btn-chat-send {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 13px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-chat-send:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
}

.quick-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-quick-pose {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-quick-pose:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
  border-color: #38bdf8;
}

.btn-quick-pose.btn-pose-checkin {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.btn-quick-pose.btn-pose-checkin:hover {
  background: rgba(16, 185, 129, 0.32);
  color: #ffffff;
}

.apartment-controls-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.apartment-dock, .room-selector-dock {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.32);
  padding: 9px 15px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.dock-label {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #94a3b8;
  letter-spacing: 0.6px;
}

.dock-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-mode, .btn-room {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-mode:hover, .btn-room:hover {
  background: rgba(51, 65, 85, 0.85);
  color: #ffffff;
  border-color: #38bdf8;
}

.btn-mode.active, .btn-room.active {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.modal.hidden {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  animation: modalEnter 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f8fafc;
}

.modal-card.modal-card-wide {
  max-width: 600px;
}

.modal-card.modal-card-xl {
  max-width: 780px;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
}

.modal-x {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-x:hover {
  color: #ffffff;
}

.plot-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.plot-badge.built {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.plot-badge.empty {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.spec-box {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  border-radius: 10px;
}

.spec-box .lbl {
  display: block;
  font-size: 10px;
  font-family: var(--font-mono);
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.spec-box b {
  font-size: 13px;
  color: #f8fafc;
}

.btn {
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-sans);
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}

.btn-secondary:hover {
  background: #334155;
  color: #ffffff;
}

.btn-build {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.btn-build:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-1px);
}

/* ==========================================================================
   DIGITAL KTP CARD & EDITOR
   ========================================================================== */
.ktp-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 14px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(56, 189, 248, 0.15);
}

.ktp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.ktp-chip {
  width: 34px;
  height: 24px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.ktp-content {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ktp-field {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  gap: 12px;
}

.ktp-field .lbl {
  color: #93c5fd;
}

.ktp-field b {
  color: #ffffff;
  font-family: var(--font-mono);
  text-align: right;
}

.ktp-footer {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #94a3b8;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}

.form-input, .form-select {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--font-sans);
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: #38bdf8;
}

/* ==========================================================================
   DIRECTORY MODAL (600+ RESIDENTS & 5 CLUSTERS)
   ========================================================================== */
.directory-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.dir-tab-btn {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dir-tab-btn:hover {
  border-color: #38bdf8;
  color: #ffffff;
}

.dir-tab-btn.active {
  background: rgba(14, 165, 233, 0.22);
  border-color: #38bdf8;
  color: #38bdf8;
}

.directory-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.resident-list-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.resident-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

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

.resident-name {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

.resident-nik {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #64748b;
}

.rank-chip {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.rank-chip.mythic { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.45); }
.rank-chip.legend { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.45); }
.rank-chip.pro { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.45); }
.rank-chip.newbie { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.45); }
.rank-chip.rookie { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

.resident-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.resident-meta {
  font-size: 11px;
  color: #94a3b8;
}

.btn-visit-unit {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-visit-unit:hover {
  background: #0284c7;
  color: #ffffff;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
#toast-wrap {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #ffffff;
  padding: 9px 18px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast.success {
  border-color: #10b981;
  color: #34d399;
}

.toast.info {
  border-color: #38bdf8;
  color: #38bdf8;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   ROBLOX FLOATING SPEECH BUBBLE
   ========================================================================== */
.roblox-speech {
  position: fixed;
  z-index: 1050;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid #38bdf8;
  border-radius: 14px;
  padding: 10px 15px;
  max-width: 310px;
  color: #ffffff;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 18px rgba(56, 189, 248, 0.3);
  pointer-events: none;
  transform: translate(-50%, -100%);
  margin-top: -16px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  animation: speechPop 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.roblox-speech::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #38bdf8;
}

.speech-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.speech-name {
  font-weight: 800;
  font-size: 12px;
  color: #38bdf8;
}

.speech-role {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  background: rgba(56, 189, 248, 0.16);
  border-radius: 6px;
  color: #bae6fd;
}

.speech-text {
  font-size: 12px;
  line-height: 1.4;
  color: #f1f5f9;
}

@keyframes speechPop {
  from { opacity: 0; transform: translate(-50%, -90%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -100%) scale(1); }
}

/* ==========================================================================
   WASD CONTROLLER PILL & PROXIMITY PROMPT
   ========================================================================== */
.wasd-helper-pill {
  position: fixed;
  bottom: 72px;
  left: 16px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 30px;
  padding: 6px 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  font-size: 11px;
  color: #94a3b8;
  transition: opacity 0.3s ease;
}

.sprint-toggle-btn {
  background: none;
  border: none;
  padding: 2px 4px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.15s ease;
}

.sprint-toggle-btn:hover {
  background: rgba(56, 189, 248, 0.15);
}

.wasd-helper-pill .key-badge.pressed {
  background: #10b981;
  border-color: #34d399;
  color: #022c22;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.wasd-helper-pill .keys-cluster {
  display: flex;
  align-items: center;
  gap: 3px;
}

.wasd-helper-pill .key-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  background: #1e293b;
  border: 1px solid #38bdf8;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  color: #38bdf8;
}

.wasd-helper-pill .key-badge.wide {
  min-width: 44px;
}

.wasd-helper-pill .helper-text {
  font-weight: 600;
  color: #ffffff;
  margin-left: 2px;
}

.wasd-helper-pill .helper-sep {
  color: #475569;
  font-family: var(--font-mono);
}

.action-prompt-pill {
  position: fixed;
  top: 108px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid #10b981;
  border-radius: 40px;
  padding: 7px 16px;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.35), 0 0 20px rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

.action-prompt-pill .action-key-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #10b981;
  color: #022c22;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11px;
  border-radius: 5px;
}

.action-prompt-pill .action-text {
  font-weight: 700;
  font-size: 12px;
  color: #ffffff;
}

.action-prompt-pill .action-click-btn {
  background: #10b981;
  color: #022c22;
  border: none;
  border-radius: 16px;
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

/* Potato mode styles */
body.potato-mode * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.potato-mode .btn-glass,
body.potato-mode .hud-top,
body.potato-mode .hud-bottom,
body.potato-mode .modal-card,
body.potato-mode .megatron-feed-card,
body.potato-mode .nongkrong-bar {
  background: #0f172a !important;
}

@media (max-width: 900px) {
  .stats-pill {
    display: none;
  }
  .wasd-helper-pill {
    display: none;
  }
  .megatron-feed-card {
    width: 250px;
    top: 118px;
  }
  .resident-list-grid {
    grid-template-columns: 1fr;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}
