/* Muk.gg - Clean Single Page Layout */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

body {
  font-family: 'Courier New', monospace;
  background: #0a0a0a;
  color: #e0e0e0;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  font-smooth: never;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

@media (min-width: 769px) {
  body {
    position: relative;
    overflow: auto;
  }
}

/* Dungeon Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: 
    /* Stone wall texture pattern */
    repeating-linear-gradient(
      90deg,
      rgba(30, 25, 20, 0.3) 0px,
      rgba(30, 25, 20, 0.3) 1px,
      rgba(20, 15, 10, 0.3) 1px,
      rgba(20, 15, 10, 0.3) 2px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(25, 20, 15, 0.2) 0px,
      rgba(25, 20, 15, 0.2) 1px,
      rgba(15, 10, 5, 0.2) 1px,
      rgba(15, 10, 5, 0.2) 3px
    ),
    /* Cave depth gradient */
    radial-gradient(
      ellipse at center bottom,
      #1a1510 0%,
      #0f0a05 40%,
      #050200 100%
    ),
    /* Base dungeon color */
    linear-gradient(
      to bottom,
      #2a2520 0%,
      #1a1510 30%,
      #0f0a05 60%,
      #050200 100%
    );
  z-index: -1;
  opacity: 1;
}

/* Add dungeon atmosphere with subtle lighting and shadows */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: 
    /* Subtle torch/light effects */
    radial-gradient(
      ellipse 800px 600px at 20% 30%,
      rgba(139, 90, 43, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 600px 500px at 80% 40%,
      rgba(139, 90, 43, 0.12) 0%,
      transparent 50%
    ),
    /* Cave shadows and depth */
    radial-gradient(
      ellipse 1200px 800px at 50% 70%,
      transparent 0%,
      rgba(0, 0, 0, 0.3) 60%,
      rgba(0, 0, 0, 0.6) 100%
    );
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: multiply;
}

@media (max-width: 768px) {
  body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Header - Mobile First */
.game-header {
  height: 50px;
  background: rgba(26, 26, 26, 0.9);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(51, 51, 51, 0.7);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  width: 100vw;
}

.header-left {
  display: none; /* Hide logo and dungeon info on mobile */
}

.header-right {
  gap: 6px;
  flex-shrink: 0;
  width: 100%;
  justify-content: flex-end;
  display: flex;
}

/* Keep all buttons visible on mobile */
#settingsButton,
#gearButton,
#profileButton {
  display: block !important;
}

@media (min-width: 769px) {
  .game-header {
    height: 40px;
    padding: 0 15px;
    position: relative;
  }
  
  .header-left {
    display: flex;
    align-items: center;
    gap: 20px;
  }
  
  .header-right {
    width: auto;
    gap: 10px;
  }
}

.logo {
  font-size: 18px;
  font-weight: bold;
  color: #4caf50;
}

.dungeon-info {
  font-size: 13px;
  color: #aaa;
  display: flex;
  align-items: center;
  gap: 8px;
}

.floor-label {
  color: #666;
}

.header-btn {
  background: #1a1a1a;
  border: 2px solid #444;
  border-style: outset;
  color: #ccc;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 0;
  transition: none;
  min-height: 36px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-btn:active {
  border-style: inset;
  box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.5);
  transform: translate(1px, 1px);
}

@media (min-width: 769px) {
  .header-btn {
    padding: 4px 12px;
    font-size: 12px;
    min-height: 28px;
    min-width: auto;
  }
  
  .header-btn:hover {
    background: #2a2a2a;
    border-color: #555;
  }
}

/* Main Container - Mobile First */
.main-container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  height: calc(100vh - 50px);
  overflow: hidden;
  width: 100vw;
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 0;
}

@media (min-width: 769px) {
  .main-container {
    grid-template-columns: 320px 1fr;
    height: calc(100vh - 40px);
    position: relative;
    top: 0;
    max-width: 100vw;
    overflow: hidden;
  }
}

/* Left Column - Mobile First (Hidden) */
.left-column {
  display: none;
}

@media (min-width: 769px) {
  .left-column {
    display: flex;
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(4px);
    border-right: 1px solid rgba(34, 34, 34, 0.7);
    overflow-y: auto;
    padding: 15px;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 10;
    width: 320px;
    flex-shrink: 0;
  }
}

.section-title {
  font-size: 18px;
  color: #4caf50;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gear-section .section-title {
  font-size: 16px;
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .section-title {
    font-size: 12px;
    margin-bottom: 8px;
  }
  
  .gear-section .section-title {
    font-size: 10px;
    margin-bottom: 4px;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 11px;
    margin-bottom: 6px;
  }
  
  .gear-section .section-title {
    font-size: 9px;
    margin-bottom: 3px;
  }
}

/* Player Snapshot */
.player-snapshot {
  flex-shrink: 0;
}

.player-level {
  font-size: 20px;
  font-weight: bold;
  color: #4caf50;
  margin-bottom: 12px;
}

.xp-bar-container {
  margin-bottom: 12px;
}

.xp-bar-label {
  font-size: 13px;
  color: #888;
  margin-bottom: 6px;
}

.xp-bar {
  width: 100%;
  height: 24px;
  background: #1a1a1a;
  border: 3px solid #333;
  border-style: outset;
  border-radius: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #66bb6a);
  transition: width 0.3s;
  width: 0%;
}

.player-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 13px;
  color: #666;
  text-transform: uppercase;
}

.stat-value {
  font-size: 18px;
  font-weight: bold;
  color: #4caf50;
}

/* Gear Section */
.gear-section {
  flex-shrink: 0;
}

.gear-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gear-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #1a1a1a;
  border: 2px solid #333;
  border-style: outset;
  border-radius: 0;
  cursor: pointer;
  transition: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 60px;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
}

.gear-item:hover {
  background: #222;
  border-color: #4caf50;
}

.gear-item:active {
  background: #2a2a2a;
  border-style: inset;
  box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.5);
  transform: translate(1px, 1px);
}

.gear-icon-container {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gear-icon {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.gear-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.gear-stats-preview {
  margin-top: 2px;
}

.gear-stats-preview-content {
  font-size: 11px;
  color: #888;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stat-preview-item {
  white-space: nowrap;
}

.stat-value-preview {
  color: #4caf50;
  font-weight: bold;
}

.gear-item.empty .gear-stats-preview {
  display: none;
}

.gear-label {
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

@media (max-width: 768px) {
  .gear-list {
    gap: 4px;
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .gear-item {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
  }

  .gear-icon-container {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
  
  .gear-label {
    font-size: 8px;
  }
  
  .gear-name {
    font-size: 10px;
  }

  .gear-stats-preview-content {
    font-size: 8px;
  }
}

@media (max-width: 480px) {
  .gear-list {
    gap: 3px;
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .gear-item {
    flex: 0 0 auto;
    padding: 4px;
    gap: 4px;
    min-height: 44px;
    width: 100%;
  }

  .gear-icon-container {
    width: 24px;
    height: 24px;
  }
  
  .gear-label {
    font-size: 7px;
  }
  
  .gear-name {
    font-size: 9px;
  }

  .gear-stats-preview-content {
    font-size: 7px;
    gap: 3px;
  }
}

.gear-name.empty {
  color: #555;
  font-style: italic;
}

/* Rarity Colors */
.gear-name.common { color: #ccc; }
.gear-name.uncommon { color: #4caf50; }
.gear-name.rare { color: #2196f3; }
.gear-name.epic { color: #9c27b0; }
.gear-name.legendary { color: #ff9800; }

.inspect-item-name.common { color: #ccc; }
.inspect-item-name.uncommon { color: #4caf50; }
.inspect-item-name.rare { color: #2196f3; }
.inspect-item-name.epic { color: #9c27b0; }
.inspect-item-name.legendary { color: #ff9800; }

/* Leaderboard */
.leaderboard-section {
  flex-shrink: 0;
}

.leaderboard-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.leaderboard-tab {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #888;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  transition: all 0.2s;
}

.leaderboard-tab.active {
  background: #2a2a2a;
  border-color: #4caf50;
  color: #4caf50;
}

.leaderboard-tab:hover {
  background: #222;
}

.leaderboard-compact {
  font-size: 13px;
}

.leaderboard-entry-compact {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #1a1a1a;
  cursor: pointer;
  transition: color 0.2s;
}

.leaderboard-entry-compact:hover {
  color: #4caf50;
}

.leaderboard-rank-compact {
  color: #666;
  width: 30px;
}

.leaderboard-name-compact {
  flex: 1;
  color: #ccc;
}

.leaderboard-floor-compact {
  color: #4caf50;
  font-weight: bold;
}

.leaderboard-loading {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Combat Stage - Mobile First */
.combat-stage {
  display: flex;
  flex-direction: column;
  background: transparent;
  padding: 0;
  padding-top: 60px; /* Space for floor level display */
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  min-height: 0;
  z-index: 1;
  width: 100vw;
  height: 100%;
  flex: 1;
}

/* Remove the old floor indicator - floor is now in combat-area */
.combat-stage::before {
  display: none;
}

@media (min-width: 769px) {
  .combat-stage {
    padding: 20px;
    padding-top: 20px;
    padding-left: 40px;
    justify-content: flex-start;
    align-items: center;
    overflow: visible;
    height: 100%;
    max-height: 100%;
  }
}

.combat-stage > * {
  position: relative;
  z-index: 2;
}

/* Screen shake animations for combat impact */
.combat-stage.screen-shake {
  animation: screenShake 0.3s ease-out;
}

.combat-stage.screen-shake-strong {
  animation: screenShakeStrong 0.4s ease-out;
}

.combat-stage.screen-shake-weak {
  animation: screenShakeWeak 0.2s ease-out;
}

@keyframes screenShake {
  0%, 100% { transform: translateX(0) translateY(0); }
  10% { transform: translateX(-4px) translateY(-2px) rotate(-0.5deg); }
  20% { transform: translateX(4px) translateY(2px) rotate(0.5deg); }
  30% { transform: translateX(-3px) translateY(-1px) rotate(-0.3deg); }
  40% { transform: translateX(3px) translateY(1px) rotate(0.3deg); }
  50% { transform: translateX(-2px) translateY(-1px) rotate(-0.2deg); }
  60% { transform: translateX(2px) translateY(1px) rotate(0.2deg); }
  70% { transform: translateX(-1px) translateY(0) rotate(-0.1deg); }
  80% { transform: translateX(1px) translateY(0) rotate(0.1deg); }
  90% { transform: translateX(0) translateY(0) rotate(0deg); }
}

@keyframes screenShakeStrong {
  0%, 100% { transform: translateX(0) translateY(0); }
  8% { transform: translateX(-8px) translateY(-4px) rotate(-1deg); }
  16% { transform: translateX(8px) translateY(4px) rotate(1deg); }
  24% { transform: translateX(-6px) translateY(-3px) rotate(-0.8deg); }
  32% { transform: translateX(6px) translateY(3px) rotate(0.8deg); }
  40% { transform: translateX(-4px) translateY(-2px) rotate(-0.5deg); }
  48% { transform: translateX(4px) translateY(2px) rotate(0.5deg); }
  56% { transform: translateX(-3px) translateY(-1px) rotate(-0.3deg); }
  64% { transform: translateX(3px) translateY(1px) rotate(0.3deg); }
  72% { transform: translateX(-2px) translateY(-1px) rotate(-0.2deg); }
  80% { transform: translateX(2px) translateY(1px) rotate(0.2deg); }
  88% { transform: translateX(-1px) translateY(0) rotate(-0.1deg); }
  96% { transform: translateX(1px) translateY(0) rotate(0.1deg); }
}

@keyframes screenShakeWeak {
  0%, 100% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(-2px) translateY(-1px) rotate(-0.3deg); }
  50% { transform: translateX(2px) translateY(1px) rotate(0.3deg); }
  75% { transform: translateX(-1px) translateY(0) rotate(-0.1deg); }
}

.combat-area {
  position: relative;
  z-index: 2;
}

.combat-area {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  width: 100%;
  max-width: 100%;
  flex-wrap: nowrap;
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  margin: 0;
}

/* Dark platform/background behind combat area - keeps black area for battle */
.combat-area::before {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% + 60px);
  max-width: 650px;
  height: 280px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.92) 30%, rgba(0, 0, 0, 0.98) 60%, rgba(0, 0, 0, 1) 100%);
  border-radius: 50% 50% 0 0;
  z-index: 0;
  pointer-events: none;
  box-shadow: 
    0 -10px 30px rgba(0, 0, 0, 0.9),
    inset 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Floor platform line - right below characters */
.combat-area::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% + 60px);
  max-width: 650px;
  height: 5px;
  background: linear-gradient(90deg, transparent 0%, #4caf50 15%, #4caf50 85%, transparent 100%);
  box-shadow: 
    0 -3px 10px rgba(76, 175, 80, 0.7),
    0 0 20px rgba(76, 175, 80, 0.4);
  z-index: 1;
  pointer-events: none;
}

@media (min-width: 769px) {
  .combat-area {
    gap: 15px;
    max-width: 600px;
  }
  
  .combat-area::before {
    height: 280px;
    max-width: 600px;
    bottom: -15px;
  }
  
  .combat-area::after {
    max-width: 600px;
    height: 6px;
    bottom: -15px;
  }
}

.combatant {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  align-self: flex-end;
}

/* Ensure both player and enemy are on same baseline and even */
.player-combatant,
.enemy-combatant {
  align-items: center;
  justify-content: flex-end;
  align-self: flex-end;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.enemy-combatant,
.enemies-container,
.enemy-display {
  display: flex !important;
  visibility: visible !important;
}

@media (min-width: 769px) {
  .combat-area {
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 20px;
    padding: 0;
    padding-bottom: 20px;
    max-width: 600px;
    overflow: visible;
  }
  
  .combat-area::before {
    left: 0;
    transform: translateX(0);
    max-width: 600px;
  }
  
  .combat-area::after {
    left: 0;
    transform: translateX(0);
    max-width: 600px;
  }
}

.combatant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  justify-content: flex-end;
  align-self: flex-end;
}

/* Enemy sprite - no flip, use image as-is */
.enemy-combatant .combat-sprite {
  transform: none;
}

.enemy-combatant .combat-sprite.attack {
  animation: attackSwingEnemy 0.2s ease-out;
}

.enemy-combatant .combat-sprite.hit {
  animation: hitReactionEnemy 0.15s ease-out;
}

@keyframes attackSwingEnemy {
  0% { transform: translateX(0) scale(1); }
  30% { transform: translateX(8px) scale(1.05); }
  60% { transform: translateX(-4px) scale(0.98); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes hitReactionEnemy {
  0% { transform: translateX(0) scale(1); filter: brightness(1); }
  50% { transform: translateX(-5px) scale(0.95); filter: brightness(1.5); }
  100% { transform: translateX(0) scale(1); filter: brightness(1); }
}

@media (min-width: 769px) {
  @keyframes attackSwingEnemy {
    0% { transform: translateX(0) scale(1); }
    30% { transform: translateX(12px) scale(1.08); }
    60% { transform: translateX(-6px) scale(0.96); }
    100% { transform: translateX(0) scale(1); }
  }
}

.sprite-container {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  max-width: 180px;
  z-index: 10;
}

.combat-sprite {
  width: 180px;
  height: 180px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  display: block;
  object-fit: contain;
  transition: transform 0.1s ease-out;
  transform-origin: center bottom;
}

/* Shake animation when taking damage */
.combat-sprite.shake {
  animation: shakeDamage 0.3s ease-in-out;
}

/* Player attack and hit animations */
.player-combatant .combat-sprite.attack {
  animation: attackSwing 0.2s ease-out;
}

.player-combatant .combat-sprite.hit {
  animation: hitReaction 0.15s ease-out;
}

@keyframes shakeDamage {
  0%, 100% { transform: translateX(0) translateY(0); }
  10% { transform: translateX(-3px) translateY(2px) rotate(-1deg); }
  20% { transform: translateX(3px) translateY(-2px) rotate(1deg); }
  30% { transform: translateX(-2px) translateY(1px) rotate(-0.5deg); }
  40% { transform: translateX(2px) translateY(-1px) rotate(0.5deg); }
  50% { transform: translateX(-1px) translateY(0) rotate(-0.3deg); }
  60% { transform: translateX(1px) translateY(0) rotate(0.3deg); }
  70% { transform: translateX(-1px) translateY(0); }
  80% { transform: translateX(1px) translateY(0); }
  90% { transform: translateX(0) translateY(0); }
}

/* Enemy shake needs to maintain flip */
.enemy-combatant .combat-sprite.shake {
  animation: shakeDamageEnemy 0.3s ease-in-out;
}

@keyframes shakeDamageEnemy {
  0%, 100% { transform: translateX(0) translateY(0); }
  10% { transform: translateX(-3px) translateY(2px) rotate(-1deg); }
  20% { transform: translateX(3px) translateY(-2px) rotate(1deg); }
  30% { transform: translateX(-2px) translateY(1px) rotate(-0.5deg); }
  40% { transform: translateX(2px) translateY(-1px) rotate(0.5deg); }
  50% { transform: translateX(-1px) translateY(0) rotate(-0.3deg); }
  60% { transform: translateX(1px) translateY(0) rotate(0.3deg); }
  70% { transform: translateX(-1px) translateY(0); }
  80% { transform: translateX(1px) translateY(0); }
  90% { transform: translateX(0) translateY(0); }
}

@keyframes attackSwing {
  0% { transform: translateX(0) scale(1); }
  30% { transform: translateX(8px) scale(1.05); }
  60% { transform: translateX(-4px) scale(0.98); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes hitReaction {
  0% { transform: translateX(0) scale(1); filter: brightness(1); }
  50% { transform: translateX(-5px) scale(0.95); filter: brightness(1.5); }
  100% { transform: translateX(0) scale(1); filter: brightness(1); }
}

@media (min-width: 769px) {
  .combatant {
    gap: 8px;
    max-width: 45%;
    flex-shrink: 1;
    align-items: center;
    justify-content: flex-end;
  }
  
  .player-combatant,
  .enemy-combatant {
    align-items: center;
    justify-content: flex-end;
    align-self: flex-end;
  }
  
  .sprite-container {
    max-width: 180px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }
  
  .combat-sprite {
    width: 180px;
    height: 180px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: bottom;
  }
  
  @keyframes shakeDamage {
    0%, 100% { transform: translateX(0) translateY(0); }
    10% { transform: translateX(-4px) translateY(3px) rotate(-1.5deg); }
    20% { transform: translateX(4px) translateY(-3px) rotate(1.5deg); }
    30% { transform: translateX(-3px) translateY(2px) rotate(-1deg); }
    40% { transform: translateX(3px) translateY(-2px) rotate(1deg); }
    50% { transform: translateX(-2px) translateY(1px) rotate(-0.5deg); }
    60% { transform: translateX(2px) translateY(-1px) rotate(0.5deg); }
    70% { transform: translateX(-1px) translateY(0); }
    80% { transform: translateX(1px) translateY(0); }
    90% { transform: translateX(0) translateY(0); }
  }
  
  @keyframes attackSwing {
    0% { transform: translateX(0) scale(1); }
    30% { transform: translateX(12px) scale(1.08); }
    60% { transform: translateX(-6px) scale(0.96); }
    100% { transform: translateX(0) scale(1); }
  }
}

/* VS divider removed - characters are close together now */


.hp-bar-container {
  width: 100%;
  max-width: 100px;
  height: 16px;
  background: #1a1a1a;
  border: 2px solid #333;
  border-style: outset;
  border-radius: 0;
  overflow: visible;
  position: relative;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.hp-bar-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0a0a0a;
  z-index: 0;
  pointer-events: none;
}

@media (min-width: 769px) {
  .hp-bar-container {
    max-width: 140px;
    height: 18px;
  }
}

#playerHPBar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  transition: width 0.3s ease-out;
  min-width: 0;
  z-index: 1;
}

.enemy-hp-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  transition: width 0.3s ease-out;
  min-width: 0;
  z-index: 1;
}

@media (max-width: 768px) {
  .hp-bar-container {
    max-width: 120px;
    height: 16px;
  }
}

@media (max-width: 480px) {
  .hp-bar-container {
    max-width: 100px;
    height: 14px;
  }
}

.hp-bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 0px rgba(0,0,0,0.8);
  transition: width 0.3s ease-out, background-color 0.3s;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
}

@media (min-width: 769px) {
  .hp-bar {
    font-size: 9px;
  }
}

.player-hp-bar {
  background: linear-gradient(90deg, #4caf50, #66bb6a);
}

.enemy-hp-bar {
  background: linear-gradient(90deg, #f44336, #e57373);
}

.enemies-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.enemy-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  width: 100%;
  justify-content: center;
  border: none;
  padding: 0;
  background: transparent;
}

.enemy-info-text {
  display: block;
  color: #4caf50;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

@media (max-width: 480px) {
  .enemy-info-text {
    font-size: 12px;
  }
}

.enemy-display.boss {
  border: none;
  padding: 0;
  background: transparent;
}

.no-enemy {
  color: #555;
  font-style: italic;
  text-align: center;
}



.combatant-stats {
  font-size: 8px;
  color: #888;
  text-align: center;
  margin-top: 2px;
  min-height: 16px;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .combatant-stats {
    font-size: 7px;
  }
}

@media (max-width: 480px) {
  .combatant-stats {
    font-size: 6px;
  }
}

/* Floating Damage Numbers */
.damage-numbers {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 100;
  width: 200px;
  height: 120px;
  overflow: visible;
}

.damage-number {
  position: absolute;
  font-size: 20px;
  font-weight: bold;
  color: #ff4444;
  text-shadow: 
    2px 2px 0px #000,
    3px 3px 6px rgba(0, 0, 0, 0.9),
    0px 0px 10px rgba(255, 68, 68, 0.9),
    0px 0px 5px rgba(255, 68, 68, 0.7);
  animation: floatUpDamage 1s ease-out forwards;
  pointer-events: none;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  transform-origin: center bottom;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 100;
}

.damage-number.crit {
  color: #ffaa00;
  font-size: 26px;
  animation: floatUpCrit 1.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  text-shadow: 
    2px 2px 0px #000,
    3px 3px 8px rgba(0, 0, 0, 0.9),
    0px 0px 15px rgba(255, 170, 0, 1),
    0px 0px 10px rgba(255, 170, 0, 0.9),
    0px 0px 5px rgba(255, 170, 0, 0.7);
  font-weight: 900;
}

.damage-number.player-damage {
  color: #f44336;
}

.damage-number.enemy-damage {
  color: #4caf50;
}

@keyframes floatUpDamage {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(0.9);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-30px) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-70px) scale(0.95);
  }
}

@keyframes floatUpCrit {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(0.7) rotate(-8deg);
  }
  30% {
    opacity: 1;
    transform: translateX(-50%) translateY(-25px) scale(1.4) rotate(8deg);
  }
  60% {
    opacity: 1;
    transform: translateX(-50%) translateY(-45px) scale(1.25) rotate(-5deg);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-90px) scale(0.9) rotate(0deg);
  }
}

/* Activity Feed - Removed */

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #1a1a1a;
  border: 4px solid #4caf50;
  border-style: outset;
  border-radius: 0;
  padding: 20px;
  max-width: 600px;
  width: 90%;
  text-align: center;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.8), 8px 8px 0px rgba(0, 0, 0, 0.4);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.modal-content h2 {
  color: #4caf50;
  margin-bottom: 20px;
  font-size: 24px;
}

.modal-close-btn {
  padding: 12px 30px;
  font-size: 16px;
  font-family: inherit;
  background: #4caf50;
  color: white;
  border: 3px solid #66bb6a;
  border-style: outset;
  border-radius: 0;
  cursor: pointer;
  font-weight: bold;
  transition: none;
  margin-top: 20px;
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.modal-close-btn:hover {
  background: #66bb6a;
}

.modal-close-btn:active {
  border-style: inset;
  box-shadow: inset 3px 3px 0px rgba(0, 0, 0, 0.5);
  transform: translate(2px, 2px);
}

/* Offline Rewards */
.offline-rewards-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
  padding: 20px;
  background: #0f0f0f;
  border-radius: 4px;
}

.offline-reward-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #121212;
  border-left: 3px solid #ff9800;
  border-radius: 4px;
}

.reward-label {
  color: #ccc;
  font-size: 16px;
  font-weight: bold;
}

.reward-value {
  color: #4caf50;
  font-size: 18px;
  font-weight: bold;
}

/* Gear Inspect */
.inspect-stats {
  text-align: left;
  padding: 20px;
  background: #0f0f0f;
  border-radius: 4px;
  margin: 20px 0;
}

.inspect-stats ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inspect-stats li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #222;
}

.inspect-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 15px;
}

.inspect-action-btn {
  grid-column: 3;
  grid-row: 1 / 3;
  padding: 8px 16px;
  font-size: 12px;
  font-family: inherit;
  background: #2a2a2a;
  color: #ccc;
  border: 2px solid #444;
  border-style: outset;
  border-radius: 0;
  cursor: pointer;
  transition: none;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  white-space: nowrap;
  min-height: 44px;
  min-width: 70px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 769px) {
  .inspect-action-btn {
    padding: 10px 20px;
    font-size: 13px;
    min-width: 80px;
  }
}

.inspect-action-btn:hover {
  background: #333;
  border-color: #4caf50;
  color: #4caf50;
}

.inspect-action-btn:active {
  border-style: inset;
  box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.5);
  transform: translate(1px, 1px);
}

/* Gear Modal */
.gear-inventory-content {
  max-height: 60vh;
  overflow-y: auto;
  text-align: left;
  padding: 10px 0;
}

@media (min-width: 769px) {
  .gear-inventory-content {
    max-height: 70vh;
  }
}

.gear-modal-content {
  max-width: 90%;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 15px;
  display: flex;
  flex-direction: column;
}

.gear-modal-content .modal-close-btn {
  margin-top: 15px;
  align-self: center;
  min-width: 120px;
  min-height: 44px;
}

.gear-modal-content h2 {
  font-size: 18px;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  text-align: center;
}

@media (max-width: 768px) {
  .gear-modal-content {
    max-width: 95%;
    padding: 12px;
    max-height: 95vh;
  }

  .gear-modal-content h2 {
    font-size: 16px;
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  .gear-modal-content {
    max-width: 100%;
    padding: 10px;
    max-height: 100vh;
    border-radius: 0;
  }

  .gear-modal-content h2 {
    font-size: 14px;
    margin-bottom: 10px;
  }
}

.equipped-section {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 3px solid #333;
}

.equipped-section h3,
.inventory-section h3 {
  color: #4caf50;
  margin-bottom: 12px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 2px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  text-align: left;
  padding-bottom: 6px;
  border-bottom: 2px solid #333;
}

.inventory-type-group {
  margin-bottom: 18px;
}

.inventory-type-label {
  color: #888;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
  padding: 4px 0;
  border-bottom: 2px solid #333;
}

@media (max-width: 768px) {
  .equipped-section {
    margin-bottom: 20px;
    padding-bottom: 12px;
  }

  .equipped-section h3,
  .inventory-section h3 {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .inventory-type-group {
    margin-bottom: 15px;
  }

  .inventory-type-label {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .equipped-section {
    margin-bottom: 15px;
    padding-bottom: 10px;
  }

  .equipped-section h3,
  .inventory-section h3 {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .inventory-type-group {
    margin-bottom: 12px;
  }

  .inventory-type-label {
    font-size: 9px;
  }
}

.equipped-item-display {
  padding: 10px;
  margin: 6px 0;
  background: #1a1a1a;
  border: 3px solid #4caf50;
  border-style: outset;
  border-radius: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  flex-wrap: wrap;
}

.equipped-item-display.empty {
  border-color: #333;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .equipped-item-display {
    padding: 8px;
    margin: 5px 0;
    gap: 8px;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .equipped-item-display {
    padding: 6px;
    margin: 4px 0;
    gap: 6px;
  }
}

.equipped-item-display .item-name {
  font-weight: bold;
  margin-bottom: 5px;
}

/* Item stats styles are now in .item-details section above */

.stat-line {
  margin: 2px 0;
  font-size: 11px;
}

@media (max-width: 768px) {
  .stat-line {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .stat-line {
    font-size: 9px;
  }
}

.item-details {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.item-name {
  font-weight: bold;
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
  line-height: 1.3;
  color: #888;
}

.stat-line {
  white-space: nowrap;
}

@media (min-width: 769px) {
  .item-name {
    font-size: 14px;
  }
  
  .item-stats {
    font-size: 11px;
    gap: 8px;
  }
}

.item-icon-large {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-icon-large svg {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.item-icon-medium {
  width: 50px;
  height: 50px;
  grid-row: 1 / 3;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-icon-medium svg {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

@media (min-width: 769px) {
  .item-icon-medium {
    width: 60px;
    height: 60px;
  }
}

.inventory-item-display {
  width: 100%;
  min-height: 50px;
  height: auto;
  padding: 8px;
  margin: 4px 0;
  background: #1a1a1a;
  border: 2px solid #ccc;
  border-style: outset;
  border-radius: 0;
  display: grid;
  grid-template-columns: 50px 1fr auto;
  grid-template-rows: auto auto;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  transition: none;
  position: relative;
}

.inventory-item-display:hover {
  background: #222;
  border-color: #4caf50;
}

.inventory-item-display:active {
  border-style: inset;
  box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.5);
  transform: translate(1px, 1px);
}

@media (min-width: 769px) {
  .inventory-item-display {
    grid-template-columns: 60px 1fr auto;
    padding: 10px;
    min-height: 60px;
  }
}

.item-header {
  flex: 1;
}

/* Item name styles are now in .item-name above */

/* Profile Modal */
.profile-modal .modal-content {
  max-width: 600px;
}

.profile-content {
  text-align: center;
}

.profile-body {
  padding: 30px 20px;
  background: #0f0f0f;
  border-radius: 4px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
  justify-items: center;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  background: rgba(26, 26, 26, 0.6);
  border: 1px solid #333;
  border-radius: 8px;
  min-width: 120px;
  transition: transform 0.2s, border-color 0.2s;
}

.profile-stat:hover {
  transform: translateY(-2px);
  border-color: #4caf50;
}

.profile-stat-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.profile-stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #4caf50;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.auth-section-minimal {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #333;
}

.auth-section-minimal.logged-in {
  padding-top: 10px;
  margin-top: 20px;
}

.auth-minimal-button {
  width: 100%;
  padding: 8px 16px;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid #4caf50;
  color: #4caf50;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  border-radius: 4px;
  transition: all 0.2s;
}

.auth-minimal-button:hover {
  background: rgba(76, 175, 80, 0.2);
  border-color: #66bb6a;
}

.auth-minimal-button.logged-in {
  padding: 6px 12px;
  font-size: 11px;
  background: rgba(244, 67, 54, 0.1);
  border-color: #f44336;
  color: #f44336;
}

.auth-minimal-button.logged-in:hover {
  background: rgba(244, 67, 54, 0.2);
}

/* Mobile-first styles are now in base styles above */

/* Floor Level Display - Mobile First */
.floor-level-display {
  display: block;
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 26, 0.9);
  backdrop-filter: blur(4px);
  border: 3px solid #4caf50;
  border-style: outset;
  border-radius: 0;
  padding: 6px 16px;
  z-index: 50;
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.floor-level-display span {
  color: #4caf50;
  font-weight: bold;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (min-width: 769px) {
  .floor-level-display {
    display: none;
  }
}
