/* ============================================
   WORLDBINDER - Global Styles
   Theme: Sandy/Gold WoW-inspired
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cinzel+Decorative:wght@400;700;900&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

/* --- CSS Variables --- */
:root {
  --gold:        #d4a456;
  --gold-light:  #f0d9a0;
  --gold-dark:   #8b6914;
  --sand:        #c8a87c;
  --sand-light:  #e8d5b5;
  --sand-dark:   #7a5c3a;
  --bg-dark:     #0a0a0a;
  --bg-panel:    rgba(20, 15, 8, 0.85);
  --bg-card:     rgba(30, 22, 12, 0.9);
  --border-gold: rgba(212, 164, 86, 0.4);
  --green-nft:   #3ecf5a;
  --white-nft:   #e8e8e8;
  --red:         #c0392b;
  --red-light:   #e74c3c;
  --hp-green:    #27ae60;
  --hp-red:      #e74c3c;
  --font-title:  'Cinzel Decorative', serif;
  --font-heading:'Cinzel', serif;
  --font-body:   'Crimson Text', serif;
  --glow-gold:   0 0 20px rgba(212, 164, 86, 0.3);
  --glow-green:  0 0 15px rgba(62, 207, 90, 0.4);
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* --- Hide UnicornStudio watermark --- */
[data-us-project] a[href*="unicorn"],
[data-us-project] a[href*="UnicornStudio"],
.us-watermark,
div[data-us-project] > a,
div[data-us-project] ~ a {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

html, body {
  width: 100%; height: 100%;
  background: var(--bg-dark);
  color: var(--sand-light);
  font-family: var(--font-body);
  overflow-x: hidden;
}

body { position: relative; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

/* --- Utility --- */
.hidden { display: none !important; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.text-gold { color: var(--gold); }
.text-sand { color: var(--sand-light); }

/* ============================================
   ONLINE BADGE (shared)
   ============================================ */
.online-badge {
  position: fixed;
  top: 20px; left: 20px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 8px 16px;
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--sand-light);
  z-index: 100;
  backdrop-filter: blur(8px);
}

.online-dot {
  width: 8px; height: 8px;
  background: #3ecf5a;
  border-radius: 50%;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(62, 207, 90, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(62, 207, 90, 0); }
}

/* ============================================
   BOTTOM PLACEHOLDERS (CA / Twitter)
   ============================================ */
.bottom-bar {
  position: fixed;
  bottom: 20px;
  left: 50%; transform: translateX(-50%);
  display: flex; gap: 30px;
  z-index: 100;
}

.placeholder-pill {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 8px 20px;
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--sand);
  letter-spacing: 1px;
  backdrop-filter: blur(8px);
  cursor: default;
  transition: border-color 0.3s;
}
.placeholder-pill:hover { border-color: var(--gold); }

/* ============================================
   LANDING PAGE
   ============================================ */
#landing-page {
  position: relative;
  width: 100%; height: 100vh;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
}

#landing-page .us-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

.landing-content {
  position: relative;
  z-index: 10;
  text-align: center;
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}

.landing-title {
  font-family: var(--font-title);
  font-size: 72px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 8px;
  text-shadow:
    0 0 40px rgba(212, 164, 86, 0.4),
    0 2px 8px rgba(0,0,0,0.8);
  line-height: 1;
}

.landing-subtitle {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--sand);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 30px;
}

.btn-connect {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--bg-dark);
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  border: 2px solid var(--gold);
  border-radius: 4px;
  padding: 14px 48px;
  cursor: pointer;
  transition: all 0.3s;
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
  box-shadow: 0 4px 20px rgba(212, 164, 86, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-connect:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(212, 164, 86, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-connect:active { transform: translateY(0); }

.landing-network {
  font-family: var(--font-heading);
  font-size: 11px;
  color: var(--sand-dark);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ============================================
   MODAL (Registration)
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: flex; justify-content: center; align-items: center;
  z-index: 1000;
}

.modal-box {
  background: linear-gradient(180deg, #1a140a 0%, #0f0b06 100%);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 40px;
  width: 420px;
  text-align: center;
  box-shadow: 0 0 60px rgba(212, 164, 86, 0.15);
}

.modal-box h2 {
  font-family: var(--font-title);
  font-size: 24px;
  color: var(--gold);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.modal-box p {
  font-size: 14px;
  color: var(--sand);
  margin-bottom: 24px;
}

.modal-input {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--sand-light);
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.3s;
}
.modal-input:focus { border-color: var(--gold); }
.modal-input::placeholder { color: var(--sand-dark); }

.modal-photo-upload {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 2px dashed var(--border-gold);
  margin: 0 auto 16px;
  display: flex; justify-content: center; align-items: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.3s;
  background: rgba(0,0,0,0.3);
}
.modal-photo-upload:hover { border-color: var(--gold); }
.modal-photo-upload img {
  width: 100%; height: 100%; object-fit: cover;
}
.modal-photo-upload span {
  font-size: 28px; color: var(--sand-dark);
}

.modal-photo-label {
  font-size: 12px; color: var(--sand-dark);
  margin-bottom: 20px; display: block;
}

.btn-gold {
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--bg-dark);
  background: linear-gradient(180deg, var(--gold-light), var(--gold), var(--gold-dark));
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 12px 36px;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-gold:hover { box-shadow: 0 4px 20px rgba(212,164,86,0.4); }
.btn-gold:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================
   GAME PAGE (Backpack)
   ============================================ */
.game-bg {
  position: fixed; inset: 0;
  background: url('../assets/backgroundarena.png') center/cover no-repeat;
  z-index: 0;
}
.game-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.game-container {
  position: relative; z-index: 1;
  min-height: 100vh;
  padding: 20px;
}

/* --- Left Panel --- */
.left-panel {
  position: fixed;
  top: 70px; left: 20px;
  width: 240px;
  display: flex; flex-direction: column; gap: 12px;
  z-index: 50;
}

.panel-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 14px;
  backdrop-filter: blur(8px);
}

.panel-card h3 {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-gold);
}

.leaderboard-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0;
  font-size: 13px;
}
.leaderboard-rank {
  font-family: var(--font-heading);
  color: var(--gold);
  font-weight: 700;
  width: 20px;
}
.leaderboard-name { color: var(--sand-light); flex: 1; }
.leaderboard-pts {
  font-family: var(--font-heading);
  color: var(--gold-light);
  font-size: 12px;
}

.stats-row {
  display: flex; justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}
.stats-label { color: var(--sand-dark); }
.stats-value { color: var(--sand-light); font-family: var(--font-heading); }

/* --- Right Panel --- */
.right-panel {
  position: fixed;
  top: 70px; right: 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 50;
}

.btn-side {
  font-family: var(--font-heading);
  font-size: 12px; font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sand-light);
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.3s;
  text-align: center;
}
.btn-side:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: var(--glow-gold);
}

.btn-logout {
  color: var(--red-light);
  border-color: rgba(231,76,60,0.3);
}
.btn-logout:hover {
  border-color: var(--red-light);
  color: var(--red);
  box-shadow: 0 0 15px rgba(231,76,60,0.2);
}

/* --- Center Content --- */
.center-content {
  max-width: 700px;
  margin: 0 auto;
  padding-top: 30px;
}

.section-header {
  text-align: center;
  margin-bottom: 20px;
}

.section-header h1 {
  font-family: var(--font-title);
  font-size: 28px;
  color: var(--gold);
  letter-spacing: 3px;
}

.player-info {
  text-align: center;
  margin-bottom: 20px;
}

.player-info .player-name {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--gold-light);
  letter-spacing: 2px;
}

.player-points {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--sand);
}

/* --- NFT Grid --- */
.nft-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

.nft-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}
.nft-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: var(--glow-gold);
}
.nft-card.selected {
  border-color: var(--green-nft);
  box-shadow: var(--glow-green);
}

.nft-capsule {
  width: 100px; height: 130px;
  margin: 0 auto 10px;
  border-radius: 50px;
  overflow: hidden;
  position: relative;
  border: 2px solid var(--border-gold);
}
.nft-capsule .cap-top {
  width: 100%; height: 50%;
  background: var(--green-nft);
  display: flex; justify-content: center; align-items: center;
}
.nft-capsule .cap-bottom {
  width: 100%; height: 50%;
  background: var(--white-nft);
}
.nft-capsule .cap-top img {
  width: 60px; height: 60px;
  object-fit: cover;
  border-radius: 50%;
}

.nft-name {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--sand-light);
  margin-bottom: 4px;
}

/* --- NFT Frame Wrap (backpack grid) --- */
.nft-frame-wrap {
  position: relative;
  width: 130px; height: 130px;
  margin: 0 auto 10px;
}
.nft-frame-wrap .nft-frame-img {
  position: absolute;
  inset: -15px;
  width: calc(100% + 30px);
  height: calc(100% + 30px);
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 0 6px rgba(212,164,86,0.3));
}
.nft-frame-wrap .nft-frame-inner {
  position: absolute;
  top: 12%; left: 12%;
  width: 76%; height: 76%;
  border-radius: 50%;
  overflow: hidden;
  z-index: 1;
  background: rgba(0,0,0,0.4);
  display: flex; justify-content: center; align-items: center;
}
.nft-frame-wrap .nft-frame-inner img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.nft-frame-small {
  width: 100px; height: 100px;
}
.nft-frame-small .nft-frame-img {
  inset: -12px;
  width: calc(100% + 24px);
  height: calc(100% + 24px);
}

.nft-rarity {
  font-size: 11px;
  font-family: var(--font-heading);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 3px;
  display: inline-block;
}
.rarity-common   { color: #aaa; border: 1px solid #555; }
.rarity-rare     { color: #5b9bd5; border: 1px solid #5b9bd5; }
.rarity-epic     { color: #a855f7; border: 1px solid #a855f7; }
.rarity-legendary { color: var(--gold); border: 1px solid var(--gold); }

/* --- NFT Detail Modal --- */
.nft-detail {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
}

.nft-detail-header {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 16px;
}

.nft-detail .trait-row {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid rgba(212,164,86,0.1);
}
.trait-name { color: var(--sand-dark); }
.trait-value { color: var(--gold-light); font-family: var(--font-heading); }

.btn-enter-arena {
  width: 100%;
  margin-top: 16px;
  font-family: var(--font-heading);
  font-size: 15px; font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--bg-dark);
  background: linear-gradient(180deg, #5aff7a, var(--green-nft), #1a8f3a);
  border: 2px solid var(--green-nft);
  border-radius: 4px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 20px rgba(62,207,90,0.3);
}
.btn-enter-arena:hover {
  box-shadow: 0 0 30px rgba(62,207,90,0.5);
  transform: translateY(-2px);
}

/* --- Sacred Jackpot --- */
.jackpot-section {
  text-align: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.jackpot-title {
  font-family: var(--font-title);
  font-size: 20px;
  color: var(--gold);
  letter-spacing: 3px;
  margin-bottom: 6px;
}

.jackpot-amount {
  font-family: var(--font-title);
  font-size: 42px;
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 0 30px rgba(212,164,86,0.4);
  margin-bottom: 4px;
}

.jackpot-sub {
  font-size: 13px;
  color: var(--sand-dark);
  font-style: italic;
}

/* --- KOTH Section --- */
.koth-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.koth-timer {
  text-align: center;
  margin-bottom: 16px;
}

.koth-timer-label {
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--sand-dark);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.koth-timer-value {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--gold-light);
  letter-spacing: 2px;
}

.koth-title {
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--gold);
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.koth-podium {
  display: flex; justify-content: center; gap: 16px;
  margin-bottom: 16px;
}

.koth-place {
  text-align: center;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border-gold);
  background: rgba(0,0,0,0.3);
  width: 120px;
}

.koth-medal { font-size: 28px; margin-bottom: 4px; }
.koth-place-name {
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--sand-light);
}
.koth-place-pts {
  font-family: var(--font-heading);
  font-size: 11px;
  color: var(--gold);
}

/* ============================================
   SKILL TREE
   ============================================ */
.skill-tree-screen {
  position: fixed; inset: 0;
  background: url('../assets/backgroundarena.png') center/cover no-repeat;
  z-index: 200;
  overflow-y: auto;
}
.skill-tree-screen::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  position: fixed;
}

.skill-tree-container {
  position: relative; z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.skill-tree-header {
  text-align: center;
  margin-bottom: 30px;
}
.skill-tree-header h1 {
  font-family: var(--font-title);
  font-size: 32px;
  color: var(--gold);
  letter-spacing: 4px;
}
.skill-tree-header p {
  color: var(--sand-dark);
  font-size: 14px;
  margin-top: 6px;
}

.skill-points-display {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--gold-light);
  margin-bottom: 30px;
}

.skill-tree-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.skill-node {
  background: var(--bg-card);
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  padding: 20px;
  width: 500px;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.3s;
  cursor: default;
}
.skill-node.unlocked { border-color: var(--green-nft); }
.skill-node.locked { opacity: 0.5; }

.skill-icon {
  font-size: 40px;
  width: 60px; height: 60px;
  display: flex; justify-content: center; align-items: center;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  border: 2px solid var(--border-gold);
  flex-shrink: 0;
}
.skill-node.unlocked .skill-icon { border-color: var(--green-nft); }

.skill-info { flex: 1; }
.skill-info h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--gold-light);
  margin-bottom: 4px;
}
.skill-info p {
  font-size: 13px;
  color: var(--sand-dark);
}
.skill-info .skill-stats {
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--sand);
  margin-top: 4px;
}

.skill-level-display {
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--gold);
  text-align: center;
  min-width: 50px;
}

.btn-skill-upgrade {
  font-family: var(--font-heading);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--bg-dark);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border: 1px solid var(--gold);
  border-radius: 3px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-skill-upgrade:hover { box-shadow: var(--glow-gold); }
.btn-skill-upgrade:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--sand);
  background: none;
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-back:hover { border-color: var(--gold); color: var(--gold); }

/* --- Connector Lines --- */
.skill-connector {
  width: 2px; height: 20px;
  background: var(--border-gold);
  margin: 0 auto;
}
.skill-connector.active { background: var(--green-nft); }

/* ============================================
   MATCHMAKING
   ============================================ */
.matchmaking-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  z-index: 500;
}

.mm-phase {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  width: 100%;
}

.matchmaking-text {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 3px;
  margin-bottom: 20px;
  text-align: center;
}

.matchmaking-spinner {
  width: 60px; height: 60px;
  border: 3px solid rgba(212,164,86,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.matchmaking-found {
  text-align: center;
  display: flex; flex-direction: column;
  align-items: center;
}
.matchmaking-found h2 {
  font-family: var(--font-title);
  font-size: 28px;
  color: var(--gold-light);
  margin-bottom: 10px;
}
.matchmaking-found p {
  color: var(--sand);
  margin-bottom: 20px;
}

.matchmaking-buttons {
  display: flex; gap: 16px;
}
.btn-yes {
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 700;
  letter-spacing: 2px;
  color: var(--bg-dark);
  background: linear-gradient(180deg, #5aff7a, var(--green-nft));
  border: 2px solid var(--green-nft);
  border-radius: 4px;
  padding: 12px 40px;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-no {
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 700;
  letter-spacing: 2px;
  color: var(--sand-light);
  background: rgba(192,57,43,0.3);
  border: 2px solid var(--red);
  border-radius: 4px;
  padding: 12px 40px;
  cursor: pointer;
  transition: all 0.3s;
}

.countdown-number {
  font-family: var(--font-title);
  font-size: 120px;
  color: var(--gold);
  text-shadow: 0 0 60px rgba(212,164,86,0.6);
  animation: countdown-pulse 1s ease-in-out;
}

@keyframes countdown-pulse {
  0% { transform: scale(2); opacity: 0; }
  50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.5; }
}

/* ============================================
   ARENA (Battle)
   ============================================ */
.arena-bg {
  position: fixed; inset: 0;
  background: url('../assets/backgroundarena.png') center/cover no-repeat;
  z-index: 0;
}
.arena-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.arena-container {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* --- Top Bar (HP + Timer) --- */
.arena-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 30px;
}

.player-hp-bar {
  display: flex; align-items: center; gap: 10px;
  width: 300px;
}

.hp-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  overflow: hidden;
  flex-shrink: 0;
}
.hp-avatar img { width: 100%; height: 100%; object-fit: cover; }

.hp-info { flex: 1; }

.hp-name {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--gold-light);
  margin-bottom: 4px;
}

.hp-bar-outer {
  width: 100%; height: 18px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border-gold);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.hp-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #1a8f3a, var(--hp-green));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.hp-bar-inner.low { background: linear-gradient(90deg, #8b1a1a, var(--hp-red)); }

.hp-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: 11px;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.arena-timer {
  text-align: center;
}
.arena-timer-label {
  font-family: var(--font-heading);
  font-size: 11px;
  color: var(--sand-dark);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.arena-timer-value {
  font-family: var(--font-title);
  font-size: 42px;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(212,164,86,0.4);
}

/* --- Battle Field --- */
.battle-field {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 120px;
  padding: 20px;
}

.battle-nft {
  text-align: center;
}

/* --- Battle NFT Frame (using frame.png) --- */
.battle-nft-frame {
  position: relative;
  width: 160px; height: 160px;
  margin: 0 auto 10px;
  transition: all 0.3s;
}

.battle-nft-frame .battle-frame-img {
  position: absolute;
  inset: -25px;
  width: calc(100% + 50px);
  height: calc(100% + 50px);
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 0 10px rgba(212,164,86,0.4));
}

.battle-nft-frame .battle-frame-inner {
  position: absolute;
  top: 10%; left: 10%;
  width: 80%; height: 80%;
  border-radius: 50%;
  overflow: hidden;
  z-index: 1;
  background: rgba(0,0,0,0.5);
  display: flex; justify-content: center; align-items: center;
}

.battle-nft-frame .battle-frame-inner img {
  width: 100%; height: 100%;
  object-fit: cover;
}
/* ====== VFX: Base Hit ====== */
.battle-nft-frame.hit {
  animation: shake 0.3s;
  filter: brightness(1.5) saturate(1.5);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* ====== VFX: Blade Strike — gold slash ====== */
.battle-nft-frame.vfx-blade::after {
  content: '';
  position: absolute; inset: -20px;
  background:
    linear-gradient(135deg, transparent 40%, rgba(212,164,86,0.9) 48%, rgba(255,220,120,1) 50%, rgba(212,164,86,0.9) 52%, transparent 60%);
  border-radius: 50px;
  animation: blade-slash 0.4s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}

@keyframes blade-slash {
  0%   { opacity: 0; transform: rotate(-60deg) scale(0.3); }
  30%  { opacity: 1; transform: rotate(0deg) scale(1.2); }
  100% { opacity: 0; transform: rotate(15deg) scale(1.5); }
}

/* ====== VFX: Energy Burst — orange/yellow explosion ====== */
.battle-nft-frame.vfx-energy::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 200px; height: 200px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,200,50,0.9) 0%, rgba(255,120,20,0.6) 40%, rgba(255,60,0,0.3) 65%, transparent 80%);
  animation: energy-burst 0.6s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}

@keyframes energy-burst {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  50%  { transform: translate(-50%, -50%) scale(1.3); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* ====== VFX: Meteor Rain — fiery meteors falling ====== */
.vfx-meteor-container {
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 200px; height: 300px;
  pointer-events: none;
  z-index: 20;
  overflow: visible;
}

.vfx-meteor {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 10%, #ffa500 40%, #ff4500 70%, transparent 100%);
  box-shadow: 0 0 20px #ff6600, 0 0 40px #ff3300, 0 -15px 30px rgba(255,100,0,0.4);
  animation: meteor-fall 0.7s ease-in forwards;
}
.vfx-meteor::after {
  content: '';
  position: absolute;
  top: -30px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 35px;
  background: linear-gradient(to bottom, transparent, #ff6600, #ffa500);
  border-radius: 2px;
  filter: blur(2px);
}

.vfx-meteor:nth-child(1) { left: 20%;  animation-delay: 0s; }
.vfx-meteor:nth-child(2) { left: 55%;  animation-delay: 0.15s; }
.vfx-meteor:nth-child(3) { left: 80%;  animation-delay: 0.3s; }
.vfx-meteor:nth-child(4) { left: 40%;  animation-delay: 0.1s; }
.vfx-meteor:nth-child(5) { left: 65%;  animation-delay: 0.25s; }

@keyframes meteor-fall {
  0%   { transform: translateY(0) scale(0.5); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateY(320px) scale(1.2); opacity: 0; }
}

/* Meteor impact flash */
.battle-nft-frame.vfx-meteor-impact::after {
  content: '';
  position: absolute;
  bottom: -10px; left: 50%;
  width: 160px; height: 60px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,100,0,0.8) 0%, rgba(255,60,0,0.4) 50%, transparent 80%);
  animation: meteor-impact 0.8s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}

@keyframes meteor-impact {
  0%   { transform: translateX(-50%) scaleX(0.3) scaleY(0.3); opacity: 1; }
  40%  { transform: translateX(-50%) scaleX(1.5) scaleY(1); opacity: 0.8; }
  100% { transform: translateX(-50%) scaleX(2) scaleY(0.5); opacity: 0; }
}

/* screen shake on meteor */
.arena-container.screen-shake {
  animation: screen-shake 0.5s ease-out;
}
@keyframes screen-shake {
  0%, 100% { transform: translate(0,0); }
  10% { transform: translate(-6px, 4px); }
  20% { transform: translate(5px, -6px); }
  30% { transform: translate(-4px, 3px); }
  40% { transform: translate(6px, -2px); }
  50% { transform: translate(-3px, 5px); }
  60% { transform: translate(2px, -4px); }
  70% { transform: translate(-5px, 2px); }
  80% { transform: translate(4px, -3px); }
  90% { transform: translate(-2px, 1px); }
}

/* ====== VFX: Defense — purple/violet shield bubble ====== */
.battle-nft-frame.vfx-shield {
  position: relative;
}
.battle-nft-frame.vfx-shield::before {
  content: '';
  position: absolute;
  inset: -18px;
  border-radius: 60px;
  border: 3px solid rgba(160, 80, 255, 0.7);
  background: radial-gradient(ellipse at center, rgba(140, 60, 255, 0.08) 0%, rgba(180, 100, 255, 0.15) 50%, transparent 75%);
  box-shadow:
    0 0 25px rgba(160, 80, 255, 0.4),
    0 0 50px rgba(130, 50, 220, 0.2),
    inset 0 0 20px rgba(180, 100, 255, 0.15);
  animation: shield-pulse 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 5;
}
.battle-nft-frame.vfx-shield::after {
  content: '🛡️';
  position: absolute;
  top: -30px; left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  animation: shield-icon-float 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 6;
}

@keyframes shield-pulse {
  0%, 100% {
    box-shadow: 0 0 25px rgba(160,80,255,0.4), 0 0 50px rgba(130,50,220,0.2), inset 0 0 20px rgba(180,100,255,0.15);
    border-color: rgba(160, 80, 255, 0.7);
  }
  50% {
    box-shadow: 0 0 40px rgba(160,80,255,0.6), 0 0 70px rgba(130,50,220,0.3), inset 0 0 30px rgba(180,100,255,0.2);
    border-color: rgba(200, 130, 255, 0.9);
  }
}

@keyframes shield-icon-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

/* Shield activation flash */
.battle-nft-frame.vfx-shield-activate::before {
  content: '';
  position: absolute; inset: -30px;
  border-radius: 70px;
  background: radial-gradient(circle, rgba(180,100,255,0.6), transparent 70%);
  animation: shield-activate 0.5s ease-out forwards;
  pointer-events: none;
  z-index: 11;
}

@keyframes shield-activate {
  0%   { transform: scale(0); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* ====== VFX: Healing — green rising particles ====== */
.battle-nft-frame.vfx-heal {
  position: relative;
}
.battle-nft-frame.vfx-heal::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 55px;
  border: 2px solid rgba(62, 207, 90, 0.5);
  background: radial-gradient(ellipse at center, rgba(62, 207, 90, 0.06) 0%, rgba(80, 220, 110, 0.12) 50%, transparent 75%);
  box-shadow:
    0 0 20px rgba(62, 207, 90, 0.3),
    0 0 40px rgba(40, 180, 70, 0.15),
    inset 0 0 15px rgba(62, 207, 90, 0.1);
  animation: heal-glow 1.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 5;
}

@keyframes heal-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(62,207,90,0.3), 0 0 40px rgba(40,180,70,0.15), inset 0 0 15px rgba(62,207,90,0.1);
  }
  50% {
    box-shadow: 0 0 35px rgba(62,207,90,0.5), 0 0 60px rgba(40,180,70,0.25), inset 0 0 25px rgba(62,207,90,0.2);
  }
}

.vfx-heal-particle-container {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 140px; height: 200px;
  pointer-events: none;
  z-index: 20;
  overflow: visible;
}

.vfx-heal-particle {
  position: absolute;
  bottom: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #7fff7f, #3ecf5a, transparent);
  box-shadow: 0 0 8px #3ecf5a, 0 0 16px rgba(62,207,90,0.4);
  animation: heal-rise 1.5s ease-out forwards;
  opacity: 0;
}

.vfx-heal-particle:nth-child(1) { left: 15%; animation-delay: 0s; }
.vfx-heal-particle:nth-child(2) { left: 35%; animation-delay: 0.2s; }
.vfx-heal-particle:nth-child(3) { left: 55%; animation-delay: 0.1s; }
.vfx-heal-particle:nth-child(4) { left: 75%; animation-delay: 0.3s; }
.vfx-heal-particle:nth-child(5) { left: 45%; animation-delay: 0.15s; }
.vfx-heal-particle:nth-child(6) { left: 25%; animation-delay: 0.25s; }
.vfx-heal-particle:nth-child(7) { left: 65%; animation-delay: 0.35s; }
.vfx-heal-particle:nth-child(8) { left: 50%; animation-delay: 0.05s; }

@keyframes heal-rise {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(-180px) scale(0.3); opacity: 0; }
}

/* Heal tick flash */
.battle-nft-frame.vfx-heal-tick {
  filter: brightness(1.3) saturate(1.3);
  transition: filter 0.2s;
}

.battle-nft-label {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--sand-light);
}

.vs-text {
  font-family: var(--font-title);
  font-size: 36px;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(212,164,86,0.5);
}

/* --- Skill Bar --- */
.skill-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 20px 30px 30px;
}

.skill-btn {
  position: relative;
  width: 80px; height: 80px;
  background: var(--bg-card);
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  cursor: pointer;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  transition: all 0.3s;
  overflow: hidden;
}
.skill-btn:hover:not(.on-cooldown) {
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
  transform: translateY(-3px);
}
.skill-btn.on-cooldown {
  opacity: 0.4;
  cursor: not-allowed;
}

.skill-btn .skill-emoji { font-size: 28px; }
.skill-btn .skill-label {
  font-family: var(--font-heading);
  font-size: 9px;
  color: var(--sand);
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.skill-btn .cooldown-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; justify-content: center; align-items: center;
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--gold);
}

/* --- Damage Float --- */
.damage-float {
  position: fixed;
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 900;
  color: var(--red-light);
  text-shadow: 0 0 10px rgba(231,76,60,0.6), 0 2px 4px rgba(0,0,0,0.5);
  animation: float-up 1.2s ease-out forwards;
  pointer-events: none;
  z-index: 100;
}
.damage-float.heal {
  color: var(--green-nft);
  text-shadow: 0 0 12px rgba(62,207,90,0.7), 0 2px 4px rgba(0,0,0,0.5);
  font-size: 26px;
}
.damage-float.shield {
  color: #b464ff;
  text-shadow: 0 0 12px rgba(160,80,255,0.7), 0 2px 4px rgba(0,0,0,0.5);
}
.damage-float.blade {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(212,164,86,0.6);
}
.damage-float.energy {
  color: #ffaa00;
  text-shadow: 0 0 14px rgba(255,170,0,0.8), 0 0 30px rgba(255,100,0,0.4);
  font-size: 38px;
}
.damage-float.meteor {
  color: #ff4500;
  text-shadow: 0 0 16px rgba(255,69,0,0.9), 0 0 40px rgba(255,30,0,0.5);
  font-size: 44px;
  font-weight: 900;
}

@keyframes float-up {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-80px); opacity: 0; }
}

/* ============================================
   RESULT SCREEN
   ============================================ */
.result-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  z-index: 600;
  backdrop-filter: blur(4px);
}

.result-title {
  font-family: var(--font-title);
  font-size: 48px;
  letter-spacing: 6px;
  margin-bottom: 10px;
  text-shadow: 0 0 40px currentColor;
}
.result-title.win { color: var(--gold-light); }
.result-title.lose { color: var(--red-light); }

.result-sub {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--sand-dark);
  letter-spacing: 2px;
  margin-bottom: 30px;
}

.result-buttons {
  display: flex; gap: 16px;
}

/* --- Misc Animations --- */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fade-in 0.4s ease forwards; }

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(212,164,86,0.2); }
  50% { box-shadow: 0 0 25px rgba(212,164,86,0.4); }
}

/* ============================================
   NFT BONUS TABLE
   ============================================ */
#nft-bonus-table h3 {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-gold);
}

.bonus-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
  color: var(--sand-dark);
  font-family: var(--font-heading);
  opacity: 0.5;
}
.bonus-row.active {
  color: var(--green-nft);
  opacity: 1;
}

.bonus-current {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-gold);
  text-align: center;
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--gold-light);
}
.bonus-current strong {
  color: var(--green-nft);
}

/* ============================================
   TOKEN BALANCE / SKILL TREE EXTRAS
   ============================================ */
.skill-token-info {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 30px;
}

.token-balance-box {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 12px 24px;
  text-align: center;
}

.token-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 10px;
  color: var(--sand-dark);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.token-value {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--gold-light);
}

.skill-next-level {
  font-family: var(--font-heading);
  font-size: 11px;
  color: var(--green-nft);
  margin-top: 4px;
  opacity: 0.8;
}

/* Override old skill-points-display — now replaced by token info */
.skill-points-display { display: none; }

/* ============================================
   SCAN STATUS (registration modal)
   ============================================ */
.scan-status {
  background: rgba(62, 207, 90, 0.15);
  border: 1px solid rgba(62, 207, 90, 0.4);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 16px;
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--green-nft);
  text-align: center;
  letter-spacing: 1px;
}

/* ============================================
   NO-NFT MODAL
   ============================================ */
.no-nft-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* ============================================
   ARENA BONUS BADGE
   ============================================ */
.arena-bonus-badge {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--green-nft);
  background: rgba(62, 207, 90, 0.15);
  border: 1px solid rgba(62, 207, 90, 0.4);
  border-radius: 4px;
  padding: 4px 14px;
  letter-spacing: 2px;
  z-index: 10;
}

/* ============================================
   MATCHMAKING BUTTONS CENTERING FIX
   ============================================ */
.matchmaking-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
}

.countdown-number {
  text-align: center;
}
