:root {
  --bg-dark: #0d1117;
  --bg-card: #161b22;
  --bg-card-hover: #1f242e;
  --border-color: #30363d;
  --border-gold: #d4a373;
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --text-gold: #f3c068;
  --primary: #d4a373;
  --primary-hover: #faedcd;
  --accent: #e5a93c;
  --success: #3fb950;
  --danger: #f85149;
  --warning: #d29922;
  --info: #58a6ff;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(212, 163, 115, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(63, 185, 80, 0.04) 0%, transparent 40%);
}

.app-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 24px 48px;
}

/* TOP NAVBAR */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

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

.brand-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2b2118, #16120e);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(212, 163, 115, 0.25);
}

.brand-text h1 {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-gold);
  letter-spacing: 0.5px;
}

.brand-text .subtitle {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-metrics {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.metric-card {
  background: #0d1117;
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  min-width: 105px;
}

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
}

.metric-value {
  font-size: 16px;
  font-weight: 700;
}

.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-accent  { color: var(--accent); }
.text-info    { color: var(--info); }
.text-gold    { color: var(--text-gold); }

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

/* BUTTONS */
.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #d4a373, #b07d52);
  color: #16120e;
  box-shadow: 0 2px 8px rgba(212, 163, 115, 0.3);
}

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

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-success {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.4);
}
.btn-success:hover {
  background: rgba(63, 185, 80, 0.3);
}

.btn-danger {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.4);
}
.btn-danger:hover {
  background: rgba(248, 81, 73, 0.3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* SUB NAVIGATION TABS */
.sub-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card);
}

.tab-btn.active {
  color: var(--text-gold);
  background: rgba(212, 163, 115, 0.12);
  border: 1px solid rgba(212, 163, 115, 0.3);
  font-weight: 600;
}

/* TAB CONTENT */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-gold);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* SECTION TOOLBAR */
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  width: 320px;
  max-width: 100%;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  width: 100%;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

/* BOTS GRID */
.bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

.bot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.bot-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
}

.bot-card.is-farming {
  border-left: 4px solid var(--success);
}
.bot-card.is-dead {
  border-left: 4px solid var(--danger);
}
.bot-card.is-returning {
  border-left: 4px solid var(--warning);
}
.bot-card.is-idle {
  border-left: 4px solid var(--border-color);
}

.bot-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bot-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bot-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2b2118, #181410);
  border: 1px solid var(--border-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.bot-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.bot-id-tag {
  font-size: 11px;
  color: var(--text-muted);
}

.bot-status-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-farming   { background: rgba(63, 185, 80, 0.2); color: #3fb950; border: 1px solid rgba(63, 185, 80, 0.4); }
.tag-dead      { background: rgba(248, 81, 73, 0.2); color: #f85149; border: 1px solid rgba(248, 81, 73, 0.4); }
.tag-returning { background: rgba(210, 153, 34, 0.2); color: #d29922; border: 1px solid rgba(210, 153, 34, 0.4); }
.tag-idle      { background: rgba(139, 148, 158, 0.2); color: #8b949e; border: 1px solid rgba(139, 148, 158, 0.4); }

.bot-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #0d1117;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.bot-info-item .info-label {
  color: var(--text-muted);
  display: block;
  font-size: 11px;
}

.bot-info-item .info-val {
  font-weight: 600;
  color: var(--text-main);
}

.bot-features {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.feat-pill {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}
.feat-pill.active {
  background: rgba(212, 163, 115, 0.15);
  border-color: rgba(212, 163, 115, 0.4);
  color: var(--text-gold);
}

.bot-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.bot-actions .btn {
  flex: 1;
}

/* EMPTY STATE */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-gold);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 20px;
  font-size: 14px;
}

/* RUNNERS */
.runners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.runner-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* FORMS */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

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

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.form-group small {
  font-size: 11px;
  color: var(--text-muted);
}

.form-input {
  background: #0d1117;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--border-gold);
}

.form-select {
  cursor: pointer;
}

/* TOGGLE SWITCH */
.toggle-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-group input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  width: 40px;
  height: 22px;
  background: #30363d;
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-group input:checked + .toggle-switch {
  background: var(--accent);
}

.toggle-group input:checked + .toggle-switch::after {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 13px;
  font-weight: 600;
}

.form-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

/* TERMINAL LOGS */
.logs-terminal {
  background: #090d13;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  height: 480px;
  overflow-y: auto;
  padding: 12px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
}

.log-row {
  display: flex;
  gap: 10px;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.log-time { color: var(--text-muted); flex-shrink: 0; }
.log-bot  { color: var(--text-gold); font-weight: 600; flex-shrink: 0; }
.log-level {
  font-weight: 700;
  padding: 0 4px;
  border-radius: 2px;
  font-size: 10px;
  flex-shrink: 0;
  height: fit-content;
}

.log-level-KẾT\ NỐI, .log-level-INFO { background: rgba(88, 166, 255, 0.2); color: #58a6ff; }
.log-level-COMBAT  { background: rgba(63, 185, 80, 0.2); color: #3fb950; }
.log-level-LỆNH    { background: rgba(229, 169, 60, 0.2); color: #e5a93c; }
.log-level-TỬ\ TRẬN, .log-level-TIMEOUT, .log-level-NGẮT\ KẾT\ NỐI { background: rgba(248, 81, 73, 0.2); color: #f85149; }

.log-msg { color: var(--text-main); word-break: break-word; }

/* GUIDE */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.step-box {
  display: flex;
  gap: 16px;
  background: #0d1117;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.step-num {
  width: 36px;
  height: 36px;
  background: rgba(212, 163, 115, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--text-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content h3 {
  font-size: 15px;
  color: var(--text-gold);
  margin-bottom: 6px;
}

.step-content p, .step-content ul {
  font-size: 13px;
  color: var(--text-muted);
}

.step-content ul {
  padding-left: 20px;
  margin-top: 6px;
}

.step-content code {
  background: #1f242d;
  padding: 2px 6px;
  border-radius: 4px;
  color: #faedcd;
  font-family: monospace;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  width: 500px;
  max-width: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

.modal-lg {
  width: 860px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  color: var(--text-gold);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}
.modal-close:hover { color: #fff; }

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #11151c;
}

/* LIVE VIEW */
.liveview-screen-wrap {
  width: 100%;
  height: 480px;
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.liveview-screen-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.screen-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border-gold);
  color: var(--text-gold);
  font-size: 13px;
  display: none;
}

/* VITALS BARS (HP, MP / QI, EXP) */
.vitals-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.vital-label {
  font-size: 10px;
  font-weight: 700;
  width: 28px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.hp-bar-wrap, .mp-bar-wrap, .exp-bar-wrap {
  flex: 1;
  height: 16px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hp-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #e63946, #52b788);
  border-radius: 8px;
  transition: width 0.3s ease;
}

.mp-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 8px;
  transition: width 0.3s ease;
}

.exp-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #d97706, #fbbf24);
  border-radius: 8px;
  transition: width 0.3s ease;
}

.vital-bar-text {
  position: relative;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  letter-spacing: 0.3px;
}

.exp-gain-badge {
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* AUTH TABS */
.tab-toggle-auth {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.auth-tab-btn {
  flex: 1;
  background: #0d1117;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: var(--bg-card);
  color: var(--text-gold);
  border-bottom: 2px solid var(--border-gold);
}

.w-100 { width: 100%; }
.mt-3  { margin-top: 12px; }
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flex-center {
  display: flex;
  align-items: center;
}
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.p-4  { padding: 16px; }
.text-center { text-align: center; }

/* REALM BADGE & BREAKTHROUGH */
.realm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(212, 163, 115, 0.15);
  border: 1px solid rgba(212, 163, 115, 0.4);
  color: var(--text-gold);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.btn-breakthrough {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #000000;
  font-weight: 700;
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.5); }
  50% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.9); }
}

/* SECT FILTERS */
.sect-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sect-pill {
  background: #0d1117;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sect-pill:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.3);
}

.sect-pill.active {
  background: rgba(212, 163, 115, 0.18);
  border-color: var(--border-gold);
  color: var(--text-gold);
  box-shadow: 0 0 10px rgba(212, 163, 115, 0.2);
}

/* SKILLS GRID */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}

.skill-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 163, 115, 0.5);
}

.skill-card.is-learned {
  border-left: 3px solid #3fb950;
}

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

.skill-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.skill-sect-tag {
  font-size: 11px;
  color: var(--text-gold);
  font-weight: 600;
}

.skill-lvl-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.skill-lvl-badge.learned {
  background: rgba(63, 185, 80, 0.2);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.4);
}

.skill-meta-tags {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.skill-meta-tag {
  background: #0d1117;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.skill-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  background: #090d13;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid rgba(212, 163, 115, 0.3);
}

.skill-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* WORLDS GRID */
.worlds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.world-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}

.world-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.5);
}

.world-card.active-map {
  border: 1px solid #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
  border-left: 4px solid #38bdf8;
}

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

.world-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.world-id-badge {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.world-status-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.world-portals-box {
  background: #090d13;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.world-portals-title {
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.portal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.portal-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.world-actions {
  display: flex;
  gap: 8px;
}

/* == TU TIÊN 2D STYLES & MODAL TABS == */
.btn-tutien-quick {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  border: 1px solid #34d399;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.btn-tutien-quick:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
  color: #fff;
}

.game-select-tabs {
  display: flex;
  gap: 10px;
  background: #090d13;
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.game-tab-btn {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.game-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.game-tab-btn.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tutien-box-guest {
  background: radial-gradient(circle at top left, rgba(16, 185, 129, 0.12), transparent 70%), #121820;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
}

.tutien-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.tutien-box-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: #34d399;
}

.badge-guest {
  font-size: 11px;
  background: #10b981;
  color: #064e3b;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tutien-box-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.divider-text {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider-text span {
  padding: 0 10px;
}

/* Tu Tiên Badges & Highlights */
.tag-tutien {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.4);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.tag-kiting {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.tag-meditate {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.tag-loot {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.tag-patrol {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.bot-card.tutien-card {
  border-color: rgba(52, 211, 153, 0.3);
}

.bot-card.tutien-card:hover {
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 8px 26px rgba(16, 185, 129, 0.15);
}

.bot-card.tutien-card .bot-avatar {
  background: linear-gradient(135deg, #064e3b, #022c22);
  border-color: #34d399;
  color: #34d399;
}

/* ZONE / PHÂN KHU (TU TIÊN 2D) */
.khu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(30, 41, 59, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.khu-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
}

.khu-btn.khu-green {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.12);
}
.khu-btn.khu-green .khu-count {
  color: #4ade80;
}

.khu-btn.khu-yellow {
  border-color: rgba(234, 179, 8, 0.5);
  background: rgba(234, 179, 8, 0.12);
}
.khu-btn.khu-yellow .khu-count {
  color: #facc15;
}

.khu-btn.khu-red {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
}
.khu-btn.khu-red .khu-count {
  color: #f87171;
}

.khu-btn.khu-current {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.2) !important;
}

.khu-num {
  font-weight: 700;
  font-size: 13px;
  color: #f8fafc;
}

.khu-count {
  font-size: 11px;
  margin-top: 2px;
  font-weight: 500;
}

.tag-khu {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
