@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Outfit:wght@300;400;600;800&family=Rajdhani:wght@500;700&display=swap');

:root {
  --font-title: 'Orbitron', 'Rajdhani', sans-serif;
  --font-body: 'Outfit', sans-serif;
  
  /* Modern HSL Color Palettes */
  --bg-main: hsl(240, 20%, 6%);
  --bg-panel: hsla(240, 20%, 12%, 0.75);
  --bg-panel-light: hsla(240, 20%, 18%, 0.85);
  --border-color: hsla(240, 15%, 25%, 0.4);
  
  --primary: hsl(280, 80%, 60%);
  --primary-glow: hsla(280, 80%, 60%, 0.35);
  --secondary: hsl(180, 100%, 45%);
  --secondary-glow: hsla(180, 100%, 45%, 0.35);
  --accent: hsl(340, 90%, 55%);
  --accent-glow: hsla(340, 90%, 55%, 0.35);
  
  --text-main: hsl(0, 0%, 93%);
  --text-muted: hsl(240, 10%, 65%);
  --text-highlight: hsl(180, 100%, 65%);
  
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  --glow-shadow: 0 0 15px var(--primary-glow);
  --glass-blur: blur(12px);
  --transition-speed: 0.3s;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, hsla(280, 80%, 60%, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, hsla(180, 100%, 45%, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Glassmorphism & Card Utility Styles */
.glass {
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}

.glow-purple {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.glow-cyan {
  border-color: var(--secondary);
  box-shadow: 0 0 15px var(--secondary-glow);
}

.glow-pink {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

h1, h2, h3, h4, h5, .title-font {
  font-family: var(--font-title);
  letter-spacing: 1px;
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

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

/* Layout - App Containers */
.app-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Navigation Sidebar (PC layout) */
.sidebar {
  padding: 24px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  background: rgba(10, 10, 15, 0.95);
  justify-content: space-between;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-family: var(--font-title);
  font-size: 20px;
  box-shadow: 0 0 10px var(--primary-glow);
}

.logo-text {
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(to right, #fff, var(--text-highlight));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 16px;
  color: var(--text-muted);
  transition: all var(--transition-speed);
  border: 1px solid transparent;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
  background: hsla(280, 80%, 60%, 0.15);
  border-color: hsla(280, 80%, 60%, 0.3);
  transform: translateX(5px);
}

.nav-item.active {
  border-left: 4px solid var(--primary);
  box-shadow: inset 5px 0 15px -5px var(--primary-glow);
}

.nav-icon {
  font-size: 18px;
  width: 24px;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* User mini profile card in sidebar */
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--secondary);
  box-shadow: 0 0 8px var(--secondary-glow);
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

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

/* Main Content Area */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  padding: 32px;
}

/* Top bar statistics */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  background: hsla(180, 100%, 45%, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid hsla(180, 100%, 45%, 0.3);
  cursor: pointer;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 8px var(--secondary);
}

.status-dot.offline {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* Forms & Auth Styles */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  animation: slideIn 0.5s ease-out;
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header .logo-icon {
  margin: 0 auto 16px auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-family: var(--font-title);
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.form-input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 15px;
  font-family: var(--font-body);
  transition: all var(--transition-speed);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  background: rgba(0, 0, 0, 0.6);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all var(--transition-speed);
  border: 1px solid transparent;
  gap: 8px;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), hsl(280, 80%, 50%));
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
  filter: brightness(1.1);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), hsl(340, 90%, 45%));
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
  filter: brightness(1.1);
}

.oauth-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.oauth-divider::before, .oauth-divider::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: var(--border-color);
}

.oauth-divider::before { margin-right: 12px; }
.oauth-divider::after { margin-left: 12px; }

.oauth-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-oauth {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 13px;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-oauth:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

.btn-google:hover {
  border-color: #ea4335;
  box-shadow: 0 0 10px rgba(234, 67, 53, 0.2);
}

.btn-line:hover {
  border-color: #06c755;
  box-shadow: 0 0 10px rgba(6, 199, 85, 0.2);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-link {
  color: var(--secondary);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

.auth-link:hover {
  text-decoration: underline;
}

/* Dashboard Views (Tab layouts) */
.tab-content {
  animation: slideIn 0.3s ease-out;
  display: none;
}

.tab-content.active {
  display: block;
}

/* Character Page Styles */
.char-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

.char-card-hero {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  position: relative;
}

.char-hero-image-wrapper {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  border: 2px solid var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  overflow: hidden;
  background: #111;
  position: relative;
}

.char-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.char-badge-lvl {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-title);
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.char-name-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

.char-name-text {
  font-size: 20px;
  font-weight: bold;
}

.char-name-edit-icon {
  color: var(--secondary);
  cursor: pointer;
  font-size: 14px;
}

.char-level-bar-container {
  width: 100%;
  margin-top: 8px;
}

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

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.5s ease-out;
}

.char-equip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  margin-top: 16px;
}

.char-equip-grid .equip-slot[data-slot="ring"] {
  grid-column: span 2;
  aspect-ratio: auto;
  height: 54px;
  flex-direction: row;
  gap: 10px;
}

.equip-slot {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  cursor: pointer;
  transition: all var(--transition-speed);
  position: relative;
}

.equip-slot:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--secondary);
  box-shadow: 0 0 8px var(--secondary-glow);
}

.equip-slot-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
  text-align: center;
}

.equip-slot-value {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.equip-slot-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

/* Equipment Inventory Grid */
.char-details-container {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
}

.stat-box {
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-name {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-title);
  color: var(--text-highlight);
}

/* Game Lobby Module Grid */
.lobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.game-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 320px;
  transition: all var(--transition-speed);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.game-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at top right, hsla(180, 100%, 45%, 0.15), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-speed);
  pointer-events: none;
}

.game-card:hover {
  transform: translateY(-8px);
  border-color: var(--secondary);
  box-shadow: 0 12px 30px var(--secondary-glow);
}

.game-card:hover::after {
  opacity: 1;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.game-icon {
  font-size: 32px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.game-tag {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
}

.game-info {
  margin: 16px 0;
}

.game-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

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

/* Chat & Interactive Lobby */
.interactive-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
  height: calc(100vh - 180px);
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  gap: 12px;
  animation: slideIn 0.2s ease-out;
  max-width: 80%;
}

.chat-message.system {
  max-width: 100%;
  color: var(--secondary);
  font-size: 12px;
  justify-content: center;
  align-items: center;
  font-family: var(--font-title);
  background: rgba(180, 100%, 45%, 0.05);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px dashed rgba(180, 100%, 45%, 0.2);
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
}

.chat-bubble-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-username {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-muted);
}

.chat-bubble {
  background: var(--bg-panel-light);
  padding: 10px 14px;
  border-radius: 4px 12px 12px 12px;
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid var(--border-color);
}

.chat-message.self {
  margin-left: auto;
  flex-direction: row-reverse;
}

.chat-message.self .chat-bubble {
  background: hsla(280, 80%, 60%, 0.15);
  border-color: hsla(280, 80%, 60%, 0.3);
  border-radius: 12px 4px 12px 12px;
}

.chat-message.self .chat-avatar {
  border-color: var(--secondary);
}

.chat-message.self .chat-username {
  text-align: right;
}

.chat-input-wrapper {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
}

.chat-input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-main);
  font-family: var(--font-body);
}

.chat-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 10px var(--secondary-glow);
}

.chat-send-btn {
  width: 100px;
}

.users-list-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.online-users-title {
  font-size: 13px;
  font-family: var(--font-title);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.online-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.online-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 5px var(--secondary);
}

/* Mission Lobby Styles */
.missions-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.mission-card {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 200px 120px;
  align-items: center;
  gap: 20px;
  transition: all var(--transition-speed);
}

.mission-card:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--primary);
}

.mission-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mission-title {
  font-size: 16px;
  font-weight: 700;
}

.mission-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.mission-progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mission-progress-text {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

.btn-claim {
  padding: 8px 16px;
  font-size: 13px;
}

/* Toast Message Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}

.toast {
  background: var(--bg-panel-light);
  border: 1px solid var(--secondary);
  border-left: 5px solid var(--secondary);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  color: var(--text-main);
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.success {
  border-color: var(--secondary);
  border-left-color: var(--secondary);
}

.toast.error {
  border-color: var(--accent);
  border-left-color: var(--accent);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  width: 90%;
  max-width: 500px;
  padding: 24px;
  animation: float 4s ease-in-out infinite;
}

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

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

.modal-close:hover {
  color: var(--text-main);
}

.equip-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 8px;
}

.equip-item-card {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-speed);
}

.equip-item-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--secondary);
  transform: translateX(4px);
}

.equip-item-name {
  font-weight: bold;
  font-size: 15px;
}

.equip-item-stat {
  font-size: 12px;
  color: var(--secondary);
  font-family: var(--font-title);
}

/* Mobile Floating Action Button (FAB) for Chat */
.btn-chat-fab {
  display: none;
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px var(--secondary-glow);
  color: white;
  font-size: 24px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  transition: all var(--transition-speed);
  animation: float 3s ease-in-out infinite;
}

.btn-chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px var(--secondary-glow);
}

/* Mobile & Tablet Responsiveness (Crucial Step!) */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }
  
  .sidebar {
    display: none; /* Hide PC sidebar */
  }
  
  /* Mobile Bottom Navigation Bar */
  .mobile-nav {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 70px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
  }
  
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-family: var(--font-title);
    font-size: 10px;
    gap: 4px;
    text-decoration: none;
    cursor: pointer;
    flex-grow: 1;
    height: 100%;
    transition: color var(--transition-speed);
  }
  
  .mobile-nav-item.active {
    color: var(--secondary);
  }
  
  .mobile-nav-item .nav-icon {
    font-size: 20px;
    width: auto;
    margin: 0;
  }
  
  .main-content {
    padding: 20px;
    padding-bottom: 90px; /* Leave space for mobile bottom nav */
    height: auto;
    overflow-y: visible;
  }
  
  .char-layout {
    grid-template-columns: 1fr;
  }
  
  .char-equip-grid {
    display: flex !important;
    overflow-x: auto !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 4px 4px 10px 4px !important;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .char-equip-grid .equip-slot {
    flex: 0 0 75px !important;
    aspect-ratio: 1 !important;
  }
  
  .btn-chat-fab {
    display: flex !important;
  }

  .chat-input-wrapper {
    display: none !important;
  }

  .interactive-layout {
    grid-template-columns: 1fr;
    height: calc(100dvh - 200px) !important;
    margin-bottom: 20px !important;
  }
  
  .users-list-panel {
    display: none; /* Hide active users panel on small screens to conserve space */
  }
  
  .mission-card {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }
  
  .mission-progress-wrapper {
    align-items: center;
  }
  
  .mission-progress-text {
    text-align: center;
  }
}

/* Default state for elements when not in mobile mode */
.mobile-nav {
  display: none;
}

@media (min-width: 993px) {
  .main-content {
    /* Lock scrolling to the content area on PC */
    height: 100vh;
    overflow-y: auto;
  }
}

/* ==================== GAME IFRAME MODAL STYLES ==================== */
.game-frame-modal {
  background: var(--bg-panel) !important;
  border: 1px solid var(--secondary) !important;
  box-shadow: 0 0 35px var(--secondary-glow) !important;
}

@media (max-width: 768px) {
  .game-frame-modal iframe {
    height: 400px !important;
  }
}

/* ==================== GAME PERFORMANCE OPTIMIZATION OVERRIDES ==================== */
/* Disable expensive blur filters and floating animations on the game modal to maximize rendering performance */
#modal-game-frame {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#modal-game-frame .game-frame-modal {
  animation: none !important; /* Disable floating animation to avoid constant repaint cycles */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Fullscreen Game mode overrides for ultimate performance and dedicated page experience */
#modal-game-frame.fullscreen-active {
  position: fixed !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: #000 !important;
  z-index: 99999 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: stretch !important;
  align-items: stretch !important;
  opacity: 1 !important;
  pointer-events: all !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#modal-game-frame.fullscreen-active .game-frame-modal {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #000 !important;
  animation: none !important;
}

#modal-game-frame.fullscreen-active .game-frame-modal > div:last-child {
  flex-grow: 1 !important;
  height: 100% !important;
}

#modal-game-frame.fullscreen-active iframe {
  height: 100% !important;
  width: 100% !important;
}

/* Shop & Consignment Market Responsive Sizing */
@media (max-width: 768px) {
  .shop-grid {
    grid-template-columns: 1fr !important;
  }
  .consignment-mgr-grid {
    grid-template-columns: 1fr !important;
  }
  #tab-shop .glass {
    height: auto !important;
    min-height: 350px;
  }
}
