:root {
  --bg-deep: #0b0b14;
  --bg-dark: #0f0f1a;
  --bg-panel: #14141f;
  --bg-card: #1a1a2e;
  --bg-hover: #22223a;
  --border: #2a2a44;
  --border-light: #3a3a5a;
  --text: #e8e8f0;
  --text-dim: #6b6b8a;
  --text-bright: #f0f0ff;
  --accent: #00d4aa;
  --accent-dim: #00b894;
  --gold: #ffd700;
  --gold-dim: #cc8800;
  --green: #44ddaa;
  --green-dim: #22aa88;
  --cyan: #00bbdd;
  --red: #ff4466;
  --blue: #4488ff;
  --purple: #aa66ff;
  --asia: #ff4455;
  --americas: #4488ff;
  --europe: #44ddaa;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --glass: rgba(26,26,46,0.85);
  --font: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app { width: 100%; height: 100%; position: relative; }

/* ===== ICONS ===== */
.icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* ===== BUTTONS ===== */
.btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(0,212,170,0.12);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary { background: linear-gradient(135deg, #0066ff, #0044cc); border-color: #4488ff; color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, #1177ff, #0055dd); }
.btn-success { background: linear-gradient(135deg, var(--accent), var(--accent-dim)); border-color: var(--accent); color: #fff; }
.btn-success:hover { background: linear-gradient(135deg, #00eebb, #00cc99); }
.btn-danger { background: linear-gradient(135deg, #ff4466, #cc2244); border-color: #ff4466; color: #fff; }
.btn-danger:hover { background: linear-gradient(135deg, #ff5577, #dd3355); }
.btn-discord { background: #5865F2; border-color: #5865F2; color: #fff; }
.btn-discord:hover { background: #6b77f5; }
.btn-gold { background: linear-gradient(135deg, #ff8800, #cc6600); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: linear-gradient(135deg, #ff9900, #dd7700); }
.btn-sm { padding: 6px 12px; font-size: 11px; border-radius: 5px; }
.btn-full { width: 100%; justify-content: center; }

/* ===== INPUTS ===== */
.input {
  font-family: var(--font);
  font-size: 14px;
  background: #0d0d18;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  outline: none;
  width: 100%;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 12px rgba(0,212,170,0.1); }
.input::placeholder { color: #3a3a5a; }

.form-msg { font-size: 12px; color: var(--red); text-align: center; min-height: 18px; }

/* ===== PAGES ===== */
.page { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
.page.active { display: flex; }

/* ===== PAGE 1: LOGIN ===== */
#page-login {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
}
#page-login::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,212,170,0.04) 0%, transparent 70%);
  top: -200px; left: -200px;
  pointer-events: none;
}
#page-login::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(68,136,255,0.03) 0%, transparent 70%);
  bottom: -150px; right: -150px;
  pointer-events: none;
}

.login-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  gap: 24px;
}

.login-brand { text-align: center; }
.login-logo { margin-bottom: 12px; }
.logo-img { height: 72px; }

.login-brand-title {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #00bbdd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 4px;
}
.login-brand-sub {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 6px;
  margin-top: 4px;
}

.login-card {
  width: 420px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.login-tabs { display: flex; }
.login-tab {
  flex: 1;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 14px;
  cursor: pointer;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.login-tab:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.login-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(0,212,170,0.05);
}

.login-card-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.login-tab-panel { display: none; flex-direction: column; gap: 12px; }
.login-tab-panel.active { display: flex; }

.login-divider { display: flex; align-items: center; gap: 14px; color: var(--text-dim); font-size: 12px; }
.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-card-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(0,0,0,0.15);
}

.login-footer-text { font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }

.citizen-agreement { display: flex; flex-direction: column; gap: 10px; }
.agree-checkbox { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13px; }
.agree-checkbox input { display: none; }
.check-custom {
  width: 20px; height: 20px;
  min-width: 20px;
  border: 2px solid var(--border);
  background: #0d0d18;
  display: inline-block;
  border-radius: 4px;
  transition: all 0.2s;
  margin-top: 1px;
}
.agree-checkbox input:checked + .check-custom {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpolyline points='5,10 9,14 15,6' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.agree-text {
  font-size: 12px;
  color: var(--text-dim);
  padding: 12px 14px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  line-height: 1.7;
  border-radius: var(--radius-sm);
  margin-left: 30px;
}

/* ===== PAGE 2: ONBOARDING ===== */
#page-onboarding { flex-direction: column; background: var(--bg-dark); }

.topbar {
  height: 56px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-logo { height: 32px; }
.topbar-title { font-size: 16px; font-weight: 700; letter-spacing: 1px; background: linear-gradient(135deg, var(--accent), #00bbdd); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.topbar-right { display: flex; align-items: center; gap: 10px; position: relative; }

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.user-badge:hover { border-color: var(--border); background: rgba(255,255,255,0.03); }
.user-name { font-size: 14px; font-weight: 600; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--accent); object-fit: cover; }

.user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  width: 240px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  padding: 16px;
  margin-top: 8px;
}
.user-menu.hidden { display: none; }
.user-menu-header { display: flex; align-items: center; gap: 12px; }
.menu-avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--accent); object-fit: cover; }
.menu-name { font-size: 14px; font-weight: 700; }
.menu-tag { font-size: 12px; color: var(--text-dim); }
.menu-divider { height: 1px; background: var(--border); margin: 12px 0; }

.onboarding-body {
  flex: 1;
  overflow-y: auto;
  padding: 48px 24px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}
.section-title-sm { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 14px; letter-spacing: 0.3px; }

.onboarding-card {
  max-width: 680px;
  margin: 0 auto 40px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.guide-text { font-size: 14px; line-height: 2; color: var(--text-dim); }

.faction-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}

.faction-card {
  width: 270px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s ease;
  box-shadow: var(--shadow);
}
.faction-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(0,212,170,0.1);
  transform: translateY(-4px);
}

.faction-banner {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 42px;
}
.faction-banner[data-faction="asia"] { background: linear-gradient(180deg, rgba(255,68,85,0.12), rgba(200,0,0,0.2)); }
.faction-banner[data-faction="americas"] { background: linear-gradient(180deg, rgba(68,136,255,0.12), rgba(0,50,150,0.2)); }
.faction-banner[data-faction="europe"] { background: linear-gradient(180deg, rgba(68,221,170,0.12), rgba(0,150,100,0.2)); }

.faction-name { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.faction-desc { font-size: 13px; color: var(--text-dim); line-height: 1.8; }
.faction-stats { display: flex; justify-content: center; gap: 6px; margin-top: 12px; opacity: 0.5; font-size: 18px; }

/* ===== PAGE 3: GAME ===== */
#page-game { flex-direction: row; }

/* Sidebar */
.sidebar {
  width: 220px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-logo {
  padding: 16px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo-img { height: 28px; }
.sidebar-logo-text {
  font-size: 15px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #00bbdd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-btn {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
}
.sidebar-btn:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.sidebar-btn.active {
  color: var(--accent);
  background: rgba(0,212,170,0.08);
  font-weight: 600;
}
.sidebar-label { flex: 1; text-align: left; }

.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-user:hover { background: rgba(255,255,255,0.03); }

.user-avatar-sm { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--accent); object-fit: cover; }
.user-name-sm { font-size: 13px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Main Area */
.main-area {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.game-page { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
.game-page.active { display: flex; flex-direction: column; }

.page-center {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px;
}

/* MAP PAGE */
.map-toolbar {
  height: 52px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  flex-shrink: 0;
}
.map-gold-display { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--gold); }
.gold-value { font-size: 16px; }
.map-gps-display { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); }
.gps-value { color: var(--text); font-weight: 600; }
.gps-label { font-size: 11px; }

.map-split { flex: 1; display: flex; overflow: hidden; }
.map-area { flex: 1; position: relative; }
#world-leaflet-map { width: 100%; height: 100%; }

#world-leaflet-map .leaflet-tile-pane { filter: brightness(0.45) saturate(0.4) hue-rotate(180deg); }
#world-leaflet-map .leaflet-control-zoom a {
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 16px;
}
#world-leaflet-map .leaflet-control-zoom a:hover { background: var(--bg-hover); color: var(--accent); }

.leaflet-tooltip {
  font-family: var(--font);
  font-size: 12px;
  background: var(--glass) !important;
  backdrop-filter: blur(10px);
  color: var(--text) !important;
  border: 1px solid var(--accent) !important;
  border-radius: var(--radius-sm) !important;
  padding: 6px 12px !important;
  box-shadow: var(--shadow) !important;
}
.leaflet-tooltip::before { border-top-color: var(--accent) !important; }

.map-sidebar {
  width: 260px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex-shrink: 0;
}

.cp-header {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 12px;
}
.cp-body { display: flex; flex-direction: column; gap: 8px; }
.cp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.cp-row span:nth-child(2) { color: var(--text-dim); margin-right: auto; }
.cp-row span:nth-child(3) { font-weight: 600; }

.cp-rest { margin-top: 10px; }
.cp-rest .cp-row { font-size: 12px; color: var(--text-dim); }

.mine-quick-panel {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.qp-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }

.progress-bar {
  width: 100%; height: 6px;
  background: #0d0d18;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), #00eebb);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.mine-levels { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.ml-item {
  padding: 6px 10px;
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  transition: all 0.15s;
}
.ml-item.active { border-color: var(--gold); background: rgba(255,215,0,0.06); color: var(--gold); }
.ml-item.completed { border-color: var(--accent); background: rgba(0,212,170,0.04); color: var(--accent); }

/* MINING PAGE */
.mine-card {
  text-align: center;
  max-width: 520px;
  width: 100%;
}
.mine-visual {
  width: 100%;
  max-width: 420px;
  height: 240px;
  background: #0d0d18;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 20px auto;
  overflow: hidden;
}
#mine-canvas { width: 100%; height: 100%; }

.mine-stat-row { display: flex; gap: 14px; justify-content: center; margin: 20px 0; }
.mine-stat {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 110px;
}
.stat-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.stat-val { font-size: 18px; font-weight: 700; color: var(--gold); }

/* GACHA PAGE */
.gacha-card { text-align: center; max-width: 500px; width: 100%; }
.gacha-cost { font-size: 14px; color: var(--text-dim); margin-bottom: 16px; }
.gold-highlight { color: var(--gold); font-weight: 700; }

.gacha-machine {
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 220px;
  margin: 16px auto;
}
.gacha-box {
  width: 100%; height: 100%;
  background: #0d0d18;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
#gacha-canvas { width: 100%; height: 100%; }

.gacha-lights {
  position: absolute;
  top: -10px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
}
.light { width: 10px; height: 10px; background: #222; border: 1px solid #444; border-radius: 50%; }
.light.active { background: var(--gold); box-shadow: 0 0 12px var(--gold); }

.rarity-table {
  text-align: left;
  background: rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 14px 0;
}
.rt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 5px 0;
}
.rt-row span:nth-child(2) { color: var(--text); min-width: 100px; }
.rt-row span:nth-child(3) { color: var(--text-dim); font-size: 12px; }

.rt-dot {
  width: 10px; height: 10px;
  display: inline-block;
  border-radius: 50%;
}
.rt-dot.common { background: #666; }
.rt-dot.epic { background: var(--purple); box-shadow: 0 0 6px rgba(170,102,255,0.4); }
.rt-dot.mythic { background: var(--gold); box-shadow: 0 0 6px rgba(255,215,0,0.4); }
.rt-dot.unique { background: var(--red); box-shadow: 0 0 8px rgba(255,68,102,0.5); }

.gacha-result { margin-top: 14px; padding: 18px; min-height: 56px; text-align: center; }
.rarity-common { color: #888; }
.rarity-epic { color: var(--purple); text-shadow: 0 0 12px rgba(170,102,255,0.3); }
.rarity-mythic { color: var(--gold); text-shadow: 0 0 12px rgba(255,215,0,0.3); }
.rarity-unique { color: var(--red); text-shadow: 0 0 16px rgba(255,68,102,0.4); }

/* INVENTORY PAGE */
.inventory-card { width: 100%; max-width: 760px; }
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.inventory-item {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
}
.inventory-item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }
.item-rarity { font-size: 10px; margin-bottom: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.item-name { font-size: 13px; margin: 6px 0; font-weight: 600; }
.item-desc { font-size: 11px; color: var(--text-dim); }
.item-icon { width: 56px; height: 56px; margin: 0 auto 8px; background: var(--bg-dark); border: 1px solid var(--border); border-radius: var(--radius-sm); object-fit: contain; }

/* STATS PAGE */
.stats-card { width: 100%; max-width: 700px; }
.stat-cards-row { display: flex; gap: 16px; margin-bottom: 28px; }
.s-card {
  flex: 1;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.s-label { display: block; font-size: 11px; color: var(--text-dim); margin: 6px 0 4px; text-transform: uppercase; letter-spacing: 1px; }
.s-value { font-size: 22px; font-weight: 700; color: var(--gold); }

.stats-split { display: flex; gap: 20px; margin-top: 12px; }
.stats-half { flex: 1; }

.list-box {
  background: rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-height: 120px;
}

.aura-row, .leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
}
.aura-row:last-child, .leaderboard-row:last-child { border-bottom: none; }
.aura-row .aura-faction { display: flex; align-items: center; gap: 8px; }

/* UNIQUE NOTIFICATION */
.unique-notif {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  animation: notif-in 0.4s ease-out;
}
.unique-notif.hidden { display: none; }
.unique-notif-content {
  background: linear-gradient(135deg, #440011, #220008);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--red);
  box-shadow: 0 0 40px rgba(255,68,102,0.25);
}
@keyframes notif-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-24px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* GOALS PAGE */
.goals-card { width: 100%; max-width: 580px; }
.goals-tabs { display: flex; border-bottom: 1px solid var(--border); }
.goal-tab {
  flex: 1;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 14px;
  cursor: pointer;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.goal-tab:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.goal-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: rgba(255,215,0,0.04);
}
.goal-tab-content { display: none; padding: 20px 0; }
.goal-tab-content.active { display: block; }

.quest-streak {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(255,215,0,0.05);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: var(--radius-sm);
}
.quest-list { display: flex; flex-direction: column; gap: 10px; }
.quest-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.15s;
}
.quest-item.completed { border-color: var(--accent); background: rgba(0,212,170,0.03); }
.quest-item.claimed { opacity: 0.45; }
.quest-icon { font-size: 22px; width: 32px; text-align: center; }
.quest-info { flex: 1; min-width: 0; }
.quest-name { font-size: 14px; font-weight: 600; }
.quest-reward { font-size: 12px; color: var(--gold); margin-top: 3px; }
.quest-progress { margin-top: 8px; }
.quest-progress-bar {
  width: 100%; height: 5px;
  background: #0d0d18;
  border-radius: 3px;
  overflow: hidden;
}
.quest-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), #00eebb);
  border-radius: 3px;
  transition: width 0.3s;
}
.quest-progress-text { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.quest-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 600;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(0,212,170,0.08);
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.quest-btn:hover { background: rgba(0,212,170,0.18); }
.quest-btn.claimed { border-color: var(--border); background: transparent; color: var(--text-dim); cursor: default; }
.quest-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ACHIEVEMENTS */
.achievement-list { display: flex; flex-direction: column; gap: 10px; }
.achievement-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.15s;
}
.achievement-item.completed { border-color: var(--gold); background: rgba(255,215,0,0.03); }
.achievement-item.claimed { opacity: 0.45; }
.ach-icon { font-size: 22px; width: 32px; text-align: center; }
.ach-info { flex: 1; }
.ach-name { font-size: 14px; font-weight: 600; }
.ach-desc { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.ach-reward { font-size: 12px; color: var(--gold); margin-top: 3px; }
.ach-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 600;
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  background: rgba(255,215,0,0.08);
  color: var(--gold);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.ach-btn:hover { background: rgba(255,215,0,0.18); }
.ach-btn.claimed { border-color: var(--border); background: transparent; color: var(--text-dim); cursor: default; }
.ach-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* CLAN PAGE */
.clan-card { width: 100%; max-width: 580px; }
.clan-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.clan-name { font-size: 20px; font-weight: 800; color: var(--gold); }
.clan-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
}
.clan-level { font-size: 13px; color: var(--accent); margin-top: 4px; }
.clan-desc { font-size: 13px; color: var(--text-dim); margin: 10px 0 20px; line-height: 1.7; }
.clan-members-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.clan-member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
}
.clan-member-role {
  font-size: 10px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.clan-member-name { flex: 1; font-weight: 600; }
.clan-member-info { font-size: 11px; color: var(--text-dim); }

.clan-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.clan-list-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.clan-list-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}
.clan-list-info { flex: 1; }
.clan-list-name { font-size: 14px; font-weight: 600; }
.clan-list-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

.clan-requests-section {
  margin-top: 20px;
  padding: 16px;
  background: rgba(255,215,0,0.03);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: var(--radius);
}
.clan-requests-title { font-size: 13px; font-weight: 600; color: var(--gold); margin-bottom: 10px; }
.clan-request { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 13px; }
.clan-request-actions { display: flex; gap: 8px; margin-left: auto; }

.clan-input-group { display: flex; gap: 12px; margin-bottom: 12px; }
.clan-input-group .input { flex: 1; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .login-card { width: 95%; }
  .faction-row { flex-direction: column; align-items: center; }
  .sidebar { width: 56px; }
  .sidebar-logo-text { display: none; }
  .sidebar-label { display: none; }
  .sidebar-btn { justify-content: center; padding: 12px 0; }
  .sidebar-user .user-name-sm { display: none; }
  .map-sidebar { width: 200px; }
  .mine-stat-row { flex-direction: column; }
  .stat-cards-row { flex-direction: column; }
  .stats-split { flex-direction: column; }
}
