@charset "UTF-8";

/* Minecraft Font & Pixel Styling */
@font-face {
  font-family: 'Minecraft';
  src: local('Consolas'), local('Courier New'), monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
  touch-action: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family: 'Minecraft', 'Segoe UI', Tahoma, monospace;
  color: #fff;
  image-rendering: pixelated;
}

#game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

canvas#render-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Crosshair */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
}
#crosshair::before, #crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}
#crosshair::before {
  top: 9px;
  left: 0;
  width: 20px;
  height: 2px;
}
#crosshair::after {
  top: 0;
  left: 9px;
  width: 2px;
  height: 20px;
}

/* Block Breaking Progress Ring / Overlay */
#break-progress {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9;
  display: none;
}
#break-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #fff;
  position: absolute;
  bottom: -10px;
}
#break-progress-fill {
  width: 0%;
  height: 100%;
  background: #00ff00;
  transition: width 0.05s linear;
}

/* HUD Overlay */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Bottom Bar: Health, Armor, Resources, Hotbar */
#bottom-hud {
  align-self: center;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Resource Counters Above Hotbar */
#resources-display {
  display: flex;
  gap: 16px;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 14px;
  border-radius: 4px;
  border: 2px solid #3c3c3c;
  font-size: 16px;
  text-shadow: 2px 2px #000;
}
.res-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: bold;
}
.res-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  border-radius: 2px;
}
.res-iron { background: #d8d8d8; border: 1px solid #fff; }
.res-gold { background: #ffd700; border: 1px solid #fff; }
.res-diamond { background: #4cedf3; border: 1px solid #fff; }
.res-emerald { background: #17dd62; border: 1px solid #fff; }

/* Status Bar: Health & Armor */
#status-bars {
  display: flex;
  justify-content: space-between;
  width: 364px;
  padding: 0 4px;
  font-size: 14px;
}
#health-container, #armor-container {
  display: flex;
  gap: 3px;
}
.heart, .armor-icon {
  font-size: 16px;
  line-height: 1;
  text-shadow: 1px 1px #000;
}
.heart-full { color: #e71e24; }
.heart-half { color: #e71e24; opacity: 0.7; }
.heart-empty { color: #3b0000; }
.armor-full { color: #a0a0a0; }
.armor-empty { color: #303030; }

/* Hotbar */
#hotbar {
  display: flex;
  background: #8f8f8f;
  padding: 4px;
  border: 4px solid #373737;
  border-top-color: #dbdbdb;
  border-left-color: #dbdbdb;
  box-shadow: inset 2px 2px 0px #ffffff, inset -2px -2px 0px #555555, 0 4px 10px rgba(0,0,0,0.8);
}
.hotbar-slot {
  width: 44px;
  height: 44px;
  background: #8b8b8b;
  border: 2px solid #373737;
  border-top-color: #373737;
  border-left-color: #373737;
  border-bottom-color: #ffffff;
  border-right-color: #ffffff;
  margin: 0 2px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hotbar-slot.active {
  border: 3px solid #ffffff !important;
  background: #a0a0a0;
  box-shadow: 0 0 6px #ffffff;
}
.hotbar-slot .slot-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
}
.hotbar-slot .slot-count {
  position: absolute;
  right: 2px;
  bottom: 0px;
  font-size: 14px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 2px 2px 0px #000000;
}
.hotbar-slot .slot-key {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 10px;
  color: #cccccc;
  text-shadow: 1px 1px 0px #000;
  opacity: 0.8;
}

/* Top-Right Scoreboard */
#scoreboard {
  position: absolute;
  top: 24px;
  right: 20px;
  background: rgba(0, 0, 0, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.15);
  padding: 14px 20px;
  min-width: 240px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1.5;
  text-shadow: 1px 1px 2px #000;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
#scoreboard-title {
  color: #ffaa00;
  font-weight: bold;
  font-size: 20px;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 1px;
  text-shadow: 2px 2px #553300;
}
.sb-divider {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin: 6px 0;
}
.sb-team {
  display: flex;
  justify-content: space-between;
  margin: 4px 0;
}
.sb-team.red { color: #ff5555; font-weight: bold; }
.sb-team.blue { color: #5555ff; font-weight: bold; }
.sb-team.green { color: #55ff55; font-weight: bold; }
.sb-team.yellow { color: #ffff55; font-weight: bold; }
.sb-status-alive { color: #55ff55; font-weight: bold; }
.sb-status-dead { color: #ff5555; font-weight: bold; }
.sb-label { color: #aaaaaa; }
.sb-value { color: #ffffff; font-weight: bold; }
.sb-footer {
  color: #ffaa00;
  text-align: center;
  font-size: 13px;
  margin-top: 6px;
}

/* Chat & Kill Feed */
#chat-box {
  position: absolute;
  bottom: 80px;
  left: 20px;
  width: 460px;
  max-height: 240px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
}
.chat-msg {
  background: rgba(0, 0, 0, 0.55);
  padding: 5px 10px;
  margin-top: 3px;
  border-radius: 3px;
  font-size: 16px;
  text-shadow: 1px 1px #000;
  animation: fadeIn 0.3s ease;
  line-height: 1.4;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Villager Interaction Hint */
#npc-hint {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, 0);
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #ffd700;
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 18px;
  font-weight: bold;
  color: #ffeb3b;
  text-shadow: 1px 1px 2px #000;
  display: none;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* Shop Modal */
#shop-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 680px;
  background: #c6c6c6;
  border: 4px solid #ffffff;
  border-bottom-color: #555555;
  border-right-color: #555555;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.9);
  z-index: 100;
  display: none;
  color: #333333;
}
#shop-header {
  background: #373737;
  color: #ffffff;
  padding: 8px 16px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  text-shadow: 2px 2px #000;
}
#shop-close-btn {
  background: #ff5555;
  color: #fff;
  border: 2px solid #aa0000;
  padding: 2px 10px;
  cursor: pointer;
  font-weight: bold;
}
#shop-close-btn:hover { background: #ff7777; }
#shop-categories {
  display: flex;
  background: #8b8b8b;
  padding: 6px 10px 0 10px;
  border-bottom: 3px solid #373737;
  gap: 6px;
}
.shop-tab {
  padding: 6px 14px;
  background: #c6c6c6;
  border: 2px solid #ffffff;
  border-bottom: none;
  border-right-color: #555555;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  color: #373737;
}
.shop-tab.active {
  background: #e0e0e0;
  border-top-color: #55ff55;
  color: #000;
}
#shop-items-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 16px;
  max-height: 380px;
  overflow-y: auto;
  background: #8f8f8f;
}
.shop-card {
  background: #b5b5b5;
  border: 3px solid #ffffff;
  border-bottom-color: #373737;
  border-right-color: #373737;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.1s, background 0.1s;
}
.shop-card:hover {
  background: #d4d4d4;
  transform: translateY(-2px);
}
.shop-card .card-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
}
.shop-card .card-title {
  font-size: 14px;
  font-weight: bold;
  color: #111;
  text-align: center;
}
.shop-card .card-price {
  font-size: 13px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.price-iron { background: #dcdcdc; color: #333; }
.price-gold { background: #ffd700; color: #553300; }
.price-diamond { background: #55ffff; color: #004455; }
.price-emerald { background: #55ff55; color: #004411; }

/* Center Big Title / Banners (Bed break, Victory, Defeat) */
#big-banner {
  position: absolute;
  top: 32%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 50;
  display: none;
}
#banner-title {
  font-size: 44px;
  font-weight: bold;
  text-shadow: 4px 4px #000;
  letter-spacing: 2px;
  margin-bottom: 10px;
}
#banner-subtitle {
  font-size: 22px;
  text-shadow: 2px 2px #000;
  color: #ffeb3b;
}

/* Respawn Overlay */
#respawn-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(180, 0, 0, 0.55);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 60;
  pointer-events: none;
}
#respawn-title {
  font-size: 48px;
  color: #ffffff;
  text-shadow: 4px 4px #000;
  margin-bottom: 12px;
}
#respawn-timer {
  font-size: 24px;
  color: #ffff55;
  text-shadow: 2px 2px #000;
}

/* Start / Pause / Control Guide Screen */
#start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  z-index: 200;
  backdrop-filter: blur(4px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px;
  box-sizing: border-box;
}
.start-box {
  background: #2b2b2b;
  border: 4px solid #555555;
  border-top-color: #888888;
  border-left-color: #888888;
  padding: 14px 20px;
  text-align: center;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
  margin: 10px auto;
  box-sizing: border-box;
}
.start-title {
  font-size: 32px;
  color: #ffaa00;
  text-shadow: 3px 3px #553300;
  margin-bottom: 4px;
  letter-spacing: 2px;
}
.start-subtitle {
  font-size: 13px;
  color: #55ff55;
  margin-bottom: 12px;
  text-shadow: 1px 1px #000;
}
.start-instructions {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid #444;
  padding: 10px 14px;
  margin-bottom: 14px;
  text-align: left;
  font-size: 13px;
  line-height: 1.6;
  color: #dddddd;
  border-radius: 4px;
}
.start-instructions b {
  color: #ffff55;
}
.inst-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 12px;
}
.inst-tip {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #555;
  color: #ffaa00;
  font-size: 12px;
}

/* Mode & Difficulty Selection Section */
.mode-select-section {
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.45);
  padding: 10px 14px;
  border-radius: 4px;
  border: 1px solid #444;
}
.mode-select-title {
  font-size: 13px;
  font-weight: bold;
  color: #ffaa00;
  margin-bottom: 6px;
  text-align: left;
}
.map-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}
.map-btn {
  background: #333338;
  border: 2px solid #555566;
  color: #ffffff;
  padding: 8px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.15s ease;
  font-family: inherit;
  border-radius: 3px;
}
.map-btn:hover {
  background: #444450;
  border-color: #8888aa;
}
.map-btn.active {
  background: #254b77;
  border-color: #4da3ff;
  box-shadow: 0 0 10px rgba(77, 163, 255, 0.65);
}
.map-name {
  font-size: 13px;
  font-weight: bold;
  color: #ffffff;
  pointer-events: none;
}
.map-desc {
  font-size: 11px;
  color: #bbbbee;
  pointer-events: none;
}

.mode-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mode-btn {
  background: #383838;
  border: 2px solid #555555;
  color: #ffffff;
  padding: 8px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.15s ease;
  font-family: inherit;
  border-radius: 3px;
}
.mode-btn:hover {
  background: #484848;
  border-color: #888888;
}
.mode-btn.active {
  background: #1e6324;
  border-color: #52c458;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}
.mode-name {
  font-size: 13px;
  font-weight: bold;
  color: #ffffff;
  pointer-events: none;
}
.mode-desc {
  font-size: 11px;
  color: #bbbbbb;
  pointer-events: none;
}
.difficulty-options {
  display: flex;
  gap: 8px;
}
.diff-btn {
  flex: 1;
  background: #383838;
  border: 2px solid #555555;
  color: #ffffff;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  border-radius: 3px;
  transition: all 0.15s ease;
}
.diff-btn:hover {
  background: #484848;
}
.diff-btn.active {
  background: #b71c1c;
  border-color: #ff5252;
  box-shadow: 0 0 8px rgba(255, 82, 82, 0.6);
}

.start-btn {
  background: #4caf50;
  color: #fff;
  border: 3px solid #2e7d32;
  font-size: 18px;
  font-weight: bold;
  padding: 12px 24px;
  width: 100%;
  cursor: pointer;
  text-shadow: 2px 2px #1b5e20;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  border-radius: 4px;
  box-sizing: border-box;
}
.start-btn:hover {
  background: #66bb6a;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.6);
}
.start-btn:active {
  transform: translateY(1px);
}

/* Compliance & Legal Notice Footer */
.compliance-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  font-size: 11px;
  color: #8f9297;
  line-height: 1.6;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.compliance-disclaimer {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.compliance-disclaimer span {
  display: block;
}
.compliance-disclaimer b {
  color: #ffaa00;
}
.compliance-icp {
  margin-top: 4px;
}
.icp-link {
  color: #64b5f6;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(100, 181, 246, 0.3);
  border-radius: 4px;
  transition: all 0.2s ease;
}
.icp-link:hover {
  color: #90caf9;
  border-color: #64b5f6;
  background: rgba(100, 181, 246, 0.15);
  text-decoration: underline;
}
.icp-icon {
  font-size: 12px;
}

/* Victory / Game Over Modal */
#gameover-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #222222;
  border: 4px solid #ffaa00;
  padding: 32px 48px;
  text-align: center;
  z-index: 300;
  display: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
}
.modal-title {
  font-size: 42px;
  font-weight: bold;
  margin-bottom: 14px;
  text-shadow: 3px 3px #000;
}
.modal-stats {
  font-size: 16px;
  color: #cccccc;
  line-height: 1.8;
  margin-bottom: 24px;
}

/* Resume / Focus Overlay */
#resume-overlay {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  display: none;
  pointer-events: none;
}
.resume-box {
  background: rgba(30, 30, 30, 0.96);
  border: 2px solid #55ff55;
  border-radius: 8px;
  padding: 10px 22px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  animation: pulseResume 2s infinite;
}
@keyframes pulseResume {
  0% { transform: scale(1); box-shadow: 0 0 8px rgba(85, 255, 85, 0.4); }
  50% { transform: scale(1.02); box-shadow: 0 0 18px rgba(85, 255, 85, 0.75); }
  100% { transform: scale(1); box-shadow: 0 0 8px rgba(85, 255, 85, 0.4); }
}
.resume-title {
  font-size: 15px;
  font-weight: bold;
  color: #ffff55;
  text-shadow: 1px 1px #000;
}
.resume-btn-group {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.resume-action-btn {
  background: #4caf50;
  color: #ffffff;
  border: 2px solid #2e7d32;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.resume-action-btn:hover {
  background: #66bb6a;
  transform: translateY(-1px);
}
.resume-action-btn.secondary-action {
  background: #2b5278;
  border-color: #173859;
}
.resume-action-btn.secondary-action:hover {
  background: #3b74ad;
}

/* ==========================================================================
   Skin Management UI & Modal Styles
   ========================================================================== */
.skin-manage-btn {
  background: linear-gradient(180deg, #388e3c 0%, #2e7d32 100%);
  color: #ffffff;
  border: 2px solid #81c784;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 1px 1px 2px #000;
}
.skin-manage-btn:hover {
  background: linear-gradient(180deg, #43a047 0%, #388e3c 100%);
  border-color: #a5d6a7;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(46, 125, 50, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#hud-top-actions {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 100;
  pointer-events: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.hud-skin-btn {
  background: rgba(22, 27, 34, 0.88);
  color: #ffff55;
  border: 2px solid #5a6472;
  border-radius: 6px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  text-shadow: 1px 1px #000;
  transition: all 0.15s ease;
}
.hud-skin-btn:hover {
  background: #2b3544;
  border-color: #ffd700;
  color: #ffffff;
  transform: translateY(-1px);
}
.hud-backpack-btn {
  background: linear-gradient(180deg, #1e3a5f 0%, #0f172a 100%);
  color: #38bdf8;
  border: 2px solid #38bdf8;
  border-radius: 6px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  text-shadow: 1px 1px #000;
  transition: all 0.15s ease;
}
.hud-backpack-btn:hover {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  border-color: #7dd3fc;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(2, 132, 199, 0.5);
}

/* Potion Effects HUD Overlay */
#potion-effects-hud {
  position: absolute;
  top: 56px;
  left: 16px;
  z-index: 90;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.potion-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.88);
  border: 2px solid #38bdf8;
  border-radius: 16px;
  padding: 4px 12px;
  font-family: 'Minecraft', monospace;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  animation: pulsePill 2s infinite ease-in-out;
  text-shadow: 1px 1px #000;
}
@keyframes pulsePill {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}
.potion-pill .pill-icon {
  font-size: 14px;
}
.potion-pill .pill-name {
  font-weight: bold;
}
.potion-pill .pill-timer {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 1px 6px;
  color: #ffffff;
}

.skin-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  font-family: 'Minecraft', 'Segoe UI', sans-serif;
}
.skin-modal-dialog {
  background: #181c24;
  border: 3px solid #504434;
  border-radius: 8px;
  width: 92%;
  max-width: 920px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.95), inset 0 0 15px rgba(0, 0, 0, 0.8);
  padding: 20px 24px;
  color: #ffffff;
}
.skin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #2e3544;
  padding-bottom: 12px;
}
.skin-modal-title {
  font-size: 20px;
  font-weight: bold;
  color: #ffdd44;
  text-shadow: 2px 2px #000;
  display: flex;
  align-items: center;
  gap: 10px;
}
.skin-modal-close {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s;
}
.skin-modal-close:hover {
  color: #ff4444;
}
.skin-modal-desc {
  font-size: 13px;
  color: #b0bec5;
  margin-top: 8px;
  line-height: 1.5;
}
.skin-quick-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 8px 12px;
  background: rgba(10, 14, 20, 0.6);
  border-radius: 6px;
  border: 1px solid #2c3340;
}
.skin-tool-btn {
  color: #fff;
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.skin-tool-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}
.skin-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 14px;
  overflow-y: auto;
  max-height: 52vh;
  padding: 8px 6px 8px 2px;
  margin-top: 14px;
}
.skin-card {
  background: rgba(26, 32, 44, 0.88);
  border: 2px solid #455a64;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.skin-card.team-border-red { border-color: #ef5350; }
.skin-card.team-border-blue { border-color: #42a5f5; }
.skin-card.team-border-green { border-color: #66bb6a; }
.skin-card.team-border-yellow { border-color: #ffee58; }

.skin-card-left {
  flex-shrink: 0;
}
.skin-avatar-canvas {
  width: 64px;
  height: 80px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #10141a;
  border: 2px solid #546e7a;
  border-radius: 4px;
  box-shadow: inset 0 0 8px #000;
  display: block;
}
.skin-card-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.skin-bot-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.skin-bot-name {
  font-weight: bold;
  font-size: 14px;
  color: #fff;
  text-shadow: 1px 1px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skin-badge-custom {
  background: #ff9800;
  color: #000;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 6px;
  border-radius: 3px;
}
.skin-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.skin-row-label {
  font-size: 12px;
  color: #90a4ae;
  flex-shrink: 0;
}
.skin-select {
  flex: 1;
  background: #131720;
  color: #ffffff;
  border: 1px solid #455a64;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.skin-select:focus {
  border-color: #ffdd44;
}
.skin-btn-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}
.skin-upload-btn {
  background: #1976d2;
  color: #ffffff;
  border: 1px solid #42a5f5;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}
.skin-upload-btn:hover {
  background: #2196f3;
  transform: translateY(-1px);
}
.skin-clear-btn {
  background: #d32f2f;
  color: #ffffff;
  border: 1px solid #ef5350;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.skin-clear-btn:hover {
  background: #f44336;
}
.skin-sync-team-btn {
  background: #37474f;
  color: #cfd8dc;
  border: 1px solid #607d8b;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  margin-left: auto;
  transition: all 0.15s ease;
}
.skin-sync-team-btn:hover {
  background: #455a64;
  color: #ffffff;
  border-color: #90a4ae;
}
.skin-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid #2e3544;
  padding-top: 14px;
  margin-top: 10px;
}
.skin-confirm-btn {
  background: linear-gradient(180deg, #43a047 0%, #2e7d32 100%);
  color: #ffffff;
  border: 2px solid #81c784;
  border-radius: 6px;
  padding: 8px 24px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.15s ease;
}
.skin-confirm-btn:hover {
  background: #4caf50;
  transform: translateY(-1px);
}

/* =========================================================
   Teammate Tactical Communication & Role System Styles
   ========================================================= */

/* HUD Shortcut Button */
.hud-team-btn {
  background: linear-gradient(180deg, #d32f2f 0%, #b71c1c 100%);
  color: #ffffff;
  border: 2px solid #ff7961;
  border-radius: 6px;
  padding: 6px 13px;
  font-family: 'Minecraft', 'Segoe UI', Tahoma, sans-serif;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  text-shadow: 1px 1px 2px #000;
  transition: all 0.15s ease;
  pointer-events: auto;
}
.hud-team-btn:hover {
  background: linear-gradient(180deg, #f44336 0%, #c62828 100%);
  border-color: #ffcdd2;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(211, 47, 47, 0.4);
}

/* Teammate Modal Backdrop / Dialog */
#team-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 760px;
  max-width: 95vw;
  max-height: 92vh;
  overflow-y: auto;
  background: #181c24;
  border: 4px solid #d32f2f;
  border-radius: 10px;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.95), 0 0 20px rgba(211, 47, 47, 0.35);
  z-index: 105;
  display: none;
  color: #e0e6ed;
  font-family: 'Minecraft', 'Segoe UI', Tahoma, sans-serif;
  padding: 18px 22px;
  box-sizing: border-box;
  animation: teamModalAnim 0.16s ease-out;
}

@keyframes teamModalAnim {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Modal Header */
.team-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #2e3544;
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.team-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: bold;
  color: #ffdd44;
  text-shadow: 2px 2px #000;
}
.team-badge {
  font-size: 11px;
  background: #d32f2f;
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: normal;
  text-shadow: none;
}
.team-modal-close-btn {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s;
  padding: 0 4px;
}
.team-modal-close-btn:hover {
  color: #ff4444;
}

/* Live Teammate Status Card */
.team-status-card {
  background: #222836;
  border: 2px solid #333d52;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.mate-profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mate-avatar-badge {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #d32f2f, #7f0000);
  border: 2px solid #ff7961;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.mate-meta {
  flex: 1;
}
.mate-name-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.mate-name {
  font-size: 17px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 1px 1px 2px #000;
}
.mate-status-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}
.mate-status-tag.status-alive {
  background: rgba(76, 175, 80, 0.25);
  color: #4caf50;
  border: 1px solid #4caf50;
}
.mate-status-tag.status-dead {
  background: rgba(244, 67, 54, 0.25);
  color: #f44336;
  border: 1px solid #f44336;
}
.mate-role-badge {
  font-size: 12px;
  background: #394254;
  color: #ffd700;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #505c75;
}
.mate-hp-container {
  position: relative;
  width: 100%;
  height: 18px;
  background: #11141a;
  border: 1px solid #444;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.mate-hp-bar {
  height: 100%;
  transition: width 0.2s ease, background 0.2s ease;
}
.mate-hp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
  pointer-events: none;
}
.mate-gear-line {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: #cfd8dc;
}
.mate-gear-line b {
  color: #fff;
}
.mate-res-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #343d50;
  font-size: 12px;
}
.mate-res-item {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #1a1e28;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #2d3446;
}
.mate-res-item b {
  color: #ffd700;
}

/* No Teammate Banner */
.no-mate-box {
  text-align: center;
  padding: 10px 4px;
}
.no-mate-title {
  font-size: 16px;
  font-weight: bold;
  color: #ffaa00;
  margin-bottom: 6px;
  text-shadow: 1px 1px #000;
}
.no-mate-desc {
  font-size: 13px;
  color: #b0bec5;
  margin-bottom: 12px;
  line-height: 1.4;
}
.summon-btn {
  background: linear-gradient(180deg, #d32f2f, #9a0007);
  color: #ffffff;
  border: 2px solid #ff7961;
  border-radius: 6px;
  padding: 9px 24px;
  font-size: 14px;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  transition: all 0.15s ease;
}
.summon-btn:hover {
  background: linear-gradient(180deg, #f44336, #ba000d);
  transform: translateY(-1px);
}

/* Section Headings */
.team-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 8px 0;
  font-size: 14px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 1px 1px #000;
}
.team-section-sub {
  font-size: 11px;
  font-weight: normal;
  color: #90a4ae;
}

/* Tactical Roles Grid */
.team-roles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.role-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #202634;
  border: 2px solid #333d52;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.role-card:hover {
  background: #2a3244;
  border-color: #505e7c;
  transform: translateY(-1px);
}
.role-card.active {
  background: linear-gradient(135deg, #2b3548, #1e2432);
  border: 2px solid #ff5252;
  box-shadow: 0 0 12px rgba(255, 82, 82, 0.45);
}
.role-card:nth-child(5) {
  grid-column: span 2;
}
.role-icon {
  font-size: 24px;
  min-width: 32px;
  text-align: center;
}
.role-info {
  flex: 1;
}
.role-name {
  font-size: 13px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 2px;
}
.role-tag-rec {
  font-size: 10px;
  background: #2e7d32;
  color: #a5d6a7;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
}
.role-desc {
  font-size: 11px;
  color: #90a4ae;
  line-height: 1.35;
}

/* Resource Exchange Box */
.team-exchange-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #202634;
  border: 2px solid #333d52;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}
.exchange-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exchange-label {
  font-size: 12px;
  font-weight: bold;
  color: #cfd8dc;
}
.exchange-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.give-btn, .req-btn {
  background: #2b3345;
  color: #fff;
  border: 1px solid #45526e;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}
.give-btn:hover {
  background: #388e3c;
  border-color: #81c784;
}
.req-btn:hover {
  background: #1976d2;
  border-color: #64b5f6;
}
.give-btn:active, .req-btn:active {
  transform: scale(0.96);
}

/* Quick Chat Pills */
.team-quick-chat {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.quick-pill {
  background: #283042;
  color: #eceff1;
  border: 1px solid #3d4964;
  border-radius: 14px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.quick-pill:hover {
  background: #37425b;
  border-color: #ffdd44;
  color: #ffdd44;
  transform: translateY(-1px);
}
.quick-pill:active {
  transform: scale(0.96);
}

/* Chat Input Bar */
.team-chat-input-bar {
  display: flex;
  gap: 8px;
}
#team-chat-input {
  flex: 1;
  background: #13161c;
  border: 2px solid #333d52;
  border-radius: 6px;
  color: #fff;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
#team-chat-input:focus {
  border-color: #ff5252;
}
#team-chat-send-btn {
  background: linear-gradient(180deg, #d32f2f, #9a0007);
  color: #ffffff;
  border: 2px solid #ff7961;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
#team-chat-send-btn:hover {
  background: linear-gradient(180deg, #f44336, #ba000d);
}

/* =========================================================
   Minecraft Player Backpack & Inventory System Styles
   ========================================================= */

.backpack-modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99998;
  font-family: 'Minecraft', 'Segoe UI', Tahoma, sans-serif;
}

.backpack-modal-dialog {
  background: #252b36;
  border: 3px solid #4a5568;
  border-radius: 10px;
  width: 580px;
  max-width: 95vw;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  user-select: none;
  box-sizing: border-box;
}

.backpack-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #374151;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.backpack-modal-title {
  font-size: 16px;
  font-weight: bold;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}

.backpack-hotkey-badge {
  background: #0284c7;
  color: #ffffff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: normal;
  border: 1px solid #38bdf8;
}

.backpack-close-btn {
  background: #374151;
  color: #94a3b8;
  border: 2px solid #4b5563;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.backpack-close-btn:hover {
  background: #ef4444;
  border-color: #f87171;
  color: #ffffff;
}

/* Player Status Bar */
.backpack-player-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  background: #181d24;
  border: 2px solid #374151;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
}

.bp-stat-pill {
  background: #202632;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  color: #cbd5e1;
}
.bp-stat-pill span {
  color: #38bdf8;
  font-weight: bold;
}

.bp-resources-pill {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.bp-res {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #f8fafc;
}

/* Section Title */
.backpack-section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: bold;
  color: #e2e8f0;
  margin-bottom: 8px;
}
.backpack-section-sub {
  font-size: 11px;
  font-weight: normal;
  color: #94a3b8;
}

/* Minecraft Slot Grid */
.minecraft-grid {
  display: grid;
  gap: 6px;
  background: #181d24;
  border: 2px solid #374151;
  border-radius: 8px;
  padding: 8px;
}
.backpack-27-grid {
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.hotbar-9-grid {
  grid-template-columns: repeat(9, 1fr);
}

.bp-slot {
  aspect-ratio: 1 / 1;
  background: #8b8b8b;
  border-top: 2px solid #373737;
  border-left: 2px solid #373737;
  border-bottom: 2px solid #ffffff;
  border-right: 2px solid #ffffff;
  border-radius: 3px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.08s ease;
}
.bp-slot:hover {
  filter: brightness(1.2);
  transform: scale(1.04);
  z-index: 2;
}
.bp-slot.selected {
  outline: 2px solid #facc15;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.7), inset 0 0 8px rgba(250, 204, 21, 0.5);
  filter: brightness(1.25);
  z-index: 3;
}
.bp-slot.active-hotbar {
  outline: 2px solid #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.bp-icon {
  width: 72%;
  height: 72%;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

.bp-count {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 13px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  pointer-events: none;
  line-height: 1;
}

.bp-slot-key {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 10px;
  font-weight: bold;
  color: #fde047;
  text-shadow: 1px 1px 0 #000;
  pointer-events: none;
  line-height: 1;
}

/* Footer & Buttons */
.backpack-footer {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.backpack-action-btns {
  display: flex;
  gap: 10px;
}
.bp-action-btn {
  flex: 1;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  text-shadow: 1px 1px 1px #000;
  transition: all 0.15s ease;
}
.bp-action-btn.btn-sort {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 2px solid #60a5fa;
}
.bp-action-btn.btn-sort:hover {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-color: #93c5fd;
  transform: translateY(-1px);
}
.bp-action-btn.btn-drop {
  background: linear-gradient(180deg, #475569 0%, #334155 100%);
  color: #f1f5f9;
  border: 2px solid #64748b;
}
.bp-action-btn.btn-drop:hover {
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
  border-color: #f87171;
  transform: translateY(-1px);
}

.backpack-hint-text {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  line-height: 1.5;
}
.backpack-hint-text b {
  color: #fde047;
}


