* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, sans-serif; }
body { background: #14161c; color: #e8e8e8; }
.hidden { display: none !important; }

.screen { min-height: 100vh; }

/* ---- AUTH ---- */
#authScreen { display: flex; align-items: center; justify-content: center; height: 100vh;
  background: radial-gradient(circle at top, #2a2f3a, #0e0f13); }
.auth-box { background: #1c1f27; padding: 32px; border-radius: 12px; width: 320px;
  box-shadow: 0 0 30px rgba(0,0,0,.5); text-align: center; }
.auth-box h1 { color: #e6b800; margin-bottom: 20px; letter-spacing: 2px; }
.tabs { display: flex; margin-bottom: 16px; border-radius: 8px; overflow: hidden; }
.tab-btn { flex: 1; padding: 10px; background: #262a35; border: none; color: #aaa; cursor: pointer; }
.tab-btn.active { background: #e6b800; color: #14161c; font-weight: bold; }
.form input { width: 100%; padding: 10px; margin-bottom: 10px; border-radius: 6px; border: 1px solid #333;
  background: #14161c; color: #fff; }
.form button { width: 100%; padding: 10px; background: #d9342b; color: #fff; border: none; border-radius: 6px;
  cursor: pointer; font-weight: bold; }
.form button:hover { background: #b8281f; }
.err { color: #ff6b6b; margin-top: 8px; font-size: 13px; min-height: 16px; }

/* ---- TOPBAR / MENU ---- */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px;
  background: #1c1f27; border-bottom: 2px solid #e6b800; }
.player-info span { margin-right: 16px; font-weight: bold; }
.balance { color: #6cd66c; }
.logout { background: #333; color: #fff; border: none; padding: 8px 14px; border-radius: 6px; cursor: pointer; }

.menu-tabs { display: flex; background: #1c1f27; }
.mtab { flex: 1; padding: 14px; background: none; border: none; color: #aaa; cursor: pointer; font-size: 15px;
  border-bottom: 3px solid transparent; }
.mtab.active { color: #e6b800; border-bottom: 3px solid #e6b800; }
.mtab-panel { padding: 20px; max-width: 900px; margin: 0 auto; }

/* ---- SHOP ---- */
.weapon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.weapon-card { background: #1c1f27; border-radius: 10px; padding: 16px; text-align: center;
  border: 1px solid #2a2e38; }
.weapon-card .icon { font-size: 40px; margin-bottom: 8px; }
.weapon-card h4 { color: #e6b800; margin-bottom: 6px; }
.weapon-card p { font-size: 13px; color: #aaa; margin-bottom: 4px; }
.weapon-card button { width: 100%; margin-top: 8px; padding: 8px; border: none; border-radius: 6px;
  cursor: pointer; font-weight: bold; }
.buy-btn { background: #d9342b; color: #fff; }
.equip-btn { background: #2b7a2b; color: #fff; }
.equipped-btn { background: #555; color: #ccc; cursor: default; }

/* ---- PLAY ---- */
.map-grid { display: flex; gap: 14px; margin: 16px 0; flex-wrap: wrap; }
.map-card { cursor: pointer; text-align: center; border: 2px solid transparent; border-radius: 8px; padding: 8px; }
.map-card.selected { border-color: #e6b800; }
.map-thumb { width: 150px; height: 90px; border-radius: 6px; margin-bottom: 6px; }
.map-thumb.desert { background: linear-gradient(#e0c080, #a88a4a); }
.map-thumb.snow { background: linear-gradient(#dfeeff, #9fc4e0); }
.map-thumb.city { background: linear-gradient(#555, #222); }
#createRoomBtn { padding: 12px 20px; background: #e6b800; border: none; border-radius: 8px;
  font-weight: bold; cursor: pointer; margin-bottom: 20px; }
.join-box { display: flex; gap: 8px; margin-top: 10px; }
.join-box input { padding: 10px; border-radius: 6px; border: 1px solid #333; background: #14161c; color: #fff; }
.join-box button { padding: 10px 16px; background: #2b7a2b; border: none; border-radius: 6px; color: #fff; cursor: pointer; }
#roomInfo { margin-top: 14px; color: #e6b800; font-weight: bold; }

/* ---- FRIENDS ---- */
.invite-box { display: flex; gap: 8px; margin-bottom: 20px; }
.invite-box input { flex: 1; padding: 10px; border-radius: 6px; border: 1px solid #333; background: #14161c; color: #fff; }
.invite-box button { padding: 10px 16px; background: #e6b800; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; }
.friend-row { display: flex; justify-content: space-between; align-items: center; background: #1c1f27;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; }
.friend-row button { background: #2b7a2b; border: none; color: #fff; padding: 6px 12px; border-radius: 6px; cursor: pointer; }

/* ---- GAME ---- */
#gameScreen { display: flex; flex-direction: column; align-items: center; background: #0a0a0a; height: 100vh; }
.game-hud { display: flex; gap: 20px; align-items: center; padding: 10px 20px; background: #1c1f27;
  width: 800px; max-width: 100%; font-weight: bold; }
.game-hud button { margin-left: auto; background: #d9342b; border: none; color: #fff; padding: 6px 14px;
  border-radius: 6px; cursor: pointer; }
#gameCanvas3d { width: 800px; height: 600px; max-width: 100%; cursor: crosshair; background: #333; }
#gameCanvas3d canvas { display: block; }
#deathBanner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.85); padding: 20px 30px; border-radius: 10px; font-size: 20px; }
#deathBanner button { margin-left: 12px; padding: 8px 16px; background: #e6b800; border: none; border-radius: 6px;
  cursor: pointer; font-weight: bold; }
