/* ── Retro 16-bit Theme ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --black:      #0a0a0a;
  --dark:       #111827;
  --panel:      #1a1a2e;
  --border:     #16213e;
  --gold:       #ffd700;
  --gold-dim:   #b8860b;
  --silver:     #c0c0c0;
  --platinum:   #e5e4e2;
  --green:      #00ff41;
  --green-dim:  #00aa2a;
  --cyan:       #00ffff;
  --magenta:    #ff00ff;
  --red:        #ff3131;
  --white:      #f0f0f0;
  --pixel:      'Press Start 2P', monospace;
  --scanline-opacity: 0.08;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--green);
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
  image-rendering: pixelated;
}

/* ── CRT Scanline Overlay ───────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,var(--scanline-opacity)) 2px,
    rgba(0,0,0,var(--scanline-opacity)) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── CRT Screen Vignette ────────────────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 9998;
}

/* ── Pixel Border Utility ───────────────────────────────────────────────── */
.pixel-border {
  border: 3px solid var(--green);
  box-shadow:
    inset -3px -3px 0 var(--green-dim),
    inset 3px 3px 0 rgba(0,255,65,0.3),
    0 0 12px rgba(0,255,65,0.4);
}

.pixel-border-gold {
  border: 3px solid var(--gold);
  box-shadow:
    inset -3px -3px 0 var(--gold-dim),
    inset 3px 3px 0 rgba(255,215,0,0.3),
    0 0 12px rgba(255,215,0,0.4);
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.top-nav {
  background: var(--panel);
  border-bottom: 4px solid var(--green);
  box-shadow: 0 4px 0 var(--green-dim), 0 0 20px rgba(0,255,65,0.3);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-nav h1 {
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--gold-dim), 0 0 20px rgba(255,215,0,0.6);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Blinking cursor after title */
.top-nav h1::after {
  content: '_';
  animation: blink 1s step-end infinite;
  color: var(--green);
}

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

.wallet-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn, .cta-btn, .claim-btn, .tab-btn, .logout-btn {
  font-family: var(--pixel);
  font-size: 7px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  padding: 8px 14px;
  letter-spacing: 1px;
  transition: transform 0.05s, box-shadow 0.05s;
  image-rendering: pixelated;
}

.btn {
  background: var(--green);
  color: var(--black);
  box-shadow: 3px 3px 0 var(--green-dim);
}
.btn:hover  { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--green-dim); }
.btn:active { transform: translate(2px,2px);   box-shadow: 1px 1px 0 var(--green-dim); }

.cta-btn {
  background: var(--gold);
  color: var(--black);
  box-shadow: 3px 3px 0 var(--gold-dim);
  font-size: 8px;
  padding: 12px 24px;
  display: block;
  margin: 24px auto 0;
  animation: pulse-gold 2s ease-in-out infinite;
}
.cta-btn:hover  { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--gold-dim); }
.cta-btn:active { transform: translate(2px,2px);   box-shadow: 1px 1px 0 var(--gold-dim); }

@keyframes pulse-gold {
  0%,100% { box-shadow: 3px 3px 0 var(--gold-dim), 0 0 8px rgba(255,215,0,0.4); }
  50%      { box-shadow: 3px 3px 0 var(--gold-dim), 0 0 20px rgba(255,215,0,0.8); }
}

.claim-btn {
  background: var(--magenta);
  color: var(--black);
  box-shadow: 3px 3px 0 #880088;
  width: 100%;
  margin-top: 10px;
}
.claim-btn:hover  { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 #880088; }
.claim-btn:active { transform: translate(2px,2px);   box-shadow: 1px 1px 0 #880088; }

.logout-btn {
  background: var(--red);
  color: var(--white);
  box-shadow: 3px 3px 0 #880000;
  font-size: 6px;
}

/* ── Network Select ──────────────────────────────────────────────────────── */
.network-select {
  font-family: var(--pixel);
  font-size: 7px;
  background: var(--border);
  color: var(--cyan);
  border: 2px solid var(--cyan);
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: 2px 2px 0 #006666;
}
.network-select:focus { outline: none; box-shadow: 2px 2px 0 #006666, 0 0 8px rgba(0,255,255,0.4); }

/* ── Wallet Info ─────────────────────────────────────────────────────────── */
.wallet-info {
  font-size: 6px;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--border);
  padding: 6px 10px;
  border: 2px solid var(--cyan);
}

/* ── Main Content ────────────────────────────────────────────────────────── */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ── Welcome Screen ──────────────────────────────────────────────────────── */
.welcome-section { text-align: center; padding: 20px 0; }

/* Animated title banner */
.welcome-banner {
  font-size: 11px;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--gold-dim), 0 0 30px rgba(255,215,0,0.5);
  margin-bottom: 8px;
  animation: flicker 4s linear infinite;
}

@keyframes flicker {
  0%,19%,21%,23%,25%,54%,56%,100% { opacity: 1; }
  20%,22%,24%,55% { opacity: 0.6; }
}

.welcome-subtitle {
  color: var(--silver);
  font-size: 7px;
  margin-bottom: 32px;
  letter-spacing: 2px;
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.welcome-card {
  background: var(--panel);
  padding: 20px 16px;
  border: 3px solid var(--green);
  box-shadow: 4px 4px 0 var(--green-dim), 0 0 10px rgba(0,255,65,0.2);
  text-align: left;
  position: relative;
}

.welcome-card::before {
  content: '▶';
  position: absolute;
  top: 8px;
  left: 8px;
  color: var(--green);
  font-size: 6px;
}

.welcome-card .feature-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 10px;
  image-rendering: pixelated;
}

.welcome-card h4 {
  color: var(--gold);
  font-size: 7px;
  margin-bottom: 8px;
  text-shadow: 1px 1px 0 var(--gold-dim);
}

.welcome-card p {
  color: var(--silver);
  font-size: 6px;
  line-height: 2;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 3px solid var(--green);
}

.tab-btn {
  background: var(--panel);
  color: var(--green-dim);
  border: 3px solid var(--green);
  border-bottom: none;
  padding: 10px 16px;
  font-size: 7px;
  margin-right: 4px;
  position: relative;
  top: 3px;
}

.tab-btn.active {
  background: var(--black);
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255,215,0,0.6);
  border-color: var(--gold);
  border-bottom: 3px solid var(--black);
}

.tab-btn:hover:not(.active) { color: var(--green); background: var(--border); }

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

/* ── NFT Grid ────────────────────────────────────────────────────────────── */
.nft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.nft-card {
  background: var(--panel);
  border: 3px solid var(--green);
  box-shadow: 4px 4px 0 var(--green-dim);
  cursor: pointer;
  transition: transform 0.05s, box-shadow 0.05s;
  position: relative;
  overflow: hidden;
}

.nft-card:hover {
  transform: translate(-2px,-2px);
  box-shadow: 6px 6px 0 var(--green-dim), 0 0 16px rgba(0,255,65,0.4);
  border-color: var(--gold);
}

.nft-card:hover .nft-card-overlay { opacity: 1; }

.nft-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
  border-bottom: 3px solid var(--green);
}

.nft-card-body { padding: 10px; }

.nft-card-name {
  color: var(--white);
  font-size: 6px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nft-card-collection {
  color: var(--cyan);
  font-size: 5px;
  margin-bottom: 6px;
}

.nft-card-tba {
  color: var(--gold);
  font-size: 5px;
  background: var(--border);
  padding: 3px 5px;
  border: 1px solid var(--gold-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pixel corner decorations */
.nft-card::before, .nft-card::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--gold);
  border-style: solid;
  z-index: 1;
}
.nft-card::before { top: 0; right: 0; border-width: 3px 3px 0 0; }
.nft-card::after  { bottom: 0; left: 0; border-width: 0 0 3px 3px; }

.nft-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,255,65,0.08);
  opacity: 0;
  transition: opacity 0.1s;
  pointer-events: none;
}

/* ── Rewards Summary ─────────────────────────────────────────────────────── */
.rewards-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.reward-card {
  background: var(--panel);
  padding: 20px;
  text-align: center;
  position: relative;
}

.reward-card.gold-card   { border: 3px solid var(--gold);     box-shadow: 4px 4px 0 var(--gold-dim),  0 0 12px rgba(255,215,0,0.3); }
.reward-card.silver-card { border: 3px solid var(--silver);   box-shadow: 4px 4px 0 #808080,          0 0 12px rgba(192,192,192,0.3); }
.reward-card.plat-card   { border: 3px solid var(--platinum); box-shadow: 4px 4px 0 #aaa,             0 0 12px rgba(229,228,226,0.3); }

.metal-icon { font-size: 28px; display: block; margin-bottom: 10px; }

.reward-card h4 { font-size: 7px; margin-bottom: 8px; }
.reward-card.gold-card   h4 { color: var(--gold); }
.reward-card.silver-card h4 { color: var(--silver); }
.reward-card.plat-card   h4 { color: var(--platinum); }

.reward-balance {
  font-size: 12px;
  color: var(--white);
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
  margin-bottom: 4px;
  display: block;
}

.reward-usd {
  font-size: 6px;
  color: var(--green);
  margin-bottom: 12px;
  display: block;
}

/* ── TBA List ────────────────────────────────────────────────────────────── */
.tba-list { display: flex; flex-direction: column; gap: 12px; }

.tba-row {
  background: var(--panel);
  border: 2px solid var(--border);
  border-left: 4px solid var(--cyan);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: center;
  gap: 12px;
  box-shadow: 3px 3px 0 #001a1a;
}

.tba-row:hover { border-left-color: var(--gold); box-shadow: 3px 3px 0 var(--gold-dim); }

.tba-nft-name { color: var(--white); font-size: 6px; }
.tba-address  { color: var(--cyan);  font-size: 5px; font-family: monospace; word-break: break-all; }
.tba-balance  { color: var(--gold);  font-size: 6px; text-align: right; white-space: nowrap; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: var(--panel);
  border: 4px solid var(--gold);
  box-shadow: 6px 6px 0 var(--gold-dim), 0 0 30px rgba(255,215,0,0.3);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  background: var(--gold);
  color: var(--black);
  padding: 10px 16px;
  font-size: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: var(--red);
  color: var(--white);
  border: none;
  font-family: var(--pixel);
  font-size: 8px;
  padding: 4px 8px;
  cursor: pointer;
  box-shadow: 2px 2px 0 #880000;
}

.modal-body { padding: 16px; }

.modal-image {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  image-rendering: pixelated;
  border: 3px solid var(--green);
  margin-bottom: 16px;
  display: block;
}

.modal-title { color: var(--gold); font-size: 9px; margin-bottom: 12px; }

.modal-section-label {
  color: var(--green);
  font-size: 6px;
  border-bottom: 2px solid var(--green-dim);
  padding-bottom: 4px;
  margin: 12px 0 8px;
  text-transform: uppercase;
}

.modal-tba-address {
  color: var(--cyan);
  font-size: 5px;
  font-family: monospace;
  background: var(--border);
  padding: 6px 8px;
  border: 1px solid var(--cyan);
  word-break: break-all;
}

.attr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
}

.attr-pill {
  background: var(--border);
  border: 1px solid var(--green-dim);
  padding: 5px 7px;
}

.attr-type  { color: var(--green-dim); font-size: 5px; display: block; }
.attr-value { color: var(--white);     font-size: 6px; display: block; margin-top: 2px; }

/* ── Loading / Status ────────────────────────────────────────────────────── */
.loading-text {
  color: var(--green);
  font-size: 7px;
  text-align: center;
  padding: 40px;
  animation: blink 1s step-end infinite;
}

.status-bar {
  background: var(--border);
  border-top: 3px solid var(--green);
  padding: 6px 16px;
  font-size: 6px;
  color: var(--green-dim);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  z-index: 100;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 8px; background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--green-dim); border: 2px solid var(--black); }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* ── Utility ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

.section-title {
  color: var(--gold);
  font-size: 9px;
  margin-bottom: 16px;
  text-shadow: 2px 2px 0 var(--gold-dim);
}

.section-title::before { content: '► '; color: var(--green); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .top-nav h1 { font-size: 7px; }
  .welcome-banner { font-size: 8px; }
  .nft-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .tba-row  { grid-template-columns: 1fr; }
}
