/* FULL UPDATED CSS PASTE */
body {
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)),
              url('images/backgrounds/card_collection_background.png') no-repeat center center fixed;
  background-size: cover;
  font-family: Arial, sans-serif;
  color: #f0f0f0;
  overflow-y: scroll;
  margin: 0;
  padding: 0;
}

h1 { margin: 20px; }

.snow {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  background: url('images/effects/snowfall.gif') center center / cover no-repeat;
  opacity: 0.3;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  justify-items: center;
  gap: 18px;
  padding: 5px;
  box-sizing: border-box;
}

@media (max-width: 1200px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.card-container {
  background-color: #1e1e1e;
  padding: 10px;
  width: 140px;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.card-container:hover {
  transform: scale(1.05);
  z-index: 2;
}
.card-container.common-border:hover { box-shadow: 0 0 12px limegreen, 0 0 25px limegreen; }
.card-container.uncommon-border:hover { box-shadow: 0 0 12px royalblue, 0 0 25px royalblue; }
.card-container.rare-border:hover { box-shadow: 0 0 12px purple, 0 0 25px purple; }
.card-container.legendary-border:hover { box-shadow: 0 0 15px gold, 0 0 30px gold; }
.card-container.unique-border:hover { box-shadow: 0 0 15px crimson, 0 0 30px crimson; }

.card-container img { width: 100%; border-radius: 5px; }
.card-container p { margin: 5px 0; }

/* Owned (face-up) card image */
.card-img {
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: 6px;
}

/* Generic disabled overlay (for gating trade UI when not in session) */
.is-disabled {
  position: relative;
  pointer-events: none;
  opacity: 0.5;
  filter: grayscale(70%);
}
.is-disabled::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.15);
  border-radius: inherit;
}

/* Optional label used by scripts on bottom bars */
.bar-title {
  font-weight: 700;
  margin-right: 10px;
  white-space: nowrap;
}

button.trade,
button.sell {
  background-color: rgba(51, 51, 51, 0.75);
  border: none;
  color: white;
  padding: 5px 10px;
  margin: 3px;
  border-radius: 5px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
}

button.trade:hover,
button.sell:hover {
  background-color: rgba(85, 85, 85, 0.85);
  box-shadow: 0 0 5px #00ffff;
}

button.trade:active,
button.sell:active {
  transform: scale(0.97);
  border: 2px solid gold;
  box-shadow: 0 0 10px gold, 0 0 20px gold inset;
}

button.trade.queued {
  background-color: rgba(255, 215, 0, 0.9);
  color: black;
  border: 2px solid white;
  box-shadow: 0 0 8px gold, 0 0 12px white inset;
  transform: scale(1.03);
}

button.trade.queued:hover {
  background-color: rgba(255, 223, 0, 0.95);
  box-shadow: 0 0 12px gold, 0 0 15px white inset;
}

button.trade:disabled,
button.sell:disabled {
  background-color: rgba(70, 70, 70, 0.6);
  color: #999999;
  cursor: not-allowed;
  box-shadow: none;
  border: 1px solid #444;
  opacity: 0.5;
}

button.trade:disabled:hover,
button.sell:disabled:hover {
  background-color: rgba(70, 70, 70, 0.6);
  box-shadow: none;
}

button.trade:disabled.queued,
button.sell:disabled.queued {
  background-color: rgba(100, 100, 100, 0.5);
  color: #ccc;
  border: 1px solid #666;
  box-shadow: none;
  transform: none;
}

/* Optional pulse indicator for disabled buttons if needed */
@keyframes disabledPulse {
  0% { box-shadow: none; }
  50% { box-shadow: 0 0 6px #333; }
  100% { box-shadow: none; }
}

/* Re-affirm toast stays on top */
#mock-toast {
  z-index: 99999;
}

@keyframes queuedPulse {
  0% { box-shadow: 0 0 5px gold; }
  50% { box-shadow: 0 0 15px gold; }
  100% { box-shadow: 0 0 5px gold; }
}
button.trade.queued.pulse {
  animation: queuedPulse 1.2s infinite ease-in-out;
}

.queue-submit-button {
  background-color: #222;
  color: white;
  border: 2px solid;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
}
.queue-submit-button:hover {
  transform: scale(1.02);
}
#submit-trade-btn {
  border-color: gold;
  color: gold;
}
#submit-trade-btn:hover {
  background-color: gold;
  color: black;
  box-shadow: 0 0 10px gold;
}
#submit-sell-btn {
  border-color: crimson;
  color: crimson;
}
#submit-sell-btn:hover {
  background-color: crimson;
  color: white;
  box-shadow: 0 0 10px crimson;
}

.submit-flash {
  animation: flashConfirm 0.8s ease-out;
}
@keyframes flashConfirm {
  0% { box-shadow: 0 0 5px white; }
  50% { box-shadow: 0 0 15px white; }
  100% { box-shadow: 0 0 0px transparent; }
}

.common-border { border: 2px solid green; }
.uncommon-border { border: 2px solid blue; }
.rare-border   { border: 2px solid purple; }
.legendary-border { border: 2px solid gold; }
.unique-border { border: 2px solid red; }

.legendary-glow {
  animation: glowPulse 2s infinite alternate;
  box-shadow: 0 0 10px gold, 0 0 20px gold, 0 0 30px gold;
}
@keyframes glowPulse {
  0% { box-shadow: 0 0 5px gold; }
  100% { box-shadow: 0 0 40px gold; }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .card-container { width: 100px; }
}

.card-type-emoji {
  position: absolute;
  top: 5px;
  right: 8px;
  font-size: 1.4rem;
}
body, html, div, span, a, p, li, ul, ol, h1, h2, h3, h4, h5, h6, button {
  color: #ffffff !important;
}

.facedown-card {
  border: 3px solid red !important;
}

/* Sticky decision/phase banner (JS toggles visibility) */
#trade-banner {
  position: sticky;
  top: 0;
  z-index: 1002;
  width: 100%;
  background: #0f172a;
  color: #e2e8f0;
  border-bottom: 1px solid #334155;
  padding: 10px 12px;
  font-family: system-ui, sans-serif;
  display: none;
}

/* NEW: Style trade decision action buttons in the banner */
#trade-banner-actions {
  display: flex;
  gap: 8px;
}
#trade-banner-actions button {
  background: #222;
  color: #e2e8f0;
  border: 2px solid #475569;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.25s, background 0.25s, border-color 0.25s;
}
#trade-banner-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(148,163,184,0.4);
}
/* First button (Accept) */
#trade-banner-actions button:first-child {
  border-color: #22c55e;
  color: #22c55e;
}
#trade-banner-actions button:first-child:hover {
  background: #22c55e;
  color: #111827;
}
/* Last button (Deny) */
#trade-banner-actions button:last-child {
  border-color: #ef4444;
  color: #ef4444;
}
#trade-banner-actions button:last-child:hover {
  background: #ef4444;
  color: #ffffff;
}

#new-unlocked-banner {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.5rem;
  font-weight: bold;
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
  animation: glowFade 3s ease-out forwards;
  z-index: 9999;
}
@keyframes glowFade {
  0% { opacity: 0; transform: translateX(-50%) scale(0.9); }
  10% { opacity: 1; transform: translateX(-50%) scale(1); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) scale(1); }
}
.highlight-glow {
  outline: 3px solid #00ffff;
  box-shadow: 0 0 15px #00ffff, 0 0 30px #00ffff;
  animation: shimmer 1.5s infinite alternate;
}
@keyframes shimmer {
  0% { opacity: 1; }
  100% { opacity: 0.5; }
}

.collection-header {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 15px;
  text-shadow: 1px 1px 2px black;
}
.card-actions-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 5px;
}

/* ✅ Trade Queue Bar */
#trade-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #111;
  border-top: 2px solid gold;
  color: white;
  padding: 10px 15px;
  font-size: 0.9rem;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -2px 10px rgba(255, 215, 0, 0.5);
  transition: transform 0.3s ease;
  transform: translateY(100%);
}
#trade-bottom-bar:not(.collapsed) {
  transform: translateY(0%);
}
#bottom-trade-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.trade-card-entry {
  background: #222;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid gold;
  box-shadow: 0 0 5px gold;
  color: gold;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;
}
.trade-card-entry img.thumb {
  width: 45px;
  height: auto;
  border-radius: 4px;
  border: 1px solid #444;
  box-shadow: 0 0 5px gold;
}
.trade-card-entry button {
  background: crimson;
  color: white;
  border: none;
  font-size: 0.8rem;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
}
.trade-card-entry button:hover { background-color: darkred; }

#sell-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #111;
  border-top: 2px solid crimson;
  color: white;
  padding: 10px 15px;
  font-size: 0.9rem;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -2px 10px rgba(220, 20, 60, 0.5);
  transition: transform 0.3s ease;
  transform: translateY(100%);
}
#sell-bottom-bar:not(.collapsed) {
  transform: translateY(0%);
}
#bottom-sell-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.sell-card-entry {
  background: #222;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid crimson;
  box-shadow: 0 0 5px crimson;
  color: crimson;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sell-card-entry img.thumb {
  width: 45px;
  height: auto;
  border-radius: 4px;
  border: 1px solid #444;
  box-shadow: 0 0 5px crimson;
}
.sell-card-entry button {
  background: crimson;
  color: white;
  border: none;
  font-size: 0.8rem;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
}
.sell-card-entry button:hover { background-color: darkred; }

@keyframes flashLimit {
  0%   { box-shadow: 0 0 5px red, 0 0 10px red; }
  50%  { box-shadow: 0 0 15px red, 0 0 25px red; }
  100% { box-shadow: 0 0 5px red, 0 0 10px red; }
}
.limit-reached {
  animation: flashLimit 0.8s ease-in-out 3;
}

#toggle-bottom-bar,
#toggle-sell-bar {
  position: fixed;
  right: 20px;
  z-index: 1001;
  padding: 6px 12px;
  background-color: #111;
  font-weight: bold;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  opacity: 1;
}
#toggle-bottom-bar {
  bottom: 110px;
  color: gold;
  border: 2px solid gold;
}
#toggle-sell-bar {
  bottom: 160px;
  color: crimson;
  border: 2px solid crimson;
}

/* NEW: Music toggle button (matches the two queue toggles) */
#music-toggle {
  position: fixed;
  right: 20px;
  bottom: 210px;            /* sits above the sell/trade toggles */
  z-index: 1001;
  padding: 6px 10px;
  background-color: #111;
  border: 2px solid #7dd3fc;
  color: #7dd3fc;
  font-weight: bold;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}
#music-toggle:hover {
  transform: scale(1.02);
  box-shadow: 0 0 10px #7dd3fc;
}

#mock-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #00ffcc;
  padding: 10px 20px;
  font-size: 1rem;
  border: 2px solid #00ffff;
  border-radius: 8px;
  z-index: 9999;
  opacity: 0;
  animation: toastFadeIn 0.4s ease forwards;
}
@keyframes toastFadeIn {
  0% { opacity: 0; transform: translateX(-50%) scale(0.95); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* ─────────────────────── NEW CARD HIGHLIGHT ─────────────────────── */
.is-new {
  box-shadow: 0 0 12px #00fff3, 0 0 28px #00fff3;
  animation: newPulse 1.2s ease-in-out infinite;
}
@keyframes newPulse {
  0%   { box-shadow: 0 0 8px #00fff3, 0 0 18px #00fff3; }
  50%  { box-shadow: 0 0 18px #00fff3, 0 0 48px #00fff3; }
  100% { box-shadow: 0 0 8px #00fff3, 0 0 18px #00fff3; }
}
.new-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #ffd400;
  color: #111;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.4px;
  text-shadow: none;
  box-shadow: 0 0 8px rgba(0,0,0,0.6);
  z-index: 3;
}

/* Repo 3 recovery: canonical static collection shell */
.collection-shell {
  width: min(100%, 1800px);
  margin: 0 auto;
  padding: 24px 12px 120px;
  box-sizing: border-box;
}

#collection-owner-label {
  margin: -6px 0 10px;
  opacity: .85;
}

#coin-balance-display {
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.connection-status {
  display: inline-block;
  margin: 0 0 14px;
  padding: 7px 10px;
  border-radius: 6px;
  font: 600 .85rem/1.2 system-ui, sans-serif;
  background: rgba(15, 23, 42, .9);
  border: 1px solid #64748b;
}
.connection-status.connected { color: #86efac; border-color: #22c55e; }
.connection-status.error { color: #fecaca; border-color: #ef4444; }
.connection-status.connecting { color: #bae6fd; border-color: #38bdf8; }

#ownership-warning {
  color: #ff5555;
  font-weight: bold;
  display: none;
  margin: 18px 0;
}

#return-to-hub {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 999;
  background-color: #008080;
  border: 2px solid white;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 16px;
  text-decoration: none;
  font-family: Arial, sans-serif;
}
#return-to-hub:hover {
  border-color: #00ffff;
  box-shadow: 0 0 15px #00ffff, 0 0 5px #00ffff inset;
  background-color: #004d4d;
}

@media (max-width: 700px) {
  .collection-shell { padding-top: 76px; }
  #return-to-hub { top: 12px; right: 12px; padding: 8px 12px; font-size: 14px; }
  #music-toggle, #toggle-sell-bar, #toggle-bottom-bar { right: 8px; }
}

.player-summary-row { display:flex; flex-wrap:wrap; gap:18px; align-items:center; margin-bottom:12px; }
#player-stats-summary { font-size:.95rem; opacity:.9; }
