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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Roboto', sans-serif;
  background: url('/bg.png') center/cover no-repeat fixed;
  color: #eee;
  min-height: 100vh;
  line-height: 1.6;
}

/* ========== HEADER / NAV ========== */
header {
  background: rgba(0, 0, 0, 0.9);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid #c0392b;
  backdrop-filter: blur(10px);
}

nav {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 0 2rem;
}

.logo {
  font-family: 'Impact', sans-serif;
  font-size: 2rem;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 3px;
  transition: text-shadow 0.3s;
  flex-shrink: 0;
  white-space: nowrap;
}

.logo:hover {
  text-shadow: 0 0 20px rgba(231, 76, 60, 0.8), 0 0 40px rgba(231, 76, 60, 0.5), 0 0 60px rgba(231, 76, 60, 0.3);
}

.nav-links {
  flex: 1;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 0.85rem 1.1rem;
  min-width: 0;
  flex-wrap: wrap;
}

.nav-links a {
  color: #ccc;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.3s, text-shadow 0.3s;
  font-size: 1.08rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: #e74c3c;
}

.nav-user {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-left: auto;
}

.twitch-login {
  background: #9146ff !important;
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.3s !important;
  margin-left: 0;
}

.twitch-login:hover {
  background: #7c3aed !important;
}

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 0;
  padding-left: 0;
  border-left: none;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.user-menu > * {
  position: relative;
  z-index: 1;
}

.user-menu.has-custom-bg {
  padding: 8px 12px 8px 10px;
  border-left: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background-image: var(--user-banner);
  background-clip: padding-box;
}

.user-menu.has-custom-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.78);
}

.user-menu.has-custom-bg .user-name,
.user-menu.has-custom-bg .user-level,
.user-menu.has-custom-bg .user-rank:not(.rank-meat-god),
.user-menu.has-custom-bg .meat-coins,
.user-menu.has-custom-bg .unopened-packs {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.75);
}

.user-menu.has-custom-bg .user-level,
.user-menu.has-custom-bg .meat-coins,
.user-menu.has-custom-bg .unopened-packs {
  color: #f0f0f0;
}

.user-menu.has-custom-bg .logout-link {
  color: #fff !important;
  font-weight: 700;
  margin-left: 1rem;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.28);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.user-menu.has-custom-bg .logout-link:hover {
  color: #fff !important;
  background: rgba(192, 57, 43, 0.85);
  border-color: rgba(255, 255, 255, 0.4);
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-name {
  color: #fff;
  font-weight: 700;
  font-size: 1.08rem;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.user-name:hover {
  color: #bf94ff;
  text-decoration: underline;
}

.user-sub-badge {
  width: 20px;
  height: 20px;
  image-rendering: auto;
  flex-shrink: 0;
}

.user-rank {
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
}

.rank-bronze {
  color: #cd7f32;
}

.rank-meat-god {
  color: #e74c3c;
  font-weight: 800;
  text-shadow:
    0 0 6px rgba(231, 76, 60, 0.95),
    0 0 14px rgba(231, 76, 60, 0.7),
    0 0 28px rgba(231, 76, 60, 0.45);
}

.user-level {
  color: #ccc;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 1px;
  white-space: nowrap;
}

.meat-coins {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ddd;
  font-size: 1.08rem;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
}

.meat-coin-icon {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
  vertical-align: middle;
}

.meat-coins-amount {
  color: #e74c3c;
}

.unopened-packs {
  position: relative;
  margin-top: 2px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #ddd;
  white-space: nowrap;
  cursor: help;
  width: fit-content;
}

.unopened-packs-count {
  color: #f1c40f;
}

.unopened-packs-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  padding: 10px 12px;
  background: rgba(12, 12, 12, 0.96);
  border: 1px solid #555;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  z-index: 200;
  white-space: normal;
  line-height: 1.45;
  font-size: 0.85rem;
  color: #eee;
  pointer-events: none;
}

.unopened-packs:hover .unopened-packs-tooltip {
  display: block;
}

.pack-bronze { color: #cd7f32; font-weight: 800; }
.pack-silver { color: #c0c0c0; font-weight: 800; }
.pack-gold { color: #ffd700; font-weight: 800; }

.logout-link {
  color: #888 !important;
  font-size: 0.95rem !important;
  margin-left: 0.75rem;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
}

.nav-mobile-logout {
  display: none;
}

/* ========== MAIN CONTENT ========== */
main {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 12px;
  min-height: 70vh;
  backdrop-filter: blur(5px);
}

.page-title {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 2rem;
  color: #fff;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
  font-family: 'Impact', sans-serif;
  letter-spacing: 2px;
  transition: text-shadow 0.3s;
}

.page-title:hover {
  text-shadow: 0 0 20px rgba(231, 76, 60, 0.8), 0 0 40px rgba(231, 76, 60, 0.5);
}

/* ========== SOCIALS PAGE ========== */
.profile-section {
  text-align: center;
  padding: 1.5rem 0 1rem;
}

.profile-photo-wrap {
  display: inline-block;
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 1rem;
  border-radius: 50%;
  text-decoration: none;
  color: inherit;
}

.profile-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  object-fit: cover;
  display: block;
  margin: 0;
}

.profile-photo-wrap.is-live {
  cursor: pointer;
}

.profile-photo-wrap.is-live .profile-photo {
  border: 6px solid #9146ff;
  box-shadow: 0 0 0 3px rgba(145, 70, 255, 0.35), 0 10px 25px rgba(0, 0, 0, 0.6);
}

.profile-photo-wrap.is-live:hover .profile-photo {
  box-shadow: 0 0 0 4px rgba(145, 70, 255, 0.55), 0 12px 28px rgba(0, 0, 0, 0.65);
}

.live-now-badge {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  background: #9146ff;
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  padding: 5px 12px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}

.socials-title {
  font-size: 3.5rem;
  color: #fff;
  font-family: 'Impact', sans-serif;
  letter-spacing: 2px;
  transition: text-shadow 0.3s;
}

.socials-title:hover {
  text-shadow: 0 0 20px rgba(231, 76, 60, 0.8), 0 0 40px rgba(231, 76, 60, 0.5), 0 0 60px rgba(231, 76, 60, 0.3);
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.social-link {
  font-size: 3.2rem;
  color: #bbb;
  transition: all 0.3s ease;
}

.social-link:hover {
  transform: translateY(-8px) scale(1.15);
}

.social-youtube:hover { color: #ff0000; }
.social-twitch:hover { color: #9146ff; }
.social-instagram:hover { color: #e1306c; }
.social-discord:hover { color: #5865f2; }
.social-patreon:hover { color: #ff7a00; }


.latest-upload {
  margin-top: 1.75rem;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.latest-upload-title {
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.youtube-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 2px solid #333;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  background: #000;
}

.youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ========== COLLECTION FORM ========== */
.collection-form {
  text-align: center;
  margin: 2rem 0;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  border: 2px solid #333;
}

.collection-form h2 {
  margin-bottom: 1rem;
  color: #fff;
}

.form-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.collection-form input {
  padding: 14px 20px;
  font-size: 1.1rem;
  width: 320px;
  border: 2px solid #333;
  border-radius: 8px;
  background: #1a1a1a;
  color: white;
  outline: none;
  transition: border-color 0.3s;
}

.collection-form input:focus {
  border-color: #c0392b;
}

.collection-form button {
  padding: 14px 30px;
  font-size: 1.1rem;
  background: #c0392b;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

.collection-form button:hover {
  background: #e74c3c;
}

.twitch-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #9146ff;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  transition: background 0.3s;
}

.twitch-login-btn:hover {
  background: #7c3aed;
}

/* ========== COLLECTION / PROFILE HEADER ========== */
#collection-header,
.collection-header-wrap {
  text-align: left;
  margin: 1.5rem 0 1rem;
}

.profile-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  background-color: rgba(0, 0, 0, 0.55);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid #333;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Default rank border (Meat Chud / Meat Chungus — bronze) */
.profile-panel.profile-border-rank {
  border-color: #cd7f32;
  box-shadow:
    0 0 0 1px rgba(205, 127, 50, 0.55),
    0 0 14px rgba(205, 127, 50, 0.4),
    0 0 28px rgba(205, 127, 50, 0.22);
}

/* MEAT GOD / maxed level — red glow matching rank text */
.profile-panel.profile-border-meat-god {
  border-color: #e74c3c;
  box-shadow:
    0 0 0 2px rgba(231, 76, 60, 0.85),
    0 0 14px rgba(231, 76, 60, 0.95),
    0 0 28px rgba(231, 76, 60, 0.55),
    0 0 48px rgba(231, 76, 60, 0.28);
}

/* Twitch sub — purple glow matching Tier __ text */
.profile-panel.profile-border-sub {
  border-color: #bf94ff;
  box-shadow:
    0 0 0 2px rgba(145, 70, 255, 0.85),
    0 0 14px rgba(145, 70, 255, 0.9),
    0 0 28px rgba(145, 70, 255, 0.55),
    0 0 48px rgba(145, 70, 255, 0.3);
}

.profile-panel > * {
  position: relative;
  z-index: 1;
}

.profile-panel.has-custom-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.72) 55%, rgba(0, 0, 0, 0.82) 100%),
    rgba(0, 0, 0, 0.25);
}

.profile-owner-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: -0.35rem 0 -0.5rem;
}

.profile-owner-actions-left {
  display: flex;
  gap: 0.5rem;
}

.profile-bg-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.profile-bg-remove-btn {
  background: transparent;
  color: #ddd;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.profile-bg-remove-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #888;
  color: #fff;
}

.profile-panel.has-custom-bg .profile-stat {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.12);
}

.profile-panel.has-custom-bg .profile-showcase {
  border-top-color: rgba(255, 255, 255, 0.15);
}

.profile-panel-top {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(280px, 1.4fr);
  gap: 1.5rem 2rem;
}

.profile-panel-main {
  padding: 1rem 1.15rem 1.15rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #3a3a3a;
  border-radius: 10px;
}

.profile-panel.has-custom-bg .profile-panel-main {
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.profile-identity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.profile-identity-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.profile-username {
  font-size: 2.2rem;
  color: #fff;
  font-family: 'Impact', sans-serif;
  letter-spacing: 1px;
  margin: 0;
}

.profile-sub-tier {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #bf94ff;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-shadow:
    0 0 6px rgba(145, 70, 255, 0.95),
    0 0 14px rgba(145, 70, 255, 0.7),
    0 0 28px rgba(145, 70, 255, 0.45);
}

.profile-sub-badge {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(145, 70, 255, 0.75));
}

.profile-rank-level {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.profile-rank {
  font-size: 1.65rem;
  font-weight: 800;
}

.profile-level-text {
  color: #ddd;
  font-size: 1.65rem;
  font-weight: 700;
}

.xp-bar-wrap {
  margin-bottom: 0.85rem;
}

.xp-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: #bbb;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.xp-bar-track {
  width: 100%;
  height: 14px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 999px;
  overflow: hidden;
}

/* Profile XP bar (My Profile / View Collections) */
.xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c0392b, #e74c3c, #f39c12);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.xp-bar-track.is-meat-god {
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.55), 0 0 18px rgba(231, 76, 60, 0.28);
  border-color: #e74c3c;
}

.xp-bar-fill.is-meat-god {
  width: 100%;
  background: #e74c3c;
  box-shadow:
    0 0 10px rgba(231, 76, 60, 0.95),
    0 0 22px rgba(231, 76, 60, 0.7);
}

.collection-count {
  display: block;
  width: 100%;
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.5px;
  margin: 1.1rem 0 0;
}

.profile-signature {
  color: #ccc;
  font-size: 1rem;
  font-style: italic;
  font-weight: 400;
  text-align: center;
  margin: 0.6rem 0 0;
  line-height: 1.4;
  word-break: break-word;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  align-content: start;
}

.profile-stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
}

/* Profile: highlight tiles when the viewed user is a community leaderboard leader */
.profile-stat.community-leader {
  border-color: rgba(241, 196, 15, 0.85);
  animation: communityLeaderPulse 1.6s ease-in-out infinite;
}

/* Profile: glow on "X / Y cards owned" text when user is community most-cards leader */
.community-leader-text {
  color: #fff;
  animation: communityLeaderTextPulse 1.6s ease-in-out infinite;
}

@keyframes communityLeaderTextPulse {
  0%, 100% {
    text-shadow:
      0 0 6px rgba(241, 196, 15, 0.4),
      0 0 14px rgba(241, 196, 15, 0.2);
  }
  50% {
    text-shadow:
      0 0 12px rgba(241, 196, 15, 0.75),
      0 0 26px rgba(241, 196, 15, 0.45);
  }
}

@keyframes communityLeaderPulse {
  0%, 100% {
    box-shadow:
      0 0 6px rgba(241, 196, 15, 0.3),
      0 0 14px rgba(241, 196, 15, 0.18);
  }
  50% {
    box-shadow:
      0 0 10px rgba(241, 196, 15, 0.55),
      0 0 24px rgba(241, 196, 15, 0.35);
  }
}

.profile-stat-label {
  display: block;
  color: #888;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.2rem;
}

.profile-stat-value {
  display: block;
  color: #eee;
  font-size: 1.05rem;
  font-weight: 700;
}

.profile-showcase {
  border-top: 1px solid #333;
  padding-top: 1.25rem;
}

.showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.showcase-title {
  color: #fff;
  font-size: 1.15rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0;
}

.showcase-edit-btn,
.showcase-save-btn {
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.showcase-edit-btn:hover,
.showcase-save-btn:hover {
  background: #e74c3c;
}

.showcase-cards {
  --showcase-card-width: 150px;
  --showcase-slab-render-width: 220px;
  --showcase-slab-height-ratio: 1.809;
  --showcase-card-height: calc(var(--showcase-card-width) * var(--showcase-slab-height-ratio));
  --showcase-slab-zoom: calc(var(--showcase-card-width) / var(--showcase-slab-render-width));
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.85rem;
  flex-wrap: wrap;
  min-height: 90px;
}

.showcase-card {
  width: var(--showcase-card-width);
  min-height: var(--showcase-card-height);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.showcase-card:not(.showcase-card-graded) {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
}

.showcase-card-draggable {
  cursor: grab;
}

.showcase-card-draggable:active {
  cursor: grabbing;
}

.showcase-card:not(.showcase-card-graded) > img {
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 500 / 720;
  object-fit: contain;
  object-position: center bottom;
  border: none;
  border-radius: 0;
  display: block;
  box-shadow: none;
  background: none;
  pointer-events: none;
  flex: 0 0 auto;
}

.showcase-card-graded {
  width: var(--showcase-card-width);
  min-height: var(--showcase-card-height);
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/*
  Render slabs at grid card width, then zoom down to showcase width so label
  text keeps grid proportions at any showcase size.
*/
.showcase-card-graded .showcase-graded-scaler {
  width: var(--showcase-slab-render-width);
  zoom: var(--showcase-slab-zoom);
  pointer-events: none;
}

@supports not (zoom: 1) {
  .showcase-card-graded .showcase-graded-scaler {
    transform: scale(var(--showcase-slab-zoom));
    transform-origin: top center;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: calc(var(--showcase-slab-render-width) * var(--showcase-slab-height-ratio) * (var(--showcase-slab-zoom) - 1));
  }
}

.showcase-card-graded .psa-slab {
  width: 100%;
  pointer-events: none;
}

.showcase-card-graded .psa-card-well {
  aspect-ratio: 500 / 720;
}

.showcase-card-graded .psa-card-well img {
  border: none;
  border-radius: 0;
  box-shadow: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Slightly larger type vs grid-at-half so label text stays legible */
.showcase-card-graded .psa-label {
  --psa-border: clamp(4px, 2.4cqi, 8px);
}

.showcase-card-graded .psa-label-body {
  padding: 2.4cqi 2.8cqi 3px;
}

.showcase-card-graded .psa-brand { font-size: clamp(0.58rem, 4.6cqi, 1.1rem); }
.showcase-card-graded .psa-card-name { font-size: clamp(0.76rem, 6.1cqi, 1.5rem); }
.showcase-card-graded .psa-rarity { font-size: clamp(0.64rem, 5cqi, 1.2rem); }
.showcase-card-graded .psa-card-number { font-size: clamp(0.58rem, 4.6cqi, 1.1rem); }
.showcase-card-graded .psa-condition { font-size: clamp(0.76rem, 6.1cqi, 1.5rem); }
.showcase-card-graded .psa-grade { font-size: clamp(0.76rem, 6.1cqi, 1.5rem); }
.showcase-card-graded .psa-trade-id { font-size: clamp(0.64rem, 5cqi, 1.2rem); }

.showcase-card-graded .psa-barcode {
  height: clamp(12px, 5.2cqi, 30px);
  width: clamp(64px, 32cqi, 150px);
}

.showcase-card-graded .psa-hologram {
  width: clamp(28px, 9cqi, 48px);
  height: clamp(14px, 4.6cqi, 24px);
  font-size: clamp(0.45rem, 2.3cqi, 0.8rem);
}

.showcase-card:hover {
  transform: translateY(-4px) scale(1.03);
}

.showcase-card:not(.showcase-card-graded):hover {
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 14px rgba(241, 196, 15, 0.35));
}

.showcase-card-graded:hover .psa-slab {
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 14px rgba(241, 196, 15, 0.35));
}

.showcase-card.is-dragging {
  opacity: 0.45;
  transform: scale(0.96);
}

.showcase-card:not(.showcase-card-graded).is-drop-target {
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 14px rgba(46, 204, 113, 0.45));
}

.showcase-card-graded.is-drop-target .psa-slab {
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 14px rgba(46, 204, 113, 0.45));
}

.showcase-cards.is-reordering .showcase-card:not(.is-dragging):hover {
  transform: none;
}

.showcase-empty {
  color: #888;
  text-align: center;
  width: 100%;
  padding: 0.75rem;
}

.showcase-modal-content {
  max-width: 980px;
  max-height: 90vh;
  overflow: auto;
}

.showcase-modal-title {
  color: #fff;
  margin-bottom: 0.35rem;
}

.showcase-modal-hint {
  color: #aaa;
  margin-bottom: 1rem;
}

.showcase-selected-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.showcase-selected-label {
  color: #ddd;
  font-weight: 700;
}

.showcase-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.showcase-picker-card {
  position: relative;
  background: transparent;
  border: 2px solid #333;
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.showcase-picker-card img {
  width: 100%;
  aspect-ratio: 500 / 720;
  object-fit: cover;
  display: block;
}

.showcase-picker-card.is-graded {
  /* Same tile size as plain cards; vertically squash the full slab to fit. */
  --picker-card-ratio: 1.44;   /* 720 / 500 */
  --picker-slab-ratio: 1.809;  /* full PSA slab proportions */
  --picker-warp-y: calc(var(--picker-card-ratio) / var(--picker-slab-ratio));
  overflow: hidden;
  aspect-ratio: 500 / 720;
  background: transparent;
  border-color: #555;
  position: relative;
}

.showcase-picker-card.is-graded .showcase-graded-scaler {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  /* Lay out at natural slab height, then squash Y into the 500×720 tile. */
  height: calc(100% / var(--picker-warp-y));
  transform: scaleY(var(--picker-warp-y));
  transform-origin: top center;
  pointer-events: none;
}

.showcase-picker-card.is-graded .psa-slab,
.showcase-picker-card.is-graded .psa-shell,
.showcase-picker-card.is-graded .psa-mat {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  filter: none;
}

.showcase-picker-card.is-graded .psa-shell {
  padding: 2.2% 2.4% 2.4%;
  display: flex;
  flex-direction: column;
}

.showcase-picker-card.is-graded .psa-mat {
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
  padding: 1.6% 2% 1.8%;
  display: flex;
  flex-direction: column;
}

.showcase-picker-card.is-graded .psa-label-slot {
  flex: 0 0 auto;
  padding-bottom: 2px;
}

.showcase-picker-card.is-graded .psa-card-well {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
  position: relative;
  overflow: hidden;
}

.showcase-picker-card.is-graded .psa-card-well img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: auto;
  display: block;
}

.showcase-picker-card.is-graded .psa-label {
  --psa-border: clamp(3px, 2.2cqi, 6px);
}

.showcase-picker-card.is-graded .psa-label-body {
  padding: 2cqi 2.4cqi 2px;
}

.showcase-picker-card.is-graded .psa-brand { font-size: clamp(0.45rem, 4.2cqi, 0.85rem); }
.showcase-picker-card.is-graded .psa-card-name { font-size: clamp(0.55rem, 5.4cqi, 1.05rem); }
.showcase-picker-card.is-graded .psa-rarity { font-size: clamp(0.48rem, 4.6cqi, 0.9rem); }
.showcase-picker-card.is-graded .psa-card-number { font-size: clamp(0.45rem, 4.2cqi, 0.85rem); }
.showcase-picker-card.is-graded .psa-condition { font-size: clamp(0.55rem, 5.4cqi, 1.05rem); }
.showcase-picker-card.is-graded .psa-grade { font-size: clamp(0.55rem, 5.4cqi, 1.05rem); }
.showcase-picker-card.is-graded .psa-trade-id { font-size: clamp(0.48rem, 4.6cqi, 0.9rem); }

.showcase-picker-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.showcase-picker-card.is-selected {
  border-color: #2ecc71;
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.35);
  transform: translateY(-2px);
}

.showcase-picker-card.is-selected .showcase-picker-check {
  display: flex;
  background: #2ecc71;
  color: #111;
}

@media (max-width: 860px) {
  .profile-panel-top {
    grid-template-columns: 1fr;
  }
  .profile-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .profile-username {
    font-size: 1.45rem;
  }
}

/* ========== FILTER BAR ========== */
.filter-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1rem;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  border: 1px solid #333;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-group label {
  color: #ccc;
  font-weight: 700;
  font-size: 0.9rem;
}

.filter-group select {
  padding: 8px 14px;
  border-radius: 6px;
  background: #1a1a1a;
  color: #eee;
  border: 1px solid #444;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #ccc;
  font-weight: 700;
  font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
  accent-color: #c0392b;
  width: 16px;
  height: 16px;
}

/* ========== CARDS GRID ========== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
  /* Don't stretch shorter cards to match taller graded slabs in the same row
     (that pushed FIRST OWNER / HOLO tags off the art). */
  align-items: start;
}

.set-completions {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 1rem 0 2rem;
}

.set-completions-empty {
  color: #888;
  text-align: center;
  padding: 2rem 1rem;
}

.src-set-panel {
  background: rgba(20, 20, 24, 0.92);
  border: 1px solid #333;
  border-radius: 14px;
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.src-set-panel.is-complete {
  border-color: rgba(46, 204, 113, 0.55);
  box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.18), 0 10px 28px rgba(0, 0, 0, 0.35);
}

.src-set-header {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.src-set-reward-wrap {
  width: 150px;
  flex-shrink: 0;
}

.src-set-reward-wrap .card {
  width: 100%;
}

.src-set-meta {
  flex: 1;
  min-width: 220px;
}

.src-set-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.src-set-title {
  margin: 0;
  color: #fff;
  font-size: 1.45rem;
  font-family: Impact, sans-serif;
  letter-spacing: 0.5px;
}

.src-set-status {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
}

.src-set-status.is-not-started {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.5);
}

.src-set-status.is-progress {
  color: #f1c40f;
  background: rgba(241, 196, 15, 0.12);
  border: 1px solid rgba(241, 196, 15, 0.45);
}

.src-set-status.is-done {
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.45);
}

.src-set-blurb {
  margin: 0 0 0.85rem;
  color: #999;
  font-size: 0.95rem;
  line-height: 1.4;
}

.src-set-progress-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.src-set-progress-text {
  color: #ddd;
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
}

.src-set-progress-track {
  flex: 1;
  height: 10px;
  background: #222;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

/* Set Completions progress bar (separate from profile XP) */
.src-set-progress-fill {
  height: 100%;
  background: #2ecc71;
  background-image: linear-gradient(90deg, #196f3d 0%, #2ecc71 55%, #7dffa8 100%);
  border-radius: 999px;
  transition: width 0.25s ease;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

.src-set-panel.is-complete .src-set-progress-fill {
  background: #2ecc71;
  background-image: linear-gradient(90deg, #27ae60, #2ecc71);
}

.src-set-req-label {
  color: #888;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.src-set-requires {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.src-set-requires .card {
  width: 100%;
}

.src-set-requires .card.src-set-missing {
  outline: 1px solid rgba(231, 76, 60, 0.35);
}

.src-set-requires .card.src-set-owned {
  outline: 1px solid rgba(46, 204, 113, 0.35);
}

@media (max-width: 700px) {
  .src-set-reward-wrap {
    width: 120px;
  }

  .src-set-title {
    font-size: 1.2rem;
  }

  .src-set-requires {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}

.card {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  transition: transform 0.3s ease;
  cursor: default;
  aspect-ratio: auto;
  height: fit-content;
}

.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 500 / 720;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: box-shadow 0.3s ease, outline-color 0.3s ease;
}

/* Owned cards */
.card-owned {
  cursor: pointer;
}

.card-owned:hover {
  transform: translateY(-8px) scale(1.03);
}

.card-owned:hover > img {
  outline: 3px solid #27ae60;
  outline-offset: -3px;
  box-shadow:
    0 0 0 1px rgba(39, 174, 96, 0.9),
    0 0 20px rgba(39, 174, 96, 0.55),
    0 0 40px rgba(39, 174, 96, 0.3);
}

/* Un-owned cards */
.card-unowned img {
  filter: blur(5px) brightness(0.4) grayscale(0.5);
}

/* SRC / SRR â€” heavily hidden when not owned (blur stays on hover) */
.card-hidden-tier img {
  filter: blur(14px) brightness(0.2) grayscale(0.85);
}

.hidden-tier-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 2;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.55);
}

.card-hidden-tier:hover .hidden-tier-overlay {
  opacity: 1;
}

.hidden-tier-overlay span {
  color: #f1c40f;
  font-weight: 900;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  line-height: 1.4;
  text-shadow: 0 0 12px rgba(241, 196, 15, 0.6);
}

/* SRC set cards — green unlock hint (SRR stays red via .card-srr-hidden) */
.card-tier-src.card-hidden-tier:not(.card-srr-hidden) .hidden-tier-overlay span {
  color: #2ecc71;
  text-shadow: 0 0 12px rgba(46, 204, 113, 0.6);
}

.card-srr-hidden .hidden-tier-overlay span {
  color: #e74c3c;
  text-shadow: 0 0 12px rgba(231, 76, 60, 0.6);
}

.card-src-previewable {
  cursor: pointer;
}

.card-src-previewable:hover .hidden-tier-overlay span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.src-set-modal .src-set-modal-content {
  max-width: min(1100px, 96vw);
  width: 96vw;
  max-height: 92vh;
  overflow: auto;
  padding: 1.5rem 1.5rem 1.75rem;
  border-color: #2ecc71;
  box-shadow: 0 0 28px rgba(46, 204, 113, 0.25);
}

.src-set-modal-heading {
  margin: 0 0 1rem;
  color: #2ecc71;
  font-family: Impact, sans-serif;
  letter-spacing: 1px;
  font-size: 1.8rem;
  text-align: center;
}

.src-set-modal .src-set-title {
  color: #2ecc71;
  text-shadow: 0 0 10px rgba(46, 204, 113, 0.35);
}

.src-set-modal-body .src-set-panel {
  margin: 0;
}

.card-unowned .not-owned-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 2;
  pointer-events: none;
}

.card-unowned:hover .not-owned-overlay {
  opacity: 1;
}

.not-owned-overlay i {
  font-size: 3rem;
  color: #e74c3c;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
}

.not-owned-overlay span {
  font-size: 1.3rem;
  font-weight: 900;
  color: #e74c3c;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

/* Unowned lock + text match card tier colours */
.card-tier-n .not-owned-overlay i,
.card-tier-n .not-owned-overlay span {
  color: #cd7f32;
  text-shadow: 0 0 12px rgba(205, 127, 50, 0.55);
}

.card-tier-r .not-owned-overlay i,
.card-tier-r .not-owned-overlay span {
  color: #c0c0c0;
  text-shadow: 0 0 12px rgba(192, 192, 192, 0.55);
}

.card-tier-sr .not-owned-overlay i,
.card-tier-sr .not-owned-overlay span {
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.55);
}

/* First Owner tag */
.first-owner-tag {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #f1c40f;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 2px;
  z-index: 3;
  text-shadow: 0 0 8px rgba(241, 196, 15, 0.6), 0 0 16px rgba(241, 196, 15, 0.3);
  white-space: nowrap;
  pointer-events: none;
}

/* Sit near the bottom of the graded slab */
.card.card-graded .first-owner-tag {
  bottom: 4.5%;
  z-index: 5;
}

.set-locked-tag {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #e67e22;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  z-index: 3;
  white-space: nowrap;
  pointer-events: none;
}

.card.card-graded .set-locked-tag {
  top: 3.5%;
  z-index: 5;
}

/* ========== PSA GRADED SLAB ========== */
.card.card-graded {
  /* Height follows full card art + label (no crop) */
  aspect-ratio: auto;
  height: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.card.card-graded:hover {
  border-color: transparent;
  box-shadow: none;
}

.card.card-graded.card-owned:hover {
  border-color: transparent;
  box-shadow: none;
}

.card.card-graded.card-owned:hover .psa-slab {
  outline: 3px solid #27ae60;
  outline-offset: -3px;
  box-shadow:
    0 0 0 1px rgba(39, 174, 96, 0.9),
    0 0 20px rgba(39, 174, 96, 0.55),
    0 0 40px rgba(39, 174, 96, 0.3),
    0 14px 30px rgba(0, 0, 0, 0.45);
}

/* Full slab wrapper */
.psa-slab {
  width: 100%;
  height: auto;
  box-sizing: border-box;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
  container-type: inline-size;
  container-name: psa-slab;
}

/*
  Frosted translucent acrylic shell.
  Cool clear-plastic look so it doesn't blend with silver card borders.
*/
.psa-shell {
  position: relative;
  width: 100%;
  height: auto;
  box-sizing: border-box;
  padding: 2.4% 2.6% 2.8%;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.64) 0%, rgba(255, 255, 255, 0.14) 14%, rgba(255, 255, 255, 0) 32%),
    linear-gradient(320deg, rgba(210, 230, 255, 0.24) 0%, transparent 26%),
    linear-gradient(
      165deg,
      rgba(236, 244, 250, 0.82) 0%,
      rgba(214, 228, 242, 0.72) 22%,
      rgba(200, 216, 234, 0.7) 48%,
      rgba(224, 236, 248, 0.78) 70%,
      rgba(206, 222, 238, 0.74) 100%
    );
  border: 1px solid rgba(90, 115, 145, 0.55);
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, 0.55),
    inset 0 -3px 6px rgba(25, 45, 75, 0.28),
    inset 3px 0 5px rgba(25, 45, 75, 0.16),
    inset -3px 0 5px rgba(25, 45, 75, 0.2),
    inset 0 0 0 1px rgba(40, 65, 100, 0.22),
    0 0 0 1.5px rgba(25, 40, 65, 0.7),
    0 0 0 3px rgba(70, 95, 130, 0.4),
    0 8px 18px rgba(15, 25, 45, 0.32);
  overflow: visible;
}

.psa-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.28) 0%,
      rgba(255, 255, 255, 0.05) 18%,
      transparent 42%,
      rgba(30, 55, 90, 0.14) 100%
    ),
    linear-gradient(
      90deg,
      rgba(25, 45, 75, 0.16) 0%,
      transparent 12%,
      transparent 88%,
      rgba(25, 45, 75, 0.16) 100%
    );
  z-index: 0;
}

/* Inner holder — frosted ice acrylic, not opaque silver */
.psa-mat {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 1.8% 2.2% 2%;
  /* Fixed gap — % gap collapses when height is auto */
  gap: 12px;
  border-radius: 1px;
  background:
    linear-gradient(
      165deg,
      rgba(248, 252, 255, 0.42) 0%,
      rgba(220, 234, 248, 0.36) 40%,
      rgba(208, 224, 240, 0.4) 100%
    );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -1px 2px rgba(50, 80, 120, 0.08);
  overflow: visible;
}

.psa-label-slot {
  flex: 0 0 auto;
  overflow: visible;
  padding-bottom: 4px; /* room for hologram sitting on bottom border */
}

/* White grading label — thick red border on all sides */
.psa-label {
  /* PSA does not publish the flip typeface; modern labels closely match Helvetica Bold */
  --psa-font: "Helvetica Neue", Helvetica, "Roboto", Arial, sans-serif;
  --psa-border: clamp(5px, 2.8cqi, 12px);
  position: relative;
  background: #fff;
  color: #111;
  font-family: var(--psa-font);
  border: var(--psa-border) solid #e53935;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
  overflow: visible;
}

.psa-label-body {
  padding: 2.8cqi 3.2cqi 4px;
  line-height: 1.15;
}

.psa-label-main {
  display: flex;
  justify-content: space-between;
  gap: 2.5cqi;
  align-items: flex-start;
}

.psa-label-left,
.psa-label-right {
  display: flex;
  flex-direction: column;
  gap: 0.6cqi;
  min-width: 0;
}

.psa-label-left {
  flex: 1 1 auto;
  text-align: left;
  overflow: visible;
}

.psa-label-right {
  text-align: right;
  flex: 0 1 auto;
  max-width: 46%;
  align-items: flex-end;
}

.psa-label-left .psa-barcode {
  margin-top: 2px;
}

.psa-label-right .psa-trade-id {
  margin-top: 2px;
}

.psa-brand,
.psa-card-name,
.psa-rarity,
.psa-card-number,
.psa-condition,
.psa-grade {
  font-family: var(--psa-font);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: #111;
  /* Scale with slab width so long lines never get clipped */
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.psa-brand {
  font-size: clamp(0.55rem, 4cqi, 1.1rem);
  letter-spacing: 0;
}
.psa-card-name { font-size: clamp(0.72rem, 5.3cqi, 1.5rem); }
.psa-rarity { font-size: clamp(0.6rem, 4.4cqi, 1.2rem); }
.psa-card-number { font-size: clamp(0.55rem, 4cqi, 1.1rem); }
.psa-condition { font-size: clamp(0.72rem, 5.3cqi, 1.5rem); }
.psa-grade { font-size: clamp(0.72rem, 5.3cqi, 1.5rem); }

.psa-label-footer {
  display: none;
}

.psa-barcode {
  display: flex;
  align-items: stretch;
  /* Scale with slab so modal matches grid proportions */
  height: clamp(10px, 4.8cqi, 30px);
  width: clamp(58px, 30cqi, 150px);
  max-width: 100%;
  gap: 0;
  background: #fff;
}

.psa-bar {
  display: block;
  height: 100%;
  min-width: 1px;
  background: transparent;
}

.psa-bar.on {
  background: #111;
}

.psa-hologram {
  position: absolute;
  left: 50%;
  bottom: calc(-1 * var(--psa-border));
  transform: translateX(-50%);
  z-index: 3;
  width: clamp(24px, 8.5cqi, 48px);
  height: clamp(12px, 4.2cqi, 24px);
  border-radius: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(125deg,
      #c8d4ff 0%,
      #ffffff 24%,
      #ffb0c5 48%,
      #b5efff 72%,
      #e4c4ff 100%);
  border: 1px solid #7f7f8a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.6),
    0 1px 1px rgba(0, 0, 0, 0.28);
  font-family: var(--psa-font);
  font-size: clamp(0.4rem, 2.1cqi, 0.8rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.psa-holo-p { color: #1c4ec8; }
.psa-holo-sa { color: #d32f2f; }

.psa-trade-id {
  font-family: var(--psa-font);
  font-size: clamp(0.6rem, 4.4cqi, 1.2rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Full card art — natural height, never cropped */
.psa-card-well {
  flex: 0 0 auto;
  position: relative;
  overflow: visible;
  display: block;
  background: transparent;
}

.psa-card-well img,
.card.card-graded .psa-card-well img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.card-modal-image.is-graded {
  flex: 0 0 42%;
}

.card-modal-image.is-graded .psa-slab {
  aspect-ratio: auto;
  height: auto;
}

.card-modal-image.is-graded img,
.card-modal-image.is-graded .psa-card-well img {
  border-radius: 0 !important;
  box-shadow: none !important;
}

.card-modal-image.is-graded .psa-label {
  --psa-border: 12px;
}

.card-modal-image.is-graded .psa-mat {
  gap: 16px;
}

.card-modal-image.is-graded .psa-label-body {
  padding: 12px 14px 8px;
}

.card-modal-grade-row {
  display: none;
}

.card-modal-grade-row.visible {
  display: flex;
}
/* ========== CARD DETAIL MODAL ========== */
.card-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 21000;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  padding: 24px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
}

/* Set requirements sits under the card detail modal */
.src-set-modal.card-modal {
  z-index: 20000;
}

.card-modal-content {
  position: relative;
  max-width: 1100px;
  width: 95%;
  max-height: none;
  margin: auto;
  background: #0d0d0d;
  border: 3px solid #c0392b;
  border-radius: 16px;
  overflow-y: visible;
  padding: 2rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Modal border matches card quality (holo keeps its own look below) */
.card-modal.rarity-border-n .card-modal-content {
  border-color: #cd7f32;
  box-shadow: 0 0 28px rgba(205, 127, 50, 0.28);
}
.card-modal.rarity-border-r .card-modal-content {
  border-color: #c0c0c0;
  box-shadow: 0 0 28px rgba(192, 192, 192, 0.28);
}
.card-modal.rarity-border-sr .card-modal-content {
  border-color: #ffd700;
  box-shadow: 0 0 28px rgba(255, 215, 0, 0.32);
}
.card-modal.rarity-border-src .card-modal-content {
  border-color: #2ecc71;
  box-shadow: 0 0 28px rgba(46, 204, 113, 0.32);
}
.card-modal.rarity-border-srr .card-modal-content {
  border-color: #e74c3c;
  box-shadow: 0 0 28px rgba(231, 76, 60, 0.32);
}

/* Holo detail modal — translucent / prismatic panel */
.card-modal.is-holo {
  background:
    radial-gradient(ellipse at 18% 15%, rgba(140, 210, 255, 0.16), transparent 42%),
    radial-gradient(ellipse at 82% 75%, rgba(255, 170, 220, 0.12), transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(180, 255, 220, 0.06), transparent 55%),
    rgba(4, 8, 14, 0.78);
}

.card-modal.is-holo .card-modal-content {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(200, 230, 255, 0.08) 28%,
      rgba(255, 255, 255, 0.04) 52%,
      rgba(255, 190, 230, 0.07) 78%,
      rgba(180, 220, 255, 0.1) 100%
    ),
    rgba(10, 16, 26, 0.42);
  border: 1px solid rgba(210, 235, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(80, 140, 200, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 48px rgba(120, 200, 255, 0.22),
    0 24px 64px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(22px) saturate(1.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.55);
  overflow: hidden;
}

.card-modal.is-holo .card-modal-content::before {
  content: '';
  position: absolute;
  /* Oversized so translated edges never meet the modal frame */
  inset: -60%;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 38%,
    rgba(255, 255, 255, 0.08) 44%,
    rgba(255, 255, 255, 0.18) 48%,
    rgba(160, 220, 255, 0.14) 50%,
    rgba(255, 180, 230, 0.12) 52%,
    rgba(180, 255, 220, 0.08) 56%,
    transparent 62%,
    transparent 100%
  );
  animation: holo-modal-sheen 7s ease-in-out infinite;
  z-index: 0;
  /* Soft-fade sheen at the panel edges so nothing looks cut off */
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 35%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 35%, transparent 78%);
}

.card-modal.is-holo .card-modal-content::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 18%),
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.12), transparent 28%);
  z-index: 0;
}

@keyframes holo-modal-sheen {
  0%, 100% {
    transform: translateX(-12%);
    opacity: 0;
  }
  15% { opacity: 0.75; }
  50% {
    transform: translateX(12%);
    opacity: 0.85;
  }
  85% { opacity: 0.75; }
}

.card-modal.is-holo .card-modal-layout,
.card-modal.is-holo .close-btn,
.card-modal.is-holo .card-modal-info,
.card-modal.is-holo .notes-section,
.card-modal.is-holo #modal-add-note {
  position: relative;
  z-index: 1;
}

.card-modal.is-holo .card-modal-info {
  padding: 1.15rem 1.35rem 1.25rem;
  border-radius: 14px;
  background:
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.14) 0%,
      rgba(255, 255, 255, 0.05) 45%,
      rgba(170, 210, 255, 0.08) 100%
    );
  border: 1px solid rgba(220, 240, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px) saturate(1.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
}

.card-modal.is-holo .card-modal-info h2 {
  color: #f4fbff;
  text-shadow: 0 0 18px rgba(160, 220, 255, 0.45);
}

.card-modal.is-holo .info-row {
  border-bottom-color: rgba(200, 230, 255, 0.16);
}

.card-modal.is-holo .info-label {
  color: rgba(190, 220, 245, 0.78);
}

.card-modal.is-holo .info-value {
  color: #f2f8ff;
}

.card-modal.is-holo .notes-section h3 {
  color: #eef7ff;
}

.card-modal.is-holo .note-entry {
  background: rgba(255, 255, 255, 0.08);
  border-left-color: rgba(140, 210, 255, 0.85);
}

.card-modal.is-holo .first-owner-badge {
  background: rgba(241, 196, 15, 0.12);
  border-color: rgba(255, 220, 120, 0.85);
  box-shadow: 0 0 16px rgba(241, 196, 15, 0.2);
}

.card-modal.is-holo #modal-add-note textarea,
.card-modal.is-holo #vc-modal-add-note textarea,
.card-modal.is-holo textarea {
  background: rgba(8, 14, 22, 0.45);
  border-color: rgba(180, 220, 255, 0.35);
  color: #eef6ff;
}

.card-modal.is-holo .note-submit-btn,
.card-modal.is-holo .grade-action-btn {
  box-shadow: 0 0 18px rgba(120, 200, 255, 0.25);
}

.card-modal-layout {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.card-modal-image {
  flex: 0 0 35%;
}

.card-modal-image img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.card-modal-info {
  flex: 1;
  padding-top: 1rem;
}

.card-modal-info h2 {
  font-size: 2rem;
  color: #fff;
  font-family: 'Impact', sans-serif;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #222;
}

.info-label {
  color: #888;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-value {
  color: #eee;
  font-weight: 700;
}

.trade-id-value {
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  letter-spacing: 1.5px;
  color: #f1c40f;
}

.rarity-n { color: #cd7f32; } /* Bronze */
.rarity-r { color: #c0c0c0; text-shadow: 0 0 6px rgba(192, 192, 192, 0.35); } /* Silver */
.rarity-sr { color: #ffd700; text-shadow: 0 0 8px rgba(255, 215, 0, 0.5); } /* Gold */
.rarity-src { color: #2ecc71; text-shadow: 0 0 8px rgba(46, 204, 113, 0.5); } /* Green */
.rarity-srr { color: #e74c3c; text-shadow: 0 0 8px rgba(231, 76, 60, 0.5); } /* Red */
.rarity-holo {
  color: #e8f4ff;
  text-shadow: 0 0 10px rgba(120, 210, 255, 0.75), 0 0 18px rgba(255, 255, 255, 0.35);
}

.holo-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 999px;
  font: 700 11px/1 system-ui, sans-serif;
  letter-spacing: 0.06em;
  color: #eef8ff;
  background: linear-gradient(135deg, rgba(90, 170, 255, 0.92), rgba(180, 120, 255, 0.88));
  box-shadow: 0 0 10px rgba(120, 200, 255, 0.45);
  pointer-events: none;
}

.first-owner-badge {
  margin-top: 1rem;
  padding: 10px 20px;
  background: rgba(241, 196, 15, 0.1);
  border: 2px solid #f1c40f;
  border-radius: 8px;
  color: #f1c40f;
  font-weight: 900;
  font-size: 1.1rem;
  text-align: center;
  text-shadow: 0 0 12px rgba(241, 196, 15, 0.5);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 10;
  transition: color 0.3s, transform 0.3s;
  line-height: 1;
}

.close-btn:hover {
  color: #e74c3c;
  transform: scale(1.2);
}

/* ========== NOTES ========== */
.notes-section {
  margin-top: 2rem;
}

.notes-section h3 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.note-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid #c0392b;
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 0 8px 8px 0;
}

.note-entry-profile {
  flex: 0 0 auto;
  max-width: min(100%, 220px);
}

.note-entry-profile .trade-mini-profile {
  width: 100%;
  max-width: 220px;
}

.note-entry-profile .user-avatar {
  width: 34px;
  height: 34px;
}

.note-entry-profile .user-name {
  font-size: 0.92rem;
}

.note-entry-profile .user-level,
.note-entry-profile .user-rank {
  font-size: 0.72rem;
}

.note-entry-body {
  flex: 1;
  min-width: 0;
}

.note-author {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 4px;
}

.note-text {
  color: #ddd;
  font-size: 0.95rem;
  line-height: 1.5;
}

.note-date {
  font-size: 0.75rem;
  color: #555;
  margin-top: 6px;
}

.no-notes {
  color: #555;
  font-style: italic;
}

#modal-add-note textarea,
#note-input {
  width: 100%;
  min-height: 80px;
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 8px;
  color: #eee;
  padding: 12px;
  font-size: 0.95rem;
  resize: vertical;
  margin-top: 0.5rem;
  outline: none;
  transition: border-color 0.3s;
}

#modal-add-note textarea:focus,
#note-input:focus {
  border-color: #c0392b;
}

#modal-add-note {
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.note-submit-btn {
  margin-top: 8px;
  padding: 10px 24px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  position: relative;
  z-index: 4;
  pointer-events: auto;
  transition: background 0.3s;
}

.note-submit-btn:hover {
  background: #e74c3c;
}

/* ========== COMMUNITY PAGE ========== */
.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

.stat-card {
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid #222;
  border-radius: 12px;
  padding: 1.5rem 1.25rem 1.35rem;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  overflow: visible;
}

.stat-card:hover {
  border-color: #f1c40f;
  transform: translateY(-4px);
  box-shadow: 0 0 18px rgba(241, 196, 15, 0.45), 0 0 36px rgba(241, 196, 15, 0.22);
}

.stat-card h3 {
  color: #f1c40f;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  text-shadow:
    0 0 8px rgba(241, 196, 15, 0.9),
    0 0 16px rgba(241, 196, 15, 0.65),
    0 0 28px rgba(241, 196, 15, 0.4);
}

.community-visual {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.community-empty {
  color: #888;
  font-size: 0.95rem;
  margin: 0;
}

.community-caption {
  color: #ddd;
  font-size: 0.95rem;
  font-weight: 700;
  margin: -0.25rem 0 0.75rem;
}

.community-stat-hero {
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.community-stat-hero-coins {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.community-stat-hero-coins .meat-coin-icon-inline {
  width: clamp(1.6rem, 3.5vw, 2.2rem);
  height: clamp(1.6rem, 3.5vw, 2.2rem);
}

.community-user {
  display: flex;
  justify-content: center;
}

.community-card-wrap {
  width: min(46%, 150px);
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: block;
}

button.community-card-wrap:hover .community-card-img,
button.community-card-wrap:focus-visible .community-card-img {
  border-color: #f1c40f;
  box-shadow: 0 0 12px rgba(241, 196, 15, 0.45);
}

.community-card-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.community-card-row .community-card-wrap {
  width: 30%;
  flex: 0 0 30%;
}

.community-card-img {
  width: 100%;
  aspect-ratio: 500 / 720;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #333;
  display: block;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.community-card-wrap.is-holo .community-card-img {
  border-color: #f1c40f;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.35);
}

.community-packs {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.community-packs img {
  width: 30%;
  max-width: 92px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
}

.stat-value {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-user-link {
  color: #e74c3c;
  text-decoration: none;
  font-weight: 700;
  transition: text-shadow 0.3s;
}

.stat-user-link:hover {
  text-shadow: 0 0 10px rgba(231, 76, 60, 0.6);
}

.rarity-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  margin-left: 6px;
  vertical-align: middle;
}

/* ========== VIEW COLLECTIONS / FEATURED ========== */
.section-title {
  text-align: center;
  color: #fff;
  font-family: 'Impact', sans-serif;
  font-size: 1.8rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  letter-spacing: 2px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

.featured-user-card {
  position: relative;
  background: rgba(0, 0, 0, 0.6);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid #333;
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: border-color 0.3s, transform 0.3s;
  overflow: hidden;
}

.featured-user-card > * {
  position: relative;
  z-index: 1;
}

.featured-user-card.has-custom-bg {
  background-image: var(--featured-banner);
  background-clip: padding-box;
  border-color: rgba(255, 255, 255, 0.16);
}

.featured-user-card.has-custom-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.72);
}

.featured-user-card.has-custom-bg .featured-username {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.7);
}

.featured-user-card.has-custom-bg .featured-count {
  color: #ddd;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.featured-user-card.has-custom-bg .featured-card-img {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.featured-user-card:hover {
  border-color: #c0392b;
  transform: translateY(-4px);
}

.featured-username {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.featured-count {
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.featured-preview {
  display: flex;
  gap: 6px;
}

.featured-signature {
  margin-top: 0.75rem;
  color: #ddd;
  font-size: 0.8rem;
  font-style: italic;
  text-align: center;
  word-break: break-word;
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.7);
}

.featured-card-wrap {
  position: relative;
  width: 18%;
  flex: 0 0 18%;
}

.featured-card-img {
  width: 100%;
  aspect-ratio: 500 / 720;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #333;
  display: block;
}

.featured-card-wrap.is-holo .featured-card-img {
  border-color: #f1c40f;
  box-shadow: 0 0 8px rgba(241, 196, 15, 0.35);
}

.no-data {
  color: #555;
  text-align: center;
  font-style: italic;
  padding: 2rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .note-entry {
    flex-direction: column;
  }

  .note-entry-profile,
  .note-entry-profile .trade-mini-profile {
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .card-modal-layout {
    flex-direction: column;
  }
  .card-modal-image {
    flex: none;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  body {
    background-attachment: scroll;
  }

  header {
    padding: 0.45rem 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: transform 0.28s ease;
  }

  header.nav-minimized {
    transform: translateY(-110%);
    pointer-events: none;
  }

  header.nav-open {
    transform: none;
    pointer-events: auto;
  }

  nav {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "toggle logo user"
      "links links links";
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.45rem;
    padding: 0 max(0.75rem, env(safe-area-inset-right)) 0 max(0.75rem, env(safe-area-inset-left));
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    grid-area: toggle;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer;
  }

  .nav-toggle:hover,
  .nav-toggle:focus-visible {
    background: rgba(192, 57, 43, 0.45);
    border-color: #e74c3c;
  }

  .nav-toggle.has-alert::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e74c3c;
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.9);
  }

  .logo {
    grid-area: logo;
    font-size: 1.15rem;
    letter-spacing: 1px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-user {
    grid-area: user;
    margin-left: 0;
    min-width: 0;
    max-width: 100%;
  }

  .nav-user .user-menu {
    gap: 6px;
    max-width: 100%;
  }

  .nav-user .user-menu.has-custom-bg {
    padding: 3px 6px 3px 4px;
  }

  .nav-user .user-avatar {
    width: 34px;
    height: 34px;
  }

  .nav-user .user-rank,
  .nav-user .user-level,
  .nav-user .meat-coins,
  .nav-user .unopened-packs {
    display: none;
  }

  .nav-user .user-info {
    gap: 0;
    min-width: 0;
  }

  .nav-user .user-name {
    font-size: 0.82rem;
    margin-top: 0;
    white-space: nowrap;
  }

  .trade-mini-profile {
    max-width: 100%;
  }

  .trade-mini-profile .user-info {
    min-width: 0;
    flex: 1 1 auto;
  }

  .trade-mini-profile .user-name {
    max-width: none;
    overflow: visible;
    white-space: normal;
    text-overflow: unset;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
  }

  .nav-user .logout-link {
    display: none !important;
  }

  .nav-mobile-logout {
    display: block;
  }

  .nav-links {
    display: none;
    grid-area: links;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0.35rem 0 0.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  header.nav-open .nav-links {
    display: flex;
  }

  .nav-links a {
    white-space: normal;
    font-size: 0.95rem;
    padding: 0.7rem 0.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
  .filter-bar {
    flex-direction: column;
    gap: 1rem;
  }
  main {
    margin: 1rem;
    padding: 1rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .profile-panel {
    padding: 0.9rem 0.75rem 1.1rem;
    gap: 1rem;
    min-width: 0;
  }

  .profile-owner-actions,
  .profile-bg-actions,
  .profile-owner-actions-left {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .profile-panel-main {
    padding: 0.8rem 0.75rem;
    min-width: 0;
  }

  .profile-identity {
    justify-content: flex-start;
    gap: 0.7rem;
    min-width: 0;
  }

  .profile-identity-text {
    min-width: 0;
    flex: 1 1 auto;
  }

  .profile-avatar {
    width: 56px;
    height: 56px;
  }

  .profile-username {
    font-size: 1.45rem;
    letter-spacing: 0.4px;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.15;
  }

  .profile-sub-tier {
    font-size: 1rem;
  }

  .profile-rank-level {
    gap: 0.55rem;
    margin-bottom: 0.7rem;
  }

  .profile-rank,
  .profile-level-text {
    font-size: 1.15rem;
  }

  .collection-count {
    font-size: 1.15rem;
    margin-top: 0.7rem;
  }

  .profile-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .profile-stat {
    padding: 0.5rem 0.55rem;
    min-width: 0;
  }

  .profile-stat-label {
    font-size: 0.62rem;
    letter-spacing: 0.3px;
  }

  .showcase-cards {
    --showcase-card-width: 108px;
    gap: 0.55rem;
  }

  .social-icons {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
  }

  .social-link {
    font-size: clamp(1.7rem, 7.5vw, 2.35rem);
    flex: 0 0 auto;
    line-height: 1;
  }
}

/* Pinch-zoom: sticky/fixed chrome traps iOS/Android visual viewport so you cannot zoom back out. */
html.is-pinch-zoomed header {
  position: relative !important;
  transform: none !important;
  pointer-events: auto !important;
}

html.is-pinch-zoomed .live-stream-pip {
  display: none !important;
}

/* ========== LIVE STREAM PIP ========== */
.live-stream-pip {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 340px;
  max-width: calc(100vw - 2rem);
  z-index: 9999;
  background: #0e0e10;
  border: 2px solid #9146ff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65), 0 0 20px rgba(145, 70, 255, 0.25);
}

body.modal-open .live-stream-pip {
  display: none !important;
}

.live-stream-pip-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.65rem;
  background: rgba(145, 70, 255, 0.2);
  border-bottom: 1px solid rgba(145, 70, 255, 0.45);
}

.live-stream-pip-label {
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.live-stream-pip-label i {
  color: #9146ff;
}

.live-stream-pip-open {
  margin-left: auto;
  color: #ddd !important;
  font-size: 0.7rem !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  text-decoration: none;
}

.live-stream-pip-open:hover {
  color: #fff !important;
}

.live-stream-pip-toggle {
  background: transparent;
  border: 1px solid #666;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.live-stream-pip-toggle:hover {
  border-color: #9146ff;
  background: rgba(145, 70, 255, 0.25);
}

.live-stream-pip-player {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
}

.live-stream-pip-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.live-stream-pip.is-minimized .live-stream-pip-player {
  display: none;
}

.live-stream-pip.is-minimized {
  width: auto;
}

@media (max-width: 600px) {
  .live-stream-pip {
    width: min(300px, calc(100vw - 1.5rem));
    right: 0.75rem;
    bottom: 0.75rem;
  }
}

/* ========== CARD GRADING SYSTEM ========== */
.nav-grade-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.35rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #f1c40f;
  color: #111;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.55);
  vertical-align: middle;
}

.card-grading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem;
  text-align: center;
  z-index: 4;
  pointer-events: none;
}

.card-grading-pending-state img,
.card-grading-ready-state img {
  filter: grayscale(0.85) brightness(0.35);
}

.card-grading-pending {
  background: rgba(0, 0, 0, 0.72);
  color: #ddd;
}

.card-grading-pending-icon {
  font-size: 1.35rem;
  color: #aaa;
}

.card-grading-pending-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}

.card-grading-pending-time {
  font-size: 0.78rem;
  color: #f1c40f;
  font-weight: 700;
}

.card-grading-ready {
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  pointer-events: auto;
  cursor: pointer;
}

.card-grading-ready-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #f1c40f;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  box-shadow: 0 0 14px rgba(241, 196, 15, 0.55);
}

.card-grading-ready-text {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.card-grading-ready-state {
  cursor: pointer;
}

.site-confirm-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30000;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}

.site-confirm-modal.is-open {
  display: flex;
}

.site-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.site-confirm-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 1.35rem 1.4rem 1.25rem;
  border-radius: 14px;
  background: #121212;
  border: 2px solid #c0392b;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.65), 0 0 24px rgba(192, 57, 43, 0.22);
}

.site-confirm-title {
  margin: 0 0 0.75rem;
  color: #fff;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-confirm-message {
  color: #ddd;
  font-size: 0.98rem;
  line-height: 1.5;
  margin-bottom: 1.15rem;
}

.site-confirm-message p {
  margin: 0 0 0.65rem;
}

.site-confirm-message p:last-child {
  margin-bottom: 0;
}

.site-confirm-message .site-confirm-cost {
  color: #f1c40f;
  font-weight: 800;
}

.site-confirm-message .site-confirm-warn {
  color: #f0b0a8;
  font-size: 0.9rem;
}

.site-confirm-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
}

.site-confirm-btn {
  min-width: 108px;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: none;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.site-confirm-btn:hover {
  transform: translateY(-1px);
}

.site-confirm-btn-cancel {
  background: #2a2a2a;
  color: #eee;
  border: 1px solid #444;
}

.site-confirm-btn-cancel:hover {
  background: #363636;
}

.site-confirm-btn-ok {
  background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(231, 76, 60, 0.28);
}

.site-confirm-btn-ok:hover {
  box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4);
}

.site-confirm-btn-danger,
.site-confirm-modal.is-danger .site-confirm-btn-ok {
  background: linear-gradient(180deg, #c0392b 0%, #922b21 100%);
}

.site-confirm-modal.is-danger .site-confirm-panel {
  border-color: #e74c3c;
}

.modal-grade-action {
  margin: 1rem 0;
  padding-top: 0.75rem;
  border-top: 1px solid #333;
}

.grade-action-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-text-stroke: 0.45px #000;
  paint-order: stroke fill;
  text-shadow:
    1px 0 0 #000,
    -1px 0 0 #000,
    0 1px 0 #000,
    0 -1px 0 #000,
    1px 1px 0 #000,
    -1px 1px 0 #000,
    1px -1px 0 #000,
    -1px -1px 0 #000;
}

.grade-action-btn .meat-coin-icon-inline {
  width: 0.95em;
  height: 0.95em;
  vertical-align: -0.12em;
  margin: 0 0.08em;
  filter:
    drop-shadow(1px 0 0 #000)
    drop-shadow(-1px 0 0 #000)
    drop-shadow(0 1px 0 #000)
    drop-shadow(0 -1px 0 #000)
    drop-shadow(1px 1px 0 #000)
    drop-shadow(-1px 1px 0 #000)
    drop-shadow(1px -1px 0 #000)
    drop-shadow(-1px -1px 0 #000);
}

.grade-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(231, 76, 60, 0.35);
}

.grade-reveal-btn {
  background: linear-gradient(180deg, #f1c40f 0%, #d4ac0d 100%);
  color: #111;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.grade-action-hint {
  margin-top: 0.55rem;
  color: #aaa;
  font-size: 0.82rem;
  line-height: 1.35;
}

.grade-action-pending {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #333;
  color: #ccc;
}

.grade-action-pending strong {
  color: #fff;
}

.meat-coin-icon-inline {
  width: 1rem;
  height: 1rem;
  vertical-align: -0.15rem;
}

.card-modal-image.is-reveal-pending {
  flex: 0 0 42%;
}

.modal-reveal-block {
  position: relative;
  width: 100%;
  cursor: pointer;
}

.modal-reveal-img {
  width: 100%;
  display: block;
  filter: grayscale(0.85) brightness(0.25);
}

.modal-reveal-overlay {
  position: absolute;
  inset: 0;
}

/* ========== TRADING ========== */
.trade-page-lead {
  text-align: center;
  color: #bbb;
  max-width: 720px;
  margin: -1rem auto 1.75rem;
}

.trade-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ccc;
  text-decoration: none;
  font-weight: 700;
}

.trade-back-link:hover {
  color: #e74c3c;
}

.trade-compose-top {
  margin-bottom: 0.5rem;
}

.trade-compose-top .page-title {
  margin-bottom: 0.75rem;
}

.trade-mini-profile {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  width: max-content;
  max-width: 320px;
  flex: 0 0 auto;
  border: none;
  border-radius: 10px;
  padding: 8px 14px 8px 10px;
  background-color: #111;
  box-shadow: 0 0 0 1px #444;
  overflow: hidden;
  isolation: isolate;
}

.mini-signature {
  display: block;
  color: #ddd;
  font-size: 0.72rem;
  font-style: italic;
  line-height: 1.3;
  margin-top: 3px;
  word-break: break-word;
  white-space: normal;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.7);
}

.trade-mini-profile > * {
  position: relative;
  z-index: 1;
}

.trade-mini-profile.has-custom-bg {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.trade-mini-profile.has-custom-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #000;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.72)),
    var(--user-banner);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-origin: border-box, border-box;
  background-clip: border-box, border-box;
}

.trade-mini-profile.has-custom-bg .user-name,
.trade-mini-profile.has-custom-bg .user-level,
.trade-mini-profile.has-custom-bg .user-rank:not(.rank-meat-god) {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.75);
}

.trade-mini-profile .user-avatar {
  width: 36px;
  height: 36px;
}

.trade-mini-profile .user-name {
  font-size: 1rem;
}

.trade-mini-profile .user-name.is-sub {
  color: #bf94ff;
  text-shadow:
    0 0 6px rgba(145, 70, 255, 0.95),
    0 0 14px rgba(145, 70, 255, 0.7),
    0 0 28px rgba(145, 70, 255, 0.45);
}

.trade-mini-profile.has-custom-bg .user-name.is-sub {
  text-shadow:
    0 0 6px rgba(145, 70, 255, 0.95),
    0 0 14px rgba(145, 70, 255, 0.7),
    0 0 28px rgba(145, 70, 255, 0.45),
    0 1px 2px rgba(0, 0, 0, 0.95);
}

a.trade-mini-profile {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.trade-mini-profile.mini-border-rank:hover {
  box-shadow:
    0 0 0 1px #cd7f32,
    0 0 10px rgba(205, 127, 50, 0.55),
    0 0 20px rgba(205, 127, 50, 0.3);
}

.trade-mini-profile.mini-border-sub:hover {
  box-shadow:
    0 0 0 1px #bf94ff,
    0 0 12px rgba(145, 70, 255, 0.85),
    0 0 24px rgba(145, 70, 255, 0.45);
}

.trade-mini-profile.mini-border-meat-god:hover {
  box-shadow:
    0 0 0 1px #e74c3c,
    0 0 12px rgba(231, 76, 60, 0.9),
    0 0 24px rgba(231, 76, 60, 0.45);
}

a.trade-mini-profile .user-name:hover {
  color: #fff;
  text-decoration: none;
}

a.trade-mini-profile .user-name.is-sub:hover {
  color: #d4b8ff;
}

.trade-list-head .trade-mini-profile {
  flex: 0 0 auto;
}

.trade-list-head .trade-status-pill {
  flex-shrink: 0;
}

.trade-deal-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.trade-deal-who {
  margin: 0;
}

.trade-deal-who .trade-mini-profile {
  max-width: 100%;
}

.trades-columns {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.trades-open {
  display: flex;
  flex-direction: column;
}

.trade-section {
  margin-bottom: 2rem;
}

.trade-section-title {
  color: #fff;
  font-size: 1.15rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.trade-empty {
  color: #888;
  padding: 0.5rem 0;
}

.trade-notifications {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
}

.trade-note {
  display: block;
  background: rgba(241, 196, 15, 0.12);
  border: 1px solid rgba(241, 196, 15, 0.45);
  color: #f8e9a1;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
}

.trade-note.trade_accepted {
  background: rgba(39, 174, 96, 0.15);
  border-color: rgba(39, 174, 96, 0.5);
  color: #b7f0cd;
}

.trade-note.trade_declined,
.trade-note.trade_cancelled {
  background: rgba(192, 57, 43, 0.15);
  border-color: rgba(192, 57, 43, 0.5);
  color: #f5b7b1;
}

.trade-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.trade-list-card {
  display: block;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #333;
  border-radius: 10px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.trade-list-card:hover {
  transform: translateY(-2px);
}

.trade-list-card.status-accepted:hover {
  border-color: #2ecc71;
}

.trade-list-card.status-cancelled:hover {
  border-color: #95a5a6;
}

.trade-list-card.status-declined:hover {
  border-color: #e74c3c;
}

.trade-list-card.status-pending:hover {
  border-color: #f1c40f;
}

.trade-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.trade-status-pill {
  background: #333;
  color: #eee;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.status-accepted .trade-status-pill { background: #1e8449; }
.status-declined .trade-status-pill { background: #922b21; }
.status-cancelled .trade-status-pill { background: #5d6d7e; }
.status-pending .trade-status-pill { background: #b7950b; }

.trade-list-sides {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: stretch;
}

.trade-list-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid #333;
}

.trade-list-side {
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.7rem 0.75rem;
}

.trade-list-side.trade-deal-in {
  box-shadow: inset 0 0 28px rgba(39, 174, 96, 0.22);
}

.trade-list-side.trade-deal-out {
  box-shadow: inset 0 0 28px rgba(192, 57, 43, 0.22);
}

.trade-list-sides h3 {
  color: #fff;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.55rem;
}

.trade-list-swap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f1c40f;
  min-width: 28px;
}

.trade-list-swap i {
  font-size: 1.05rem;
}

.trade-thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trade-thumb {
  width: 92px;
  background: #111;
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
}

.trade-thumb img {
  width: 100%;
  aspect-ratio: 500 / 720;
  object-fit: cover;
  display: block;
}

.trade-thumb .trade-pick-visual {
  width: 100%;
}

.trade-thumb-name,
.trade-thumb-meta {
  display: block;
  padding: 3px 6px 0;
  font-size: 0.7rem;
  line-height: 1.3;
}

.trade-thumb-name {
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-thumb-meta {
  color: #aaa;
  padding-bottom: 6px;
}

.trade-error {
  background: rgba(192, 57, 43, 0.18);
  border: 1px solid #c0392b;
  color: #f5b7b1;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 700;
}

.trade-compose-hint {
  color: #ccc;
  margin-bottom: 1.25rem;
}

.trade-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.trade-compose-board {
  grid-template-columns: minmax(240px, 0.85fr) minmax(360px, 1.25fr);
  align-items: start;
}

.trade-pane-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.trade-collection-pane .trade-pick-grid {
  min-height: 180px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 110px));
  justify-content: start;
}

.trade-summary-grid {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  max-height: 340px;
  overflow-y: auto;
}

.trade-summary-grid .trade-pick-card:hover {
  border-color: #e74c3c;
}

.trade-deal-tray {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.85rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
}

.trade-deal-tray.has-whos {
  grid-template-rows: auto 1fr;
}

.trade-deal-tray.has-whos .trade-deal-who-out {
  grid-column: 1;
  grid-row: 1;
}

.trade-deal-tray.has-whos .trade-deal-out {
  grid-column: 1;
  grid-row: 2;
}

.trade-deal-tray.has-whos .trade-deal-swap {
  grid-column: 2;
  grid-row: 2;
}

.trade-deal-tray.has-whos .trade-deal-who-in {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
}

.trade-deal-tray.has-whos .trade-deal-in {
  grid-column: 3;
  grid-row: 2;
}

.trade-deal-side {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #333;
  border-radius: 10px;
  padding: 0.9rem;
  min-height: 0;
}

.trade-deal-in {
  border-color: rgba(39, 174, 96, 0.55);
  background: rgba(39, 174, 96, 0.08);
}

.trade-deal-out {
  border-color: rgba(192, 57, 43, 0.55);
  background: rgba(192, 57, 43, 0.08);
}

.trade-deal-side h2 {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: #fff;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.35rem;
}

.trade-deal-side h2 span {
  color: #f1c40f;
  font-size: 0.85rem;
}

.trade-deal-sub {
  color: #bbb;
  font-size: 0.82rem;
  margin: 0 0 0.7rem;
}

.trade-deal-help {
  color: #888;
  font-size: 0.78rem;
  margin: 0 0 0.55rem;
}

.trade-deal-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 72px;
}

.trade-deal-swap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #f1c40f;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  min-width: 64px;
}

.trade-deal-swap i {
  font-size: 1.35rem;
}

.trade-thumb-btn {
  width: 84px;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  position: relative;
  border: 1px solid #333;
  background: #111;
}

.trade-thumb-btn:hover {
  border-color: #e74c3c;
}

.trade-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.trade-counter-browse {
  margin-bottom: 1.25rem;
}

.trade-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #333;
  border-radius: 8px;
}

.trade-toolbar .filter-group {
  gap: 8px;
}

.trade-toolbar .filter-group select {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.trade-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 0.9rem;
  color: #ccc;
  font-weight: 700;
}

.trade-pager .trade-btn {
  padding: 6px 14px;
}

.trade-browse-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.trade-tab {
  flex: 1;
  background: #1a1a1a;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.trade-tab:hover {
  border-color: #c0392b;
  color: #fff;
}

.trade-tab.is-active {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

.trade-pane {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #333;
  border-radius: 10px;
  padding: 1rem;
  min-height: 180px;
}

.trade-pane h2 {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: #fff;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.85rem;
}

.trade-pane h2 span {
  color: #f1c40f;
  font-size: 0.85rem;
}

.trade-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.7rem;
}

.trade-pick-card {
  position: relative;
  background: transparent;
  border: 2px solid #333;
  border-radius: 8px;
  padding: 0 0 8px;
  cursor: pointer;
  overflow: hidden;
  color: inherit;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s;
}

.trade-pick-visual {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 500 / 720;
  overflow: hidden;
}

.trade-pick-visual > img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  display: block;
}

.trade-pick-card.is-graded,
.trade-thumb.is-graded {
  --picker-card-ratio: 1.44;
  --picker-slab-ratio: 1.809;
  --picker-warp-y: calc(var(--picker-card-ratio) / var(--picker-slab-ratio));
}

.trade-pick-card.is-graded .trade-pick-visual,
.trade-thumb.is-graded .trade-pick-visual {
  overflow: hidden;
  background: transparent;
}

.trade-pick-card.is-graded .showcase-graded-scaler,
.trade-thumb.is-graded .showcase-graded-scaler {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: calc(100% / var(--picker-warp-y));
  transform: scaleY(var(--picker-warp-y));
  transform-origin: top center;
  pointer-events: none;
}

.trade-pick-card.is-graded .psa-slab,
.trade-pick-card.is-graded .psa-shell,
.trade-pick-card.is-graded .psa-mat,
.trade-thumb.is-graded .psa-slab,
.trade-thumb.is-graded .psa-shell,
.trade-thumb.is-graded .psa-mat {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  filter: none;
}

.trade-pick-card.is-graded .psa-shell,
.trade-thumb.is-graded .psa-shell {
  padding: 2.2% 2.4% 2.4%;
  display: flex;
  flex-direction: column;
}

.trade-pick-card.is-graded .psa-mat,
.trade-thumb.is-graded .psa-mat {
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
  padding: 1.6% 2% 1.8%;
  display: flex;
  flex-direction: column;
}

.trade-pick-card.is-graded .psa-label-slot,
.trade-thumb.is-graded .psa-label-slot {
  flex: 0 0 auto;
  padding-bottom: 2px;
}

.trade-pick-card.is-graded .psa-card-well,
.trade-thumb.is-graded .psa-card-well {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
  position: relative;
  overflow: hidden;
}

.trade-pick-card.is-graded .psa-card-well img,
.trade-thumb.is-graded .psa-card-well img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: auto;
  display: block;
}

.trade-pick-card.is-graded .psa-label,
.trade-thumb.is-graded .psa-label {
  --psa-border: clamp(3px, 2.2cqi, 6px);
}

.trade-pick-card.is-graded .psa-label-body,
.trade-thumb.is-graded .psa-label-body {
  padding: 2cqi 2.4cqi 2px;
}

.trade-pick-card.is-graded .psa-brand,
.trade-thumb.is-graded .psa-brand { font-size: clamp(0.45rem, 4.2cqi, 0.85rem); }
.trade-pick-card.is-graded .psa-card-name,
.trade-thumb.is-graded .psa-card-name { font-size: clamp(0.55rem, 5.4cqi, 1.05rem); }
.trade-pick-card.is-graded .psa-rarity,
.trade-thumb.is-graded .psa-rarity { font-size: clamp(0.48rem, 4.6cqi, 0.9rem); }
.trade-pick-card.is-graded .psa-card-number,
.trade-thumb.is-graded .psa-card-number { font-size: clamp(0.45rem, 4.2cqi, 0.85rem); }
.trade-pick-card.is-graded .psa-condition,
.trade-thumb.is-graded .psa-condition { font-size: clamp(0.55rem, 5.4cqi, 1.05rem); }
.trade-pick-card.is-graded .psa-grade,
.trade-thumb.is-graded .psa-grade { font-size: clamp(0.55rem, 5.4cqi, 1.05rem); }
.trade-pick-card.is-graded .psa-trade-id,
.trade-thumb.is-graded .psa-trade-id { font-size: clamp(0.48rem, 4.6cqi, 0.9rem); }
.trade-pick-card.is-graded .psa-barcode,
.trade-thumb.is-graded .psa-barcode {
  height: clamp(8px, 4.4cqi, 18px);
  width: clamp(48px, 28cqi, 110px);
}
.trade-pick-card.is-graded .psa-hologram,
.trade-thumb.is-graded .psa-hologram {
  width: clamp(20px, 8cqi, 36px);
  height: clamp(10px, 3.8cqi, 18px);
  font-size: clamp(0.35rem, 2cqi, 0.65rem);
}

.trade-pick-name,
.trade-pick-meta,
.trade-pick-flag {
  display: block;
  padding: 4px 6px 0;
  font-size: 0.72rem;
}

.trade-pick-name {
  color: #fff;
  font-weight: 700;
}

.trade-pick-meta { color: #aaa; }
.trade-pick-flag { color: #f1c40f; font-weight: 800; text-transform: uppercase; }

.trade-pick-card.is-selected {
  border-color: #e74c3c;
  box-shadow: 0 0 0 1px #e74c3c;
}

.trade-pick-card.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.trade-pick-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.trade-pick-lock {
  display: block;
  padding: 4px 6px 0;
  color: #e67e22;
  font-size: 0.68rem;
  font-weight: 700;
}

.trade-fee-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(241, 196, 15, 0.1);
  border: 1px solid rgba(241, 196, 15, 0.4);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 1rem;
  color: #f8e9a1;
}

.trade-fee-banner img {
  width: 22px;
  height: 22px;
  margin-top: 2px;
}

.trade-fee-banner strong,
.trade-fee-banner span {
  display: block;
}

.trade-fee-banner span {
  color: #ddd;
  font-size: 0.92rem;
  font-weight: 400;
  margin-top: 4px;
}

.trade-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.trade-btn,
.trade-request-btn {
  background: #333;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trade-btn:hover,
.trade-request-btn:hover {
  background: #444;
}

.trade-btn-primary,
.trade-request-btn {
  background: #c0392b;
}

.trade-btn-primary:hover,
.trade-request-btn:hover {
  background: #e74c3c;
}

.trade-btn-danger {
  background: #7b241c;
}

.trade-btn-danger:hover {
  background: #922b21;
}

.trade-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.modal-trade-action {
  margin: 1rem 0 0.5rem;
}

.trade-action-hint {
  color: #aaa;
  font-size: 0.85rem;
  margin-top: 0.45rem;
}

.trade-tier-hint {
  color: #f1c40f;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

@media (max-width: 800px) {
  .trade-board,
  .trade-compose-board,
  .trade-deal-tray,
  .trade-deal-tray.has-whos {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .trade-deal-tray.has-whos .trade-deal-who-out,
  .trade-deal-tray.has-whos .trade-deal-out,
  .trade-deal-tray.has-whos .trade-deal-swap,
  .trade-deal-tray.has-whos .trade-deal-who-in,
  .trade-deal-tray.has-whos .trade-deal-in {
    grid-column: auto;
    grid-row: auto;
  }

  .trade-deal-swap {
    flex-direction: row;
    min-height: 0;
    padding: 0.25rem 0;
  }

  .trades-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 0.7rem;
  }

  .trades-open,
  .trades-history-section {
    min-width: 0;
  }

  .trades-columns .trade-section {
    margin-bottom: 1.1rem;
  }

  .trades-open .trade-section:last-child,
  .trades-history-section {
    margin-bottom: 0;
  }

  .trades-columns .trade-section-title {
    font-size: 0.88rem;
    letter-spacing: 0.4px;
    margin-bottom: 0.55rem;
  }

  .trade-list-card {
    padding: 0.65rem;
  }

  .trade-list-head {
    gap: 0.45rem;
    margin-bottom: 0.6rem;
  }

  .trade-list-sides {
    gap: 0.3rem;
  }

  .trade-list-side {
    padding: 0.4rem 0.35rem;
  }

  .trade-list-sides h3 {
    font-size: 0.66rem;
    margin-bottom: 0.35rem;
  }

  .trade-list-swap {
    min-width: 16px;
    padding: 0;
  }

  .trade-list .trade-thumb-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .trade-list .trade-thumb {
    width: 56px;
    flex: 0 0 56px;
  }
}

/* ========== PACKS PAGE ========== */
.packs-app {
  max-width: 1180px;
  margin: 0 auto;
}

.packs-login-gate {
  text-align: center;
  padding: 2rem 1.5rem 2.5rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  margin-bottom: 1.75rem;
}

.packs-login-gate p {
  color: #ddd;
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
}

.packs-login-sub {
  color: #aaa !important;
  font-size: 0.95rem !important;
  margin-bottom: 1.25rem !important;
}

.packs-status {
  display: none;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1.1rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.packs-status:not([hidden]) {
  display: flex;
}

.packs-status-live {
  color: #9146ff;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.packs-status-paused {
  color: #f1c40f;
  font-weight: 700;
}

.packs-status-holo {
  color: #aaa;
  font-size: 0.9rem;
}

.packs-unopened {
  margin-bottom: 2rem;
}

.packs-section-title {
  font-family: 'Impact', sans-serif;
  letter-spacing: 1.5px;
  font-size: 1.6rem;
  margin-bottom: 0.85rem;
  color: #fff;
}

.packs-store,
.packs-unopened-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.packs-craft {
  margin-top: 2.25rem;
}

.packs-craft-panel {
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.96), rgba(8, 8, 8, 0.96));
  border: 2px solid #444;
  border-radius: 14px;
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  max-width: 720px;
}

.packs-craft-blurb {
  color: #ccc;
  font-size: 0.98rem;
  line-height: 1.45;
  margin-bottom: 1rem;
}

.packs-craft-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #333;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.packs-craft-balance-label {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #bbb;
  font-size: 0.88rem;
}

.packs-craft-balance-value {
  font-weight: 900;
  font-size: 1.35rem;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.packs-craft-scrap-icon {
  font-size: 1.15rem;
}

.packs-craft-recipe {
  color: #ddd;
  font-weight: 700;
  margin-bottom: 0.95rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.packs-craft-need {
  margin-top: 0.65rem;
  color: #f1c40f;
  font-weight: 700;
  font-size: 0.92rem;
}

.packs-craft-msg {
  margin-top: 0.75rem;
  font-weight: 700;
}

.packs-craft-msg.is-success { color: #2ecc71; }
.packs-craft-msg.is-error { color: #e74c3c; }

.packs-craft-login {
  margin-top: 0.85rem;
}

.pack-card {
  position: relative;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.96), rgba(8, 8, 8, 0.96));
  border: 2px solid #333;
  border-radius: 14px;
  padding: 1.15rem 1.1rem 1.2rem;
  text-align: center;
  overflow: visible;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.pack-card.bronze { border-color: #b87333; box-shadow: 0 0 22px rgba(184, 115, 51, 0.18); }
.pack-card.silver { border-color: #c0c0c0; box-shadow: 0 0 22px rgba(192, 192, 192, 0.16); }
.pack-card.gold { border-color: #d4af37; box-shadow: 0 0 22px rgba(212, 175, 55, 0.2); }

.pack-crate {
  width: 176px;
  height: 292px;
  margin: 0.2rem auto 0.95rem;
  position: relative;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.55));
  transition: transform 0.22s ease, filter 0.22s ease;
}

.pack-crate.pack-crate-open {
  cursor: pointer;
}

.pack-crate img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.pack-crate-label { display: none; }

.pack-card:hover .pack-crate {
  transform: translateY(-8px) scale(1.05);
}

.pack-card.bronze:hover {
  border-color: #e0a060;
  box-shadow: 0 0 28px rgba(205, 127, 50, 0.35);
}
.pack-card.bronze:hover .pack-crate {
  filter:
    drop-shadow(0 0 10px rgba(232, 176, 98, 0.95))
    drop-shadow(0 0 22px rgba(205, 127, 50, 0.85))
    drop-shadow(0 0 40px rgba(139, 69, 19, 0.55));
}

.pack-card.silver:hover {
  border-color: #eee;
  box-shadow: 0 0 28px rgba(210, 215, 225, 0.32);
}
.pack-card.silver:hover .pack-crate {
  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.9))
    drop-shadow(0 0 22px rgba(192, 192, 192, 0.85))
    drop-shadow(0 0 40px rgba(160, 170, 185, 0.5));
}

.pack-card.gold:hover {
  border-color: #ffe37a;
  box-shadow: 0 0 28px rgba(255, 215, 80, 0.35);
}
.pack-card.gold:hover .pack-crate {
  filter:
    drop-shadow(0 0 10px rgba(255, 236, 150, 0.95))
    drop-shadow(0 0 22px rgba(255, 215, 0, 0.85))
    drop-shadow(0 0 40px rgba(184, 134, 11, 0.55));
}

.pack-card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pack-blurb {
  color: #ccc;
  font-size: 0.92rem;
  line-height: 1.35;
  min-height: 2.6em;
  margin: 0.15rem 0 0.95rem;
}

.pack-cost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  margin-bottom: 0.9rem;
}

.pack-free-ribbon {
  position: absolute;
  top: 12px;
  right: -28px;
  background: #2ecc71;
  color: #08150d;
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 1px;
  padding: 4px 34px;
  transform: rotate(35deg);
}

.pack-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 160px;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  color: #111;
}

.pack-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pack-btn-bronze { background: linear-gradient(180deg, #e0a060, #cd7f32); }
.pack-btn-silver { background: linear-gradient(180deg, #eee, #bdbdbd); }
.pack-btn-gold { background: linear-gradient(180deg, #ffe37a, #d4af37); }
.pack-btn-craft { background: linear-gradient(180deg, #f7c4d4, #e891a8); color: #4a1f2c; }
.pack-btn-free { background: linear-gradient(180deg, #7dffa8, #2ecc71); }
.pack-btn-collection {
  background: linear-gradient(180deg, #7dffa8, #2ecc71);
  color: #08150d;
}
.pack-btn-ghost {
  background: transparent;
  color: #ddd;
  border: 1px solid #666;
}

.pack-btn:not(:disabled):hover {
  filter: brightness(1.08);
}

.pack-btn-coin {
  width: 1.15rem;
  height: 1.15rem;
  vertical-align: -0.22rem;
}

.pack-unopened-count {
  color: #ddd;
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

@media (max-width: 900px) {
  .packs-store,
  .packs-unopened-grid {
    grid-template-columns: 1fr;
  }
}

/* CSGO-style case opening overlay */
.pack-opening {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: radial-gradient(ellipse at center, #1a1e24 0%, #0b0c0e 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.pack-opening[hidden] {
  display: none;
}

.pack-opening-stage {
  width: min(1100px, 100%);
  padding: 1rem;
}

.pack-opening-mascot {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: min(42vh, 360px);
  margin: 0 auto 0.35rem;
  pointer-events: none;
}

.pack-opening-mascot[hidden] {
  display: none;
}

.pack-opening-mascot img {
  width: min(520px, 78vw);
  height: auto;
  max-height: min(42vh, 360px);
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.65));
  image-rendering: auto;
}

.pack-opening-case {
  width: 200px;
  height: 334px;
  margin: 0 auto 1.4rem;
  position: relative;
  background: center / contain no-repeat;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.55));
  perspective: 720px;
  transform-style: preserve-3d;
  animation: packCaseIdle 1.6s ease-in-out infinite;
}

.pack-rip-body,
.pack-rip-flap {
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
}

.pack-rip-body {
  clip-path: polygon(
    9% 14.4%, 16% 17.6%, 24% 13.8%, 32% 17.9%, 41% 14.1%, 49% 18.2%,
    58% 14.0%, 66% 17.5%, 74% 13.6%, 82% 17.2%, 91% 14.2%,
    91% 100%, 9% 100%
  );
}

.pack-rip-flap {
  z-index: 2;
  transform-origin: 50% 0%;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.5));
  clip-path: polygon(
    9% 0%, 91% 0%,
    91% 14.2%, 82% 17.2%, 74% 13.6%, 66% 17.5%, 58% 14.0%,
    49% 18.2%, 41% 14.1%, 32% 17.9%, 24% 13.8%, 16% 17.6%, 9% 14.4%
  );
}

.pack-rip-cut {
  position: absolute;
  top: 14%;
  left: 8%;
  right: 8%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #fff 18%, #ffe7a8 50%, #fff 82%, transparent);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.85);
  opacity: 0;
  z-index: 3;
  pointer-events: none;
  transform: translateX(-55%) rotate(-8deg);
}

.pack-opening-case.ripping {
  animation: packCaseTearShake 0.18s linear 4;
}

.pack-opening-case.ripping .pack-rip-flap {
  animation: packFlapRip 0.92s cubic-bezier(0.18, 0.7, 0.22, 1) forwards;
}

.pack-opening-case.ripping .pack-rip-cut {
  animation: packCutSlash 0.38s ease-out forwards;
}

.pack-opening-case.burst {
  animation: packCaseBurst 0.55s ease-in forwards;
}

.pack-opening-case.is-gone {
  display: none;
}

.pack-opening-case.bronze { background-image: url('/img/packs/bronze.png?v=final1'); }
.pack-opening-case.silver { background-image: url('/img/packs/silver.png?v=final1'); }
.pack-opening-case.gold { background-image: url('/img/packs/gold.png?v=final1'); }

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

@keyframes packCaseTearShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px) rotate(-0.6deg); }
  75% { transform: translateX(3px) rotate(0.6deg); }
}

@keyframes packFlapRip {
  0% { transform: rotateX(0deg) rotateZ(0deg) translateY(0); opacity: 1; }
  28% { transform: rotateX(-32deg) rotateZ(-6deg) translateY(-6px); opacity: 1; }
  100% { transform: rotateX(-118deg) rotateZ(-22deg) translate(34px, -56px); opacity: 0; }
}

@keyframes packCutSlash {
  0% { transform: translateX(-55%) rotate(-8deg); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translateX(55%) rotate(-8deg); opacity: 0; }
}

@keyframes packCaseBurst {
  0% { transform: scale(1); opacity: 1; }
  70% { transform: scale(1.28); opacity: 0.4; }
  100% { transform: scale(1.55); opacity: 0; }
}

.csgo-reel-wrap {
  position: relative;
  height: 210px;
  margin: 0 auto;
  max-width: 980px;
  background: linear-gradient(180deg, #12151a, #0d0f12);
  border: 2px solid #2a3038;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.65), 0 10px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.csgo-reel-window {
  height: 100%;
  overflow: hidden;
}

.csgo-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  background: #ffcc33;
  box-shadow: 0 0 12px #ffcc33, 0 0 22px rgba(255, 204, 51, 0.5);
  z-index: 3;
  pointer-events: none;
}

.csgo-needle::before,
.csgo-needle::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

.csgo-needle::before {
  top: 0;
  border-top: 12px solid #ffcc33;
}

.csgo-needle::after {
  bottom: 0;
  border-bottom: 12px solid #ffcc33;
}

.csgo-reel {
  display: flex;
  align-items: stretch;
  height: 100%;
  will-change: transform;
}

.csgo-item {
  flex: 0 0 132px;
  width: 132px;
  margin: 12px 5px;
  background: #15181d;
  border: 1px solid #2c333c;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.csgo-item img {
  flex: 1;
  width: 100%;
  object-fit: contain;
  background: #0c0e11;
}

.csgo-item-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: #ddd;
  padding: 4px 6px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.csgo-item .csgo-rarity {
  height: 6px;
  width: 100%;
}

.csgo-item.tier-n .csgo-rarity { background: #b0c3d9; }
.csgo-item.tier-r .csgo-rarity { background: #4b69ff; }
.csgo-item.tier-sr .csgo-rarity { background: #d32ce6; }
.csgo-item.is-holo .csgo-rarity {
  background: linear-gradient(90deg, #e4ae39, #fff1a8, #e4ae39);
}
.csgo-item.is-holo {
  box-shadow: inset 0 0 18px rgba(120, 200, 255, 0.45);
}
.csgo-item.is-holo .holo-tag {
  top: 6px;
  right: 6px;
}

.csgo-item.winner-landed {
  outline: 2px solid #ffcc33;
  box-shadow: 0 0 18px rgba(255, 204, 51, 0.45);
}

.pack-opening-hint {
  text-align: center;
  margin-top: 1rem;
  color: #cfd6de;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pack-opening-hint.hint-bronze {
  color: #cd7f32;
  text-shadow: 0 0 14px rgba(205, 127, 50, 0.55);
}
.pack-opening-hint.hint-silver {
  color: #d5d8dc;
  text-shadow: 0 0 14px rgba(192, 192, 192, 0.45);
}
.pack-opening-hint.hint-gold {
  color: #ffd700;
  text-shadow: 0 0 16px rgba(255, 215, 0, 0.55);
}

.pack-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(
      ellipse 42% 55% at 50% 40%,
      rgba(10, 11, 14, 0.42) 0%,
      rgba(6, 7, 9, 0.7) 48%,
      rgba(0, 0, 0, 0.88) 78%,
      rgba(0, 0, 0, 0.94) 100%
    );
  padding: 1.5rem;
}

.pack-reveal[hidden] { display: none; }

.pack-reveal-card-wrap {
  position: relative;
  animation: packRevealPop 0.65s cubic-bezier(0.2, 1.55, 0.3, 1) both;
}

.pack-reveal-card-wrap img {
  max-width: min(360px, 78vw);
  max-height: 58vh;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7);
}

.pack-reveal-card-wrap.is-holo img {
  box-shadow: 0 0 28px rgba(120, 200, 255, 0.45), 0 18px 50px rgba(0, 0, 0, 0.7);
}

.pack-reveal-name {
  margin-top: 1rem;
  font-family: 'Impact', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  letter-spacing: 1px;
  color: #fff;
  text-align: center;
}

.pack-reveal-meta {
  margin-top: 0.25rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pack-reveal-meta.is-first-owned {
  letter-spacing: 0.14em;
  font-size: 1.08em;
}

.pack-btn-again,
.pack-btn-cost {
  text-transform: none;
  min-width: 240px;
  gap: 6px;
}

.pack-confirm {
  position: fixed;
  inset: 0;
  z-index: 11900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  padding: 1.25rem;
}

.pack-confirm[hidden] {
  display: none;
}

.pack-confirm-box {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(8, 8, 8, 0.98));
  border: 2px solid #333;
  border-radius: 16px;
  padding: 1.4rem 1.3rem 1.25rem;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.pack-confirm-box.bronze { border-color: #b87333; box-shadow: 0 0 28px rgba(184, 115, 51, 0.22); }
.pack-confirm-box.silver { border-color: #c0c0c0; box-shadow: 0 0 28px rgba(192, 192, 192, 0.18); }
.pack-confirm-box.gold { border-color: #d4af37; box-shadow: 0 0 28px rgba(212, 175, 55, 0.22); }

.pack-confirm-box .pack-crate {
  width: 132px;
  height: 220px;
  margin: 0 auto 1.1rem;
}

.pack-confirm-box h2 {
  font-family: 'Impact', sans-serif;
  letter-spacing: 1px;
  font-size: 1.7rem;
  margin-bottom: 0.35rem;
}

.pack-confirm-balances {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0 1.2rem;
  text-align: left;
}

.pack-confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #333;
  border-radius: 8px;
  font-weight: 700;
}

.pack-confirm-row span:first-child {
  color: #bbb;
}

.pack-confirm-after {
  border-color: rgba(46, 204, 113, 0.45);
}

.pack-confirm-coin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

.pack-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.pack-reveal-extras {
  margin-top: 0.75rem;
  color: #ddd;
  text-align: center;
  max-width: 520px;
}

.pack-reveal-set {
  color: #2ecc71;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(46, 204, 113, 0.5);
}

.pack-reveal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

@keyframes packRevealPop {
  0% { transform: scale(0.2) rotate(-8deg); opacity: 0; filter: blur(12px); }
  60% { transform: scale(1.08); opacity: 1; filter: blur(0); }
  100% { transform: scale(1); opacity: 1; }
}

.pack-opening.tier-n .pack-reveal-meta,
.exchange-opening.tier-n .pack-reveal-meta { color: #cd7f32; }
.pack-opening.tier-r .pack-reveal-meta,
.exchange-opening.tier-r .pack-reveal-meta {
  color: #c0c0c0;
  text-shadow: 0 0 6px rgba(192, 192, 192, 0.35);
}
.pack-opening.tier-sr .pack-reveal-meta,
.exchange-opening.tier-sr .pack-reveal-meta {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}
.pack-opening.tier-n .pack-reveal-meta.is-first-owned,
.exchange-opening.tier-n .pack-reveal-meta.is-first-owned {
  color: #e09a4a;
  text-shadow:
    0 0 6px rgba(255, 210, 140, 0.95),
    0 0 16px rgba(205, 127, 50, 0.9),
    0 0 30px rgba(184, 115, 51, 0.7),
    0 0 48px rgba(205, 127, 50, 0.4);
}
.pack-opening.tier-r .pack-reveal-meta.is-first-owned,
.exchange-opening.tier-r .pack-reveal-meta.is-first-owned {
  color: #f0f0f0;
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.95),
    0 0 16px rgba(192, 192, 192, 0.85),
    0 0 30px rgba(160, 170, 190, 0.65),
    0 0 48px rgba(192, 192, 192, 0.35);
}
.pack-opening.tier-sr .pack-reveal-meta.is-first-owned,
.exchange-opening.tier-sr .pack-reveal-meta.is-first-owned {
  color: #ffe566;
  text-shadow:
    0 0 6px rgba(255, 248, 180, 0.95),
    0 0 16px rgba(255, 215, 0, 0.9),
    0 0 30px rgba(255, 180, 0, 0.7),
    0 0 48px rgba(255, 215, 0, 0.4);
}
.pack-opening.is-holo .pack-reveal-meta,
.pack-reveal-meta.is-holo {
  background: linear-gradient(90deg, #7ad7ff, #ffffff, #c9a6ff, #7ad7ff);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: packHoloShimmer 2.4s linear infinite;
  text-shadow: none;
  filter: drop-shadow(0 0 8px rgba(120, 210, 255, 0.55));
}
.pack-opening.is-holo .pack-reveal-meta.is-first-owned,
.pack-reveal-meta.is-holo.is-first-owned {
  filter:
    drop-shadow(0 0 6px rgba(255, 255, 255, 0.9))
    drop-shadow(0 0 14px rgba(120, 210, 255, 0.95))
    drop-shadow(0 0 28px rgba(201, 166, 255, 0.7));
}

@keyframes packHoloShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

/* ========== THE EXCHANGE ========== */
.exchange-lead {
  max-width: 820px;
}

.exchange-offer {
  margin-bottom: 1.75rem;
}

.exchange-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 720px;
  margin: 0 auto 1rem;
}

.exchange-slot {
  position: relative;
  min-height: 210px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px dashed #555;
  border-radius: 12px;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  overflow: hidden;
  padding: 0 0 10px;
}

.exchange-slot.is-empty {
  color: #888;
}

.exchange-slot-plus {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  color: #666;
}

.exchange-slot-label {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.82rem;
  font-weight: 800;
}

.exchange-slot.is-filled {
  border-style: solid;
  border-color: #c0392b;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.55);
  font: inherit;
  text-align: center;
  justify-content: flex-start;
}

.exchange-slot.is-filled:hover {
  border-color: #e74c3c;
}

.exchange-slot.is-holo {
  border-color: #7ad7ff;
}

.exchange-slot .trade-pick-visual {
  width: 100%;
}

.exchange-slot-name,
.exchange-slot-meta {
  padding: 0 8px;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-slot-name {
  font-weight: 800;
  font-size: 0.88rem;
  color: #fff;
}

.exchange-slot-meta {
  font-size: 0.75rem;
  color: #bbb;
}

.exchange-slot-remove {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  z-index: 2;
}

.exchange-tier-banner {
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.6px;
  margin-bottom: 0.9rem;
  color: #ddd;
}

.exchange-tier-banner.is-n { color: #cd7f32; }
.exchange-tier-banner.is-r { color: #c0c0c0; }
.exchange-tier-banner.is-sr { color: #ffd700; }

.exchange-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.exchange-collection-pane {
  max-width: 1180px;
  margin: 0 auto;
}

.exchange-confirm {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.exchange-confirm.tier-n {
  background: radial-gradient(ellipse at center, rgba(184, 115, 51, 0.42) 0%, rgba(20, 12, 6, 0.88) 55%, rgba(0, 0, 0, 0.92) 100%);
}

.exchange-confirm.tier-r {
  background: radial-gradient(ellipse at center, rgba(192, 192, 192, 0.32) 0%, rgba(16, 18, 22, 0.88) 55%, rgba(0, 0, 0, 0.92) 100%);
}

.exchange-confirm.tier-sr {
  background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.38) 0%, rgba(22, 16, 4, 0.88) 55%, rgba(0, 0, 0, 0.92) 100%);
}

.exchange-confirm[hidden] {
  display: none;
}

.exchange-confirm-box {
  width: min(560px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(8, 8, 8, 0.98));
  border: 2px solid #444;
  border-radius: 14px;
  padding: 1.4rem 1.3rem 1.2rem;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.exchange-confirm-box.tier-n {
  border-color: #b87333;
  background: linear-gradient(180deg, rgba(74, 42, 16, 0.96) 0%, rgba(18, 10, 4, 0.98) 100%);
  box-shadow: 0 0 34px rgba(184, 115, 51, 0.35), 0 18px 50px rgba(0, 0, 0, 0.55);
}

.exchange-confirm-box.tier-n h2 {
  color: #cd7f32;
  text-shadow: 0 0 12px rgba(184, 115, 51, 0.55);
}

.exchange-confirm-box.tier-r {
  border-color: #c0c0c0;
  background: linear-gradient(180deg, rgba(58, 62, 70, 0.96) 0%, rgba(12, 13, 16, 0.98) 100%);
  box-shadow: 0 0 34px rgba(192, 192, 192, 0.28), 0 18px 50px rgba(0, 0, 0, 0.55);
}

.exchange-confirm-box.tier-r h2 {
  color: #e8e8e8;
  text-shadow: 0 0 12px rgba(192, 192, 192, 0.45);
}

.exchange-confirm-box.tier-sr {
  border-color: #d4af37;
  background: linear-gradient(180deg, rgba(74, 54, 10, 0.96) 0%, rgba(16, 12, 2, 0.98) 100%);
  box-shadow: 0 0 34px rgba(212, 175, 55, 0.38), 0 18px 50px rgba(0, 0, 0, 0.55);
}

.exchange-confirm-box.tier-sr h2 {
  color: #ffd700;
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.45);
}

.exchange-confirm-box h2 {
  font-family: 'Impact', sans-serif;
  letter-spacing: 1.5px;
  margin-bottom: 0.6rem;
}

.exchange-confirm-blurb {
  color: #ccc;
  margin-bottom: 1rem;
}

.exchange-confirm-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.exchange-confirm-card {
  background: #0d0d0d;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 700;
}

.exchange-confirm-card span:last-child {
  display: block;
  padding: 0.4rem 0.35rem 0.55rem;
}

.exchange-confirm-warn {
  color: #f1c40f;
  font-weight: 700;
  margin-bottom: 1rem;
}

.exchange-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.exchange-opening {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: radial-gradient(ellipse at center, #1a120f 0%, #070708 72%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

.exchange-opening[hidden] {
  display: none;
}

.exchange-orbit-stage {
  position: relative;
  width: min(920px, 100%);
  height: min(620px, 80vh);
  perspective: 900px;
}

.exchange-orbit-stage[hidden] {
  display: none;
}

.exchange-vortex {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 420px;
  height: 420px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 0, 0, 0.55) 0%, rgba(80, 0, 0, 0.28) 42%, transparent 70%);
  filter: blur(8px);
  animation: exchangeVortexSpin 6s linear infinite;
  z-index: 0;
  pointer-events: none;
}

.exchange-pentagram {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(420px, 72%);
  height: min(420px, 72%);
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 18px rgba(180, 0, 0, 0.7)) drop-shadow(0 8px 16px rgba(80, 0, 0, 0.55));
  animation: exchangePentagramPulse 2.4s ease-in-out infinite;
}

.exchange-pentagram svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: exchangePentagramSpin 18s linear infinite;
}

.exchange-pentagram-drip {
  animation: exchangeBloodDrip 1.8s ease-in-out infinite;
  transform-origin: 50% 0;
}

.exchange-orbit-cards {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  z-index: 2;
}

.exchange-orbit-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 148px;
  aspect-ratio: 500 / 720;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.18);
  will-change: transform;
}

.exchange-orbit-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.exchange-orbit-card.is-holo {
  border-color: #7ad7ff;
  box-shadow: 0 0 22px rgba(122, 215, 255, 0.45);
}

.exchange-opening-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #eee;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.exchange-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, #fff 0%, #ffe8a3 38%, rgba(255, 255, 255, 0) 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.exchange-flash.is-on {
  animation: exchangeFlash 0.62s ease-out forwards;
}

.exchange-opening .pack-reveal {
  z-index: 6;
}

@keyframes exchangeVortexSpin {
  from { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  to { transform: translate(-50%, -50%) rotate(360deg) scale(1.08); }
}

@keyframes exchangePentagramSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

@keyframes exchangePentagramPulse {
  0%, 100% { opacity: 0.88; filter: drop-shadow(0 0 18px rgba(180, 0, 0, 0.7)) drop-shadow(0 8px 16px rgba(80, 0, 0, 0.55)); }
  50% { opacity: 1; filter: drop-shadow(0 0 28px rgba(220, 0, 0, 0.95)) drop-shadow(0 8px 18px rgba(90, 0, 0, 0.7)); }
}

@keyframes exchangeBloodDrip {
  0%, 100% { transform: scaleY(1); opacity: 0.85; }
  50% { transform: scaleY(1.18); opacity: 1; }
}

@keyframes exchangeFlash {
  0% { opacity: 0; }
  28% { opacity: 1; }
  100% { opacity: 0; }
}

@media (max-width: 700px) {
  .exchange-slots,
  .exchange-confirm-cards {
    grid-template-columns: 1fr;
    max-width: 240px;
  }
  .exchange-orbit-card {
    width: 110px;
  }
}

/* ========== MY TASKS ========== */
body.page-myquests.tasks-secret-vault-ready,
body.page-mytasks.tasks-secret-vault-ready {
  position: relative;
}

body.page-myquests.tasks-secret-vault-ready::before,
body.page-mytasks.tasks-secret-vault-ready::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  background:
    radial-gradient(ellipse at 50% 55%, transparent 38%, rgba(244, 114, 182, 0.14) 62%, rgba(219, 39, 119, 0.38) 100%);
  box-shadow:
    inset 0 0 70px rgba(244, 114, 182, 0.35),
    inset 0 0 140px rgba(232, 121, 249, 0.22);
  animation: tasks-secret-glow-pulse 3.2s ease-in-out infinite;
}

body.page-myquests.tasks-secret-vault-ready main,
body.page-mytasks.tasks-secret-vault-ready main {
  animation: tasks-secret-page-shake 3.8s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes tasks-secret-glow-pulse {
  0%, 100% {
    opacity: 0.75;
    box-shadow:
      inset 0 0 60px rgba(244, 114, 182, 0.28),
      inset 0 0 120px rgba(232, 121, 249, 0.16);
  }
  50% {
    opacity: 1;
    box-shadow:
      inset 0 0 90px rgba(244, 114, 182, 0.48),
      inset 0 0 180px rgba(232, 121, 249, 0.32);
  }
}

@keyframes tasks-secret-page-shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  12% { transform: translate(-2px, 1px) rotate(-0.15deg); }
  24% { transform: translate(2px, -1px) rotate(0.15deg); }
  36% { transform: translate(-1px, -2px) rotate(-0.1deg); }
  48% { transform: translate(1px, 2px) rotate(0.1deg); }
  60% { transform: translate(-2px, 0) rotate(-0.12deg); }
  72% { transform: translate(2px, 1px) rotate(0.12deg); }
  84% { transform: translate(-1px, 1px) rotate(-0.08deg); }
}

@media (prefers-reduced-motion: reduce) {
  header {
    transition: none;
  }

  body.page-myquests.tasks-secret-vault-ready main,
  body.page-mytasks.tasks-secret-vault-ready main {
    animation: none;
  }

  body.page-myquests.tasks-secret-vault-ready::before,
  body.page-mytasks.tasks-secret-vault-ready::before {
    animation: none;
    opacity: 0.85;
  }
}

body.page-myquests main,
body.page-mytasks main,
main:has(.tasks-app) {
  overflow: visible !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(0, 0, 0, 0.82);
}

.tasks-app {
  max-width: 1180px;
  margin: 0 auto;
}

.tasks-status {
  text-align: center;
  color: #bbb;
  margin-bottom: 1.25rem;
}

.tasks-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.35rem;
  align-items: stretch;
}

.tasks-card {
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid #222;
  border-radius: 14px;
  padding: 28px 32px 24px;
  box-sizing: border-box;
  overflow: visible;
  min-width: 0;
}

.tasks-card-daily,
.tasks-card-meatroom-daily {
  border-color: rgba(34, 211, 238, 0.55);
}

.tasks-card-weekly,
.tasks-card-meatroom-weekly {
  border-color: rgba(241, 196, 15, 0.4);
}

.tasks-card-marathon {
  border-color: rgba(230, 126, 34, 0.55);
  grid-column: 1 / -1;
}

.tasks-card.is-complete {
  box-shadow: inset 0 0 0 1px rgba(46, 204, 113, 0.35);
}

.tasks-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px 24px;
  margin: 0 0 18px;
  padding: 0;
  background: none;
  border: 0;
  position: static;
  z-index: auto;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

.tasks-card-copy {
  flex: 1 1 260px;
}

.tasks-card-head h2 {
  font-family: 'Roboto', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #fff;
  text-transform: uppercase;
  margin: 0;
  padding: 2px 0.12em 2px 0;
  overflow: visible;
}

.tasks-card-daily .tasks-card-head h2,
.tasks-card-meatroom-daily .tasks-card-head h2 { color: #22d3ee; }
.tasks-card-weekly .tasks-card-head h2,
.tasks-card-meatroom-weekly .tasks-card-head h2 { color: #f1c40f; }
.tasks-card-marathon .tasks-card-head h2 { color: #e67e22; }

.tasks-card-sub {
  color: #aaa;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 8px 0 0;
  padding-right: 0.25em;
  overflow: visible;
}

.tasks-progress-block {
  margin-bottom: 0.95rem;
}

.tasks-progress-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem 1rem;
  color: #ccc;
  font-size: 0.92rem;
}

.tasks-progress-count {
  flex: 1 1 auto;
  min-width: 0;
}

.tasks-reward-hint {
  margin: 0.45rem 0 0;
  color: #ddd;
  font-size: 0.92rem;
  line-height: 1.45;
}

.tasks-reward-granted {
  margin: 0.45rem 0 0;
  color: #2ecc71;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.45;
}

.tasks-claim-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  margin: 0.55rem 0 0;
  padding: 0.7rem 0.95rem;
  width: 100%;
  max-width: 22rem;
  border: 1px solid rgba(241, 196, 15, 0.55);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(241, 196, 15, 0.18), rgba(241, 196, 15, 0.06));
  color: #ffe27a;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.tasks-claim-cta.is-daily {
  border-color: rgba(46, 204, 113, 0.55);
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.2), rgba(46, 204, 113, 0.06));
  color: #9dffc0;
}

.tasks-claim-cta.is-weekly {
  border-color: rgba(241, 196, 15, 0.55);
  background: linear-gradient(180deg, rgba(241, 196, 15, 0.18), rgba(241, 196, 15, 0.06));
  color: #ffe27a;
}

.tasks-claim-cta:hover,
.tasks-claim-cta:focus-visible {
  border-color: rgba(241, 196, 15, 0.95);
  background: linear-gradient(180deg, rgba(241, 196, 15, 0.28), rgba(241, 196, 15, 0.1));
  outline: none;
  transform: translateY(-1px);
}

.tasks-claim-cta.is-daily:hover,
.tasks-claim-cta.is-daily:focus-visible {
  border-color: rgba(46, 204, 113, 0.95);
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.3), rgba(46, 204, 113, 0.1));
}

.tasks-claim-cta.is-weekly:hover,
.tasks-claim-cta.is-weekly:focus-visible {
  border-color: rgba(241, 196, 15, 0.95);
  background: linear-gradient(180deg, rgba(241, 196, 15, 0.28), rgba(241, 196, 15, 0.1));
}

.tasks-claim-cta:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.tasks-claim-cta-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff3bf;
}

.tasks-claim-cta.is-daily .tasks-claim-cta-title {
  color: #d8ffe8;
}

.tasks-claim-cta.is-weekly .tasks-claim-cta-title {
  color: #fff3bf;
}

.tasks-claim-cta-action {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f1c40f;
}

.tasks-claim-cta.is-daily .tasks-claim-cta-action {
  color: #2ecc71;
}

.tasks-claim-cta.is-weekly .tasks-claim-cta-action {
  color: #f1c40f;
}

.tasks-card.is-claimable {
  box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.28);
}

.tasks-card-daily.is-claimable,
.tasks-card-meatroom-daily.is-claimable,
.tasks-card-weekly.is-claimable,
.tasks-card-meatroom-weekly.is-claimable {
  box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.28);
}

.tasks-secret-reward-xp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  background: rgba(46, 204, 113, 0.18);
  border: 1px solid rgba(46, 204, 113, 0.55);
  color: #7dffa8;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.tasks-reward-hint em {
  font-style: italic;
}

.tasks-timer {
  flex: 0 0 auto;
  box-sizing: content-box;
  width: max-content;
  max-width: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 22px;
  text-align: center;
  overflow: visible;
}

.tasks-timer.is-urgent {
  background: rgba(231, 76, 60, 0.18);
  border-color: rgba(231, 76, 60, 0.7);
}

.tasks-timer.is-urgent .tasks-timer-label {
  color: #f5b7b1;
}

.tasks-timer.is-urgent .tasks-timer-value {
  color: #ff6b6b;
}

.tasks-timer-label,
.tasks-timer-value {
  display: block;
  overflow: visible;
  white-space: nowrap;
  padding: 0 2px;
}

.tasks-timer-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #999;
  line-height: 1.5;
}

.tasks-timer-value {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  margin-top: 6px;
}

.tasks-complete-pill,
.tasks-todo-pill {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
  white-space: nowrap;
}

.tasks-complete-pill {
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.15);
}

.tasks-todo-pill {
  color: #f0c27a;
  background: rgba(230, 126, 34, 0.16);
}

.tasks-card-daily .tasks-todo-pill,
.tasks-card-meatroom-daily .tasks-todo-pill {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.16);
}

.tasks-card-weekly .tasks-todo-pill,
.tasks-card-meatroom-weekly .tasks-todo-pill {
  color: #f1c40f;
  background: rgba(241, 196, 15, 0.16);
}

.tasks-live-banner {
  margin: 0 0 0.9rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  background: rgba(230, 126, 34, 0.16);
  color: #f5b041;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.task-list {
  list-style: none;
  display: grid;
  gap: 0.65rem;
  overflow: visible;
}

.tasks-card-marathon .task-list {
  grid-template-columns: 1fr 1fr;
}

.task-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.35rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: visible;
  box-sizing: border-box;
}

.task-row.is-done {
  opacity: 0.72;
  background: rgba(46, 204, 113, 0.08);
  border-color: rgba(46, 204, 113, 0.22);
}

.task-check {
  flex-shrink: 0;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  border: 2px solid #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
  margin-top: 0.12rem;
  color: #111;
}

.task-row.is-todo .task-check {
  background: transparent;
}

.task-row.is-done .task-check {
  background: #2ecc71;
  border-color: #2ecc71;
  color: #0b1a10;
}

.task-row-body {
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.task-row-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1.25rem;
  align-items: start;
}

.task-row-label {
  font-weight: 700;
  color: #f2f2f2;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.task-row-count {
  color: #bbb;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.92rem;
  line-height: 1.4;
  justify-self: end;
}

.task-bar {
  margin-top: 0.45rem;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.task-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #22d3ee;
}

.tasks-card-weekly .task-bar-fill,
.tasks-card-meatroom-weekly .task-bar-fill { background: #f1c40f; }
.tasks-card-marathon .task-bar-fill { background: #e67e22; }
.task-row.is-done .task-bar-fill { background: #2ecc71; }

.task-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin-top: 0.4rem;
  color: #999;
  font-size: 0.8rem;
  line-height: 1.4;
}

.task-row-reward {
  color: #f0c27a;
}

.tasks-secret-week {
  grid-column: 1 / -1;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 9.5rem;
  padding: 2rem 1.9rem;
  box-sizing: border-box;
  border: 2px solid rgba(255, 214, 236, 0.95);
  border-radius: 20px;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.55), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(255, 255, 255, 0.22), transparent 40%),
    linear-gradient(125deg, #ffb6d9 0%, #ff6eb4 28%, #f472b6 55%, #e879f9 78%, #db2777 100%);
  background-size: 100% 100%, 100% 100%, 220% 220%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -14px 28px rgba(157, 23, 77, 0.3),
    0 0 0 1px rgba(255, 192, 223, 0.35),
    0 0 28px rgba(244, 114, 182, 0.55),
    0 0 56px rgba(232, 121, 249, 0.28),
    0 14px 34px rgba(190, 24, 93, 0.4);
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 8px rgba(136, 19, 55, 0.55);
  animation:
    tasks-secret-pulse 2.4s ease-in-out infinite,
    tasks-secret-shift 8s ease-in-out infinite;
}

.tasks-secret-sheen {
  position: absolute;
  inset: -20% -40%;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.08) 42%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.1) 58%,
    transparent 70%
  );
  transform: translateX(-35%) rotate(8deg);
  animation: tasks-secret-sheen 3.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

.tasks-secret-sparkle {
  position: absolute;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.85);
  pointer-events: none;
  z-index: 2;
  animation: tasks-secret-twinkle 1.8s ease-in-out infinite;
}

.tasks-secret-sparkle.s1 { top: 18%; left: 10%; animation-delay: 0s; }
.tasks-secret-sparkle.s2 { top: 28%; right: 12%; width: 0.4rem; height: 0.4rem; animation-delay: 0.35s; }
.tasks-secret-sparkle.s3 { bottom: 22%; left: 16%; width: 0.35rem; height: 0.35rem; animation-delay: 0.7s; }
.tasks-secret-sparkle.s4 { bottom: 18%; right: 18%; animation-delay: 1.05s; }
.tasks-secret-sparkle.s5 { top: 12%; left: 48%; width: 0.3rem; height: 0.3rem; animation-delay: 1.3s; }
.tasks-secret-sparkle.s6 { bottom: 12%; left: 54%; width: 0.45rem; height: 0.45rem; animation-delay: 0.5s; }

.tasks-secret-week > :not(.tasks-secret-sheen):not(.tasks-secret-sparkle) {
  position: relative;
  z-index: 3;
}

button.tasks-secret-week {
  cursor: pointer;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

button.tasks-secret-week:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  filter: brightness(1.08) saturate(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -14px 28px rgba(157, 23, 77, 0.28),
    0 0 0 1px rgba(255, 214, 236, 0.55),
    0 0 36px rgba(244, 114, 182, 0.7),
    0 0 72px rgba(232, 121, 249, 0.4),
    0 18px 40px rgba(190, 24, 93, 0.48);
}

button.tasks-secret-week:disabled {
  cursor: wait;
  opacity: 0.85;
}

.tasks-secret-week-eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff7fb;
  opacity: 0.95;
  animation: tasks-secret-eyebrow 2.8s ease-in-out infinite;
}

.tasks-secret-week-title {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  font-size: clamp(1.12rem, 2.6vw, 1.6rem);
  font-weight: 900;
  letter-spacing: 0.07em;
  line-height: 1.35;
  text-transform: uppercase;
}

.tasks-secret-week-cta {
  margin-top: 0.15rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.2);
  animation: tasks-secret-cta 1.6s ease-in-out infinite;
}

.tasks-secret-week-status {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffe4f1;
}

.tasks-secret-week-rewards {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff7fb;
  opacity: 0.95;
}

.tasks-secret-week.is-claimed {
  cursor: default;
  animation: none;
  filter: saturate(0.95) brightness(0.96);
}

.tasks-secret-week.is-claimed .tasks-secret-sheen,
.tasks-secret-week.is-claimed .tasks-secret-sparkle {
  animation: none;
  opacity: 0.35;
}

@keyframes tasks-secret-pulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.7),
      inset 0 -14px 28px rgba(157, 23, 77, 0.3),
      0 0 0 1px rgba(255, 192, 223, 0.35),
      0 0 24px rgba(244, 114, 182, 0.45),
      0 0 48px rgba(232, 121, 249, 0.22),
      0 14px 34px rgba(190, 24, 93, 0.4);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.8),
      inset 0 -14px 28px rgba(157, 23, 77, 0.28),
      0 0 0 1px rgba(255, 214, 236, 0.55),
      0 0 40px rgba(244, 114, 182, 0.75),
      0 0 80px rgba(232, 121, 249, 0.4),
      0 16px 38px rgba(190, 24, 93, 0.48);
  }
}

@keyframes tasks-secret-shift {
  0%, 100% { background-position: 0% 50%, 0% 50%, 0% 50%; }
  50% { background-position: 0% 50%, 0% 50%, 100% 50%; }
}

@keyframes tasks-secret-sheen {
  0%, 18% { transform: translateX(-45%) rotate(8deg); opacity: 0; }
  35% { opacity: 1; }
  55% { transform: translateX(35%) rotate(8deg); opacity: 0.85; }
  70%, 100% { transform: translateX(55%) rotate(8deg); opacity: 0; }
}

@keyframes tasks-secret-twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.25); }
}

@keyframes tasks-secret-eyebrow {
  0%, 100% { opacity: 0.8; letter-spacing: 0.2em; }
  50% { opacity: 1; letter-spacing: 0.26em; }
}

@keyframes tasks-secret-cta {
  0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(255, 255, 255, 0.18); }
  50% { transform: scale(1.04); box-shadow: 0 0 22px rgba(255, 255, 255, 0.35); }
}

body.tasks-vault-open,
body.tasks-secret-modal-open {
  overflow: hidden;
}

/* Vault opening cinematic */
.tasks-vault-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(244, 114, 182, 0.28), transparent 55%),
    rgba(8, 4, 10, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.35s ease;
}

.tasks-vault-overlay.is-active {
  display: flex;
  pointer-events: auto;
  opacity: 1;
}

.tasks-vault-overlay.is-active.is-done {
  opacity: 0;
  pointer-events: none;
}

.tasks-vault-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  transform: scale(0.92);
  animation: tasks-vault-scene-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.tasks-vault-overlay.is-opening .tasks-vault-scene {
  animation: tasks-vault-scene-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    tasks-vault-shake 0.55s ease-in-out 0.45s;
}

.tasks-vault-body {
  position: relative;
  width: min(17rem, 72vw);
  height: min(14rem, 52vw);
  border-radius: 18px;
  background:
    linear-gradient(180deg, #ffd4ea 0%, #ff8fc9 18%, #f472b6 52%, #be185d 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    inset 0 -12px 24px rgba(136, 19, 55, 0.45),
    0 0 40px rgba(244, 114, 182, 0.55),
    0 18px 40px rgba(0, 0, 0, 0.45);
  transform-style: preserve-3d;
  perspective: 900px;
}

.tasks-vault-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 28%),
    linear-gradient(180deg, #ffc2e2 0%, #ff6eb4 45%, #db2777 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.18);
  transform-origin: center;
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}

.tasks-vault-door-left {
  left: 0;
  border-radius: 18px 0 0 18px;
  transform-origin: left center;
}

.tasks-vault-door-right {
  right: 0;
  border-radius: 0 18px 18px 0;
  transform-origin: right center;
}

.tasks-vault-overlay.is-opening .tasks-vault-door-left {
  animation: tasks-vault-door-left 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.95s forwards;
}

.tasks-vault-overlay.is-opening .tasks-vault-door-right {
  animation: tasks-vault-door-right 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.95s forwards;
}

.tasks-vault-seam {
  position: absolute;
  top: 8%;
  bottom: 8%;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  z-index: 3;
  opacity: 1;
  transition: opacity 0.25s ease 1.1s;
}

.tasks-vault-overlay.is-opening .tasks-vault-seam {
  opacity: 0;
}

.tasks-vault-wheel-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
}

.tasks-vault-meat {
  display: block;
  font-size: clamp(2.75rem, 10vw, 3.5rem);
  line-height: 1;
  filter:
    drop-shadow(0 0 10px rgba(255, 182, 213, 0.95))
    drop-shadow(0 0 22px rgba(244, 114, 182, 0.85))
    drop-shadow(0 0 34px rgba(219, 39, 119, 0.55))
    saturate(1.45)
    brightness(1.08);
  text-shadow: 0 0 16px rgba(255, 192, 223, 0.9);
}

.tasks-vault-overlay.is-opening .tasks-vault-meat {
  animation: tasks-vault-meat-spin 0.9s ease-in-out 0.35s forwards;
}

.tasks-vault-burst {
  position: absolute;
  width: min(22rem, 90vw);
  height: min(22rem, 90vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(244, 114, 182, 0.55) 28%, transparent 68%);
  opacity: 0;
  transform: scale(0.2);
  z-index: 0;
  pointer-events: none;
}

.tasks-vault-overlay.is-opening .tasks-vault-burst {
  animation: tasks-vault-burst 0.75s ease-out 1.55s forwards;
}

.tasks-vault-hint {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffd4ea;
  text-shadow: 0 0 16px rgba(244, 114, 182, 0.65);
  opacity: 0.9;
}

/* Secret rewards popup */
.tasks-secret-modal {
  position: fixed;
  inset: 0;
  z-index: 12100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
  pointer-events: none;
  opacity: 0;
}

.tasks-secret-modal.is-active {
  display: flex;
  pointer-events: auto;
  opacity: 1;
}

.tasks-secret-modal.is-visible {
  opacity: 1;
}

.tasks-secret-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 10, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.tasks-secret-modal-box {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(26rem, 100%);
  padding: 2rem 1.75rem 1.6rem;
  border: 2px solid rgba(255, 214, 236, 0.95);
  border-radius: 20px;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.55), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(255, 255, 255, 0.22), transparent 40%),
    linear-gradient(125deg, #ffb6d9 0%, #ff6eb4 28%, #f472b6 55%, #e879f9 78%, #db2777 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 0 36px rgba(244, 114, 182, 0.65),
    0 18px 40px rgba(0, 0, 0, 0.45);
  color: #fff;
  text-align: center;
  transform: scale(0.88) translateY(12px);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.tasks-secret-modal.is-visible .tasks-secret-modal-box {
  transform: scale(1) translateY(0);
}

.tasks-secret-modal-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff7fb;
}

.tasks-secret-modal-title {
  margin: 0 0 1.1rem;
  font-family: 'Roboto', sans-serif;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(136, 19, 55, 0.55);
}

.tasks-secret-modal-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tasks-secret-reward-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tasks-secret-reward-emoji {
  font-size: 1.25rem;
  line-height: 1;
  flex: 0 0 auto;
}

.tasks-secret-reward-coin {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.tasks-secret-reward-pack {
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}

.tasks-secret-modal-btn {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  padding: 0.55rem 1.35rem;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.22);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.tasks-secret-modal-btn:hover {
  transform: scale(1.03);
  filter: brightness(1.06);
}

/* Quest claim rewards popup (not vault pink) */
.tasks-quest-modal {
  position: fixed;
  inset: 0;
  z-index: 12100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
  pointer-events: none;
  opacity: 0;
}

.tasks-quest-modal.is-active {
  display: flex;
  pointer-events: auto;
  opacity: 1;
}

.tasks-quest-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 14, 0.76);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.tasks-quest-modal-box {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(26rem, 100%);
  padding: 2rem 1.75rem 1.6rem;
  border: 2px solid rgba(34, 211, 238, 0.85);
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(160deg, #083344 0%, #0e7490 42%, #155e75 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 28px rgba(34, 211, 238, 0.35),
    0 18px 40px rgba(0, 0, 0, 0.45);
  color: #fff;
  text-align: center;
  transform: scale(0.88) translateY(12px);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.tasks-quest-modal.is-theme-weekly .tasks-quest-modal-box {
  border-color: rgba(241, 196, 15, 0.9);
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(160deg, #3f2e05 0%, #b45309 42%, #ca8a04 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 28px rgba(241, 196, 15, 0.35),
    0 18px 40px rgba(0, 0, 0, 0.45);
}

.tasks-quest-modal.is-active .tasks-quest-modal-box {
  transform: scale(1) translateY(0);
}

.tasks-quest-modal-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #cffafe;
}

.tasks-quest-modal.is-theme-weekly .tasks-quest-modal-eyebrow {
  color: #fef3c7;
}

.tasks-quest-modal-title {
  margin: 0 0 1.1rem;
  font-family: 'Roboto', sans-serif;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(8, 47, 73, 0.55);
}

.tasks-quest-modal.is-theme-weekly .tasks-quest-modal-title {
  text-shadow: 0 2px 8px rgba(69, 26, 3, 0.55);
}

.tasks-quest-modal-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tasks-quest-modal .tasks-secret-reward-item {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.tasks-quest-modal-btn {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: 0.55rem 1.35rem;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.22);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.tasks-quest-modal.is-theme-weekly .tasks-quest-modal-btn {
  box-shadow: 0 0 18px rgba(241, 196, 15, 0.22);
}

.tasks-quest-modal-btn:hover {
  transform: scale(1.03);
  filter: brightness(1.06);
}

body.tasks-quest-modal-open {
  overflow: hidden;
}

@keyframes tasks-vault-scene-in {
  from { transform: scale(0.82); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes tasks-vault-shake {
  0%, 100% { transform: scale(1) translateX(0); }
  15% { transform: scale(1) translateX(-4px) rotate(-0.6deg); }
  30% { transform: scale(1) translateX(4px) rotate(0.6deg); }
  45% { transform: scale(1) translateX(-3px); }
  60% { transform: scale(1) translateX(3px); }
  75% { transform: scale(1) translateX(-2px); }
}

@keyframes tasks-vault-meat-spin {
  0% { transform: rotate(0deg) scale(0.92); }
  100% { transform: rotate(540deg) scale(1.08); }
}

@keyframes tasks-vault-door-left {
  to { transform: perspective(900px) rotateY(-108deg); opacity: 0.35; }
}

@keyframes tasks-vault-door-right {
  to { transform: perspective(900px) rotateY(108deg); opacity: 0.35; }
}

@keyframes tasks-vault-burst {
  0% { opacity: 0; transform: scale(0.2); }
  35% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.35); }
}

@media (max-width: 900px) {
  .tasks-board {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem;
  }

  .tasks-card-marathon,
  .tasks-secret-week {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .tasks-card {
    padding: 14px 12px 12px;
  }

  .tasks-card-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
  }

  .tasks-card-copy {
    flex: 1 1 auto;
  }

  .tasks-card-head h2 {
    font-size: 0.92rem;
    line-height: 1.25;
  }

  .tasks-card-sub {
    font-size: 0.72rem;
    margin-top: 4px;
  }

  .tasks-timer {
    align-self: flex-start;
  }

  .tasks-card-marathon .task-list {
    grid-template-columns: 1fr;
  }

  .task-row {
    padding: 0.65rem 0.7rem;
    gap: 0.5rem;
  }

  .task-row-top {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .task-row-count {
    justify-self: start;
  }
}

/* ========== FORUM ========== */
.forum-app {
  max-width: none;
  width: 100%;
  margin: 0 auto 2.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.forum-feed-wrap {
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid #3a3a3a;
  border-radius: 14px;
  height: min(68vh, 760px);
  overflow-y: auto;
  padding: 0.9rem 1rem 1.1rem;
}

.forum-feed {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.forum-empty {
  color: #aaa;
  text-align: center;
  padding: 2.5rem 1rem;
}

.forum-post {
  background: rgba(18, 18, 18, 0.92);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 0.85rem 1rem 1rem;
}

.forum-post-event {
  border-left-width: 3px;
  border-left-style: solid;
}

.forum-tone-event {
  background: linear-gradient(180deg, rgba(80, 42, 18, 0.28), rgba(18, 18, 18, 0.94));
  border-color: #5a3a1c;
  border-left-color: #e67e22;
}
.forum-tone-event .forum-kind { color: #e67e22; }

.forum-tone-n {
  background: linear-gradient(180deg, rgba(205, 127, 50, 0.32), rgba(18, 18, 18, 0.94));
  border-color: rgba(205, 127, 50, 0.45);
  border-left-color: #cd7f32;
}
.forum-tone-n .forum-kind { color: #cd7f32; }

.forum-tone-r {
  background: linear-gradient(180deg, rgba(192, 192, 192, 0.28), rgba(18, 18, 18, 0.94));
  border-color: rgba(192, 192, 192, 0.4);
  border-left-color: #c0c0c0;
}
.forum-tone-r .forum-kind { color: #c0c0c0; }

.forum-tone-sr {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.28), rgba(18, 18, 18, 0.94));
  border-color: rgba(255, 215, 0, 0.42);
  border-left-color: #ffd700;
}
.forum-tone-sr .forum-kind { color: #ffd700; }

.forum-tone-src {
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.28), rgba(18, 18, 18, 0.94));
  border-color: rgba(46, 204, 113, 0.42);
  border-left-color: #2ecc71;
}
.forum-tone-src .forum-kind { color: #2ecc71; }

.forum-tone-srr {
  background: linear-gradient(180deg, rgba(231, 76, 60, 0.3), rgba(18, 18, 18, 0.94));
  border-color: rgba(231, 76, 60, 0.45);
  border-left-color: #e74c3c;
}
.forum-tone-srr .forum-kind { color: #e74c3c; }

.forum-tone-holo {
  background:
    linear-gradient(
      145deg,
      rgba(140, 210, 255, 0.28) 0%,
      rgba(180, 120, 255, 0.2) 42%,
      rgba(18, 18, 18, 0.94) 100%
    );
  border-color: rgba(160, 210, 255, 0.45);
  border-left-color: #8fd3ff;
}
.forum-tone-holo .forum-kind {
  color: #e8f4ff;
  text-shadow: 0 0 10px rgba(120, 210, 255, 0.55);
}

.forum-tone-daily {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.28), rgba(18, 18, 18, 0.94));
  border-color: rgba(34, 211, 238, 0.42);
  border-left-color: #22d3ee;
}
.forum-tone-daily .forum-kind { color: #22d3ee; }

.forum-tone-weekly {
  background: linear-gradient(180deg, rgba(241, 196, 15, 0.28), rgba(18, 18, 18, 0.94));
  border-color: rgba(241, 196, 15, 0.42);
  border-left-color: #f1c40f;
}
.forum-tone-weekly .forum-kind { color: #f1c40f; }

.forum-tone-rank {
  background: linear-gradient(180deg, rgba(230, 126, 34, 0.3), rgba(18, 18, 18, 0.94));
  border-color: rgba(230, 126, 34, 0.45);
  border-left-color: #e67e22;
}
.forum-tone-rank .forum-kind { color: #e67e22; }

.forum-tone-streak {
  background: linear-gradient(180deg, rgba(231, 76, 60, 0.3), rgba(18, 18, 18, 0.94));
  border-color: rgba(231, 76, 60, 0.45);
  border-left-color: #e74c3c;
}
.forum-tone-streak .forum-kind { color: #e74c3c; }

.forum-tone-trade {
  background: linear-gradient(180deg, rgba(52, 152, 219, 0.28), rgba(18, 18, 18, 0.94));
  border-color: rgba(52, 152, 219, 0.42);
  border-left-color: #3498db;
}
.forum-tone-trade .forum-kind { color: #3498db; }

.forum-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  color: #888;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.forum-kind {
  font-weight: 700;
  color: #f0c27a;
}

.forum-post-main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.forum-post-who {
  flex: 0 0 auto;
}

.forum-post-content {
  flex: 1 1 220px;
  min-width: 0;
}

.forum-chat-body,
.forum-event-line {
  margin: 0.15rem 0 0.45rem;
  color: #eee;
  font-size: 1.02rem;
  word-break: break-word;
}

.forum-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.forum-card-wrap {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  display: block;
  width: 86px;
  cursor: pointer;
}

button.forum-card-wrap:hover .forum-card-img,
button.forum-card-wrap:focus-visible .forum-card-img {
  border-color: #f1c40f;
  box-shadow: 0 0 12px rgba(241, 196, 15, 0.45);
}

.forum-card-img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #555;
  display: block;
}

.forum-card-wrap.is-holo .forum-card-img {
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.45);
  border-color: #f1c40f;
}

.forum-empty-cards {
  color: #888;
  font-size: 0.85rem;
}

.forum-trade {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: start;
}

.forum-trade-side {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.forum-trade-swap {
  align-self: center;
  font-size: 1.4rem;
  color: #f1c40f;
  padding-top: 1.4rem;
}

.forum-composer {
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid #3a3a3a;
  border-radius: 14px;
  padding: 0.9rem 1rem 1rem;
}

.forum-composer-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #ddd;
}

.forum-composer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
  align-items: stretch;
}

.forum-composer textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid #555;
  background: #111;
  color: #eee;
  padding: 0.7rem 0.8rem;
  font: inherit;
}

.forum-send-btn {
  min-width: 96px;
  border: none;
  border-radius: 10px;
  background: #c0392b;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0 1.1rem;
}

.forum-send-btn:hover,
.forum-send-btn:focus-visible {
  background: #e74c3c;
}

.forum-send-btn:disabled {
  opacity: 0.55;
}

.forum-composer-error {
  margin: 0.55rem 0 0;
  color: #ff8a80;
  font-size: 0.88rem;
}

.forum-login-gate {
  margin-top: 0;
}

@media (max-width: 760px) {
  .forum-trade {
    grid-template-columns: 1fr;
  }

  .forum-trade-swap {
    padding-top: 0;
    text-align: center;
  }

  .forum-composer-row {
    grid-template-columns: 1fr;
  }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #c0392b; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #e74c3c; }

/* ========== DAILY LOGIN BONUS ========== */
body.daily-login-open {
  overflow: hidden;
}

#daily-login-root {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  perspective: 1200px;
}

#daily-login-root[hidden] {
  display: none !important;
}

.daily-login-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(80, 20, 40, 0.35), transparent 55%),
    rgba(0, 0, 0, 0.78);
}

.daily-login-disco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.daily-login-disco span {
  position: absolute;
  width: 30vmin;
  height: 30vmin;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: daily-disco-pulse 1.05s ease-in-out infinite alternate;
}

.daily-login-disco span:nth-child(1) { top: -8%; left: 8%; background: #ff0040; animation-delay: 0s; }
.daily-login-disco span:nth-child(2) { top: -6%; right: 10%; background: #00e5ff; animation-delay: 0.15s; }
.daily-login-disco span:nth-child(3) { bottom: -10%; left: 12%; background: #ffe600; animation-delay: 0.3s; }
.daily-login-disco span:nth-child(4) { bottom: -8%; right: 8%; background: #7cff00; animation-delay: 0.45s; }
.daily-login-disco span:nth-child(5) { top: 28%; left: -10%; background: #ff00e6; animation-delay: 0.2s; }
.daily-login-disco span:nth-child(6) { top: 32%; right: -12%; background: #ff7a00; animation-delay: 0.35s; }
.daily-login-disco span:nth-child(7) { top: 55%; left: 20%; width: 18vmin; height: 18vmin; background: #4d7cff; animation-delay: 0.5s; }
.daily-login-disco span:nth-child(8) { top: 60%; right: 18%; width: 18vmin; height: 18vmin; background: #ff3d81; animation-delay: 0.65s; }

@keyframes daily-disco-pulse {
  from { transform: scale(0.85) translate(0, 0); opacity: 0.35; }
  to { transform: scale(1.25) translate(2%, -3%); opacity: 0.8; }
}

.daily-login-strobes {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.daily-login-strobes i {
  position: absolute;
  width: 18%;
  height: 140%;
  top: -20%;
  opacity: 0;
  mix-blend-mode: screen;
  filter: blur(2px);
  transform: skewX(-18deg);
  animation: daily-strobe 0.55s steps(2, end) infinite;
}

.daily-login-strobes i:nth-child(1) { left: 4%; background: linear-gradient(180deg, transparent, #fff, #ff0, transparent); animation-delay: 0s; }
.daily-login-strobes i:nth-child(2) { left: 22%; background: linear-gradient(180deg, transparent, #0ff, #fff, transparent); animation-delay: 0.08s; }
.daily-login-strobes i:nth-child(3) { left: 40%; background: linear-gradient(180deg, transparent, #f0f, #fff, transparent); animation-delay: 0.16s; }
.daily-login-strobes i:nth-child(4) { left: 58%; background: linear-gradient(180deg, transparent, #0f0, #fff, transparent); animation-delay: 0.24s; }
.daily-login-strobes i:nth-child(5) { left: 74%; background: linear-gradient(180deg, transparent, #ff0, #f00, transparent); animation-delay: 0.32s; }
.daily-login-strobes i:nth-child(6) { left: 88%; background: linear-gradient(180deg, transparent, #0ff, #00f, transparent); animation-delay: 0.4s; }

#daily-login-root.is-spinning .daily-login-strobes i {
  animation-duration: 0.28s;
}

#daily-login-root.is-winner .daily-login-strobes i {
  animation-duration: 0.18s;
}

@keyframes daily-strobe {
  0%, 49% { opacity: 0; }
  50%, 100% { opacity: 0.55; }
}

.daily-login-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  padding: 1.75rem 1.5rem 1.7rem;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 220, 80, 0.22), transparent 45%),
    linear-gradient(165deg, #3a1420 0%, #1a0c14 42%, #2a1030 100%);
  border: 4px solid #ffd24a;
  box-shadow:
    0 0 0 6px #7a1028,
    0 0 0 10px #ffd24a,
    0 28px 0 #4a0c18,
    0 38px 50px rgba(0, 0, 0, 0.55),
    inset 0 2px 0 rgba(255, 255, 255, 0.2);
  text-align: center;
  color: #fff8e7;
  transform: rotateX(6deg) translateY(-4px);
  animation: daily-panel-bob 2.4s ease-in-out infinite;
}

@keyframes daily-panel-bob {
  0%, 100% { transform: rotateX(6deg) translateY(-2px); }
  50% { transform: rotateX(8deg) translateY(-10px); }
}

#daily-login-root.is-spinning .daily-login-panel {
  animation: daily-panel-shake 0.18s linear infinite;
}

@keyframes daily-panel-shake {
  0%, 100% { transform: rotateX(6deg) translate(0, -4px) rotate(-0.4deg); }
  50% { transform: rotateX(6deg) translate(2px, -6px) rotate(0.4deg); }
}

.daily-login-marquee {
  position: absolute;
  inset: 8px;
  border-radius: 22px;
  pointer-events: none;
  z-index: 0;
}

.daily-login-marquee b {
  position: absolute;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0;
  background: none;
  box-shadow: none;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(255, 210, 74, 0.55));
  animation: daily-bulb 0.7s ease-in-out infinite alternate;
}

.daily-login-marquee b::before {
  content: '🥩';
}

.daily-login-marquee b:nth-child(odd) {
  background: none;
  box-shadow: none;
}

.daily-login-marquee b:nth-child(1) { top: 0; left: 8%; }
.daily-login-marquee b:nth-child(2) { top: 0; left: 28%; animation-delay: 0.08s; }
.daily-login-marquee b:nth-child(3) { top: 0; left: 48%; animation-delay: 0.16s; }
.daily-login-marquee b:nth-child(4) { top: 0; left: 68%; animation-delay: 0.24s; }
.daily-login-marquee b:nth-child(5) { top: 0; left: 88%; animation-delay: 0.32s; }
.daily-login-marquee b:nth-child(6) { top: 18%; right: 0; animation-delay: 0.1s; }
.daily-login-marquee b:nth-child(7) { top: 42%; right: 0; animation-delay: 0.18s; }
.daily-login-marquee b:nth-child(8) { top: 66%; right: 0; animation-delay: 0.26s; }
.daily-login-marquee b:nth-child(9) { bottom: 0; right: 8%; animation-delay: 0.12s; }
.daily-login-marquee b:nth-child(10) { bottom: 0; right: 28%; animation-delay: 0.2s; }
.daily-login-marquee b:nth-child(11) { bottom: 0; right: 48%; animation-delay: 0.28s; }
.daily-login-marquee b:nth-child(12) { bottom: 0; right: 68%; animation-delay: 0.36s; }
.daily-login-marquee b:nth-child(13) { bottom: 0; right: 88%; animation-delay: 0.08s; }
.daily-login-marquee b:nth-child(14) { top: 18%; left: 0; animation-delay: 0.14s; }
.daily-login-marquee b:nth-child(15) { top: 42%; left: 0; animation-delay: 0.22s; }
.daily-login-marquee b:nth-child(16) { top: 66%; left: 0; animation-delay: 0.3s; }

@keyframes daily-bulb {
  from {
    opacity: 0.35;
    transform: scale(0.82);
    filter: drop-shadow(0 0 2px rgba(255, 210, 74, 0.2)) brightness(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1.28);
    filter: drop-shadow(0 0 10px rgba(255, 210, 74, 0.85)) brightness(1.2);
  }
}

.daily-login-close {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  z-index: 3;
  width: 2.1rem;
  height: 2.1rem;
  border: 2px solid #ffd24a;
  border-radius: 999px;
  background: #7a1028;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: 0 3px 0 #3a0810;
}

.daily-login-close:hover {
  background: #a01838;
}

.daily-login-title {
  position: relative;
  z-index: 1;
  margin: 0.15rem 0 0.2rem;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  font-size: clamp(1.7rem, 5vw, 2.15rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffe566;
  text-shadow:
    0 3px 0 #7a1028,
    0 6px 0 #3a0810,
    0 0 18px rgba(255, 210, 74, 0.55);
  animation: daily-title-wiggle 1.8s ease-in-out infinite;
}

@keyframes daily-title-wiggle {
  0%, 100% { transform: rotate(-1.5deg) scale(1); }
  50% { transform: rotate(1.5deg) scale(1.03); }
}

.daily-login-sub {
  position: relative;
  z-index: 1;
  margin: 0 0 1.05rem;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 0 #7a1028;
}

.daily-login-stage {
  position: relative;
  z-index: 1;
  width: min(390px, 82vw);
  margin: 0.55rem auto 1.25rem;
  transform-style: preserve-3d;
}

.daily-login-pointer {
  position: absolute;
  top: -72px;
  left: 50%;
  z-index: 5;
  width: 96px;
  height: 112px;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.55));
  animation: daily-pointer-bounce 0.7s ease-in-out infinite;
  pointer-events: none;
}

.daily-login-pointer-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  user-select: none;
  -webkit-user-drag: none;
}

@keyframes daily-pointer-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-4deg); }
  50% { transform: translateX(-50%) translateY(7px) rotate(4deg); }
}

.daily-login-wheel-shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -14px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  filter: blur(8px);
  transform: translateZ(-40px);
}

.daily-login-wheel-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: rotateX(18deg) translateZ(20px);
  transform-style: preserve-3d;
  animation: daily-wheel-idle 3.2s ease-in-out infinite;
}

#daily-login-root.is-spinning .daily-login-wheel-wrap,
#daily-login-root.is-winner .daily-login-wheel-wrap {
  animation: none;
}

@keyframes daily-wheel-idle {
  0%, 100% { transform: rotateX(18deg) rotateZ(-2deg) translateZ(20px); }
  50% { transform: rotateX(20deg) rotateZ(2deg) translateZ(28px); }
}

.daily-login-wheel-rim {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, #fff1e4, #f2d6c2 32%, #c45c6a 62%, #6e1524 100%);
  box-shadow:
    0 14px 0 #3a0c14,
    0 22px 28px rgba(0, 0, 0, 0.45),
    inset 0 3px 0 rgba(255, 255, 255, 0.45),
    inset 0 -8px 16px rgba(0, 0, 0, 0.35);
  z-index: 0;
}

.daily-login-wheel-lights {
  position: absolute;
  inset: -10px;
  z-index: 4;
  pointer-events: none;
  border-radius: 50%;
}

.daily-login-wheel-lights b {
  --r: calc(min(205px, 41vw) + 2px);
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.45rem;
  height: 1.45rem;
  margin: -0.725rem;
  border-radius: 0;
  background: none;
  box-shadow: none;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  line-height: 1;
  transform: rotate(var(--a)) translateY(calc(-1 * var(--r)));
  animation: daily-meat-bulb 0.55s ease-in-out infinite alternate;
}

.daily-login-wheel-lights b::before {
  content: '🥩';
  display: block;
  transform: rotate(calc(-1 * var(--a)));
}

.daily-login-wheel-lights b:nth-child(odd) {
  background: none;
  box-shadow: none;
}

.daily-login-wheel-lights b:nth-child(1)  { --a: 0deg; }
.daily-login-wheel-lights b:nth-child(2)  { --a: 22.5deg; animation-delay: 0.04s; }
.daily-login-wheel-lights b:nth-child(3)  { --a: 45deg; animation-delay: 0.08s; }
.daily-login-wheel-lights b:nth-child(4)  { --a: 67.5deg; animation-delay: 0.12s; }
.daily-login-wheel-lights b:nth-child(5)  { --a: 90deg; animation-delay: 0.16s; }
.daily-login-wheel-lights b:nth-child(6)  { --a: 112.5deg; animation-delay: 0.2s; }
.daily-login-wheel-lights b:nth-child(7)  { --a: 135deg; animation-delay: 0.24s; }
.daily-login-wheel-lights b:nth-child(8)  { --a: 157.5deg; animation-delay: 0.28s; }
.daily-login-wheel-lights b:nth-child(9)  { --a: 180deg; animation-delay: 0.32s; }
.daily-login-wheel-lights b:nth-child(10) { --a: 202.5deg; animation-delay: 0.36s; }
.daily-login-wheel-lights b:nth-child(11) { --a: 225deg; animation-delay: 0.4s; }
.daily-login-wheel-lights b:nth-child(12) { --a: 247.5deg; animation-delay: 0.44s; }
.daily-login-wheel-lights b:nth-child(13) { --a: 270deg; animation-delay: 0.48s; }
.daily-login-wheel-lights b:nth-child(14) { --a: 292.5deg; animation-delay: 0.52s; }
.daily-login-wheel-lights b:nth-child(15) { --a: 315deg; animation-delay: 0.56s; }
.daily-login-wheel-lights b:nth-child(16) { --a: 337.5deg; animation-delay: 0.6s; }

@keyframes daily-meat-bulb {
  from {
    opacity: 0.35;
    filter: drop-shadow(0 0 2px rgba(255, 210, 74, 0.2)) brightness(0.85);
  }
  to {
    opacity: 1;
    filter: drop-shadow(0 0 12px rgba(255, 210, 74, 0.9)) brightness(1.25);
  }
}

#daily-login-root.is-spinning .daily-login-wheel-lights b,
#daily-login-root.is-winner .daily-login-wheel-lights b {
  animation-duration: 0.28s;
}

.daily-login-wheel {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  overflow: hidden;
  will-change: transform;
  z-index: 1;
  box-shadow:
    inset 0 0 0 3px rgba(0, 0, 0, 0.35),
    inset 0 10px 24px rgba(255, 255, 255, 0.18),
    inset 0 -18px 30px rgba(0, 0, 0, 0.28);
}

.daily-login-wheel::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,0.08) 0 2deg, transparent 2deg 45deg);
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.daily-login-slice-label {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  transform: rotate(var(--slice-angle));
  pointer-events: none;
}

.daily-login-slice-label span {
  position: absolute;
  top: 9%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  min-width: 3.4rem;
  padding: 0.22rem 0.28rem;
  border-radius: 0.45rem;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  line-height: 1.05;
  white-space: nowrap;
}

.daily-login-slice-label strong {
  font-size: 0.95rem;
  font-weight: 900;
  color: #fff;
  text-shadow:
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000,
     0 2px 0 #000;
}

.daily-login-slice-label em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #ffe566;
  text-shadow:
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
}

.daily-login-hub {
  position: absolute;
  inset: 34%;
  z-index: 3;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff1e4, #f2d6c2 36%, #c45c6a 68%, #6e1524 100%);
  border: 4px solid #f7e7d5;
  box-shadow:
    0 8px 0 #3a0c14,
    inset 0 3px 0 rgba(255, 255, 255, 0.55),
    inset 0 -8px 14px rgba(0, 0, 0, 0.28);
  color: #3a0c14;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.daily-login-hub span {
  transform: translateY(1px);
}

.daily-login-spin-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 340px);
  min-height: 3.4rem;
  padding: 0.95rem 1.35rem;
  border: 3px solid #fff6a8;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffef7a 0%, #ffd24a 45%, #f0a800 100%);
  color: #5a1808;
  font-weight: 900;
  font-size: clamp(1.05rem, 3.8vw, 1.35rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow:
    0 8px 0 #9a5a00,
    0 16px 24px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
  animation: daily-spin-pulse 1.1s ease-in-out infinite;
}

.daily-login-spin-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.daily-login-spin-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow:
    0 3px 0 #9a5a00,
    0 8px 14px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

.daily-login-spin-btn:disabled {
  opacity: 0.85;
  cursor: wait;
  animation: none;
}

.daily-login-spin-btn[hidden] {
  display: none !important;
}

@keyframes daily-spin-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

.daily-login-result {
  position: relative;
  z-index: 1;
  margin: 0 0 0.35rem;
  padding: 0.9rem 0.95rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 230, 100, 0.22), rgba(255, 80, 140, 0.16));
  border: 2px solid #ffd24a;
  box-shadow: 0 0 24px rgba(255, 210, 74, 0.35);
  animation: daily-login-pop 0.5s cubic-bezier(0.2, 1.4, 0.3, 1);
}

.daily-login-result[hidden] {
  display: none !important;
}

.daily-login-result-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  margin-bottom: 0.35rem;
}

.daily-login-reward-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35));
}

.daily-login-pack-img {
  width: 64px;
  height: 64px;
}

.daily-login-emoji {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35));
}

.daily-login-result-label {
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #ffe566;
  text-shadow: 0 2px 0 #7a1028;
}

.daily-login-result-value {
  margin-top: 0.25rem;
  font-size: 1.45rem;
  font-weight: 900;
  color: #fff;
  text-shadow:
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000,
     0 3px 0 #7a1028;
}

@keyframes daily-login-pop {
  from { transform: scale(0.7) rotate(-4deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

@media (max-width: 480px) {
  .daily-login-title { font-size: 1.5rem; }
  .daily-login-panel { padding: 1.25rem 0.9rem 1.3rem; }
  .daily-login-slice-label strong { font-size: 0.82rem; }
  .daily-login-slice-label em { font-size: 0.62rem; }
  .daily-login-spin-btn { min-height: 3.1rem; }
}

html, body, *, *::before, *::after {
  cursor: url('/img/cursor-meatslap.png') 21 25, auto !important;
}
