:root {
  --solana-purple: #9945FF;
  --solana-green: #14F195;
  --gold: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.3);
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --dark-bg: #0f172a;
  --panel-bg: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.3); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--solana-purple); }

* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
body { 
  width: 100vw; 
  height: 100vh; 
  overflow: hidden; 
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.85) 0%, rgba(2, 6, 23, 0.98) 100%), url('../background.jpg') center center / cover no-repeat; 
  font-family: 'Roboto', sans-serif; 
  color: var(--text-primary); 
  display: flex; 
}
h1, h2, h3, h4 { font-family: 'Cinzel', serif; letter-spacing: 0.05em; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

/* Buttons */
.btn-large { 
  padding: 14px 24px; 
  background: linear-gradient(135deg, #2563eb, #1d4ed8); 
  color: #fff; 
  border: 1px solid rgba(255,255,255,0.1); 
  border-radius: 12px; 
  font-weight: bold; 
  cursor: pointer; 
  font-size: 15px; 
  width: 100%; 
  margin-bottom: 12px; 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s;
  will-change: transform;
}
.btn-large:hover:not(:disabled) { 
  transform: translateY(-2px); 
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255,255,255,0.2); 
  filter: brightness(1.1);
}
.btn-large:active:not(:disabled) { transform: translateY(1px); }
.btn-large:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-large.green { background: linear-gradient(135deg, #10b981, #047857); }
.btn-large.green:hover:not(:disabled) { box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3); }
.btn-large.purple { background: linear-gradient(135deg, var(--solana-purple), #6d28d9); }
.btn-large.purple:hover:not(:disabled) { box-shadow: 0 10px 15px -3px rgba(153, 69, 255, 0.3); }
.btn-large.red { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.btn-large.red:hover:not(:disabled) { box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3); }

/* Premium Input Fields */
.input-field { 
  width: 100%; 
  padding-top: 14px !important; 
  padding-bottom: 14px !important; 
  font-size: 14.5px; 
  margin-bottom: 12px; 
  text-align: center; 
  background: rgba(0, 0, 0, 0.25); 
  border: 1px solid rgba(255, 255, 255, 0.08); 
  color: #fff;
  border-radius: 12px; 
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.input-field:focus {
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.4);
  outline: none;
  box-shadow: 0 0 0 1px var(--gold), inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Modals System Overlay (Base styles for simple modals like Monpoly, Create Room) */
.modal-overlay { 
  position: fixed; 
  inset: 0; 
  background: rgba(2, 6, 23, 0.75); 
  backdrop-filter: blur(12px); 
  -webkit-backdrop-filter: blur(12px); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  z-index: 300; 
}
.modal-box { 
  background: rgba(15, 23, 42, 0.75) !important; 
  backdrop-filter: blur(24px) !important; 
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important; 
  border-radius: 24px !important; 
  padding: 35px 30px !important; 
  width: 440px; 
  text-align: center; 
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255,255,255,0.1) !important; 
  max-height: 85vh; 
  overflow-y: auto; 
}
.modal-box h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: none;
  margin-bottom: 24px;
}
.modal-box label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 900; text-transform: uppercase; color: var(--text-secondary); margin-top: 14px; text-align: left; letter-spacing: 0.05em; }

/* Special Form Toggles (e.g. Play Modes) */
.resource-select-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.resource-select-btn {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-secondary);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.resource-select-btn:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.2); color: #fff; transform: translateY(-1px); }
.resource-select-btn.selected {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}
.resource-select-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.resource-select-btn.wood { background: rgba(19, 94, 38, 0.1); color: #72d98d; }
.resource-select-btn.brick { background: rgba(191, 78, 40, 0.1); color: #e07050; }
.resource-select-btn.sheep { background: rgba(128, 194, 52, 0.1); color: #bdf27c; }
.resource-select-btn.grain { background: rgba(245, 179, 39, 0.1); color: #ffd54f; }
.resource-select-btn.ore { background: rgba(84, 110, 122, 0.1); color: #90a4ae; }

/* =========================================
   MODERN UI UPGRADES (REWORKED MODALS)
   ========================================= */

#browser-menu { position: fixed; inset: 0; background: rgba(2, 6, 23, 0.75); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 250; display: none; justify-content: center; align-items: center; }

/* Overriding Base Modal for a sleeker look */
.modal-box.modern-modal, .browser-container.modern-modal {
  background: rgba(13, 17, 28, 0.9) !important; /* Deep dark crisp background */
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 20px !important;
  padding: 0 !important; /* Managed individually via header/bodies */
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  display: flex;
  flex-direction: column;
}

.browser-container { width: 820px; max-width: 95%; max-height: 85%; position: relative; }

.modern-modal-header {
  padding: 24px 30px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: rgba(0,0,0,0.2);
}
.modern-modal-header.borderless { border-bottom: none; background: transparent; padding-bottom: 10px; }
.modern-modal-header h2 { margin: 0; font-size: 22px; color: #fff; text-shadow: none; }

.modern-close-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: var(--text-secondary);
  width: 32px; height: 32px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.modern-close-btn:hover { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }

/* Forms & Text */
.form-row { margin-bottom: 16px; text-align: left; }
.form-row.flex-row { display: flex; gap: 14px; }
.modern-textarea { resize: none; text-align: left !important; font-size: 14px !important; }
.modern-success-text { color: var(--solana-green); font-size: 13px; font-weight: bold; margin-bottom: 10px; min-height: 18px; text-align: center; }
.muted-label { text-transform: none; font-size: 10px; opacity: 0.6; letter-spacing: normal; font-weight: normal; }
.accent-label { color: var(--gold) !important; }
.accent-label span { color: #f59e0b; opacity:0.8; text-transform:none; letter-spacing:normal; }
.input-field.accent-input { border-color: var(--gold); }
.modern-eye-btn { position:absolute; right:14px; top:50%; transform:translateY(-50%); background:none; border:none; cursor:pointer; color:var(--text-secondary); font-size:18px; outline:none; transition: color 0.2s; }
.modern-eye-btn:hover { color: #fff; }

/* Custom Segmented Control (Tabs/Radios) */
.modern-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.modern-tabs.inline-form { width: 100%; border-radius: 10px; padding: 4px; }
.modern-tab {
  flex: 1; padding: 10px; margin: 0; text-align: center; font-weight: bold; font-size: 13.5px;
  color: var(--text-secondary); border: none; background: transparent; cursor: pointer;
  border-radius: 8px; font-family: 'Cinzel', serif; letter-spacing: 0.02em; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.modern-tab.active { background: rgba(255, 255, 255, 0.1); color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

/* Edit Profile Split Panel layout */
.modern-modal-split { display: flex; flex: 1; overflow: hidden; min-height: 480px; }
.modern-modal-col { overflow-y: auto; padding: 24px 30px; }
.modern-modal-col.left { flex: 2; min-width: 0; }
.modern-modal-col.right { flex: 1.1; background: rgba(0, 0, 0, 0.2); border-left: 1px solid rgba(255,255,255,0.06); padding: 24px; display: flex; flex-direction: column; gap: 20px;}

/* Social Pane Lists inside settings */
.side-panel-title { margin:0; color:#fff; font-size:16px; display:flex; align-items:center; gap:8px;}
.side-panel-section label { border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 8px; margin-bottom: 8px; display: block; color: var(--gold); font-size: 10px; }
.side-list { max-height: 160px; overflow-y: auto; padding-right: 5px; }

/* Modern Tables */
.modern-table-container { padding: 0 30px; }
.modern-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.modern-table th { text-align: left; padding: 12px 14px; font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--text-secondary); opacity: 0.8; letter-spacing: 0.1em; font-family: 'Cinzel', serif;}
.modern-table td { padding: 14px; font-size: 14px; color: #fff; background: rgba(255,255,255,0.02); border-top: 1px solid rgba(255,255,255,0.04); border-bottom: 1px solid rgba(255,255,255,0.04); transition: background 0.2s; cursor: pointer;}
.modern-table td:first-child { border-left: 1px solid rgba(255,255,255,0.04); border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.modern-table td:last-child { border-right: 1px solid rgba(255,255,255,0.04); border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
.modern-table tr:hover td { background: rgba(255,255,255,0.045); }
.modern-table tr.selected td { background: rgba(212, 175, 55, 0.1); border-color: var(--gold); border-bottom-color: var(--gold); border-top-color: var(--gold); }
.empty-state { text-align: center; color: var(--text-secondary); font-style: italic; opacity: 0.7; padding: 30px !important; background: transparent !important; border:none !important; }
.p-icon { display: inline-block; width: 18px; font-size: 13px; text-align: center; margin-right: 2px; }
.p-icon.empty { opacity: 0.15; }
.p-icon.filled { filter: drop-shadow(0 0 2px rgba(255,255,255,0.3)); }

/* Public Profile Clean Stat Cards */
.pub-modal { padding: 40px !important; }
.pub-avatar-display { font-size: 72px; margin: 0 auto 12px; display: inline-block; filter: drop-shadow(0 8px 12px rgba(0,0,0,0.5)); }
.pub-username-display { margin-bottom: 4px; font-size: 26px; font-weight: 900; }
.pub-desc-display { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; font-style: normal; opacity:0.8;}
.pub-wallet-display { font-size: 12px; color: var(--text-secondary); font-family: monospace; background: rgba(0,0,0,0.2); border:1px solid rgba(255,255,255,0.08); display: inline-block; padding: 6px 14px; border-radius: 20px; margin-bottom: 30px;}
.pub-stats-row { display: flex; gap: 12px; margin-bottom: 30px; }
.pub-stat { flex: 1; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); padding: 16px; border-radius: 14px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.2); }
.stat-val { font-size: 22px; font-weight: 900; margin-bottom: 2px; }
.stat-label { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; font-family:'Cinzel',serif; letter-spacing: 0.05em; font-weight:bold; }
.text-green { color: var(--solana-green); } .text-red { color: #f87171; } .text-gold { color: var(--gold); }

/* Browser layout fixes */
.browser-header { padding: 30px 40px 10px; background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent); text-align: center;}
.browser-header h2 { margin: 0 0 20px; color: #fff; font-size: 26px; font-family: 'Cinzel', serif;}
.browser-content { padding: 0 40px 20px; flex: 1; overflow-y: auto;}
.modern-footer { padding: 24px 40px; background: rgba(0, 0, 0, 0.25); border-top: 1px solid rgba(255,255,255,0.05); display: flex; gap: 15px; }
.modern-btn-outline { flex:1; padding:14px; background: rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.1); border-radius:12px; color:#fff; font-weight:bold; cursor:pointer; transition: all 0.2s; font-size: 15px;}
.modern-btn-outline:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.25); }
.modern-btn-primary { flex:1; padding:14px; background: linear-gradient(135deg, #10b981, #047857); border:none; box-shadow:0 6px 12px rgba(16,185,129,0.2); border-radius:12px; color:#fff; font-weight:bold; cursor:pointer; transition: all 0.2s; font-size: 15px;}
.modern-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 15px rgba(16,185,129,0.35); }

/* General Feedback layout fixing inside modals */
#feedback-modal .modal-box { padding: 40px !important; }
.admin-feedback-grid { margin: 0 30px 20px; max-height: 380px; overflow-y:auto; text-align:left; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; padding: 14px;}
.admin-fb-item { padding: 12px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.04); border-radius: 8px; margin-bottom: 8px;}

/* Reusable elegant scroll */
.scroll-styled::-webkit-scrollbar { width: 6px; }
.scroll-styled::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 8px;}
.scroll-styled::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 8px; }
.scroll-styled::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }


/* =========================================
   AUTHENTICATION DASHBOARD 
   ========================================= */
/* Dashboard Pointers & Layout Overrides */
#main-menu { position: absolute; inset: 0; background: transparent; display: flex; align-items: center; justify-content: center; z-index: 200; pointer-events: none; }
#main-menu .dashboard-wrapper {
  pointer-events: auto; /* Highly critical so dashboard buttons register */
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Authentication Modal */
#auth-screen { 
  position: absolute; inset: 0; background: transparent;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  z-index: 300; pointer-events: none;
  padding: 90px 0 60px;
}
.auth-box { 
  pointer-events: auto; text-align: center; background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid rgba(255, 255, 255, 0.08); padding: 45px 40px; border-radius: 24px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255,255,255,0.1); width: 440px; max-width: 95%; 
}
.auth-box h1 { background: linear-gradient(135deg, #fff 0%, var(--gold) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-size: 34px; font-weight: 900; margin-bottom: 6px; }
.auth-box .subtitle { color: var(--text-secondary); margin-bottom: 24px; font-size: 14px; }

/* Submenus (Tabs inside modaks / auths) */
.auth-tabs { display: flex; background: rgba(0, 0, 0, 0.25); border-radius: 12px; padding: 4px; border: 1px solid rgba(255, 255, 255, 0.05); margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 10px 12px; cursor: pointer; font-weight: bold; color: var(--text-secondary); font-size: 13.5px; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 8px; font-family: 'Cinzel', serif; letter-spacing: 0.05em; border: none; }
.auth-tab.active { background: rgba(255,255,255,0.1); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.auth-error { color: #f87171; font-size: 13px; margin-bottom: 12px; min-height: 18px; font-weight: bold; }


/* =========================================
   GAME LOBBY DETAILS
   ========================================= */
#lobby-menu { position: absolute; inset: 0; background: var(--dark-bg); z-index: 200; display: none; color: #fff; overflow: hidden; justify-content: center; }
.lobby-wrapper { display: flex; width: 100%; height: 100%; max-width: 1500px; }
.lobby-left { width: 320px; display: flex; flex-direction: column; background: rgba(19, 27, 46, 0.8); backdrop-filter: blur(10px); padding: 25px 20px; gap: 20px; border-right: 1px solid var(--glass-border); overflow-y: auto; }
.lobby-center { flex: 1; display: flex; flex-direction: column; padding: 25px 40px; gap: 20px; position: relative; overflow-y: auto; background: var(--dark-bg); }
.lobby-right { width: 340px; display: flex; flex-direction: column; background: rgba(19, 27, 46, 0.8); backdrop-filter: blur(10px); padding: 25px 20px; border-left: 1px solid var(--glass-border); }

.lobby-sec-title { text-align: center; font-size: 18px; font-weight: bold; margin-bottom: 15px; color: var(--gold); }
.player-slot { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--glass-border); border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 12px; position: relative; margin-bottom: 10px; transition: transform 0.2s; }
.player-slot:hover { transform: translateY(-2px); background: rgba(255,255,255,0.05); }
.p-avatar { width: 44px; height: 44px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--glass-border); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #333; }
.p-info { flex: 1; font-size: 11px; }
.p-name { font-weight: bold; font-size: 14px; margin-bottom: 2px; }
.p-name.clickable:hover { color: var(--solana-purple) !important; }
.p-status { position: absolute; bottom: 12px; right: 12px; font-size: 10px; letter-spacing: 0.1em; font-weight: 900; color: var(--solana-green); background: rgba(20, 241, 149, 0.15); padding: 2px 6px; border-radius: 4px; }
.btn-kick { position: absolute; top: 8px; right: 8px; background: #ef4444; color: white; border: none; font-size: 9px; font-weight: bold; padding: 2px 6px; border-radius: 4px; cursor: pointer; }
.btn-add-bot { background: rgba(255, 255, 255, 0.05); border: 1px dashed rgba(255, 255, 255, 0.15); color: var(--text-secondary); padding: 12px; border-radius: 8px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; width: 100%; transition: all 0.2s; }
.btn-add-bot:hover:not(.disabled) { background: rgba(255, 255, 255, 0.08); border-color: #fff; color: #fff; }
.btn-add-bot.disabled { opacity: 0.3; cursor: not-allowed; }

.lobby-header { display: flex; justify-content: center; align-items: center; position: relative; margin-bottom: 5px; }
.lobby-header h2 { font-size: 26px; font-weight: bold; color: #fff; }
.btn-close-lobby { position: absolute; right: 0; top: 0; background: none; border: none; color: var(--text-secondary); font-size: 24px; cursor: pointer; transition: color 0.15s; }
.btn-close-lobby:hover { color: #fff; }

.lobby-box { background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 4px 15px rgba(0,0,0,0.15); width: 100%; }
.box-title { font-weight: bold; margin-bottom: 14px; font-size: 14px; text-transform: uppercase; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; letter-spacing: 0.05em; }
.box-title i { background: rgba(255,255,255,0.08); width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-style: normal; }
.invite-row { display: flex; width: 100%; max-width: 500px; gap: 8px; }
.invite-row input { flex: 1; padding: 12px 14px; border: 1px solid var(--glass-border); border-radius: 10px; background: rgba(0, 0, 0, 0.3); color: white; font-size: 13px; outline: none; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
.btn-copy { background: var(--solana-purple); color: white; border: none; padding: 0 20px; font-weight: bold; border-radius: 10px; cursor: pointer; transition: all 0.2s; }
.btn-copy:hover { filter: brightness(1.1); }
.map-grid { display: flex; gap: 12px; width: 100%; overflow-x: auto; padding-bottom: 5px; justify-content: center; }
.map-item { width: 105px; height: 105px; background: rgba(255,255,255,0.02); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; border: 1.5px solid rgba(255,255,255,0.1); position: relative; font-size: 11px; gap: 8px; transition: all 0.2s; box-shadow: inset 0 0 10px rgba(0,0,0,0.2); }
.map-item.active { background: rgba(153, 69, 255, 0.08); border-color: var(--solana-purple); box-shadow: 0 0 15px rgba(153, 69, 255, 0.2); color: #fff; }
.map-item.locked { opacity: 0.35; cursor: not-allowed; }
.map-icon { font-size: 28px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); }
.map-lock { position: absolute; right: 8px; bottom: 8px; font-size: 10px; }
.rules-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; }
.rule-item { background: rgba(255,255,255,0.02); border: 1.5px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 15px 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; text-align: center; font-size: 11px; gap: 8px; transition: all 0.2s; }
.rule-item.active { background: rgba(153, 69, 255, 0.1); border-color: var(--solana-purple); color: #fff; box-shadow: inset 0 0 10px rgba(153, 69, 255, 0.15); }
.rule-item.locked { opacity: 0.35; cursor: not-allowed; }
.rule-item.outline-red { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.05); }
.rule-icon { font-size: 24px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.settings-row { display: flex; gap: 15px; width: 100%; }
.setting-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: bold; font-size: 13px; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: 16px; padding: 18px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
.stepper { display: flex; align-items: center; gap: 24px; font-size: 15px; background: rgba(0,0,0,0.3); padding: 4px 14px; border-radius: 30px; border: 1px solid var(--glass-border); }
.stepper span { cursor: pointer; user-select: none; font-weight: bold; padding: 0 5px; opacity: 0.8; font-size: 20px; color: var(--gold); transition: opacity 0.15s; }
.stepper span:hover { opacity: 1; }

.btn-start-game { background: linear-gradient(135deg, #10b981, #047857); color: white; border: none; padding: 16px 50px; border-radius: 12px; font-weight: bold; font-size: 18px; cursor: pointer; margin: 10px auto 0; display: block; box-shadow: 0 10px 15px -3px rgba(16,185,129,0.3); transition: all 0.2s; }
.btn-start-game:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn-start-game:active { transform: translateY(1px); }

/* =========================================
   GAME BOARD & MATCH UI
   ========================================= */
#app { display: none; width: 100%; height: 100%; flex-direction: row; background: radial-gradient(ellipse at center, #1565c0 0%, #0d47a1 40%, #0a2f6e 100%); }
.left-nav { width: 55px; background: #0f172a; display: flex; flex-direction: column; align-items: center; padding-top: 15px; gap: 15px; border-right: 1px solid var(--glass-border); }
.nav-icon { width: 34px; height: 34px; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); border-radius: 8px; cursor: pointer; color: white; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; text-decoration: none; transition: all 0.2s; }
.nav-icon:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); }
.center-col { flex: 1; display: flex; flex-direction: column; position: relative; min-width: 0; }
.canvas-container { flex: 1; display: flex; align-items: stretch; justify-content: stretch; position: relative; min-height: 0; overflow: hidden; padding: 0; }
#board-canvas { display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }

.dice-overlay { position: absolute; bottom: 30px; right: 30px; display: flex; gap: 15px; background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(8px); border: 1.5px solid var(--glass-border); padding: 15px; border-radius: 18px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5); z-index: 15; cursor: pointer; transition: all 0.2s ease; }
.dice-overlay:hover { transform: scale(1.05); border-color: rgba(255,255,255,0.2); }
.die { width: 58px; height: 58px; background: radial-gradient(circle at 30% 30%, #ffffff, #eaeaea 60%, #cccccc 100%); border-radius: 14px; box-shadow: 0 6px 10px rgba(0,0,0,0.3), inset -3px -3px 6px rgba(0,0,0,0.25), inset 2px 2px 4px rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.rolling-anim { animation: shake 0.1s infinite; }
@keyframes shake { 0% { transform: translate(1px, 1px) rotate(0deg); } 20% { transform: translate(-1px, -2px) rotate(-6deg); } 40% { transform: translate(-3px, 0px) rotate(6deg); } 60% { transform: translate(2px, 1px) rotate(0deg); } 80% { transform: translate(1px, -1px) rotate(6deg); } 100% { transform: translate(-1px, 2px) rotate(-6deg); } }
.roll-prompt { position: absolute; top: -38px; left: 50%; transform: translateX(-50%); background: var(--solana-green); color: #020617; padding: 6px 14px; border-radius: 12px; font-size: 12px; font-weight: 900; text-transform: uppercase; white-space: nowrap; box-shadow: 0 4px 10px rgba(0,0,0,0.3); pointer-events: none; display: none; animation: pulse-prompt 1.5s infinite; border: 1px solid #fff; }
.roll-prompt::after { content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); border-width: 6px 6px 0 6px; border-style: solid; border-color: #fff transparent transparent transparent; }
@keyframes pulse-prompt { 0% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.08); } 100% { transform: translateX(-50%) scale(1); } }
.room-overlay { position: absolute; top: 15px; left: 15px; background: rgba(15, 23, 42, 0.85); border: 1.5px solid var(--glass-border); color: #fff; padding: 8px 16px; border-radius: 10px; font-weight: bold; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3); z-index: 5; font-family: 'Cinzel', serif; letter-spacing: 0.05em; }

#trade-panel { display: none; position: absolute; bottom: 15px; left: 15px; width: 350px; background: rgba(244, 241, 224, 0.98); border: 2.5px solid var(--gold); border-radius: 16px; z-index: 30; flex-direction: column; box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.tp-top-bar { display: flex; padding: 10px; gap: 8px; border-bottom: 2px solid var(--gold); background: rgba(228, 222, 199, 0.9); border-radius: 13px 13px 0 0; }
.tp-res-btn { flex: 1; height: 48px; border: 1px solid rgba(0,0,0,0.2); border-radius: 8px; cursor: pointer; font-size: 24px; transition: transform 0.1s; position: relative; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.1); }
.tp-res-btn:active { transform: scale(0.95); }
.tp-res-btn.wood { background: #135e26; } .tp-res-btn.brick { background: #bf4e28; } .tp-res-btn.sheep { background: #80c234; } .tp-res-btn.grain { background: #f5b327; } .tp-res-btn.ore { background: #546e7a; }
.port-rate-badge { position: absolute; top: -6px; right: -6px; background: #020617; color: #fff; font-size: 9px; padding: 2px 5px; border-radius: 6px; font-weight: bold; border: 1px solid #fff; z-index: 2; pointer-events: none; display: none; }
.tp-main { display: flex; padding: 10px; gap: 10px; }
.tp-left { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.tp-row { display: flex; align-items: center; gap: 12px; min-height: 60px; border-bottom: 1px solid rgba(0,0,0,0.08); padding-bottom: 8px; }
.tp-row:last-child { border-bottom: none; padding-bottom: 0; }
.tp-icon-col { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 20px; font-weight: bold; width: 35px; line-height: 1.2; color: #334155; }
.tp-cards { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.tp-mini-card { width: 38px; height: 52px; border-radius: 6px; border: 1px solid #1e293b; position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 22px; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.25), 0 3px 5px rgba(0,0,0,0.15); transition: transform 0.1s; }
.tp-mini-card:active { transform: scale(0.95); }
.tp-mini-card.wood { background: #135e26; }  .tp-mini-card.brick { background: #bf4e28; } .tp-mini-card.sheep { background: #80c234; } .tp-mini-card.grain { background: #f5b327; } .tp-mini-card.ore { background: #546e7a; }
.tp-badge { position: absolute; top: -7px; right: -7px; background: var(--solana-purple); color: #fff; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: bold; border: 1.5px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.tp-right { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; width: 110px; }
.tp-btn { border-radius: 10px; border: 2px solid #fff; box-shadow: 0 4px 6px rgba(0,0,0,0.15); display: flex; align-items: center; justify-content: center; font-size: 28px; cursor: pointer; position: relative; background: #9bd6e6; transition: all 0.15s; }
.tp-btn.active { background: #47a6bd; color: white; }
.tp-btn.active::after { content: '✔'; position: absolute; top: -6px; right: -6px; font-size: 10px; background: var(--solana-green); color: #000; border-radius: 50%; padding: 2px 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); font-weight: bold; }
.tp-action { font-size: 26px; font-weight: bold; }
.tp-action.tp-cancel { background: #fee2e2; border: 2.5px solid #fca5a5; color: #dc2626; }
.tp-action.tp-confirm { background: #d1fae5; border: 2.5px solid #6ee7b7; color: #059669; }
.tp-action:active { transform: scale(0.95); }

/* ── atp-outer: positions the entire trade column (trade panel + counter section) ── */

Based on the image and your code, there are two distinct UI layout bugs causing the trade panel to look weird on mobile:
Overlapping Trade Panels: The top portions of the red, yellow, and green resource buttons from the normal #trade-panel are poking out from behind the #active-trade-panel. This happens because both panels share the exact same bottom positioning on mobile, and they are both open at the same time.
Status Tooltip Blockage: The "BOT B (BOT)'S TURN" bubble is the .status-text wrapper, which has been dynamically repositioned by your mobile patches to sit near the middle of the screen. Because of its z-index, it's overlapping the active trade header and forcing the avatars to wrap onto a second line.
Here are the fixes to resolve these issues.
1. Update the CSS
Increase the z-index of the active trade panel and add a rule to hide the status tooltip while the active trade is open.
code
CSS
/* Find #atp-outer and update its z-index from 50 to 200 */
body.active-trade-open .status-wrapper { display: none !important; }

#atp-outer { display: none; position: absolute; top: 15px; right: 15px; width: 440px; z-index: 200; flex-direction: column; gap: 8px; }
#active-trade-panel { display: flex; position: static; width: 100%; background: rgba(244, 241, 224, 0.98); border: 3px solid var(--gold); border-radius: 16px; flex-direction: column; box-shadow: 0 25px 45px rgba(0,0,0,0.5); }
/* Counter-offers: own card, separate from the trade panel card above */
#atp-counter-section { background: rgba(244, 241, 224, 0.98); border: 2.5px solid rgba(245,158,11,0.7); border-radius: 14px; padding: 8px 10px; flex-direction: column; gap: 6px; box-shadow: 0 10px 25px rgba(0,0,0,0.35); }
.atp-header { display: flex; padding: 10px; border-bottom: 2.5px solid var(--gold); background: rgba(228, 222, 199, 0.9); border-radius: 13px 13px 0 0; flex-direction: column; gap: 0; }
.atp-player-indicator { width: 38px; height: 38px; border-radius: 50%; border: 2.5px solid #ccc; display: flex; align-items: center; justify-content: center; font-size: 22px; background: #fff; position: relative; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* ── Horizontal player strip inside the trade panel header ── */
.atp-header { display: flex; flex-direction: column; gap: 4px; padding: 10px; align-items: center; border-bottom: 2.5px solid var(--gold); background: rgba(228, 222, 199, 0.9); border-radius: 13px 13px 0 0; }
.atp-pstrip-row { display: flex; align-items: center; gap: 6px; }
.atp-pstrip-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #ccc; display: flex; align-items: center; justify-content: center; font-size: 18px; background: #fff; flex-shrink: 0; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.atp-pstrip-badge { width: 26px; height: 26px; border-radius: 6px; border: 2px solid rgba(0,0,0,0.12); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: bold; flex-shrink: 0; }
.atp-pstrip-pending { background: rgba(100,116,139,0.18); color: #64748b; opacity: 0.7; }
.atp-pstrip-reject  { background: rgba(239,68,68,0.15);   color: #ef4444; }
.atp-pstrip-accept  { background: rgba(16,185,129,0.2);   color: #10b981; border-color: #10b981; }
.atp-pstrip-counter { background: rgba(245,158,11,0.2);   color: #f59e0b; border-color: #f59e0b; }
.atp-pstrip-clickable { cursor: pointer; transform: scale(1.05); }
.atp-pstrip-clickable:hover { transform: scale(1.12); filter: brightness(1.1); }
.atp-pstrip-actions { display: flex; gap: 4px; margin-left: 4px; flex-shrink: 0; }
.atp-pstrip-actions .atp-status-btn { width: 32px; height: 32px; font-size: 14px; border-radius: 7px; }

.atp-main { display: flex; padding: 12px; gap: 12px; }
.atp-left { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.atp-right { display: none; }
.atp-status-btn { width: 42px; height: 42px; border-radius: 8px; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: bold; box-shadow: 0 3px 6px rgba(0,0,0,0.2); transition: transform 0.1s; }
.atp-status-pending { opacity: 0.55; }
.atp-status-rejected { opacity: 0.45; filter: grayscale(60%); }
.atp-status-accepted { opacity: 1; cursor: pointer; border-color: var(--solana-green); transform: scale(1.05); }
.atp-status-accepted:hover { transform: scale(1.1); }
.atp-status-accepted:active { transform: scale(0.95); }
.atp-btn-cancel { background: #0ea5e9; color: #fff; cursor: pointer; }
.atp-btn-accept { background: #10b981; color: #fff; cursor: pointer; }
.atp-btn-reject { background: #ef4444; color: #fff; cursor: pointer; }

.atp-counter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: 10px;
  padding: 6px 8px;
}
.atp-counter-name {
  font-size: 10px;
  font-weight: bold;
  color: #f59e0b;
  white-space: nowrap;
  flex-shrink: 0;
}
.atp-counter-cards {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  flex-wrap: wrap;
}
.atp-counter-label {
  font-size: 9px;
  color: #92400e;
  flex-shrink: 0;
}
.atp-counter-accept {
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.1s;
}
.atp-counter-accept:hover { filter: brightness(1.1); }
.atp-counter-accept:active { transform: scale(0.95); }

#discard-overlay { display: none; position: fixed; inset: 0; background: rgba(2, 6, 23, 0.85); backdrop-filter: blur(8px); z-index: 99999; align-items: center; justify-content: center; }
#discard-overlay.active { display: flex; }
.discard-box { background: rgba(15, 23, 42, 0.95); border: 1.5px solid var(--glass-border); border-radius: 24px; padding: 30px; width: 490px; max-width: 95vw; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8); }
.discard-box h2 { color: #f87171; margin-bottom: 8px; text-align: center; }
.discard-box p { text-align: center; margin-bottom: 20px; color: var(--text-secondary); font-size: 15px; }
.discard-res-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.discard-res-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.discard-res-btn button { width: 54px; height: 64px; border-radius: 8px; border: 1.5px solid rgba(255,255,255,0.15); font-size: 26px; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.25), 0 4px 6px rgba(0,0,0,0.15); transition: transform 0.1s; }
.discard-res-btn button:active { transform: scale(0.95); }
.discard-res-btn .discard-count { font-weight: bold; font-size: 13px; color: #fff; }
.discard-res-btn.wood button { background: #135e26; } .discard-res-btn.brick button { background: #bf4e28; } .discard-res-btn.grain button { background: #f5b327; } .discard-res-btn.sheep button { background: #80c234; } .discard-res-btn.ore button { background: #546e7a; }
.discard-confirm { width: 100%; padding: 14px; background: linear-gradient(135deg, #10b981, #047857); color: #fff; border: none; border-radius: 10px; font-size: 16px; font-weight: bold; cursor: pointer; transition: all 0.2s; }
.discard-confirm:disabled { background: rgba(255,255,255,0.05); color: var(--text-secondary); border: 1px solid var(--glass-border); cursor: not-allowed; }

.bottom-bar { height: 125px; background: rgba(15, 23, 42, 0.98); border-top: 1.5px solid rgba(255,255,255,0.1); display: flex; align-items: center; padding: 12px 20px; gap: 24px; z-index: 5; position: relative; }
.resource-bar { display: flex; gap: 6px; background: rgba(255,255,255,0.03); padding: 5px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); height: 100%; align-items: flex-end; overflow: visible; }
.res-card { flex-shrink: 0; width: 62px; height: 100%; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px 0; color: #fff; font-weight: bold; font-size: 16px; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.25), 0 3px 6px rgba(0,0,0,0.2); cursor: pointer; transform: translateY(0); transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease; will-change: transform; position: relative; z-index: 0; }
.res-card:hover { transform: translateY(-24px); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.25), 0 10px 20px rgba(0,0,0,0.4); z-index: 1; }
.res-card:active { transform: translateY(-16px); }
.res-card span { font-size: 26px; text-shadow: 1px 2px 3px rgba(0,0,0,0.6); }
.res-card.wood { background: linear-gradient(135deg, #288c42, #0b3c17); border: 1px solid rgba(40,140,66,0.4); } 
.res-card.brick { background: linear-gradient(135deg, #e07050, #8d3a1a); border: 1px solid rgba(224,112,80,0.4); }
.res-card.grain { background: linear-gradient(135deg, #ffd54f, #e6940a); border: 1px solid rgba(255,213,79,0.4); } 
.res-card.sheep { background: linear-gradient(135deg, #a0ea4d, #49821a); border: 1px solid rgba(160,234,77,0.4); }
.res-card.ore { background: linear-gradient(135deg, #78909c, #37474f); border: 1px solid rgba(120,144,156,0.4); }

.action-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.status-wrapper { display: flex; align-items: center; gap: 10px; }
.status-text { background: rgba(30, 41, 59, 0.92); color: #fff; padding: 6px 24px; border-radius: 20px; font-weight: bold; font-size: 15px; box-shadow: 0 4px 6px rgba(0,0,0,0.15); border: 1px solid rgba(255,255,255,0.08); font-family: 'Cinzel', serif; letter-spacing: 0.05em; }
.action-buttons { display: flex; gap: 8px; }
.btn-sq { width: 54px; height: 54px; background: #475569; border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; cursor: pointer; font-size: 24px; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s, filter 0.15s; will-change: transform; }
.btn-sq:hover:not(:disabled) { transform: translateY(-3px); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2), 0 6px 10px rgba(0,0,0,0.25); filter: brightness(1.15); }
.btn-sq:active:not(:disabled) { box-shadow: inset 0 0 0 rgba(0,0,0,0); transform: translateY(2px); }
.btn-sq.active-mode { border: 2.5px solid var(--solana-green); box-shadow: 0 0 12px var(--solana-green); background: #334155; }
.btn-sq:disabled { opacity: 0.25; cursor: not-allowed; }
.btn-sq.green { background: linear-gradient(135deg, #10b981, #047857); } .btn-sq.blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); } .btn-sq.red { background: linear-gradient(135deg, #ef4444, #b91c1c); } .btn-sq.purple { background: linear-gradient(135deg, var(--solana-purple), #6d28d9); }

.top-timer { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(10px); border: 1.5px solid var(--glass-border); border-radius: 16px; padding: 8px 24px; box-shadow: 0 12px 25px rgba(0,0,0,0.4); z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 150px; }
.top-timer-text { font-family: monospace; font-size: 30px; font-weight: bold; line-height: 1; text-shadow: 0 0 8px rgba(255,255,255,0.3); }
.top-timer-bar-bg { display: none; }
#turn-timer-bar { height: 100%; background: var(--solana-green); width: 100%; transition: width 1s linear, background-color 0.5s; }
#turn-timer-bar.warning { background: #f59e0b; } #turn-timer-bar.danger { background: #ef4444; }

@keyframes timerBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.15; }
}

.right-col { width: 380px; background: #0f172a; display: flex; flex-direction: column; border-left: 1.5px solid var(--glass-border); z-index: 10; color: #fff; }
.bank-area { background: rgba(19, 27, 46, 0.9); padding: 16px 12px; display: flex; justify-content: center; gap: 8px; border-bottom: 2px solid var(--glass-border); }
.bank-icon { font-size: 28px; display: flex; align-items: center; margin-right: 6px; color: var(--gold); filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4)); }
.bank-card { position: relative; width: 48px; height: 68px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.25), 0 3px 6px rgba(0,0,0,0.3); cursor: pointer; transition: transform 0.15s; }
.bank-card:hover { transform: translateY(-4px); }
.bank-card.wood { background: #135e26; border: 1px solid rgba(19,94,38,0.4); } .bank-card.brick { background: #bf4e28; border: 1px solid rgba(191,78,40,0.4); } .bank-card.grain { background: #f5b327; border: 1px solid rgba(245,179,39,0.4); } .bank-card.sheep { background: #80c234; border: 1px solid rgba(128,194,52,0.4); } .bank-card.ore { background: #546e7a; border: 1px solid rgba(84,110,122,0.4); } .bank-card.dev { background: var(--solana-purple); border: 1px solid rgba(153,69,255,0.3); color: #fff; font-size: 16px; }
.bank-badge { position: absolute; top: -10px; right: -10px; background: #0ea5e9; color: #fff; font-size: 14px; font-weight: bold; padding: 3px 8px; border-radius: 12px; border: 1.5px solid #fff; box-shadow: 0 3px 6px rgba(0,0,0,0.3); pointer-events: none; }
.players-container { padding: 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 2px solid var(--glass-border); }
.player-box { background: rgba(255,255,255,0.02); border-radius: 12px; border: 1.5px solid rgba(255,255,255,0.05); display: flex; padding: 12px; gap: 12px; align-items: center; position: relative; transition: all 0.25s ease; }
.player-box.active-turn { background: rgba(255,255,255,0.05); border-color: #38bdf8; box-shadow: 0 0 15px rgba(56, 189, 248, 0.25); }
.player-box.active-turn::before { content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%); border-width: 8px; border-style: solid; border-color: transparent #38bdf8 transparent transparent; }
.avatar-sec { display: flex; flex-direction: column; align-items: center; width: 70px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: #1e293b; border: 2.5px solid #64748b; display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 4px 6px rgba(0,0,0,0.2); }
.vp-shield { background: #0f172a; border: 1.5px solid var(--glass-border); color: var(--gold); border-radius: 8px; padding: 4px 14px; font-weight: 900; font-size: 18px; margin-top: -12px; z-index: 2; box-shadow: 0 3px 6px rgba(0,0,0,0.4); text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.stats-sec { flex: 1; }
.p-name { font-weight: bold; font-size: 15px; margin-bottom: 6px; display: flex; justify-content: space-between; font-family: 'Cinzel', serif; }
.p-stats { display: flex; gap: 12px; color: var(--text-secondary); flex-wrap: wrap; margin-top: 8px; }
.stat-item { display: flex; align-items: center; gap: 8px; cursor: help; background: rgba(0, 0, 0, 0.25); padding: 5px 12px; border-radius: 8px; font-size: 18px; line-height: 1; }
.stat-item span { font-weight: bold; color: #fff; font-size: 15px; }

.log-panel { flex: 1; background: #090d16; margin: 12px 12px 0 12px; border: 1px solid var(--glass-border); border-radius: 8px; overflow-y: auto; padding: 12px; font-size: 13px; line-height: 1.5; color: #cbd5e1; box-shadow: inset 0 2px 5px rgba(0,0,0,0.5); }
.game-chat-panel { background: #090d16; margin: 8px 12px 12px 12px; border: 1px solid var(--glass-border); border-radius: 8px; display: flex; flex-direction: column; height: 140px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.5); }
.game-chat-log { flex: 1; overflow-y: auto; padding: 8px 12px; font-size: 13px; line-height: 1.4; display: flex; flex-direction: column; gap: 4px; color: #cbd5e1; }
.game-chat-input-row { display: flex; border-top: 1px solid var(--glass-border); background: rgba(15,23,42,0.4); }
.game-chat-input-row input { flex: 1; border: none; background: transparent; padding: 10px 12px; outline: none; font-size: 13px; color: #fff; }
.game-chat-input-row button { background: rgba(255,255,255,0.03); border: none; padding: 0 14px; cursor: pointer; color: #fff; transition: background 0.15s; border-left: 1px solid var(--glass-border); }
.game-chat-input-row button:hover { background: rgba(255,255,255,0.08); }

.dev-card-row { display: flex; justify-content: space-between; align-items: center; background: rgba(0, 0, 0, 0.2); padding: 12px; margin-bottom: 10px; border-radius: 12px; border: 1px solid var(--glass-border); }
.dev-card-info { text-align: left; }
.dev-card-info strong { display: block; font-size: 15px; color: #fff; }
.dev-card-info span { font-size: 12px; color: var(--text-secondary); }
.port-tooltip { position: absolute; pointer-events: none; background: rgba(15, 23, 42, 0.95); border: 1px solid rgba(255,255,255,0.15); color: #fff; padding: 6px 12px; border-radius: 8px; font-size: 12px; white-space: nowrap; z-index: 100; display: none; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3); }

/* =========================================
   SOCIAL: FRIENDS & DM CHAT 
   ========================================= */
#main-friends-panel { margin-top: 18px; background: rgba(255,255,255,0.02); border-radius: 14px; padding: 15px; text-align: left; max-height: 240px; overflow-y: auto; border: 1px solid var(--glass-border); }
#main-friends-panel h4 { font-size: 14px; font-weight: bold; color: var(--gold); margin-bottom: 10px; display: flex; justify-content: space-between; }
.friend-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 13px; }
.friend-row:last-child { border-bottom: none; }
.friend-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.friend-status-dot.online { background: var(--solana-green); box-shadow: 0 0 6px var(--solana-green); }
.friend-status-dot.offline { background: #475569; }
.friend-name-btn { flex: 1; font-weight: bold; color: var(--text-primary); cursor: pointer; background: none; border: none; text-align: left; font-size: 13px; padding: 0; }
.friend-name-btn:hover { text-decoration: underline; color: var(--solana-purple); }
.friend-action-btn { background: var(--solana-purple); color: #fff; border: none; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 11px; font-weight: bold; }
.friend-action-btn:hover { filter: brightness(1.1); }
.friend-action-btn.chat-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); }
.friend-action-btn.chat-btn:hover { background: rgba(255,255,255,0.1); }

#lobby-friends-panel { margin-top: 18px; }
#lobby-friends-panel h3 { font-size: 16px; font-weight: bold; margin-bottom: 12px; text-align: center; color: var(--gold); }
.lobby-friend-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: 8px; margin-bottom: 8px; font-size: 13px; }
.lobby-friend-name { flex: 1; font-weight: bold; color: #fff; }
.lobby-friend-name.offline { color: var(--text-secondary); }
.btn-invite { background: var(--solana-purple); color: #fff; border: none; border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 11px; font-weight: bold; transition: all 0.2s; }
.btn-invite:hover { filter: brightness(1.1); }
.btn-invite:disabled { background: rgba(255,255,255,0.05); color: var(--text-secondary); border: 1px solid var(--glass-border); cursor: default; }

#dm-modal { position: fixed; inset: 0; background: rgba(2, 6, 23, 0.6); display: none; align-items: flex-end; justify-content: flex-end; z-index: 500; padding: 25px; }
#dm-modal.open { display: flex; }
.dm-window { background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px); border: 1.5px solid var(--glass-border); border-radius: 16px; width: 330px; height: 430px; display: flex; flex-direction: column; box-shadow: 0 20px 40px rgba(0,0,0,0.6); overflow: hidden; }
.dm-header { background: rgba(0, 0, 0, 0.4); color: #fff; padding: 14px 18px; display: flex; align-items: center; gap: 10px; font-weight: bold; font-size: 14px; border-bottom: 1px solid var(--glass-border); }
.dm-header span { flex: 1; font-family: 'Roboto', sans-serif; letter-spacing: 0.01em; font-weight: 700; }
.dm-close-btn { background: none; border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; transition: color 0.15s; }
.dm-close-btn:hover { color: #fff; }
.dm-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: transparent; }
.dm-msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4; word-break: break-word; }
.dm-msg.mine { background: var(--solana-purple); color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; }
.dm-msg.theirs { background: rgba(0,0,0,0.4); color: #fff; align-self: flex-start; border-bottom-left-radius: 3px; border: 1px solid var(--glass-border); }
.dm-msg-label { font-size: 10px; color: var(--text-secondary); margin-bottom: 2px; }
.dm-input-row { display: flex; border-top: 1px solid var(--glass-border); background: rgba(0, 0, 0, 0.4); }
.dm-input-row input { flex: 1; border: none; background: transparent; padding: 12px 14px; font-size: 13px; outline: none; color: #fff; }
.dm-input-row button { background: var(--solana-purple); color: #fff; border: none; padding: 0 18px; cursor: pointer; font-size: 15px; }
.dm-input-row button:hover { filter: brightness(1.1); }

.invite-toast { position: fixed; top: 25px; right: 25px; background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); color: #fff; padding: 16px 20px; border-radius: 16px; z-index: 9999; font-size: 14px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5); display: flex; flex-direction: column; gap: 12px; max-width: 300px; }
.invite-toast-btns { display: flex; gap: 8px; }
.invite-toast-btns button { flex: 1; padding: 8px; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 12px; }
.invite-accept { background: linear-gradient(135deg, #10b981, #047857); color: #fff; }
.invite-decline { background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); color: #fff; }

/* =========================================
   TOOLTIPS & FLOATING SOCIAL BAR 
   ========================================= */
.global-header { position: absolute; top: 0; left: 0; width: 100%; display: flex; align-items: center; justify-content: center; z-index: 300; pointer-events: none; }
.header-logo { max-height: 120px; width: auto; pointer-events: auto; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5)); margin-top: 10px; }

#card-hover-tooltip {
  display: none; position: fixed; z-index: 1000; background: rgba(15, 23, 42, 0.96); color: #fff;
  padding: 16px; border-radius: 14px; pointer-events: none; width: 250px; text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6); border: 1px solid rgba(255,255,255,0.12);
  transform: translate(-50%, -100%); margin-top: -15px; backdrop-filter: blur(5px);
}
#card-hover-tooltip.compact { width: 210px; padding: 14px; }
#card-hover-tooltip.compact #cht-icon { font-size: 30px; margin-bottom: 4px; }
#card-hover-tooltip.compact #cht-title { font-size: 15px; margin-bottom: 4px; }
#card-hover-tooltip.compact #cht-desc { font-size: 13px; line-height: 1.4; }
#cht-icon { font-size: 44px; margin-bottom: 8px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); }
#cht-title { font-weight: bold; font-size: 18px; color: var(--gold); margin-bottom: 6px; font-family: 'Cinzel', serif; }
#cht-desc { font-size: 15px; color: var(--text-secondary); line-height: 1.4; }

.social-floating-bar {
  position: fixed; bottom: 20px; right: 20px; display: flex; gap: 12px; z-index: 350; background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1.5px solid var(--glass-border); padding: 10px 14px; border-radius: 30px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4); transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}
.social-floating-bar.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(8px);
}
.social-icon-link { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--glass-border); transition: all 0.2s ease-in-out; }
.social-icon-link svg { width: 18px; height: 18px; fill: var(--text-secondary); transition: fill 0.2s ease, filter 0.2s ease; }
.social-icon-link:hover { background: rgba(153, 69, 255, 0.15); border-color: var(--solana-purple); transform: translateY(-2px); box-shadow: 0 0 10px rgba(153, 69, 255, 0.3); }
.social-icon-link:hover svg { fill: #fff; filter: drop-shadow(0 0 4px var(--solana-purple)); }


/* =========================================
   DASHBOARD / MENU CLASSES 
   ========================================= */
.dashboard-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #fff;
}
.dashboard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dashboard-logo {
  height: 36px;
}
.dashboard-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}
.dashboard-container {
  max-width: 1200px;
  width: 100%;
  margin: 40px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 2fr 1.1fr;
  gap: 30px;
  flex: 1;
}
@media (max-width: 900px) {
  .dashboard-container { grid-template-columns: 1fr; margin: 20px auto; }
  .dashboard-nav { padding: 16px 20px; }
}
.dashboard-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.play-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s;
  border-radius: 20px;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 180px;
  text-align: left;
}
.play-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.play-card-browse {
  background: linear-gradient(135deg, rgba(153, 69, 255, 0.12), rgba(0,0,0,0)), rgba(255,255,255,0.02);
  border: 1px solid rgba(153, 69, 255, 0.3);
}
.play-card-browse:hover {
  background: linear-gradient(135deg, rgba(153, 69, 255, 0.2), rgba(0,0,0,0)), rgba(255,255,255,0.04);
  border-color: rgba(153, 69, 255, 0.6);
}
.play-card-host {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(0,0,0,0)), rgba(255,255,255,0.02);
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.play-card-host:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(0,0,0,0)), rgba(255,255,255,0.04);
  border-color: rgba(59, 130, 246, 0.6);
}
.play-card-icon {
  font-size: 36px;
  margin-bottom: 16px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.play-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  font-family: 'Cinzel', serif;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.play-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.action-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}
.action-icon-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  transform: scale(1.05);
  color: #fff;
}
.action-icon-btn.logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}
.profile-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px 6px 6px;
  border-radius: 30px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.profile-pill:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--gold);
}
.section-title {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}
.section-title i {
  font-style: normal;
  color: var(--gold);
}
.join-wrap { display: flex; gap: 12px; }
.join-input {
  flex: 1;
  background: rgba(0,0,0,0.4) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  padding: 16px 20px !important;
  font-size: 16px !important;
  font-weight: 600;
  letter-spacing: 3px;
  border-radius: 14px !important;
  color: #fff !important;
  text-transform: uppercase;
  outline: none;
  margin-bottom: 0 !important;
  text-align: center;
}
.join-input:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 1px var(--gold);
}
.join-btn {
  padding: 0 36px !important;
  border-radius: 14px !important;
  font-size: 14px !important;
  background: linear-gradient(135deg, #334155, #1e293b) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  font-weight: bold;
  transition: all 0.2s;
  cursor: pointer;
  margin-bottom: 0 !important;
  color: #fff !important;
  width: auto !important;
}
.join-btn:hover { background: rgba(255,255,255,0.1) !important; border-color: rgba(255,255,255,0.25) !important; }

/* Dashboard UI Small Elements */
.add-friend-btn-small {
  width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,0.05); color: var(--text-secondary); border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s;
}
.add-friend-btn-small:hover { background: rgba(255,255,255,0.15); color: #fff; }
.dashboard-friend-input {
  background: rgba(0,0,0,0.3) !important; border: 1px solid rgba(255,255,255,0.1) !important; padding: 12px 14px !important; margin: 0 !important; font-size: 13px !important; flex: 1; border-radius: 10px !important; color: #fff !important; outline: none;
}
.dashboard-friend-input:focus { border-color: rgba(255,255,255,0.2) !important; }
.faq-item-title { font-weight: 600; font-size: 13.5px; color: #e2e8f0; cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; transition: color 0.2s; }
.faq-item-title:hover { color: #fff; }

/* =========================================
   CLEAN & PROFESSIONAL UI REWORK (V2)
   ========================================= */

/* Core Modal Container Rework */
.modal-box.pro-modal, .browser-container.pro-modal {
  background: #0B0F19 !important; /* Deep clean solid background */
  backdrop-filter: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  display: flex;
  flex-direction: column;
}

/* Modal Headers */
.modern-modal-header {
  padding: 24px 32px;
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex; justify-content: space-between; align-items: center;
}
.modern-modal-header h2 {
  margin: 0; font-family: 'Roboto', sans-serif !important;
  font-size: 18px !important; font-weight: 700; color: #fff;
  letter-spacing: 0.02em; text-shadow: none !important;
}

/* Modals Body & Footers */
.pro-modal-footer {
  padding: 20px 32px; background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex; gap: 16px;
}

/* Modern Form Elements */
.pro-form-group { margin-bottom: 20px; text-align: left; }
.pro-label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #64748b; margin-bottom: 8px; font-family: 'Roboto', sans-serif;
}
.pro-muted { text-transform: none; font-weight: normal; font-size: 10px; color: #475569; letter-spacing: normal; }
.pro-accent-label { color: #f59e0b !important; }

.pro-input, .pro-textarea {
  width: 100%; background: #131825 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important; padding: 14px 16px !important;
  color: #f8fafc !important; font-size: 14px !important;
  font-family: 'Roboto', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s !important;
  box-shadow: none !important; margin: 0 !important; text-align: left !important;
}
.pro-input::placeholder, .pro-textarea::placeholder { color: #475569; }
.pro-input:focus, .pro-textarea:focus {
  outline: none; border-color: var(--solana-purple) !important;
  background: #181E2E !important;
}
.pro-textarea { resize: none; line-height: 1.5; }
.pro-eye-btn {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #64748b; font-size: 16px; cursor: pointer; transition: color 0.2s;
}
.pro-eye-btn:hover { color: #fff; }

/* Buttons Custom */
.pro-btn {
  padding: 12px 24px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; border: none; font-family: 'Roboto', sans-serif;
}
.pro-btn-primary {
  background: #10b981; color: #fff; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.pro-btn-primary:hover { background: #059669; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3); }
.pro-btn-outline {
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.15); color: #fff;
}
.pro-btn-outline:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.3); }
.pro-btn-outline.red { color: #f87171; border-color: rgba(248, 113, 113, 0.3); }
.pro-btn-outline.red:hover { background: rgba(248, 113, 113, 0.1); border-color: #f87171; }
.pro-btn-purple {
  background: var(--solana-purple); color: #fff; box-shadow: 0 4px 12px rgba(153, 69, 255, 0.2);
}
.pro-btn-purple:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* Edit Profile Split Layout */
.pro-modal-split { display: flex; width: 100%; min-height: 520px; }
.pro-modal-col.left { flex: 1.2; padding: 32px; overflow-y: auto; }
.pro-modal-col.right {
  flex: 0.8; background: #0E131F; border-left: 1px solid rgba(255,255,255,0.04);
  padding: 32px; display: flex; flex-direction: column; overflow-y: auto;
}
.pro-avatar-row { display: flex; gap: 20px; align-items: center; }
.pro-avatar-edit {
  width: 72px; height: 72px; border-radius: 50%;
  background: #181E2E; border: 1px dashed rgba(255,255,255,0.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; overflow: hidden; transition: border-color 0.2s;
}
.pro-avatar-edit:hover { border-color: var(--gold); border-style: solid; }
.pro-avatar-input {
  position: absolute; inset: 0; width: 100%; height: 100%; background: transparent;
  border: none; text-align: center; font-size: 32px; color: transparent; text-shadow: 0 0 0 #fff;
  cursor: pointer; padding: 0; outline: none; z-index: 2;
}
.pro-avatar-input:focus { outline: none; box-shadow: none; }
.pro-avatar-hint {
  position: absolute; bottom: 8px; font-size: 9px; text-transform: uppercase;
  color: #64748b; font-weight: 700; pointer-events: none;
}

/* Sidebar Social (Profile right panel) */
.pro-sidebar-title { font-size: 14px; font-weight: 700; color: #fff; margin: 0 0 20px; }
.pro-sidebar-section { margin-bottom: 24px; }
.pro-sidebar-header {
  font-size: 10px; font-weight: 700; text-transform: uppercase; color: #64748b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 8px; margin-bottom: 12px; letter-spacing: 0.05em;
}
.pro-side-list { max-height: 200px; padding-right: 8px; }

/* Tabs Rework */
.modern-tabs.pro-tabs {
  background: #131825; padding: 4px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.04);
}
.modern-tabs.pro-tabs.full-width { display: flex; width: 100%; }
.modern-tabs.pro-tabs .modern-tab {
  padding: 10px 20px; font-family: 'Roboto', sans-serif; font-size: 13px; font-weight: 600;
  border-radius: 8px; color: #64748b; letter-spacing: normal; transition: all 0.2s;
}
.modern-tabs.pro-tabs .modern-tab:hover { color: #fff; }
.modern-tabs.pro-tabs .modern-tab.active { background: #1E293B; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }

/* Table Rework (Browser & Transactions) */
.pro-table-container { min-height: 300px; max-height: 500px; }
.pro-table { width: 100%; border-collapse: collapse; text-align: left; }
.pro-table th {
  padding: 16px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #64748b; border-bottom: 1px solid rgba(255,255,255,0.04);
  font-family: 'Roboto', sans-serif;
}
.pro-table td {
  padding: 16px; font-size: 14px; color: #f8fafc; border-bottom: 1px solid rgba(255,255,255,0.02);
  transition: background 0.2s;
}
.pro-table-hover tbody tr:hover td { background: rgba(255,255,255,0.015); cursor: pointer; }
.pro-table-hover tbody tr.selected td { background: rgba(153, 69, 255, 0.08); border-color: rgba(153, 69, 255, 0.2); }
/* Custom Table overrides for nested JS generated content */
.pro-table td.empty-state { padding: 40px !important; font-style: normal; color: #475569; }

/* Public Profile Banner & Grid Card UI */
.pro-pub-modal { position: relative; }
.pro-pub-banner {
  height: 120px; background: linear-gradient(135deg, rgba(153, 69, 255, 0.2), rgba(16, 185, 129, 0.15));
  border-bottom: 1px solid rgba(255,255,255,0.05); position: relative;
}
.pro-pub-content { padding: 0 32px 32px; text-align: center; }
.pro-pub-header { margin-top: -45px; margin-bottom: 24px; }
.pro-pub-avatar {
  font-size: 56px; width: 90px; height: 90px; margin: 0 auto 12px;
  background: #0B0F19; border: 4px solid #0B0F19; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
.pro-pub-username { font-size: 22px; font-weight: 700; margin-bottom: 4px; font-family: 'Roboto', sans-serif !important; }
.pro-pub-wallet {
  display: inline-block; font-size: 11px; font-family: monospace; color: #64748b;
  background: #131825; padding: 6px 12px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.04); margin-bottom: 16px;
}
.pro-pub-desc { font-size: 14px; color: #94a3b8; line-height: 1.5; }

.pro-stats-grid { display: flex; gap: 12px; margin-bottom: 32px; }
.pro-stat-card {
  flex: 1; background: rgba(255,255,255,0.015); border: 1px solid rgba(255,255,255,0.04);
  padding: 16px 12px; border-radius: 12px; text-align: center; transition: transform 0.2s;
}
.pro-stat-card.highlight { background: rgba(212, 175, 55, 0.03); border-color: rgba(212, 175, 55, 0.15); }
.pro-stat-card .stat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #64748b; margin-bottom: 6px; letter-spacing: 0.05em; }
.pro-stat-card .stat-val { font-size: 22px; font-weight: 700; }
.pro-pub-actions { display: flex; justify-content: center; width: 100%; }

/* Admin Feedback List Clean-up */
.pro-admin-grid { max-height: 400px; }
.admin-fb-item {
  background: #131825; border: 1px solid rgba(255,255,255,0.04) !important;
  border-radius: 12px; padding: 16px; margin-bottom: 12px; font-size: 13px; color: #e2e8f0;
}

/* Image Upload & Banner Enhancements */
.pro-cover-banner {
  height: 150px;
  background: linear-gradient(135deg, rgba(153, 69, 255, 0.2), rgba(16, 185, 129, 0.15));
  background-size: cover;
  background-position: center;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.pro-cover-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.pro-cover-banner:hover .pro-cover-overlay { opacity: 1; }
.pro-upload-btn {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3);
  color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 13px; font-weight: bold;
  cursor: pointer; backdrop-filter: blur(4px); transition: background 0.2s;
}
.pro-upload-btn:hover { background: rgba(255,255,255,0.25); }

/* Avatar Overlapping Image Mode */
.pro-avatar-edit.image-mode, .pro-pub-avatar.image-mode {
  width: 90px; height: 90px; border-radius: 50%;
  background-color: #131825; background-size: cover; background-position: center;
  border: 4px solid #0B0F19; /* matches modal bg to look like cutout */
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #fff; cursor: pointer; flex-shrink: 0; margin: 0;
}
.pro-pub-avatar.image-mode { margin: 0 auto 12px; cursor: default; }
.pro-avatar-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; opacity: 0; transition: opacity 0.2s;
}
.pro-avatar-edit.image-mode:hover .pro-avatar-overlay { opacity: 1; }

.pro-modal-col.left, .pro-modal-col.right {
  overflow-y: auto;
}

/* =========================================================
   AUTH PAGE — FAQ section styles
   ========================================================= */
.auth-faq-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
  text-align: left;
  width: 100%;
}
.auth-faq-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  font-family: 'Cinzel', serif;
  display: flex;
  align-items: center;
  gap: 6px;
}
.auth-faq-item {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.auth-faq-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.auth-faq-q {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  padding: 6px 0;
  transition: color 0.2s;
}
.auth-faq-q:hover { color: #fff; }
.auth-faq-q .faq-arrow { font-size: 10px; opacity: 0.5; transition: transform 0.2s; flex-shrink: 0; margin-left: 8px; }
.auth-faq-a {
  display: none;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  padding: 4px 0 8px;
}

/* =========================================================
   MOBILE / RESPONSIVE  —  max-width: 768px
   ========================================================= */
@media (max-width: 768px) {
	

  /* ── Safe-area insets ── */
  :root {
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top:    env(safe-area-inset-top, 0px);
  }

  /* ── 1. PREVENT INPUT ZOOM (iOS/Safari zoom when font-size < 16px) ── */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }

  /* ── Force App to hide scrollbars ── */
  #app { overflow: hidden !important; }
  #app ::-webkit-scrollbar { display: none !important; width: 0 !important; }
  #app * { -ms-overflow-style: none !important; scrollbar-width: none !important; }

  /* ── Auth screen ── */
  #auth-screen {
    overflow-y: auto !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding: 110px 0 40px !important;
    /* Allow scroll so FAQ below auth box is reachable */
    pointer-events: none !important;
  }
  .auth-box {
    width: calc(100vw - 32px) !important;
    max-width: 460px;
    padding: 24px 20px !important;
    pointer-events: auto;
    /* Allow scrolling inside auth-box itself for shorter phones */
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .auth-faq-section { pointer-events: auto; }
  .auth-tabs { gap: 0; }
  .auth-tab { font-size: 13px; padding: 10px 14px; }

  /* ── Dashboard ── */
  .dashboard-wrapper { min-height: 100vh; }
  .dashboard-nav { padding: 12px 16px; gap: 10px; }
  .brand-mark.dashboard-logo { font-size: 2rem !important; }
  .dashboard-profile { gap: 8px; }
  .profile-pill { gap: 8px; padding: 6px 10px; }
  #main-menu-username { font-size: 12px !important; }
  .action-icon-btn { width: 34px; height: 34px; }
  .dashboard-container { grid-template-columns: 1fr !important; padding: 0 16px; gap: 20px; }
  .play-card { min-height: 140px; padding: 20px 18px; }
  .play-card-icon { font-size: 28px; margin-bottom: 10px; }
  .play-card-title { font-size: 17px; }
  #social-floating-bar { bottom: 14px; right: 14px; padding: 8px 12px; gap: 8px; }

  /* ── 2. MODALS — CENTERED DIALOG (not bottom sheet) ── */
  .modal-overlay {
    padding: 16px !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .modal-box,
  .modal-box.modern-modal,
  .browser-container.modern-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 86vh !important;
    border-radius: 18px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: calc(var(--safe-bottom) + 8px) !important;
    margin: 0 !important;
    animation: modalPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  @keyframes modalPop {
    from { transform: scale(0.94) translateY(8px); opacity: 0.5; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
  }

  /* Host/Create room modal */
  #create-room-modal .modal-box { padding-bottom: calc(var(--safe-bottom) + 20px) !important; }
  #create-room-modal .pro-modal-body { overflow: visible !important; }

  /* ── 3. BROWSER MODAL — centered dialog ── */
  #browser-menu {
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
  }
  .browser-container {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 86vh !important;
    border-radius: 18px !important;
    padding-bottom: calc(var(--safe-bottom) + 8px) !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  /* Browser header: title+tabs stacked on left, close button top-right */
  .modern-modal-header.pro-browser-header {
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    padding: 16px 16px 10px !important;
    gap: 0 !important;
    flex-wrap: nowrap;
  }
  .modern-modal-header.pro-browser-header > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    flex: 1; min-width: 0;
  }
  .modern-modal-header.pro-browser-header .modern-close-btn {
    flex-shrink: 0; align-self: flex-start; margin-left: 10px;
  }
  .pro-table-container { min-height: 80px; max-height: 42vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .pro-table th, .pro-table td { font-size: 12px; padding: 10px 10px !important; }
  .pro-table th:first-child, .pro-table td:first-child { padding-left: 14px !important; }
  .pro-table th:last-child, .pro-table td:last-child { padding-right: 14px !important; }
  .pro-modal-footer { padding: 14px 16px; gap: 10px; }

  /* ── 4. PROFILE (Edit) MODAL — reduce dead-space ── */
  .pro-modal-split { flex-direction: column !important; min-height: unset !important; height: auto !important; }
  .pro-modal-col.left,
  .pro-modal-col.right {
    width: 100% !important; max-width: 100%;
    border-left: none !important;
    border-top: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto !important; -webkit-overflow-scrolling: touch !important;
    max-height: none !important;
    padding: 14px 16px !important;
  }
  .pro-cover-banner { height: 90px !important; min-height: 90px !important; flex-shrink: 0; }
  /* Show cover overlay permanently on touch — hover doesn't exist on mobile */
  .pro-cover-overlay { opacity: 1 !important; background: rgba(0,0,0,0.35) !important; }
  /* Make the Change Cover button always readable on mobile */
  .pro-upload-btn { font-size: 12px !important; padding: 8px 14px !important; }
  /* Show avatar camera hint on touch too */
  .pro-avatar-overlay { opacity: 0.85 !important; }
  /* Avatar row is now outside the scroll container — adjust for smaller mobile cover */
  .pro-modal .pro-avatar-edit.image-mode {
    width: 72px !important; height: 72px !important;
    margin-top: 0 !important;
  }
  .pro-modal-col.left h2 { font-size: 15px !important; line-height: 1.2 !important; }
  .pro-form-group { margin-bottom: 14px !important; }

  /* ── Public profile ── */
  .pro-pub-wallet {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; display: block !important; font-size: 10px !important;
  }
  .pro-pub-content { padding: 0 16px calc(var(--safe-bottom) + 16px) !important; }
  .pro-pub-banner { height: 80px !important; }

  /* ── 5. DM WINDOW — smaller, not full screen ── */
  #dm-modal { padding: 16px !important; align-items: center !important; justify-content: center !important; }
  .dm-window {
    width: 100% !important;
    border-radius: 16px !important;
    height: 50vh !important;
    max-height: 50vh !important;
    padding-bottom: var(--safe-bottom);
  }
  .dm-messages { -webkit-overflow-scrolling: touch; }

  /* ── Lobby ── */
  #lobby-menu {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .lobby-wrapper {
    flex-direction: column !important;
    height: auto !important;
    min-height: 100% !important;
    width: 100% !important;
    padding: 0 !important;
  }
  /* Players section: expand fully, never clip internally */
  .lobby-left {
    width: 100% !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
    border-right: none !important;
    border-bottom: 1px solid var(--glass-border);
    padding: 16px !important;
    min-height: 0 !important;
    height: auto !important;
  }
  #lobby-friends-panel { display: none; }
  /* Lobby settings: expand fully */
  .lobby-center {
    width: 100% !important;
    flex: none !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
    padding: 16px !important;
    height: auto !important;
  }
  .lobby-right {
    width: 100% !important;
    flex-shrink: 0 !important;
    border-left: none !important;
    border-top: 1px solid var(--glass-border);
    max-height: 220px;
  }
  .rules-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .map-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .settings-row { flex-direction: column; gap: 10px; }
  .setting-item { flex-direction: row; justify-content: space-between; padding: 12px 16px; }
  .lobby-header { padding: 12px 16px; }
  .lobby-box { margin-bottom: 12px; }

  /* ── Reconnect banner ── */
  #cryptan-reconnect-banner { flex-direction: column; gap: 10px; padding: 14px 16px; text-align: center; }

  /* ── GAME SCREEN ── */
  #app { flex-direction: column !important; height: 100dvh; }
  .left-nav {
    width: 100% !important; height: 38px !important; flex-direction: row !important;
    padding: 0 10px !important; gap: 8px !important; border-right: none !important;
    border-bottom: 1px solid var(--glass-border); justify-content: flex-start; align-items: center;
  }
  .nav-icon { width: 28px; height: 28px; font-size: 13px !important; }
  .mobile-panel-btn { display: none !important; }
  .center-col { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .canvas-container { flex: 1; }
  .right-col { display: none !important; max-height: unset !important; overflow: unset !important; }
  .right-col.mobile-open {
    display: flex !important; flex-direction: column !important; width: 100% !important;
    max-height: 50vh !important; overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important; border-top: 1.5px solid var(--glass-border);
  }

  /* Bottom bar — tight padding, no artificial top gap */
  .bottom-bar {
    height: auto !important; min-height: 0 !important;
    padding: 4px 6px 2px !important; gap: 4px !important;
    flex-wrap: wrap !important; align-items: center !important;
    margin-top: 0 !important;
  }
  .resource-bar {
    height: 54px !important; min-height: 54px !important; max-height: 54px !important;
    align-items: center !important; overflow-x: auto !important;
    -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; flex-shrink: 0;
  }
  .res-card {
    width: 36px !important; min-width: 36px !important;
    height: 48px !important; min-height: 48px !important; max-height: 48px !important;
    font-size: 10px !important; padding: 3px 0 !important;
  }
  .res-card span { font-size: 16px !important; }
  .res-card:hover { transform: none !important; }
  .res-card:active { transform: translateY(-5px) !important; }
  .action-center { width: 100%; gap: 3px; }
  .status-text { font-size: 11px !important; padding: 3px 8px !important; }
  .action-buttons { gap: 3px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .btn-sq { width: 36px !important; height: 36px !important; font-size: 16px !important; border-radius: 8px !important; flex-shrink: 0; }

  /* Timer: inline in top nav bar, no floating, no progress bar */
  .top-timer {
    position: static !important; top: auto !important; left: auto !important;
    transform: none !important; background: transparent !important;
    border: none !important; box-shadow: none !important;
    backdrop-filter: none !important; padding: 0 !important;
    min-width: 0 !important; gap: 2px !important; margin: 0 auto !important;
  }
  .top-timer-text { font-size: 16px !important; text-shadow: none !important; }
  .top-timer-bar-bg { display: none !important; }

  /* dice bottom is set dynamically by mobile-patches.js updateDicePosition() */
  .dice-overlay { right: 6px !important; padding: 10px; gap: 10px; }

  #trade-panel { width: calc(100vw - 20px) !important; left: 10px !important; bottom: 155px !important; right: auto !important; }
#atp-outer { width: calc(100vw - 20px) !important; left: 10px !important; top: auto !important; right: auto !important; bottom: 155px !important; z-index: 200 !important; }
  /* When the counter-accept section is visible, push the whole wrapper up so it clears the bottom bar */
  #atp-outer.has-counter { bottom: 225px !important; }
  #active-trade-panel { width: 100% !important; }
  .tp-right { width: 80px; }
  .tp-btn { font-size: 22px; }

  .discard-box { width: 95vw; padding: 20px; }
  .discard-res-btn button { width: 46px; height: 56px; font-size: 22px; }
  #monopoly-modal .modal-box, #yop-modal .modal-box { padding: 24px 20px !important; }
  /* room-overlay moved into nav bar by mobile-patches.js */
  .room-overlay { position: static !important; top: auto !important; left: auto !important;
    transform: none !important; background: transparent !important; border: none !important;
    box-shadow: none !important; padding: 0 !important; font-size: 11px !important; }
  .port-tooltip { display: none !important; }
  .die { width: 46px; height: 46px; border-radius: 10px; }
  .game-chat-panel { height: 100px !important; min-height: 100px !important; flex-shrink: 0; }
  #transactions-list-container { max-height: 50vh !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch !important; }
}

/* Extra small screens */
@media (max-width: 390px) {
  .btn-sq { width: 34px !important; height: 34px !important; font-size: 15px !important; }
  .action-buttons { gap: 2px; }
  .bottom-bar { padding: 3px 5px !important; }
  .res-card { width: 34px !important; min-width: 34px !important; height: 46px !important; min-height: 46px !important; }
}

/* Prevent iOS double-tap zoom on buttons */
@media (hover: none) and (pointer: coarse) {
  button, .nav-icon, .play-card, .rule-item, .map-item,
  .tp-res-btn, .tp-btn, .bank-card {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  /* btn-sq and res-card use touch-action:auto so double-tap detection works */
  .btn-sq, .res-card {
    -webkit-tap-highlight-color: transparent;
    touch-action: auto;
  }
  .btn-sq:hover:not(:disabled) { transform: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2); }
  .play-card:hover { transform: none; box-shadow: none; }
  .bank-card:hover { transform: none; }
}

/* ── Robber confirm modal: shift up on mobile so it clears the bottom bar ── */
@media (max-width: 768px) {
  #robber-confirm-modal.modal-overlay {
    align-items: center !important;
  }
  #robber-confirm-modal .modal-box {
    margin-bottom: 200px !important;
    margin-top: 0 !important;
  }
}
/* ── Robber victim (choose who to rob) modal: always shift up so it clears
      the action bar at the bottom of the game screen ── */
#robber-victim-modal.modal-overlay {
  align-items: flex-start !important;
  padding-top: 12vh !important;
}
@media (max-width: 768px) {
  #robber-victim-modal.modal-overlay {
    padding-top: 8vh !important;
  }
  #robber-victim-modal .modal-box {
    max-height: 60vh !important;
    overflow-y: auto !important;
  }
}