@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap');

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

body {
  font-family: 'Fredoka', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0d1117;
  color: #e6edf3;
  min-height: 100vh;
}

.screen { display: none; }
.screen.active { display: block; }

/* ===== AUTH ===== */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background: radial-gradient(ellipse at 50% 30%, #1a1500 0%, #0d1117 70%);
}

.logo {
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f5c542, #ff9f1c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  margin-bottom: 0.25rem;
}

.tagline {
  color: #7d8590;
  margin-bottom: 2.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 320px;
}

.auth-form input {
  padding: 0.85rem 1rem;
  border: 2px solid #30363d;
  border-radius: 12px;
  background: #161b22;
  color: #e6edf3;
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form input:focus {
  border-color: #f5c542;
  box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.15);
}

.auth-form button, button {
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5c542, #ff9f1c);
  color: #0d1117;
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
}

.auth-form button:hover, button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(245, 197, 66, 0.3);
}

.auth-form button:active, button:active {
  transform: translateY(0);
}

.switch-text {
  text-align: center;
  color: #7d8590;
  font-size: 0.9rem;
}

.switch-text a {
  color: #f5c542;
  text-decoration: none;
  font-weight: 600;
}

.error {
  color: #f85149;
  text-align: center;
  margin-top: 0.5rem;
  min-height: 1.25rem;
  font-weight: 500;
}

/* ===== DASHBOARD ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: #161b22;
  border-bottom: 2px solid #21262d;
}

.logo-small {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f5c542, #ff9f1c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.banana-count {
  background: linear-gradient(135deg, #f5c542, #ff9f1c);
  color: #0d1117;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
}

.btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  background: #30363d;
  color: #e6edf3;
  border-radius: 8px;
  font-weight: 500;
}

.btn-small:hover {
  background: #484f58;
  box-shadow: none;
  transform: none;
}

main {
  padding: 1rem 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}

.bonus-banner {
  background: linear-gradient(135deg, #1a3a1a, #0d2a0d);
  border: 1px solid #238636;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 600;
  animation: bannerSlide 0.4s ease-out;
}

@keyframes bannerSlide {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== TABS ===== */
.tab-bar {
  display: flex;
  gap: 0;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  flex: 0 0 auto;
  padding: 0.7rem 1rem;
  background: transparent;
  color: #7d8590;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s;
  border-radius: 0;
  box-shadow: none;
}

.tab:hover {
  color: #e6edf3;
  transform: none;
  box-shadow: none;
}

.tab.active {
  color: #f5c542;
  border-bottom-color: #f5c542;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== PACKS ===== */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.pack-card {
  background: #161b22;
  border: 2px solid #30363d;
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.pack-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.pack-card.standard {
  border-top: 4px solid #7d8590;
}
.pack-card.standard:hover { border-color: #7d8590; }

.pack-card.premium {
  border-top: 4px solid #a855f7;
}
.pack-card.premium:hover { border-color: #a855f7; box-shadow: 0 8px 25px rgba(168,85,247,0.2); }

.pack-card.ultra {
  border-top: 4px solid #f5c542;
}
.pack-card.ultra:hover { border-color: #f5c542; box-shadow: 0 8px 25px rgba(245,197,66,0.2); }

.pack-icon { font-size: 3.5rem; margin-bottom: 0.75rem; }
.pack-name { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.25rem; }
.pack-cost { color: #f5c542; font-weight: 700; font-size: 1.25rem; }
.pack-max { color: #7d8590; font-size: 0.8rem; margin-top: 0.5rem; }

.pack-card.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pack-card.disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: #30363d;
}

/* ===== INVENTORY ===== */
.inventory-stats {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.stat-box {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  text-align: center;
}

.stat-number { font-size: 1.5rem; font-weight: 700; color: #f5c542; }
.stat-label { font-size: 0.7rem; color: #7d8590; text-transform: uppercase; letter-spacing: 1px; }

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.6rem;
}

.inv-card {
  background: #161b22;
  border: 2px solid #30363d;
  border-radius: 12px;
  padding: 0.85rem;
  text-align: center;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}

.inv-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.inv-card .inv-emoji { font-size: 2.25rem; margin-bottom: 0.25rem; }
.inv-card .inv-name { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.2rem; line-height: 1.2; }
.inv-card .inv-rarity { font-size: 0.65rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
.inv-card .inv-count {
  position: absolute;
  top: 6px;
  right: 8px;
  background: #30363d;
  border-radius: 10px;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
}

.inv-card .inv-potassium {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #2d5a1e, #1a3a12);
  border: 1px solid #3fb950;
  border-radius: 8px;
  padding: 1px 5px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #7ee787;
  white-space: nowrap;
}

.reveal-potassium {
  margin-top: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #7ee787;
  letter-spacing: 1px;
}

/* Rarity colors */
.rarity-common { color: #8b949e; }
.inv-card.rarity-common { border-color: #484f58; }

.rarity-rare { color: #58a6ff; }
.inv-card.rarity-rare { border-color: #1f6feb; }

.rarity-epic { color: #bc8cff; }
.inv-card.rarity-epic { border-color: #8957e5; }

.rarity-legendary { color: #f5c542; }
.inv-card.rarity-legendary { border-color: #d29922; box-shadow: 0 0 8px rgba(245,197,66,0.15); }

.rarity-chroma_shiny { color: #3fb950; }
.inv-card.rarity-chroma_shiny { border-color: #238636; box-shadow: 0 0 10px rgba(63,185,80,0.15); }

.rarity-chroma_rainbow .inv-rarity { color: #f5c542; }
.inv-card.rarity-chroma_rainbow {
  border-image: linear-gradient(135deg, #f85149, #f5c542, #3fb950, #58a6ff, #bc8cff) 1;
  box-shadow: 0 0 12px rgba(245,197,66,0.15);
}

.rarity-mystical { color: #f85149; }
.inv-card.rarity-mystical { border-color: #da3633; box-shadow: 0 0 12px rgba(248,81,73,0.2); }

.rarity-bananarang { color: #fef08a; }
.inv-card.rarity-bananarang {
  border-color: #f5c542;
  box-shadow: 0 0 16px rgba(245,197,66,0.3);
  animation: bananarangPulse 2s ease-in-out infinite alternate;
}
@keyframes bananarangPulse {
  from { box-shadow: 0 0 12px rgba(245,197,66,0.2); }
  to { box-shadow: 0 0 24px rgba(245,197,66,0.5); }
}

.rarity-astronomical { color: #fff; }
.inv-card.rarity-astronomical {
  border-color: #e6edf3;
  background: linear-gradient(135deg, #161b22, #1c1230);
  box-shadow: 0 0 20px rgba(255,255,255,0.15);
}

/* ===== PACK OPENING ===== */
.pack-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.pack-reveal {
  text-align: center;
  width: 100%;
  max-width: 360px;
  padding: 2rem;
}

.pack-opening-text {
  font-size: 1.5rem;
  font-weight: 700;
  animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.reveal-card {
  background: #161b22;
  border: 3px solid #30363d;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  animation: revealPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes revealPop {
  0% { transform: scale(0.3) rotateY(180deg); opacity: 0; }
  100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}

.reveal-emoji { font-size: 4rem; margin: 0.5rem 0; }
.reveal-img { width: 200px; height: 200px; object-fit: cover; border-radius: 8px; margin: 0.5rem 0; }
.inv-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; margin-bottom: 0.25rem; }
.reveal-rarity {
  text-transform: uppercase;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 3px;
  margin-bottom: 0.25rem;
}
.reveal-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.reveal-close {
  margin-top: 1.5rem;
  padding: 0.75rem 2rem;
}

.reveal-card.glow-common { border-color: #484f58; }
.reveal-card.glow-rare { border-color: #1f6feb; box-shadow: 0 0 40px rgba(31,111,235,0.4); }
.reveal-card.glow-epic { border-color: #8957e5; box-shadow: 0 0 40px rgba(137,87,229,0.4); }
.reveal-card.glow-legendary { border-color: #d29922; box-shadow: 0 0 50px rgba(245,197,66,0.5); }
.reveal-card.glow-chroma_shiny { border-color: #238636; box-shadow: 0 0 50px rgba(63,185,80,0.5); }
.reveal-card.glow-chroma_rainbow {
  border-image: linear-gradient(135deg, #f85149, #f5c542, #3fb950, #58a6ff, #bc8cff) 1;
  box-shadow: 0 0 60px rgba(245,197,66,0.4);
}
.reveal-card.glow-mystical { border-color: #da3633; box-shadow: 0 0 60px rgba(218,54,51,0.5); }
.reveal-card.glow-bananarang {
  border-color: #f5c542;
  box-shadow: 0 0 80px rgba(245,197,66,0.6);
  animation: revealPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), bananaGlow 1s ease-in-out infinite alternate;
}
@keyframes bananaGlow {
  from { box-shadow: 0 0 50px rgba(245,197,66,0.4); }
  to { box-shadow: 0 0 100px rgba(245,197,66,0.8); }
}
.reveal-card.glow-astronomical {
  border-color: #fff;
  box-shadow: 0 0 100px rgba(255,255,255,0.5);
}

/* Swipe */
.swipe-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  touch-action: none;
  user-select: none;
}

.swipe-card {
  width: 200px;
  height: 280px;
  background: linear-gradient(135deg, #161b22, #1c1500);
  border: 3px solid #f5c542;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  position: relative;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
  cursor: grab;
  box-shadow: 0 0 30px rgba(245,197,66,0.2);
}

.swipe-card.swiping { transition: none; }
.swipe-card.swiped {
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  transform: translateY(-120vh) rotate(5deg);
  opacity: 0;
}

.swipe-card-front { font-size: 5rem; }
.swipe-card-back { display: none; }

.swipe-hint {
  color: #7d8590;
  font-size: 0.9rem;
  font-weight: 500;
  animation: hintBounce 1.5s ease-in-out infinite;
}

@keyframes hintBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ===== CRAFTING ===== */
.craft-recipes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.craft-card {
  background: #161b22;
  border: 2px solid #21262d;
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.craft-arrow { text-align: center; font-size: 1.5rem; color: #f5c542; }

.craft-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.craft-from, .craft-to { font-weight: 600; text-transform: capitalize; }
.craft-count { color: #7d8590; font-size: 0.85rem; }

.craft-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 10px;
}

.craft-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.craft-result {
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #161b22 0%, #1c2333 100%);
  border: 2px solid #f5c542;
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  animation: revealPop 0.4s ease-out;
  box-shadow: 0 0 20px rgba(245, 197, 66, 0.2);
}

.craft-result-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; color: #f5c542; }
.craft-result-img { width: 160px; height: 160px; object-fit: cover; border-radius: 10px; margin: 0.75rem 0; box-shadow: 0 4px 15px rgba(0,0,0,0.4); }

/* ===== TRADING ===== */
.trade-section { margin-bottom: 1.5rem; }

.trade-section h3 {
  margin-bottom: 0.75rem;
  color: #f5c542;
  font-size: 1rem;
}

.trade-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
}

.trade-form select {
  padding: 0.65rem 0.75rem;
  border: 2px solid #30363d;
  border-radius: 10px;
  background: #161b22;
  color: #e6edf3;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  outline: none;
}

.trade-form select:focus { border-color: #f5c542; }

.trades-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trade-item {
  background: #161b22;
  border: 2px solid #21262d;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.trade-details { flex: 1; min-width: 200px; }
.trade-details p { margin: 0.15rem 0; font-size: 0.9rem; }

.trade-actions { display: flex; gap: 0.5rem; }
.trade-actions button {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-accept { background: #238636; color: #fff; }
.btn-accept:hover { background: #2ea043; }
.btn-decline { background: #da3633; color: #fff; }
.btn-decline:hover { background: #f85149; }
.btn-cancel { background: #30363d; color: #e6edf3; }

.no-trades { color: #484f58; font-style: italic; font-size: 0.9rem; }

/* ===== CHAT ===== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 160px);
  max-width: 100%;
  margin-top: 0.5rem;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.chat-rooms { display: flex; gap: 0.5rem; }

.room-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  background: #21262d;
  color: #7d8590;
  border-radius: 8px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
}
.room-btn:hover { box-shadow: none; transform: none; }
.room-btn.active { background: linear-gradient(135deg, #f5c542, #ff9f1c); color: #0d1117; }

.online-count { color: #3fb950; font-size: 0.8rem; font-weight: 600; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chat-msg { padding: 0.3rem 0; font-size: 0.9rem; line-height: 1.4; }
.chat-msg .msg-user { font-weight: 700; margin-right: 0.4rem; }
.chat-msg .msg-owner { color: #f5c542; }
.chat-msg .msg-badge {
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 0.3rem;
  font-weight: 700;
}
.chat-msg .msg-text { color: #c9d1d9; }
.chat-msg.system-msg { color: #484f58; font-style: italic; font-size: 0.8rem; }
.chat-msg.share-msg {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
}

.chat-input-bar {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chat-input-bar input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 2px solid #30363d;
  border-radius: 12px;
  background: #161b22;
  color: #e6edf3;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  outline: none;
}

.chat-input-bar input:focus { border-color: #f5c542; box-shadow: 0 0 0 3px rgba(245,197,66,0.1); }
.chat-input-bar button { padding: 0.65rem 1.5rem; border-radius: 12px; }

/* ===== LEADERBOARD ===== */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #161b22;
  border: 2px solid #21262d;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  transition: transform 0.15s;
}

.lb-row:hover { transform: translateX(4px); }

.lb-row.lb-rank-1 {
  border-color: #f5c542;
  background: linear-gradient(135deg, #161b22, #1c1700);
  box-shadow: 0 0 15px rgba(245,197,66,0.15);
}
.lb-row.lb-rank-2 { border-color: #8b949e; }
.lb-row.lb-rank-3 { border-color: #cd7f32; }

.lb-rank {
  font-size: 1.5rem;
  font-weight: 800;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.lb-rank-1 .lb-rank { color: #f5c542; }
.lb-rank-2 .lb-rank { color: #8b949e; }
.lb-rank-3 .lb-rank { color: #cd7f32; }

.lb-info { flex: 1; }
.lb-username { font-weight: 700; font-size: 1rem; }
.lb-stats { color: #7d8590; font-size: 0.8rem; margin-top: 0.1rem; }

.lb-score { font-size: 1.25rem; font-weight: 800; color: #f5c542; text-align: right; flex-shrink: 0; }
.lb-score-label { font-size: 0.6rem; color: #7d8590; text-transform: uppercase; letter-spacing: 1px; text-align: right; }

/* ===== ADMIN ===== */
.admin-section {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.admin-section h3 {
  color: #f5c542;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.admin-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.admin-form input, .admin-form select {
  padding: 0.5rem 0.75rem;
  border: 2px solid #30363d;
  border-radius: 10px;
  background: #0d1117;
  color: #e6edf3;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  outline: none;
}

.admin-form input:focus, .admin-form select:focus { border-color: #f5c542; }

.admin-form input[type="color"] {
  width: 40px;
  height: 36px;
  padding: 2px;
  cursor: pointer;
  border-radius: 8px;
}

.admin-form button {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 10px;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-user-info { font-size: 0.85rem; }
.admin-user-info .banana-inline { color: #f5c542; font-weight: 600; }
.admin-user-actions { display: flex; gap: 0.4rem; }
.admin-user-actions button {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* ===== POTASSIUM WAR ===== */
.war-prize-info {
  background: linear-gradient(135deg, #1a3a1a, #0d2a0d);
  border: 1px solid #238636;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #7ee787;
}

.war-players-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.war-player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #161b22;
  border: 2px solid #21262d;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s;
}

.war-player-row:hover {
  border-color: #30363d;
}

.war-player-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.war-player-name .owner-tag {
  color: #f5c542;
  font-size: 0.7rem;
  margin-left: 0.3rem;
}

.war-challenge-btn {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #238636, #2ea043);
  color: #fff;
}

.war-challenge-btn:hover {
  box-shadow: 0 2px 10px rgba(46,160,67,0.3);
}

.war-challenge-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.war-self-row {
  opacity: 0.5;
}

.war-self-row .war-player-name::after {
  content: ' (you)';
  color: #484f58;
  font-weight: 400;
  font-size: 0.8rem;
}

/* Incoming challenge popup */
.war-incoming {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.war-incoming-inner {
  background: #161b22;
  border: 2px solid #f5c542;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 0 40px rgba(245,197,66,0.2);
}

.war-incoming-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.war-incoming-inner p {
  font-size: 1rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.war-incoming-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.war-incoming-actions button {
  padding: 0.6rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

/* Battle result overlay */
.war-result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.3s ease-out;
}

.war-result-inner {
  background: #161b22;
  border: 2px solid #30363d;
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  max-width: 500px;
  width: 95%;
}

.war-result-inner h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #f5c542;
}

.war-battle-field {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.war-side {
  flex: 1;
  min-width: 0;
}

.war-side-name {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.war-cards {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.war-card {
  background: #0d1117;
  border: 2px solid #30363d;
  border-radius: 10px;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  animation: warCardFlip 0.4s ease-out both;
}

.war-card:nth-child(2) { animation-delay: 0.15s; }
.war-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes warCardFlip {
  0% { transform: rotateX(90deg); opacity: 0; }
  100% { transform: rotateX(0deg); opacity: 1; }
}

.war-card-img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.war-card-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.war-card-name {
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.war-card-potassium {
  font-size: 0.65rem;
  color: #7ee787;
  font-weight: 700;
}

.war-vs {
  font-size: 1.5rem;
  font-weight: 800;
  color: #f85149;
  padding-top: 2.5rem;
  flex-shrink: 0;
}

.war-total {
  margin-top: 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: #7ee787;
}

.war-total.winner {
  color: #f5c542;
  text-shadow: 0 0 8px rgba(245,197,66,0.4);
}

.war-total.loser {
  color: #f85149;
}

.war-result-prize {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.war-result-inner button {
  padding: 0.65rem 2rem;
  border-radius: 10px;
}

.war-status {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.9rem;
  color: #f5c542;
  font-weight: 600;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0d1117; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* ===== MASCOT & BRANDING ===== */

/* Login screen mascot */
.auth-mascot {
  width: 120px;
  height: auto;
  margin-bottom: 0.5rem;
  animation: mascotBounce 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(245,197,66,0.3));
}

@keyframes mascotBounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

/* Header mascot */
.header-mascot {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  margin-right: 2px;
  filter: drop-shadow(0 1px 3px rgba(245,197,66,0.3));
}

/* Section header with mascot */
.section-header-with-mascot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0 0.75rem;
}

.section-header-with-mascot h2 {
  margin: 0;
}

.section-mascot {
  width: 48px;
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(245,197,66,0.2));
  flex-shrink: 0;
}

/* Empty states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
  text-align: center;
}

.empty-mascot {
  width: 100px;
  height: auto;
  margin-bottom: 1rem;
  opacity: 0.8;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.empty-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e6edf3;
  margin-bottom: 0.25rem;
}

.empty-subtext {
  font-size: 0.85rem;
  color: #7d8590;
}

/* Banana decorative accents on pack cards */
.pack-card::before {
  content: '🍌';
  position: absolute;
  top: -8px;
  right: -4px;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.2s, transform 0.3s;
  transform: rotate(20deg);
}

.pack-card:hover::before {
  opacity: 1;
  transform: rotate(20deg) scale(1.2);
}

.pack-card {
  position: relative;
  overflow: visible;
}

/* Daily bonus banana mascot animation */
.bonus-banner {
  position: relative;
  overflow: visible;
}

.bonus-banner::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: url('/img/mascot/banana-excited.svg') no-repeat center;
  background-size: contain;
}

.bonus-banner p {
  padding-left: 32px;
}

/* Reveal mascot overlay for rare pulls */
.reveal-mascot {
  position: absolute;
  bottom: -20px;
  right: -15px;
  width: 60px;
  height: auto;
  animation: revealMascotPop 0.6s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
  pointer-events: none;
}

@keyframes revealMascotPop {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  100% { transform: scale(1) rotate(5deg); opacity: 1; }
}

.reveal-card {
  position: relative;
  overflow: visible;
}

/* Banana-themed loading spinner */
.banana-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  background: url('/img/mascot/banana-peel.svg') no-repeat center;
  background-size: contain;
  animation: bananaSpinBounce 1s ease-in-out infinite;
}

@keyframes bananaSpinBounce {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(90deg) scale(1.1); }
  50% { transform: rotate(180deg) scale(1); }
  75% { transform: rotate(270deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Banana peel scatter (background decoration for auth) */
.auth-container {
  position: relative;
  overflow: hidden;
}

.auth-container::before,
.auth-container::after {
  content: '🍌';
  position: absolute;
  font-size: 2rem;
  opacity: 0.06;
  pointer-events: none;
}

.auth-container::before {
  top: 15%;
  left: 8%;
  transform: rotate(-30deg);
}

.auth-container::after {
  bottom: 20%;
  right: 10%;
  transform: rotate(25deg);
}

/* Banana count in header gets a tiny banana */
.banana-count::before {
  content: '🍌 ';
  font-size: 0.8em;
}

/* Chat room has subtle banana watermark */
.chat-messages::after {
  content: '';
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  background: url('/img/mascot/banana-happy.svg') no-repeat center;
  background-size: contain;
  opacity: 0.04;
  pointer-events: none;
}

.chat-messages {
  position: relative;
}

/* No-trades empty state */
.no-trades {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.no-trades::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  background: url('/img/mascot/banana-sad.svg') no-repeat center;
  background-size: contain;
  opacity: 0.6;
  flex-shrink: 0;
}

/* ===== CHAT UNREAD BADGE ===== */
.tab {
  position: relative;
}

.tab-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  background: #f85149;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 8px;
  text-align: center;
  padding: 0 4px;
  pointer-events: none;
  animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* ===== GLOBAL CHALLENGE TOAST ===== */
.war-challenge-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  display: flex;
  justify-content: center;
  padding: 0.75rem;
  animation: toastSlideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastSlideDown {
  0% { transform: translateY(-100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.war-toast-inner {
  background: linear-gradient(135deg, #1c1700, #161b22);
  border: 2px solid #f5c542;
  border-radius: 14px;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 8px 32px rgba(245,197,66,0.25), 0 0 0 1px rgba(0,0,0,0.5);
  max-width: 500px;
  width: 95%;
}

.war-toast-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.war-toast-text {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
}

.war-toast-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.war-toast-actions button {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* ===== WAR H2H DISPLAY ===== */
.war-h2h {
  font-size: 0.7rem;
  color: #7d8590;
  font-weight: 500;
  margin-left: 0.5rem;
  background: #21262d;
  padding: 2px 8px;
  border-radius: 6px;
}

.war-result-h2h {
  font-size: 0.85rem;
  color: #7d8590;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

/* ===== BANANA ROULETTE ===== */

.roulette-section {
  border-top: 1px solid #30363d;
  padding-top: 1.5rem;
}

/* Wager Controls */
.roulette-wager {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.roulette-wager-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.roulette-wager-tab {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #0d1117;
  color: #8b949e;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.roulette-wager-tab.active {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #fff;
}

.roulette-wager-tab:hover:not(.active) {
  border-color: #484f58;
  color: #c9d1d9;
}

.roulette-banana-wager input[type="range"] {
  width: 100%;
  margin-bottom: 0.5rem;
  accent-color: #f5c542;
}

.roulette-amount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.roulette-amount-row span {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f5c542;
}

.roulette-amount-row input[type="number"] {
  width: 100px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #0d1117;
  color: #c9d1d9;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  text-align: center;
}

.roulette-card-wager select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #0d1117;
  color: #c9d1d9;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
}

.roulette-card-value {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #f5c542;
  font-weight: 600;
}

/* Wheel Container */
.roulette-wheel-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto 1rem;
  overflow: hidden;
  border: 2px solid #30363d;
  border-radius: 12px;
  background: #0d1117;
  height: 100px;
}

.roulette-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  color: #f5c542;
  z-index: 10;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  filter: drop-shadow(0 0 6px rgba(245, 197, 66, 0.6));
}

.roulette-wheel {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
}

.roulette-slot {
  width: 90px;
  min-width: 90px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #21262d;
  gap: 4px;
}

.roulette-slot-emoji {
  font-size: 1.8rem;
}

.roulette-slot-mult {
  font-size: 0.8rem;
  font-weight: 700;
  color: #8b949e;
}

/* Slot colors */
.roulette-slot-0 { background: #2d1515; } /* Rotten - dark red */
.roulette-slot-1 { background: #2d2415; } /* Half Peel - dark orange */
.roulette-slot-2 { background: #1e2228; } /* Push - neutral dark */
.roulette-slot-3 { background: #152d1a; } /* Double - dark green */
.roulette-slot-4 { background: #15202d; } /* Triple - dark blue */
.roulette-slot-5 { background: #251530; } /* Bunch - dark purple */
.roulette-slot-6 { background: #2d2a15; } /* Golden - dark gold */

.roulette-slot-0 .roulette-slot-mult { color: #f87171; }
.roulette-slot-1 .roulette-slot-mult { color: #fb923c; }
.roulette-slot-2 .roulette-slot-mult { color: #7d8590; }
.roulette-slot-3 .roulette-slot-mult { color: #4ade80; }
.roulette-slot-4 .roulette-slot-mult { color: #60a5fa; }
.roulette-slot-5 .roulette-slot-mult { color: #c084fc; }
.roulette-slot-6 .roulette-slot-mult { color: #fbbf24; }

/* Spin Button */
.roulette-spin-btn {
  display: block;
  width: 100%;
  max-width: 500px;
  margin: 0 auto 1.5rem;
  padding: 0.8rem 2rem;
  font-size: 1.3rem;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  background: linear-gradient(135deg, #f5c542, #e6a817);
  color: #1a1a1a;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.roulette-spin-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffd666, #f5c542);
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(245, 197, 66, 0.3);
}

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

/* Result Display */
.roulette-result {
  text-align: center;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  animation: roulette-result-pop 0.3s ease;
}

@keyframes roulette-result-pop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.roulette-result-emoji {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.roulette-result-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #c9d1d9;
  margin-bottom: 0.5rem;
}

.roulette-result-payout {
  font-size: 1rem;
  font-weight: 600;
}

.roulette-result-payout.win {
  color: #4ade80;
}

.roulette-result-payout.loss {
  color: #f87171;
}

.roulette-result-payout.push {
  color: #7d8590;
}

/* History */
.roulette-history {
  max-width: 500px;
  margin: 0 auto;
}

.roulette-history h3 {
  color: #c9d1d9;
  margin-bottom: 0.5rem;
}

.roulette-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roulette-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.roulette-history-slot {
  color: #8b949e;
  flex: 1;
}

.roulette-history-wager {
  color: #c9d1d9;
  flex: 1;
  text-align: center;
}

.roulette-history-net {
  font-weight: 700;
  min-width: 70px;
  text-align: right;
}

.roulette-history-net.win { color: #4ade80; }
.roulette-history-net.loss { color: #f87171; }
.roulette-history-net.push { color: #7d8590; }
