@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
  --color-bg-dark: #121214;
  --color-stone: #25262a;
  --color-stone-light: #3d3e44;
  --color-gold: #c99a4e;
  --color-copper: #a66a38;
  --color-border-dark: #1e1f22;
  --color-common: #e0e0e0;
  --color-uncommon: #4caf50;
  --color-rare: #2196f3;
  --color-epic: #9c27b0;
  --color-legendary: #ff9800;

  --font-pixel: 'Press Start 2P', monospace;
  --font-text: 'VT323', monospace;
}

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

body {
  background-color: var(--color-bg-dark);
  color: #f1f1f1;
  font-family: var(--font-text);
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

/* 3-Section Container */
.game-container {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-left: 4px solid var(--color-stone-light);
  border-right: 4px solid var(--color-stone-light);
  background-color: var(--color-stone);
}

/* A. TOP BAR HEADER */
.game-header {
  background-color: #1a1a1d;
  border-bottom: 4px solid var(--color-gold);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.resource-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}

.resource {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background-color: rgba(0, 0, 0, 0.4);
  padding: 4px 6px;
  border: 1px solid var(--color-stone-light);
  border-radius: 4px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--color-gold);
  white-space: nowrap;
  flex: 1;
}

.resource.gems {
  color: #ff4081;
}

.header-icons {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 4px;
  align-items: center;
}

.header-btn {
  background: none;
  border: 1px solid var(--color-stone-light);
  color: #ccc;
  padding: 5px 6px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.header-btn:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* B. CENTRAL PANEL (MANAGEMENT) */
.central-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background-color: var(--color-stone);
  padding: 12px;
  gap: 12px;
}

/* Tibia-style Character Layout Grid */
.character-layout-grid {
  display: grid;
  grid-template-columns: 48px 48px 1fr 48px 48px;
  gap: 6px;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border: 2px solid var(--color-copper);
  border-radius: 6px;
  align-items: start;
}

@media (max-width: 480px) {
  .character-layout-grid {
    grid-template-columns: 36px 36px 1fr 36px 36px;
    gap: 4px;
    padding: 6px;
  }

  .eq-column-grid {
    gap: 4px;
  }

  .eq-slot {
    width: 36px !important;
    height: 36px !important;
  }

  .eq-slot span {
    font-size: 5px !important;
  }

  .eq-slot div {
    transform: scale(0.8);
    /* Scale down the 32x32 icon slightly to sit nicely */
  }

  .party-member-btn {
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
  }

  .rune-slot {
    width: 20px !important;
    height: 20px !important;
    font-size: 10px !important;
  }

  .portrait-wrapper {
    width: 48px !important;
    height: 48px !important;
  }

  .hero-avatar {
    width: 48px !important;
    height: 48px !important;
  }

  .hero-pet {
    width: 36px !important;
    height: 36px !important;
    left: -12px !important;
  }
}

.eq-column-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eq-slot {
  width: 48px;
  height: 48px;
  background-color: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--color-stone-light);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #666;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
  text-transform: uppercase;
  overflow: hidden;
}

.eq-slot:hover {
  border-color: var(--color-copper);
}

.eq-slot.equipped {
  border-color: var(--color-gold);
}

/* Center Character Column */
.center-character-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 156px;
  padding: 0 4px;
}

.hero-portrait-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hero-avatar {
  width: 64px;
  height: 64px;
  background-color: #3a3b40;
  border: 2px solid var(--color-gold);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-size: 18px;
  transition: transform 0.1s ease-out, background-position 0.1s ease-out;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.hero-header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-name {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--color-gold);
}

.exp-bar-container {
  width: 100%;
  height: 8px;
  background-color: #1a1a1d;
  border: 1px solid var(--color-stone-light);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #81c784);
  width: 0%;
  transition: width 0.3s ease;
}

/* Mini Party Selector & Runes Container */
.party-and-runes-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.party-selector-mini {
  display: flex;
  gap: 4px;
}

.party-member-btn {
  width: 28px;
  height: 28px;
  background: var(--color-stone-light);
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.party-member-btn.active {
  border-color: var(--color-gold);
  background: var(--color-stone);
}

.runes-slots-mini {
  display: flex;
  gap: 4px;
}

.rune-slot {
  width: 26px;
  height: 26px;
  background: #111;
  border: 2px solid var(--color-stone-light);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #555;
}

.rune-slot:hover {
  border-color: var(--color-gold);
}

/* Inventory Grid */
.inventory-section {
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid var(--color-stone-light);
  border-radius: 6px;
  padding: 10px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.inventory-cell {
  aspect-ratio: 1;
  background: #1a1a1d;
  border: 1px solid var(--color-stone-light);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color 0.2s;
}

.inventory-cell:hover {
  background: #25262a;
}

/* Bottom Tab Navigation for Central Area */
.central-tabs {
  display: flex;
  gap: 4px;
  margin-top: auto;
  border-top: 2px solid var(--color-stone-light);
  padding-top: 8px;
}

.tab-btn {
  flex: 1;
  background-color: var(--color-stone-light);
  border: 1px solid var(--color-border-dark);
  color: #fff;
  padding: 8px 4px;
  cursor: pointer;
  font-family: var(--font-text);
  font-size: 16px;
  text-align: center;
  border-radius: 4px;
}

.tab-btn.active {
  background-color: var(--color-gold);
  color: #000;
  font-weight: bold;
}

/* C. BOTTOM BAR (IDLE COMBAT AREA) */
.combat-area {
  height: 200px;
  background-color: #1c1f24;
  border-top: 4px solid var(--color-gold);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.combat-stage-header {
  background-color: rgba(0, 0, 0, 0.6);
  padding: 2px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--color-gold);
}

.combat-canvas-container {
  position: relative;
  flex: 1;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Chat overlay window widget */
.chat-widget {
  position: fixed;
  top: 120px;
  left: calc(50% + 255px);
  width: 240px;
  height: 180px;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid var(--color-gold);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  z-index: 100;
  transition: height 0.25s ease-in-out;
}

@media (max-width: 980px) {
  .chat-widget {
    left: auto;
    right: 15px;
    top: 120px;
    width: 200px;
    height: 180px;
  }
}

.chat-header {
  background: var(--color-stone-light);
  padding: 4px 6px;
  font-family: var(--font-pixel);
  font-size: 8px;
  display: flex;
  justify-content: space-between;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-input-row {
  display: flex;
  border-top: 1px solid var(--color-stone-light);
}

.chat-input {
  flex: 1;
  background: #111;
  border: none;
  color: #fff;
  padding: 4px;
  font-family: var(--font-text);
  font-size: 14px;
}

/* Rarity classes styling & glowing highlights for inventory cells and equipment slots */
.rarity-Common {
  color: var(--color-common);
  border-color: var(--color-stone-light);
}

.rarity-Uncommon {
  color: var(--color-uncommon);
}

.rarity-Rare {
  color: var(--color-rare);
}

.rarity-Epic {
  color: var(--color-epic);
}

.rarity-Legendary {
  color: var(--color-legendary);
}

.inventory-cell.rarity-Common,
.eq-slot.equipped.rarity-Common,
.cube-grid-slot.rarity-Common {
  border-color: var(--color-stone-light) !important;
  box-shadow: none !important;
}

.inventory-cell.rarity-Uncommon,
.eq-slot.equipped.rarity-Uncommon,
.cube-grid-slot.rarity-Uncommon {
  border-color: var(--color-uncommon) !important;
  box-shadow: inset 0 0 6px rgba(76, 175, 80, 0.3) !important;
}

.inventory-cell.rarity-Rare,
.eq-slot.equipped.rarity-Rare,
.cube-grid-slot.rarity-Rare {
  border-color: var(--color-rare) !important;
  box-shadow: inset 0 0 8px rgba(33, 150, 243, 0.4) !important;
}

.inventory-cell.rarity-Epic,
.eq-slot.equipped.rarity-Epic,
.cube-grid-slot.rarity-Epic {
  border-color: var(--color-epic) !important;
  box-shadow: inset 0 0 10px rgba(156, 39, 176, 0.5) !important;
}

.inventory-cell.rarity-Legendary,
.eq-slot.equipped.rarity-Legendary,
.cube-grid-slot.rarity-Legendary {
  border-color: var(--color-legendary) !important;
  box-shadow: inset 0 0 12px rgba(255, 152, 0, 0.6) !important;
}

/* Upgrades Styles */
.upgrade-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--color-stone-light);
  border-radius: 4px;
  padding: 6px 10px;
  gap: 10px;
}

.upgrade-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.upgrade-title {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--color-gold);
}

.upgrade-desc {
  font-size: 14px;
  color: #bbb;
}

.upgrade-btn {
  background: var(--color-copper);
  border: 1px solid var(--color-gold);
  color: #fff;
  padding: 4px 10px;
  font-family: var(--font-text);
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  min-width: 80px;
  text-align: center;
}

.upgrade-btn:hover:not(:disabled) {
  background: var(--color-gold);
  color: #000;
}

.upgrade-btn:disabled {
  background: #333;
  border-color: #555;
  color: #888;
  cursor: not-allowed;
}

/* Auth Screen Overlay Modal */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(18, 18, 20, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.auth-box {
  width: 320px;
  background-color: var(--color-stone);
  border: 4px solid var(--color-gold);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-box h2 {
  font-family: var(--font-pixel);
  font-size: 18px;
  color: var(--color-gold);
  letter-spacing: 1px;
  text-shadow: 2px 2px #000;
}

.auth-box p {
  font-size: 15px;
  color: #ccc;
  line-height: 1.4;
  font-family: var(--font-text);
}

.auth-box input {
  background: #121214;
  border: 2px solid var(--color-stone-light);
  border-radius: 4px;
  color: #fff;
  padding: 8px 12px;
  font-family: var(--font-pixel);
  font-size: 10px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.auth-box input:focus {
  border-color: var(--color-gold);
}

.auth-box button {
  background: var(--color-copper);
  border: 2px solid var(--color-gold);
  border-radius: 4px;
  color: #fff;
  padding: 8px 16px;
  font-family: var(--font-pixel);
  font-size: 10px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  box-shadow: 0 4px #76451e;
}

.auth-box button:hover {
  background: var(--color-gold);
  color: #000;
}

.auth-box button:active {
  transform: translateY(2px);
  box-shadow: 0 2px #76451e;
}

.auth-error-msg {
  color: #ff5252;
  font-size: 14px;
  font-family: var(--font-text);
}

/* Chat Widget Minimized State styling */
.chat-widget.minimized {
  height: 26px !important;
  overflow: hidden;
}

.chat-widget.minimized .chat-messages,
.chat-widget.minimized .chat-input-row {
  display: none !important;
}

/* ==========================================
   MARKETPLACE / SHOP MODAL STYLES
   ========================================== */
.shop-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(18, 18, 20, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.shop-box {
  width: 95%;
  max-width: 680px;
  height: 90vh;
  background-color: var(--color-stone);
  border: 4px solid var(--color-gold);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.shop-header {
  background-color: #1a1a1d;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--color-gold);
}

.shop-header h2 {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--color-gold);
  text-shadow: 2px 2px #000;
}

.shop-close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.shop-close-btn:hover {
  color: #ff5252;
}

.shop-tabs {
  display: flex;
  background-color: rgba(0, 0, 0, 0.3);
  border-bottom: 2px solid var(--color-stone-light);
}

.shop-tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: #aaa;
  padding: 12px;
  font-family: var(--font-pixel);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-tab-btn.active {
  color: var(--color-gold);
  border-bottom-color: var(--color-gold);
  background-color: rgba(255, 255, 255, 0.03);
}

.shop-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.shop-tab-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.shop-layout {
  display: flex;
  gap: 16px;
  height: 100%;
}

.shop-filters-sidebar {
  width: 200px;
  background-color: rgba(0, 0, 0, 0.25);
  border: 2px solid var(--color-stone-light);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #ccc;
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.price-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.price-input-wrapper span {
  position: absolute;
  left: 6px;
  color: #666;
  font-family: var(--font-pixel);
  font-size: 8px;
}

.price-input-wrapper input,
.filter-group select {
  width: 100%;
  background-color: #121214;
  border: 1px solid var(--color-stone-light);
  border-radius: 4px;
  color: #fff;
  padding: 6px 6px 6px 20px;
  font-family: var(--font-text);
  font-size: 16px;
  outline: none;
}

.filter-group select {
  padding-left: 6px;
}

/* Dual Range Slider Styling */
.slider-track-container {
  position: relative;
  height: 20px;
  margin-top: 4px;
}

.range-slider {
  position: absolute;
  width: 100%;
  pointer-events: none;
  -webkit-appearance: none;
  background: none;
  height: 4px;
  top: 8px;
}

.range-slider::-webkit-slider-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  pointer-events: auto;
  -webkit-appearance: none;
  border: 2px solid var(--color-gold);
}

.shop-listings-container {
  flex: 1;
  background-color: rgba(0, 0, 0, 0.15);
  border: 2px solid var(--color-stone-light);
  border-radius: 6px;
  padding: 12px;
  overflow-y: auto;
}

.shop-listings-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.market-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--color-stone-light);
  border-radius: 6px;
  padding: 8px 12px;
  transition: border-color 0.2s;
}

.market-item-card:hover {
  border-color: var(--color-gold);
}

.market-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.market-item-icon {
  width: 48px;
  height: 48px;
  background-color: rgba(0, 0, 0, 0.5);
  border: 2px solid var(--color-stone-light);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.market-item-details {
  display: flex;
  flex-direction: column;
}

.market-item-name {
  font-family: var(--font-pixel);
  font-size: 8px;
}

.market-item-meta {
  font-size: 14px;
  color: #888;
  margin-top: 2px;
}

.market-item-action {
  display: flex;
  align-items: center;
  gap: 16px;
}

.market-price-tag {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: #4caf50;
  text-shadow: 1px 1px #000;
}

.btn-primary {
  background-color: var(--color-copper);
  border: 2px solid var(--color-gold);
  color: #fff;
  padding: 8px 16px;
  font-family: var(--font-pixel);
  font-size: 8px;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 4px #76451e;
  border-bottom: 4px solid var(--color-gold);
}

.btn-primary:hover {
  background-color: var(--color-gold);
  color: #000;
}

.btn-secondary {
  background-color: var(--color-stone-light);
  border: 1px solid var(--color-border-dark);
  color: #fff;
  padding: 6px 12px;
  font-family: var(--font-text);
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
}

.btn-secondary:hover {
  background-color: #5d5e64;
}

/* Sell layout flows */
.sell-flow-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
  height: 100%;
}

.sell-pricing-card {
  background-color: rgba(0, 0, 0, 0.25);
  border: 2px solid var(--color-stone-light);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* Server Announcement Bar */
.announcement-bar {
  background-color: #0b0b0c;
  border-bottom: 2px solid var(--color-gold);
  height: 24px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  z-index: 100;
}

.announcement-text {
  position: absolute;
  white-space: nowrap;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #fff;
  will-change: transform;
  transform: translateX(100%);
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes marquee {
  0% {
    transform: translateX(100%);
  }

  100% {
    transform: translateX(-100%);
  }
}

.announcement-active {
  animation: marquee 12s linear forwards;
}

/* Quests Modal & Victory Styles */
.quests-box {
  width: 95%;
  max-width: 480px;
  background-color: var(--color-stone);
  border: 4px solid var(--color-gold);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
  padding: 16px;
  overflow: hidden;
}

.quests-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.quest-card {
  background-color: rgba(0, 0, 0, 0.35);
  border: 2px solid var(--color-stone-light);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s;
  position: relative;
}

.quest-card:hover:not(.locked) {
  border-color: var(--color-gold);
}

.quest-card.locked {
  opacity: 0.6;
}

.quest-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quest-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quest-card-title {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--color-gold);
}

.quest-card-meta {
  font-size: 13px;
  color: #888;
}

.quest-card-desc {
  font-size: 14px;
  color: #bbb;
  margin-top: 4px;
  line-height: 1.3;
}

.quest-card-rewards {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.quest-reward-preview-slot {
  width: 36px;
  height: 36px;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--color-stone-light);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.quest-reward-qty-tag {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 8px;
  font-family: var(--font-pixel);
  color: #fff;
  text-shadow: 1px 1px #000;
}

/* Victory Box Overlay styling */
.quest-victory-box {
  width: 320px;
  background-color: var(--color-stone);
  border: 4px solid var(--color-gold);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.quest-victory-box h2 {
  font-family: var(--font-pixel);
  font-size: 14px;
  margin-bottom: 8px;
}

.quest-rewards-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  width: 100%;
}

.quest-reward-card {
  width: 80px;
  height: 80px;
  background-color: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--color-stone-light);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}

.quest-reward-card span {
  font-size: 13px;
  color: #ccc;
}

/* Cube Modal Styles */
.cube-box {
  width: 360px;
  background-color: var(--color-stone);
  border: 4px solid var(--color-gold);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.cube-selectors {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.cube-selectors .select-wrapper {
  flex: 1;
}

.cube-selectors select {
  width: 100%;
  background-color: #1a1a1d;
  border: 2px solid var(--color-copper);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
}

.cube-selectors select option {
  background-color: var(--color-stone);
  color: #fff;
}

/* 3x3 Grid Centered */
.cube-grid-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
  position: relative;
  background: radial-gradient(circle, rgba(201, 154, 78, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
}

.cube-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  z-index: 2;
}

.cube-grid-slot {
  width: 48px;
  height: 48px;
  background-color: rgba(0, 0, 0, 0.5);
  border: 2px solid var(--color-stone-light);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.cube-grid-slot:hover {
  border-color: var(--color-copper);
  background-color: rgba(26, 26, 29, 0.8);
}

.cube-grid-slot.filled {
  border-color: var(--color-gold);
  background-color: rgba(0, 0, 0, 0.7);
}

/* Warnings */
.cube-warning {
  color: #ff3333;
  font-size: 11px;
  text-align: center;
  font-family: var(--font-text);
  margin-top: -4px;
  line-height: 1.3;
}

/* Action Row */
.cube-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cube-action-btn-secondary {
  flex: 1;
  background-color: #4a3424;
  border: 2px solid var(--color-copper);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 10px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
  text-align: center;
}

.cube-action-btn-secondary:hover {
  background-color: #5d4037;
}

.cube-synthesize-btn {
  background-color: #1a4f72;
  border: 2px solid #2196f3;
  color: #fff;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cube-synthesize-btn:hover:not(:disabled) {
  background-color: #1f6491;
  border-color: #64b5f6;
}

.cube-synthesize-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Depot Checkbox */
.cube-depot-checkbox-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -4px;
}

.cube-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #ccc;
  user-select: none;
}

.cube-checkbox-label input {
  display: none;
}

.cube-custom-checkbox {
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-copper);
  border-radius: 2px;
  display: inline-block;
  position: relative;
  background: #111;
}

.cube-checkbox-label input:checked+.cube-custom-checkbox::after {
  content: '✓';
  color: var(--color-gold);
  font-size: 10px;
  font-weight: bold;
  position: absolute;
  top: -2px;
  left: 1px;
}

/* Info Panel & Probabilities */
.cube-info-panel {
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--color-stone-light);
  border-radius: 4px;
  padding: 8px 12px;
}

.cube-info-title {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #e0e0e0;
  text-align: center;
  border-bottom: 1px dashed var(--color-stone-light);
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.cube-prob-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cube-prob-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #bbb;
}

.cube-prob-item span {
  font-weight: bold;
  font-family: var(--font-pixel);
  font-size: 8px;
}

/* Inventory Grid inside Modal */
.cube-inventory-wrapper {
  border-top: 1px solid var(--color-stone-light);
  padding-top: 10px;
}

.cube-inventory-wrapper .inventory-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.cube-inventory-wrapper .inventory-cell.slotted {
  opacity: 0.3;
  pointer-events: none;
  border-color: #333;
}

/* Roulette Wheel Container */
.cube-roulette-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 0;
  height: 200px;
  position: relative;
  background: radial-gradient(circle, rgba(216, 67, 21, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
}

.roulette-wheel {
  position: relative;
  width: 160px;
  height: 160px;
}

.roulette-spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #d84315;
  border: 3px solid var(--color-gold);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 8px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s, background-color 0.2s;
  outline: none;
}

.roulette-spin-btn:hover:not(:disabled) {
  background-color: #ff5722;
  transform: translate(-50%, -50%) scale(1.05);
}

.roulette-spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.roulette-slot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  background-color: rgba(0, 0, 0, 0.6);
  border: 2px solid var(--color-stone-light);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: all 0.1s ease;
}

.roulette-slot.active-spin {
  border-color: #ffeb3b !important;
  box-shadow: 0 0 12px #ffeb3b !important;
  transform: translate(-50%, -50%) scale(1.15) !important;
  background-color: rgba(255, 235, 59, 0.2);
}

.roulette-slot.rarity-Common {
  border-color: var(--color-stone-light) !important;
}

.roulette-slot.rarity-Uncommon {
  border-color: var(--color-uncommon) !important;
  box-shadow: inset 0 0 4px rgba(76, 175, 80, 0.3);
}

.roulette-slot.rarity-Rare {
  border-color: var(--color-rare) !important;
  box-shadow: inset 0 0 6px rgba(33, 150, 243, 0.4);
}

.roulette-slot.rarity-Epic {
  border-color: var(--color-epic) !important;
  box-shadow: inset 0 0 8px rgba(156, 39, 176, 0.5);
}

.roulette-slot.rarity-Legendary {
  border-color: var(--color-legendary) !important;
  box-shadow: inset 0 0 10px rgba(255, 152, 0, 0.6);
}

/* ==========================================
   PET SYSTEM STYLES
   ========================================== */
.pets-box {
  width: 360px;
  background-color: var(--color-stone);
  border: 4px solid var(--color-gold);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.pets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.pet-card {
  background-color: rgba(0, 0, 0, 0.35);
  border: 2px solid var(--color-stone-light);
  border-radius: 6px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  text-align: center;
  font-family: var(--font-text);
  min-height: 120px;
}

.pet-card:hover {
  border-color: var(--color-gold);
}

.pet-card-title {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--color-gold);
}

.pet-card-stats {
  font-size: 13px;
  color: #ccc;
  line-height: 1.2;
}

.pet-card-price {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #ffd54f;
  margin-top: auto;
  padding: 2px 0;
}

.hero-pet {
  image-rendering: pixelated;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  transition: transform 0.15s ease-out;
}

/* ============================================================
   AUTH SCREEN — Full Login / Register / Forgot Password
   ============================================================ */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(4px);
}

.auth-box {
  background: linear-gradient(160deg, #1a1b20 0%, #12131a 100%);
  border: 2px solid var(--color-gold);
  border-radius: 12px;
  padding: 28px 24px 24px;
  width: 340px;
  max-width: calc(100vw - 32px);
  box-shadow:
    0 0 40px rgba(201, 154, 78, 0.15),
    0 20px 60px rgba(0, 0, 0, 0.7);
  animation: authBoxIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes authBoxIn {
  from {
    transform: scale(0.88) translateY(20px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Logo */
.auth-logo {
  text-align: center;
  margin-bottom: 20px;
}

.auth-logo-icon {
  font-size: 32px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 12px rgba(201, 154, 78, 0.6));
}

.auth-title {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--color-gold);
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(201, 154, 78, 0.4);
}

.auth-subtitle {
  font-family: var(--font-text);
  font-size: 14px;
  color: #666;
  margin-top: 2px;
}

/* Tabs */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid #2a2b30;
  margin-bottom: 18px;
  gap: 0;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #666;
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.auth-tab:hover {
  color: #aaa;
}

.auth-tab.active {
  color: var(--color-gold);
  border-bottom-color: var(--color-gold);
}

/* Panels */
.auth-panel {
  display: none;
}

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

/* Form fields */
.auth-field-group {
  margin-bottom: 12px;
}

.auth-field-group label {
  display: block;
  font-family: var(--font-pixel);
  font-size: 7px;
  color: #888;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.auth-field-group input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 10px 12px;
  color: #f1f1f1;
  font-family: var(--font-text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field-group input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 2px rgba(201, 154, 78, 0.15);
}

.auth-field-group input::placeholder {
  color: #444;
}

/* Submit button */
.auth-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--color-gold), var(--color-copper));
  border: none;
  border-radius: 6px;
  padding: 11px;
  color: #0d0d0f;
  font-family: var(--font-pixel);
  font-size: 9px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 6px;
  letter-spacing: 1px;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 12px rgba(201, 154, 78, 0.3);
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(201, 154, 78, 0.45);
}

.auth-submit-btn:active {
  transform: translateY(0);
  opacity: 0.85;
}

.auth-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Google divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: #444;
  font-family: var(--font-text);
  font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #2a2b30;
}

.auth-divider span {
  color: #555;
}

/* Messages */
.auth-error-msg {
  background: rgba(211, 47, 47, 0.15);
  border: 1px solid rgba(211, 47, 47, 0.4);
  border-radius: 6px;
  color: #ef9a9a;
  font-family: var(--font-text);
  font-size: 14px;
  padding: 8px 12px;
  margin-top: 12px;
  line-height: 1.4;
}

.auth-success-msg {
  background: rgba(56, 142, 60, 0.15);
  border: 1px solid rgba(56, 142, 60, 0.4);
  border-radius: 6px;
  color: #a5d6a7;
  font-family: var(--font-text);
  font-size: 14px;
  padding: 8px 12px;
  margin-top: 12px;
  line-height: 1.4;
}

/* Spinner */
.auth-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(201, 154, 78, 0.2);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Email verified banner (shows after redirect from email link) */
.auth-verified-banner {
  background: linear-gradient(135deg, rgba(56, 142, 60, 0.25), rgba(56, 142, 60, 0.1));
  border: 1px solid #4caf50;
  border-radius: 6px;
  color: #a5d6a7;
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 10px 14px;
  margin-bottom: 14px;
  text-align: center;
  line-height: 1.6;
}

/* ==========================================
   LANDING PAGE STYLES
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

.landing-page-container {
  font-family: 'Outfit', sans-serif;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.9) 100%),
    url('data/images/landing_bg.png') no-repeat center center;
  background-size: cover;
  overflow-y: auto;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  color: #e2e8f0;
  padding: 40px 20px;
  box-sizing: border-box;
}

/* Custom scrollbar for Landing Page */
.landing-page-container::-webkit-scrollbar {
  width: 10px;
}

.landing-page-container::-webkit-scrollbar-track {
  background: #08090c;
}

.landing-page-container::-webkit-scrollbar-thumb {
  background: #25262a;
  border-radius: 5px;
  border: 2px solid #08090c;
}

.landing-page-container::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold);
}

.landing-logo-container {
  margin-top: 10px;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.landing-logo-img {
  max-width: 240px;
  height: auto;
  filter: drop-shadow(0 0 15px rgba(201, 154, 78, 0.6));
}

.landing-subtitles {
  text-align: center;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.landing-subtitles h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #ffeb3b;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.landing-subtitles p {
  font-size: 12px;
  color: #cbd5e1;
  margin: 6px 0 0 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Game Showcase Area */
.landing-showcase-box {
  width: 100%;
  max-width: 440px;
  background: rgba(8, 9, 12, 0.9);
  border: 2px solid var(--color-gold);
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8);
  margin-bottom: 15px;
  overflow: hidden;
  flex-shrink: 0;
}

.showcase-header {
  background-color: rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--color-gold);
}

.showcase-stats {
  color: #4caf50;
}

.showcase-screen {
  height: 130px;
  background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('data/images/background_1.png') no-repeat center center;
  background-size: cover;
  position: relative;
  overflow: hidden;
}

.showcase-stage-info {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #ffeb3b;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--color-gold);
  z-index: 10;
  white-space: nowrap;
}

.showcase-party {
  position: absolute;
  left: 20px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
}

.showcase-hero {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  position: relative;
}

.showcase-hero.knight {
  background-image: url('data/images/heroes/knight/outfit_knight.png');
  background-size: 128px auto;
  background-position: -32px -32px;
  margin-left: 20px;
  animation: showcaseBob 0.6s ease-in-out infinite alternate;
}

.showcase-hero.cleric {
  background-image: url('data/images/heroes/cleric/outfit_cleric.png');
  background-size: 128px auto;
  background-position: -32px -32px;
  animation: showcaseBob 0.6s ease-in-out infinite alternate-reverse;
}

.showcase-hero.sorcerer {
  background-image: url('data/images/heroes/sorcerer/outfit_sorcerer.png');
  background-size: 128px auto;
  background-position: -32px -32px;
  animation: showcaseBob 0.7s ease-in-out infinite alternate;
}

.showcase-boss-wrapper {
  position: absolute;
  right: 35px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
}

.showcase-boss {
  width: 48px;
  height: 48px;
  background-image: url('data/images/monsters/outfit_35_.png');
  background-repeat: no-repeat;
  background-size: 192px auto;
  background-position: -144px -48px;
  image-rendering: pixelated;
  animation: bossFloat 3s ease-in-out infinite;
}

.showcase-boss-wrapper .showcase-monster-name {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #ff5252;
  margin-top: 4px;
  text-shadow: 1px 1px 2px #000;
  text-transform: uppercase;
}

.showcase-hp-bar {
  width: 20px;
  height: 3px;
  background: #d32f2f;
  border-radius: 1px;
  overflow: hidden;
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
}

.showcase-boss-wrapper .showcase-hp-bar {
  width: 36px;
  top: -8px;
}

.showcase-hp-bar .fill {
  height: 100%;
  background: #388e3c;
}

.showcase-damage {
  position: absolute;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
  pointer-events: none;
  animation: damageFloat 1.2s ease-out infinite;
  z-index: 15;
}

.showcase-damage.crit {
  color: #ffeb3b;
  font-size: 10px;
  font-weight: bold;
  animation-delay: 0.4s;
}

.showcase-damage.normal {
  color: #ff5252;
  animation-delay: 0.8s;
}

.showcase-spell-effect {
  position: absolute;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 12;
}

.showcase-spell-effect.fireball {
  width: 32px;
  height: 32px;
  background-image: url('data/images/spells/fireball_16_.png');
  background-size: 32px auto;
  left: 60px;
  top: 50px;
  animation: showcaseFireball 1.5s linear infinite;
}

.showcase-spell-effect.slash {
  width: 48px;
  height: 48px;
  background-image: url('data/images/spells/slash_216_.png');
  background-size: 48px auto;
  right: 35px;
  top: 40px;
  animation: showcaseSlash 1.2s steps(6) infinite;
}

@keyframes showcaseBob {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-3px);
  }
}

@keyframes bossFloat {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-6px);
  }

  100% {
    transform: translateY(0px);
  }
}

@keyframes damageFloat {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.8);
  }

  20% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  80% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(-16px);
  }
}

@keyframes showcaseFireball {
  0% {
    left: 45px;
    top: 85px;
    opacity: 0;
    transform: scale(0.5) rotate(0deg);
  }

  10% {
    opacity: 1;
  }

  80% {
    left: 190px;
    top: 60px;
    opacity: 1;
    transform: scale(1) rotate(360deg);
  }

  100% {
    left: 210px;
    top: 55px;
    opacity: 0;
    transform: scale(1.2) rotate(360deg);
  }
}

@keyframes showcaseSlash {

  0%,
  70% {
    opacity: 0;
    background-position: 0 0;
  }

  75% {
    opacity: 1;
    background-position: 0 0;
  }

  100% {
    opacity: 1;
    background-position: 0 -240px;
  }
}

/* Feature Grid */
.landing-features-grid {
  width: 100%;
  max-width: 440px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.landing-feature-card {
  background: rgba(18, 20, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s;
}

.landing-feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-gold);
}

.card-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.card-info {
  display: flex;
  flex-direction: column;
}

.card-info h3 {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 3px 0;
}

.card-info p {
  font-size: 9px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.3;
}

/* CTA Actions */
.landing-actions {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.landing-btn-primary {
  background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
  color: #fff;
  border: none;
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(21, 101, 192, 0.4);
  font-family: 'Outfit', sans-serif;
  transition: transform 0.2s, box-shadow 0.2s;
}

.landing-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(21, 101, 192, 0.6);
}

.landing-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: background-color 0.2s, color 0.2s;
}

.landing-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.landing-footer {
  text-align: center;
  padding: 20px 20px;
  font-size: 11px;
  color: #64748b;
  margin-top: 20px;
  flex-shrink: 0;
}

/* Ranking Styles */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  background-color: rgba(0, 0, 0, 0.2);
}

.ranking-table th,
.ranking-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--color-stone-light);
}

.ranking-table th {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--color-gold);
  border-bottom: 2px solid var(--color-gold);
}

.ranking-table tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.ranking-table tr.my-rank {
  background-color: rgba(201, 154, 78, 0.15);
  font-weight: bold;
}

/* Portal Map Styles */
.portal-map-container {
  background-image: radial-gradient(circle, rgba(37, 38, 42, 0.8) 0%, rgba(18, 18, 20, 0.9) 100%);
  position: relative;
}

.portal-stage-node {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 160px;
  justify-content: flex-start;
  cursor: pointer;
  padding: 6px;
  border-radius: 20px;
  transition: all 0.2s ease;
  position: relative;
}

.portal-stage-node::after {
  content: '';
  position: absolute;
  left: 17px;
  bottom: -12px;
  width: 2px;
  height: 12px;
  border-left: 2px dashed #555;
  z-index: 1;
}

.portal-stage-node:first-child::after {
  display: none;
  /* No line under the last node in the DOM (top node) */
}

.portal-stage-node .node-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid #555;
  background-color: #222;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.2s ease;
}

.portal-stage-node .node-label {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #888;
}

/* Unlocked stage state */
.portal-stage-node.unlocked .node-circle {
  border-color: var(--color-copper);
  background-color: #fff;
  box-shadow: 0 0 6px rgba(166, 106, 56, 0.6);
}

.portal-stage-node.unlocked .node-label {
  color: #fff;
}

.portal-stage-node.unlocked:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.portal-stage-node.unlocked:hover .node-circle {
  border-color: var(--color-gold);
  box-shadow: 0 0 10px rgba(201, 154, 78, 0.8);
}

/* Current active stage state */
.portal-stage-node.current .node-circle {
  border-color: var(--color-gold);
  background-color: #ffd54f;
  box-shadow: 0 0 12px rgba(255, 213, 79, 0.8);
  animation: portal-pulse 1.5s infinite alternate;
}

.portal-stage-node.current .node-label {
  color: var(--color-gold);
  font-weight: bold;
}

/* Locked stage state */
.portal-stage-node.locked {
  cursor: not-allowed;
  opacity: 0.5;
}

.portal-stage-node.locked .node-circle {
  background-color: #111;
  border-color: #333;
}

.portal-stage-node.locked .node-circle::before {
  content: '🔒';
  font-size: 8px;
}

@keyframes portal-pulse {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.15);
  }
}

/* UI Icons Styles */
.ui-icon {
  background-size: 100% auto;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  display: inline-block;
  background-position: 0px 0px;
}

.card-icon.ui-icon {
  width: 32px;
  height: 32px;
  font-size: 0;
  vertical-align: middle;
}

.header-btn .ui-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

.inline-title-icon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 6px;
}