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

body {
  overflow: hidden;
  background: #1a1a2e;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#ui-layer {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 100;
}

#ui-layer > * { pointer-events: auto; }

/* Loading Screen */
#loading {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: #fff;
  z-index: 1000;
}

#loading h1 {
  font-size: 56px;
  margin-bottom: 10px;
  font-family: 'Cinzel', serif;
  background: linear-gradient(135deg, #c9a227 0%, #f0d060 50%, #c9a227 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#loading .subtitle { font-size: 18px; color: #888; margin-bottom: 40px; }

#loading-bar {
  width: 300px; height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 15px;
}

#loading-progress {
  height: 100%;
  background: linear-gradient(90deg, #c9a227, #f0d060);
  width: 0%;
  transition: width 0.3s;
}

#loading-text { color: #666; font-size: 14px; }

/* HUD */
#hud {
  position: absolute;
  top: 20px; left: 20px;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  user-select: none;
}

#player-count {
  font-size: 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#player-count .dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

#coordinates { font-size: 12px; font-family: monospace; color: #aaa; }
#fps { font-size: 12px; color: #888; margin-top: 4px; }
#time-display { font-size: 12px; color: #ffd54f; margin-top: 4px; }

/* Controls Hint */
#controls-hint {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 10px;
  color: #666;
}

#controls-hint span {
  background: rgba(0,0,0,0.4);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Interaction Prompt */
#interaction-prompt {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
  z-index: 100;
  border: 1px solid #5c4a32;
}

#interaction-prompt.visible {
  display: block;
}

#interaction-prompt .prompt-action {
  color: #ffd700;
  font-weight: bold;
}

#interaction-prompt .prompt-key {
  background: #5c4a32;
  padding: 2px 8px;
  border-radius: 4px;
  margin: 0 4px;
}

/* Minimap */
#minimap {
  position: absolute;
  top: 20px; right: 20px;
  width: 150px; height: 150px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.2);
  overflow: hidden;
}

#minimap-canvas { width: 100%; height: 100%; }

/* Stats Panel - Separated from menu */
#stats-panel {
  position: absolute;
  top: 180px; left: 20px;
  background: linear-gradient(180deg, rgba(40,30,20,0.95) 0%, rgba(30,20,15,0.95) 100%);
  padding: 12px;
  border-radius: 8px;
  color: #fff;
  width: 180px;
  border: 2px solid #5c4a32;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

#hp-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

#hp-bar-bg {
  flex: 1;
  height: 16px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
}

#hp-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(to right, #ff4444, #cc0000);
  transition: width 0.3s;
}

#hp-text {
  font-size: 12px;
  min-width: 45px;
  text-align: right;
}

/* Stamina Bar */
#stamina-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

#stamina-bar-bg {
  flex: 1;
  height: 12px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
}

#stamina-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(to right, #ffd700, #ff8c00);
  transition: width 0.1s;
}

#skills-panel {
  font-size: 11px;
}

.skill-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.skill-row span:first-child {
  text-transform: capitalize;
  color: #aaa;
}

.skill-row span:last-child {
  color: #c9a227;
  font-weight: bold;
}

/* Old Inventory - hidden, using game menu instead */
#inventory {
  display: none;
}

#inventory h3 {
  font-size: 14px;
  margin-bottom: 10px;
  color: #c9a227;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 8px;
}

.inventory-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.inventory-item .name { color: #ccc; }
.inventory-item .count { color: #4ade80; font-weight: bold; }

/* Chat */
#chat-container {
  position: absolute;
  bottom: 20px; left: 20px;
  width: 380px;
}

#chat-log {
  height: 180px;
  overflow-y: auto;
  background: rgba(0,0,0,0.6);
  padding: 12px;
  border-radius: 12px 12px 0 0;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
}

#chat-log::-webkit-scrollbar { width: 6px; }
#chat-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.chat-message { margin: 5px 0; font-size: 13px; line-height: 1.4; }
.chat-message .name { font-weight: bold; margin-right: 6px; }
.chat-message.player .name { color: #c9a227; }
.chat-message.agent .name { color: #ffd54f; }
.chat-message.system { color: #888; font-style: italic; }
.chat-message .text { color: #fff; }

#chat-input-container {
  display: flex;
  background: rgba(0,0,0,0.8);
  border-radius: 0 0 12px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-top: none;
}

#chat-input {
  flex: 1;
  padding: 12px 15px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
  outline: none;
}

#chat-input::placeholder { color: #666; }

#chat-send {
  padding: 12px 20px;
  background: #c9a227;
  border: none;
  color: #000;
  font-weight: bold;
  cursor: pointer;
}

#chat-send:hover { background: #e0b830; }

/* RuneScape-style Game Menu */
#game-menu {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 240px;
  height: 280px;
  background: linear-gradient(180deg, #3d3122 0%, #2a2318 100%);
  border: 2px solid #5c4a32;
  border-radius: 8px;
  font-family: 'Segoe UI', sans-serif;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}

#menu-tabs {
  display: flex;
  background: #2a2318;
  border-bottom: 2px solid #5c4a32;
}

.menu-tab {
  flex: 1;
  padding: 8px 4px;
  border: none;
  background: #3d3122;
  color: #b8a070;
  font-size: 11px;
  cursor: pointer;
  border-right: 1px solid #5c4a32;
  transition: all 0.2s;
}

.menu-tab:last-child {
  border-right: none;
}

.menu-tab:hover {
  background: #4d4032;
  color: #d4c4a0;
}

.menu-tab.active {
  background: #5c4a32;
  color: #ffd700;
}

#menu-content {
  padding: 10px;
  flex: 1;
  overflow-y: auto;
}

.menu-panel {
  display: none;
}

.menu-panel.active {
  display: block;
}

/* Inventory Grid */
#inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}

.inv-slot {
  width: 42px;
  height: 42px;
  background: rgba(0,0,0,0.4);
  border: 1px solid #5c4a32;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #b8a070;
  cursor: pointer;
}

.inv-slot:hover {
  background: rgba(255,255,255,0.1);
  border-color: #ffd700;
}

.inv-slot .item-icon {
  font-size: 16px;
  margin-bottom: 2px;
}

.inv-slot .item-count {
  color: #ffd700;
  font-weight: bold;
}

#coin-display {
  text-align: center;
  color: #ffd700;
  font-size: 12px;
  padding: 5px;
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
}

/* Equipment Panel */
#equipment-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.equip-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: rgba(0,0,0,0.3);
  border: 1px solid #5c4a32;
  border-radius: 4px;
}

.slot-label {
  color: #b8a070;
  font-size: 11px;
}

.slot-item {
  color: #ffd700;
  font-size: 11px;
  font-weight: bold;
}

/* Skills Grid */
#skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.skill-box {
  padding: 6px;
  background: rgba(0,0,0,0.3);
  border: 1px solid #5c4a32;
  border-radius: 2px;
  text-align: center;
}

.skill-box .skill-name {
  color: #b8a070;
  font-size: 9px;
  text-transform: capitalize;
}

.skill-box .skill-level {
  color: #ffd700;
  font-size: 14px;
  font-weight: bold;
}

/* Settings Panel */
.settings-btn {
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;
  background: #4d4032;
  border: 1px solid #5c4a32;
  border-radius: 4px;
  color: #d4c4a0;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-btn:hover {
  background: #5c4a32;
  color: #ffd700;
}

.settings-btn.logout {
  background: #5c3232;
  border-color: #8c4a4a;
}

.settings-btn.logout:hover {
  background: #7c4242;
}

/* Instructions - hidden by default to reduce clutter */
#instructions {
  display: none;
  position: absolute;
  bottom: 20px; right: 180px;
  background: rgba(0,0,0,0.6);
  padding: 12px;
  border-radius: 10px;
  color: #aaa;
  font-size: 11px;
  line-height: 1.8;
}

#instructions strong { color: #c9a227; display: block; margin-bottom: 5px; }
#instructions kbd { background: rgba(255,255,255,0.1); padding: 2px 5px; border-radius: 3px; }

/* Trade Window */
#trade-window {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20,20,30,0.95);
  padding: 25px;
  border-radius: 16px;
  display: none;
  min-width: 320px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
}

#trade-window h3 { color: #c9a227; margin-bottom: 15px; }
#trade-content { color: #fff; margin-bottom: 20px; line-height: 1.6; }
#trade-content .offer, #trade-content .want {
  background: rgba(255,255,255,0.05);
  padding: 10px;
  border-radius: 8px;
  margin: 10px 0;
}

#trade-window .buttons { display: flex; gap: 10px; }

#trade-window button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

#accept-trade { background: #4ade80; color: #000; }
#decline-trade { background: #ff5252; color: #fff; }

/* Customize Window */
#customize-window {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20,20,30,0.95);
  padding: 20px;
  border-radius: 16px;
  display: none;
  min-width: 280px;
}

#customize-window h3 { color: #c9a227; margin-bottom: 15px; }

.color-options { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }

.color-btn {
  width: 36px; height: 36px;
  border: 3px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.color-btn:hover, .color-btn.selected { border-color: #fff; transform: scale(1.1); }

.close-btn {
  width: 100%;
  padding: 10px;
  background: #c9a227;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

/* Auth Modal - Landing Page Style */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&display=swap');

#auth-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #0d0d0d;
  background-image: url('https://www.transparenttextures.com/patterns/dark-leather.png');
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#auth-modal .auth-content {
  background: #1a1a1a;
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  border: 1px solid #333;
}

#auth-modal h1 {
  font-family: 'Cinzel', serif;
  font-size: 42px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #c9a227 0%, #f0d060 50%, #c9a227 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#auth-modal .tagline {
  color: #a0a0a0;
  margin-bottom: 30px;
  font-size: 14px;
}

#auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: #252525;
  padding: 6px;
  border-radius: 8px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: #888;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.2s;
}

.auth-tab:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.auth-tab.active {
  background: #c9a227;
  color: #000;
  font-weight: bold;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.auth-form.active {
  display: flex;
}

.auth-form input {
  padding: 14px 16px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #252525;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.auth-form input:focus {
  border-color: #c9a227;
}

.auth-form input::placeholder {
  color: #666;
}

.auth-form button {
  padding: 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #3ecf8e 0%, #1db777 100%);
  color: #000;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.auth-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(62, 207, 142, 0.3);
}

.auth-error {
  color: #ff6b6b;
  font-size: 13px;
  min-height: 20px;
  margin: 0;
}

.agent-info {
  color: #aaa;
  font-size: 13px;
  margin-bottom: 5px;
}

.agent-result {
  background: #252525;
  padding: 15px;
  border-radius: 8px;
  text-align: left;
  font-family: monospace;
  font-size: 11px;
  color: #c9a227;
  display: none;
  word-break: break-all;
}

.agent-result.show {
  display: block;
}

.agent-docs {
  color: #666;
  font-size: 12px;
  margin-top: 10px;
}

.agent-docs a {
  color: #c9a227;
}

.guest-option {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.guest-option span {
  color: #666;
  font-size: 12px;
}

#guest-play {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: transparent;
  color: #a0a0a0;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

#guest-play:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.guest-note {
  color: #666;
  font-size: 11px;
  margin-top: 8px;
}

/* Name Modal (legacy, hidden) */
#name-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#name-modal .modal-content {
  background: rgba(30,30,50,0.95);
  padding: 30px;
  border-radius: 16px;
  text-align: center;
}

#name-modal h2 { color: #c9a227; margin-bottom: 20px; }

#name-modal input {
  padding: 12px 20px;
  font-size: 16px;
  border: 2px solid #c9a227;
  border-radius: 8px;
  background: rgba(0,0,0,0.3);
  color: #fff;
  outline: none;
  width: 220px;
  text-align: center;
}

#name-modal button {
  margin-top: 15px;
  padding: 12px 40px;
  background: #c9a227;
  border: none;
  border-radius: 8px;
  color: #000;
  font-weight: bold;
  cursor: pointer;
}

/* Click to start */
#click-to-start {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 500;
  cursor: pointer;
}

#click-to-start .content { text-align: center; color: #fff; }
#click-to-start h2 { font-size: 28px; margin-bottom: 10px; }
#click-to-start p { color: #888; }

/* Crosshair */
#crosshair {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 20px; height: 20px;
  pointer-events: none;
  z-index: 50;
  display: none;
}

#crosshair::before, #crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.5);
}

#crosshair::before { width: 2px; height: 100%; left: 50%; transform: translateX(-50%); }
#crosshair::after { width: 100%; height: 2px; top: 50%; transform: translateY(-50%); }

/* Target info */
#target-info {
  position: fixed;
  top: 60%; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  padding: 8px 16px;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  display: none;
  z-index: 50;
}

#target-info.agent { border: 1px solid #ffd54f; }
#target-info.player { border: 1px solid #c9a227; }
#target-info.resource { border: 1px solid #4ade80; }

/* Notification */
#notification {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  display: none;
  z-index: 300;
}

#notification.success { border-left: 4px solid #4ade80; }
#notification.error { border-left: 4px solid #ff5252; }
#notification.info { border-left: 4px solid #c9a227; }

/* Chat Bubbles */
.chat-bubble {
  position: absolute;
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
  max-width: 150px;
  pointer-events: none;
  animation: bubbleFade 4s forwards;
  z-index: 200;
}

.chat-bubble.agent { border: 1px solid #ffd54f; }

@keyframes bubbleFade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* Oxygen Bar */
#oxygen-container {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 20px;
  background: rgba(0,0,0,0.7);
  border-radius: 10px;
  border: 2px solid #5c9fd4;
  overflow: hidden;
  display: none;
  z-index: 150;
}

#oxygen-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #5c9fd4, #3d7ab8);
  transition: width 0.2s;
}

/* Gather Progress */
#gather-progress {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  padding: 15px 25px;
  border-radius: 10px;
  text-align: center;
  display: none;
  z-index: 160;
}

#gather-progress .progress-label {
  color: #fff;
  margin-bottom: 10px;
  font-size: 14px;
}

#gather-progress .progress-bar {
  width: 200px;
  height: 12px;
  background: #333;
  border-radius: 6px;
  overflow: hidden;
}

#gather-progress .progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd700, #ff8c00);
  transition: width 0.1s;
}

/* Shop Window */
#shop-window {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, rgba(40,30,20,0.98) 0%, rgba(30,20,15,0.98) 100%);
  padding: 24px;
  border-radius: 12px;
  display: none;
  min-width: 380px;
  max-width: 450px;
  max-height: 80vh;
  overflow-y: auto;
  border: 2px solid #5c4a32;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  z-index: 500;
}

#shop-window h3 { 
  color: #ffd700; 
  margin-bottom: 12px; 
  font-size: 20px;
  text-align: center;
  border-bottom: 1px solid #5c4a32;
  padding-bottom: 10px;
}

#shop-coins {
  color: #ffd700;
  font-size: 14px;
  margin-bottom: 15px;
  padding: 8px;
  background: rgba(255,215,0,0.1);
  border-radius: 8px;
}

#shop-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.shop-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
}

.shop-item:hover {
  background: rgba(255,255,255,0.1);
}

.shop-item-info {
  flex: 1;
}

.shop-item-name {
  color: #fff;
  font-weight: bold;
  font-size: 13px;
}

.shop-item-desc {
  color: #888;
  font-size: 11px;
  margin-top: 2px;
}

.shop-item-price {
  color: #ffd700;
  font-size: 12px;
  margin-right: 10px;
}

.shop-item button {
  padding: 8px 16px;
  background: linear-gradient(135deg, #3ecf8e 0%, #1db777 100%);
  border: none;
  border-radius: 6px;
  color: #000;
  font-weight: bold;
  cursor: pointer;
  font-size: 11px;
}

.shop-item button:hover {
  transform: translateY(-1px);
}

.shop-item button:disabled {
  background: #555;
  color: #888;
  cursor: not-allowed;
}

.shop-item.owned {
  opacity: 0.6;
}

.shop-item.owned .shop-item-name::after {
  content: ' (Owned)';
  color: #4ade80;
}

#logout-btn {
  background: rgba(255,82,82,0.3) !important;
}

#logout-btn:hover {
  background: rgba(255,82,82,0.5) !important;
}

/* Underwater effect */
body.underwater::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 100, 150, 0.3);
  pointer-events: none;
  z-index: 10;
}

/* ============================================
   MONETIZATION UI STYLES
   ============================================ */

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

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

.modal-close {
  position: absolute;
  top: 15px; right: 15px;
  background: none;
  border: none;
  color: #888;
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #fff;
}

/* Premium Modal */
.premium-content {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 40px;
  border-radius: 20px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(255,215,0,0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.premium-content h2 {
  text-align: center;
  color: #ffd700;
  font-size: 32px;
  margin-bottom: 10px;
}

.premium-tagline {
  text-align: center;
  color: #888;
  margin-bottom: 30px;
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.pricing-tier {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 25px;
  border: 2px solid rgba(255,255,255,0.1);
  transition: all 0.3s;
  position: relative;
}

.pricing-tier:hover {
  transform: translateY(-5px);
  border-color: rgba(79,195,247,0.5);
}

.pricing-tier.recommended {
  border-color: #ffd700;
  background: rgba(255,215,0,0.1);
}

.pricing-tier.recommended::before {
  content: 'BEST VALUE';
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #ffd700, #ff8c00);
  color: #000;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
}

.pricing-tier.current {
  border-color: #c9a227;
}

.pricing-tier.current::after {
  content: 'CURRENT';
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: #c9a227;
  color: #000;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
}

.tier-name {
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 10px;
}

.tier-price {
  font-size: 36px;
  font-weight: bold;
  color: #c9a227;
  margin-bottom: 5px;
}

.tier-price span {
  font-size: 14px;
  color: #888;
}

.tier-features {
  list-style: none;
  margin: 20px 0;
}

.tier-features li {
  padding: 8px 0;
  color: #ccc;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tier-features li::before {
  content: '✓';
  color: #4ade80;
  font-weight: bold;
}

.tier-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.tier-btn.primary {
  background: linear-gradient(135deg, #3ecf8e 0%, #1db777 100%);
  color: #000;
}

.tier-btn.primary:hover {
  transform: scale(1.02);
  box-shadow: 0 5px 20px rgba(79,195,247,0.4);
}

.tier-btn.secondary {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}

.tier-btn.secondary:hover {
  background: rgba(255,255,255,0.2);
}

.tier-btn:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

.current-sub-info {
  text-align: center;
  padding: 15px;
  background: rgba(74,222,128,0.1);
  border-radius: 10px;
  color: #4ade80;
  font-size: 14px;
}

/* Cosmetics Modal */
.cosmetics-content {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 30px;
  border-radius: 20px;
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.1);
}

.cosmetics-content h2 {
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
}

.shop-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.shop-tab {
  padding: 10px 20px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 20px;
  color: #ccc;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.shop-tab:hover {
  background: rgba(255,255,255,0.2);
}

.shop-tab.active {
  background: #c9a227;
  color: #000;
  font-weight: bold;
}

.cosmetics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
}

.cosmetic-item {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 15px;
  border: 2px solid rgba(255,255,255,0.1);
  transition: all 0.3s;
  text-align: center;
}

.cosmetic-item:hover {
  transform: translateY(-3px);
  border-color: rgba(79,195,247,0.5);
}

.cosmetic-item.owned {
  border-color: #4ade80;
  background: rgba(74,222,128,0.1);
}

.cosmetic-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.cosmetic-name {
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 5px;
}

.cosmetic-desc {
  color: #888;
  font-size: 11px;
  margin-bottom: 10px;
}

.cosmetic-price {
  color: #ffd700;
  font-weight: bold;
  margin-bottom: 10px;
}

.cosmetic-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: bold;
  margin-bottom: 10px;
}

.cosmetic-badge.bundle {
  background: linear-gradient(90deg, #ff6b6b, #ffd700);
  color: #000;
}

.cosmetic-badge.savings {
  background: #4ade80;
  color: #000;
}

.cosmetic-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.cosmetic-btn.buy {
  background: linear-gradient(135deg, #3ecf8e 0%, #1db777 100%);
  color: #000;
}

.cosmetic-btn.buy:hover {
  transform: scale(1.02);
}

.cosmetic-btn.owned {
  background: rgba(74,222,128,0.2);
  color: #4ade80;
  cursor: default;
}

/* Wardrobe Modal */
.wardrobe-content {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 30px;
  border-radius: 20px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.1);
}

.wardrobe-content h2 {
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
}

.wardrobe-sections h3 {
  color: #c9a227;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.wardrobe-equipped {
  margin-bottom: 30px;
}

.equipped-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.equipped-slot {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  border: 2px solid rgba(255,255,255,0.1);
}

.equipped-slot.empty {
  border-style: dashed;
  opacity: 0.5;
}

.slot-type {
  color: #888;
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.slot-item-name {
  color: #fff;
  font-weight: bold;
  font-size: 12px;
}

.slot-unequip {
  margin-top: 8px;
  padding: 5px 10px;
  background: rgba(255,82,82,0.3);
  border: none;
  border-radius: 5px;
  color: #ff5252;
  font-size: 10px;
  cursor: pointer;
}

.slot-unequip:hover {
  background: rgba(255,82,82,0.5);
}

.owned-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.owned-item {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  border: 2px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.2s;
}

.owned-item:hover {
  border-color: #c9a227;
  transform: scale(1.02);
}

.owned-item.equipped {
  border-color: #4ade80;
  background: rgba(74,222,128,0.1);
}

.owned-item-icon {
  font-size: 28px;
  margin-bottom: 5px;
}

.owned-item-name {
  color: #fff;
  font-size: 11px;
}

/* Upgrade Banner */
.upgrade-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(79,195,247,0.9), rgba(0,230,118,0.9));
  padding: 12px 25px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 500;
  box-shadow: 0 5px 30px rgba(0,0,0,0.3);
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.upgrade-banner.hidden {
  display: none;
}

.upgrade-banner span {
  color: #000;
  font-weight: bold;
  font-size: 14px;
}

.upgrade-banner button {
  padding: 8px 20px;
  border: none;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

#banner-upgrade-btn {
  background: #000;
  color: #fff;
}

#banner-upgrade-btn:hover {
  background: #333;
}

.banner-close {
  background: transparent;
  color: rgba(0,0,0,0.5);
  font-size: 20px;
  padding: 0 5px !important;
}

.banner-close:hover {
  color: #000;
}

/* Premium Button in Settings */
.settings-btn.premium {
  background: linear-gradient(90deg, rgba(255,215,0,0.3), rgba(255,140,0,0.3)) !important;
  border: 1px solid rgba(255,215,0,0.5) !important;
}

.settings-btn.premium:hover {
  background: linear-gradient(90deg, rgba(255,215,0,0.5), rgba(255,140,0,0.5)) !important;
}

/* Membership Badge */
.membership-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: bold;
  margin-left: 5px;
  vertical-align: middle;
}

.membership-badge.plus {
  background: linear-gradient(90deg, #c9a227, #e0b830);
  color: #000;
}

.membership-badge.pro {
  background: linear-gradient(90deg, #ffd700, #ff8c00);
  color: #000;
}

/* Player name with badge in chat */
.chat-name.premium-plus::after {
  content: '⭐';
  margin-left: 3px;
}

.chat-name.premium-pro::after {
  content: '👑';
  margin-left: 3px;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */
@media (max-width: 768px) {
  /* Hide non-essential HUD elements */
  #coordinates,
  #fps,
  #controls-hint {
    display: none !important;
  }
  
  /* Smaller HUD */
  #hud {
    top: 10px;
    left: 10px;
    font-size: 12px;
  }
  
  #player-count {
    font-size: 12px;
  }
  
  #time-display {
    font-size: 11px;
  }
  
  /* Smaller minimap */
  #minimap {
    width: 100px;
    height: 100px;
    top: 10px;
    right: 10px;
  }
  
  #minimap-canvas {
    width: 100px;
    height: 100px;
  }
  
  /* Compact stats panel */
  #stats-panel {
    top: 120px;
    left: 10px;
    width: 140px;
    padding: 8px;
    font-size: 11px;
  }
  
  #skills-panel {
    max-height: 150px;
    overflow-y: auto;
  }
  
  .skill-row {
    padding: 2px 0;
    font-size: 10px;
  }
  
  /* Game menu - bottom of screen */
  #game-menu {
    position: fixed;
    bottom: 60px;
    right: 10px;
    top: auto;
    width: 180px;
    max-height: 250px;
  }
  
  #menu-tabs {
    flex-wrap: wrap;
  }
  
  .menu-tab {
    padding: 6px 8px;
    font-size: 10px;
  }
  
  #inventory-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
  }
  
  .inv-slot {
    width: 32px;
    height: 32px;
    font-size: 8px;
  }
  
  /* Chat - smaller and at bottom */
  #chat-container {
    bottom: 10px;
    left: 10px;
    width: calc(100% - 200px);
    max-width: 280px;
    height: 120px;
  }
  
  #chat-log {
    height: 80px;
    font-size: 11px;
  }
  
  #chat-input {
    font-size: 12px;
    padding: 6px;
  }
  
  #chat-send {
    padding: 6px 10px;
    font-size: 11px;
  }
  
  /* Modals - full width on mobile */
  #shop-window,
  #trade-window,
  #customize-window {
    width: 95%;
    min-width: auto;
    max-width: none;
    padding: 15px;
  }
  
  .shop-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .shop-item button {
    width: 100%;
  }
  
  /* Auth modal */
  #auth-modal .auth-content {
    width: 95%;
    padding: 20px;
  }
  
  #auth-modal h1 {
    font-size: 32px;
  }
  
  /* Hide old inventory panel (use game menu instead) */
  #inventory {
    display: none !important;
  }
  
  /* Interaction prompt - higher on mobile */
  #interaction-prompt {
    bottom: 180px;
    font-size: 12px;
    padding: 8px 12px;
  }
  
  /* Notification positioning */
  #notification {
    top: auto;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
  }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
  #minimap {
    width: 80px;
    height: 80px;
  }
  
  #minimap-canvas {
    width: 80px;
    height: 80px;
  }
  
  #stats-panel {
    width: 120px;
    padding: 6px;
  }
  
  #game-menu {
    width: 160px;
    max-height: 200px;
  }
  
  #chat-container {
    width: calc(100% - 180px);
    max-width: 200px;
    height: 100px;
  }
  
  #chat-log {
    height: 60px;
    font-size: 10px;
  }
}

/* Mobile-specific body class styles */
body.mobile {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body.mobile #ui-layer {
  touch-action: auto;
}
