/* ================================================================== */
/* Jack Packs — Card Themes & Collection UI                           */
/* ================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Atma:wght@400;600&family=Cherry+Bomb+One&family=Irish+Grover&family=Rakkas&display=swap');

/* ── Ocean back (deep navy + diagonal wave stripes) ──────────────── */
.card.back.theme-ocean {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(0, 180, 220, 0.18) 0px, rgba(0, 180, 220, 0.18) 1.5px,
      transparent 1.5px, transparent 11px
    ),
    repeating-linear-gradient(
      45deg,
      rgba(0, 130, 180, 0.10) 0px, rgba(0, 130, 180, 0.10) 1px,
      transparent 1px, transparent 11px
    ),
    #020d1c !important;
  border-color: rgba(0, 175, 215, 0.80) !important;
  box-shadow: 0 0 14px rgba(0, 175, 215, 0.42), 0 0 4px rgba(0, 155, 200, 0.22),
              inset 0 0 18px rgba(0, 155, 200, 0.06) !important;
}

/* ── Classic Gold back (deep navy + gold diamond lattice) ────────── */
.card.back.theme-classic-gold {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(245, 200, 66, 0.18) 0px, rgba(245, 200, 66, 0.18) 1.5px,
      transparent 1.5px, transparent 10px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(245, 200, 66, 0.18) 0px, rgba(245, 200, 66, 0.18) 1.5px,
      transparent 1.5px, transparent 10px
    ),
    #060e22 !important;
  border-color: rgba(245, 200, 66, 0.85) !important;
  box-shadow: 0 0 14px rgba(245, 200, 66, 0.40), 0 0 4px rgba(245, 200, 66, 0.20) !important;
}

/* ── Amethyst back (deep purple + violet diamond lattice) ────────── */
.card.back.theme-amethyst {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(160, 80, 255, 0.16) 0px, rgba(160, 80, 255, 0.16) 1.5px,
      transparent 1.5px, transparent 10px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(120, 50, 210, 0.12) 0px, rgba(120, 50, 210, 0.12) 1.5px,
      transparent 1.5px, transparent 10px
    ),
    #080118 !important;
  border-color: rgba(155, 70, 245, 0.80) !important;
  box-shadow: 0 0 14px rgba(150, 65, 240, 0.42), 0 0 4px rgba(130, 50, 210, 0.22),
              inset 0 0 18px rgba(120, 45, 200, 0.07) !important;
}

/* ── Ocean face ──────────────────────────────────────────────────────
   Watercolor card backgrounds, Atma font                              */

.card.theme-ocean:not(.back) {
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.card.theme-ocean:not(.back).black {
  background-color: #0a2040;
  background-image: url('/ui/images/ocean/bg-black.png');
}
.card.theme-ocean:not(.back).red {
  background-color: #c46070;
  background-image: url('/ui/images/ocean/bg-red.png');
}

.card.theme-ocean:not(.back) .rank,
.card.theme-ocean:not(.back) .suit {
  font-family: 'Atma', cursive;
  font-weight: 600;
  font-size: calc(var(--card-rank-size) * 1.0);
  letter-spacing: 0;
}
.card.theme-ocean:not(.back) .suit {
  font-size: calc(var(--card-suit-size) * 2.0);
}
.card.theme-ocean:not(.back).black .rank,
.card.theme-ocean:not(.back).black .suit {
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}
.card.theme-ocean:not(.back).red .rank,
.card.theme-ocean:not(.back).red .suit {
  color: #1B3A6B;
  text-shadow: none;
}

/* ── Classic Gold face ───────────────────────────────────────────────
   Warm parchment stock, gold border, Rakkas display font              */

.card.theme-classic-gold:not(.back) {
  background: #fdf6e0;
  border: 1.5px solid rgba(200, 155, 12, 0.75);
  box-shadow: 0 0 12px rgba(200, 155, 12, 0.35), 0 0 4px rgba(200, 155, 12, 0.20),
              inset 0 0 10px rgba(200, 155, 12, 0.06);
}
.card.theme-classic-gold:not(.back) .rank,
.card.theme-classic-gold:not(.back) .suit {
  font-family: 'Rakkas', cursive;
  font-size: calc(var(--card-rank-size) * 1.0);
  letter-spacing: 0.01em;
}
.card.theme-classic-gold:not(.back) .suit {
  font-size: calc(var(--card-suit-size) * 1.0);
}
.card.theme-classic-gold:not(.back).red   { color: #8b0000; }
.card.theme-classic-gold:not(.back).black { color: #1a0a00; }
.card.theme-classic-gold:not(.back).red   .suit { text-shadow: 0 0 6px rgba(139, 0, 0, 0.35); }
.card.theme-classic-gold:not(.back).black .suit { text-shadow: 0 0 6px rgba(200, 155, 12, 0.30); }

/* ── Amethyst face ───────────────────────────────────────────────────
   Soft lavender stock, violet border glow, Irish Grover display font  */

.card.theme-amethyst:not(.back) {
  background: #f0eaf8;
  border: 1.5px solid rgba(140, 65, 230, 0.72);
  box-shadow: 0 0 16px rgba(140, 65, 230, 0.36), 0 0 5px rgba(120, 50, 205, 0.20),
              inset 0 0 12px rgba(110, 45, 190, 0.06);
}
.card.theme-amethyst:not(.back) .rank,
.card.theme-amethyst:not(.back) .suit {
  font-family: 'Irish Grover', cursive;
  font-size: calc(var(--card-rank-size) * 1.0);
  letter-spacing: 0.02em;
}
.card.theme-amethyst:not(.back) .suit {
  font-size: calc(var(--card-suit-size) * 1.0);
}
.card.theme-amethyst:not(.back).red   { color: #c0006e; }
.card.theme-amethyst:not(.back).black { color: #3d006e; }
.card.theme-amethyst:not(.back).red   .suit { text-shadow: 0 0 8px rgba(192, 0, 110, 0.55), 0 0 16px rgba(210, 0, 125, 0.25); }
.card.theme-amethyst:not(.back).black .suit { text-shadow: 0 0 8px rgba(100, 30, 200, 0.55), 0 0 16px rgba(120, 50, 220, 0.25); }
.card.theme-amethyst:not(.back).red   .rank { text-shadow: 0 0 5px rgba(192, 0, 110, 0.45); }
.card.theme-amethyst:not(.back).black .rank { text-shadow: 0 0 5px rgba(100, 30, 200, 0.45); }

/* ================================================================== */
/* Gemstone Pack                                                       */
/* ================================================================== */

/* ── Gemstone card back (dark crystal lattice) ───────────────────── */
.card.back.theme-gemstone {
  background:
    repeating-linear-gradient(
      60deg,
      rgba(160, 90, 255, 0.14) 0px, rgba(160, 90, 255, 0.14) 1px,
      transparent 1px, transparent 12px
    ),
    repeating-linear-gradient(
      -60deg,
      rgba(100, 50, 200, 0.10) 0px, rgba(100, 50, 200, 0.10) 1px,
      transparent 1px, transparent 12px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(80, 30, 160, 0.08) 0px, rgba(80, 30, 160, 0.08) 1px,
      transparent 1px, transparent 12px
    ),
    #0e0520 !important;
  border-color: rgba(180, 100, 255, 0.75) !important;
  box-shadow: 0 0 14px rgba(160, 80, 255, 0.45), 0 0 4px rgba(130, 50, 220, 0.25),
              inset 0 0 18px rgba(120, 45, 200, 0.08) !important;
}

/* ── Gemstone face — shared base ─────────────────────────────────── */
.card.theme-gemstone:not(.back) {
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.30);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ── Card faces — red suits / black suits ────────────────────────── */
.card.theme-gemstone:not(.back).red   { background-image: url('/ui/images/gemstone/bg-red.png'); }
.card.theme-gemstone:not(.back).black { background-image: url('/ui/images/gemstone/bg-black.png'); }

.card.theme-gemstone:not(.back).red   .rank,
.card.theme-gemstone:not(.back).red   .suit { color: #c41a1a; text-shadow: 0 1px 3px rgba(255,255,255,0.7); }

.card.theme-gemstone:not(.back).black .rank,
.card.theme-gemstone:not(.back).black .suit { color: #1e0a38; text-shadow: 0 1px 3px rgba(255,255,255,0.7); }

/* ── Holographic shimmer (holo Jacks) ─────────────────────────────── */
@keyframes holo-shimmer {
  0%   { background-position: -250% center; }
  100% { background-position:  250% center; }
}

.card.holo {
  position: relative;
  overflow: hidden;
}

.card.holo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 80, 200, 0.48) 30%,
    rgba(80, 240, 255, 0.52) 42%,
    rgba(255, 240, 80, 0.48) 54%,
    rgba(160, 80, 255, 0.42) 66%,
    transparent 76%
  );
  background-size: 300% 100%;
  animation: holo-shimmer 2.6s linear infinite;
  pointer-events: none;
  z-index: 5;
}

/* ================================================================== */
/* Coins & Pack badge                                                  */
/* ================================================================== */
#coins-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: #f5c842;
  letter-spacing: 0.04em;
  justify-content: center;
  padding: 2px 0;
}
#coins-badge .coins-val {
  font-weight: 700;
  font-size: 16px;
}
#packs-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(245, 200, 66, 0.14);
  border: 1px solid rgba(245, 200, 66, 0.38);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 12px;
  color: #f5e09a;
  margin-left: 4px;
  white-space: nowrap;
}

/* ================================================================== */
/* Pack Opening Modal                                                  */
/* ================================================================== */
#pack-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 2, 20, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 450;
  flex-direction: column;
  gap: 22px;
  padding: 20px;
}

#pack-modal-title {
  font-size: 22px;
  color: #f5c842;
  text-shadow: 0 0 16px rgba(245, 200, 66, 0.6);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

#pack-modal-theme {
  font-size: 13px;
  color: #e8d5ff;
  opacity: 0.68;
  letter-spacing: 0.10em;
  text-align: center;
  text-transform: uppercase;
  margin-top: -16px;
}

#pack-cards-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

.pack-card-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: calc(var(--card-width, 84px));
}

@keyframes pack-flip {
  0%   { transform: rotateY(-90deg) scale(0.8);  opacity: 0.5; }
  55%  { transform: rotateY(7deg)   scale(1.10); opacity: 1;   }
  75%  { transform: rotateY(-3deg)  scale(1.05); }
  100% { transform: rotateY(0deg)   scale(1);    }
}

.pack-card-slot .card {
  width:  var(--card-width,  84px);
  height: var(--card-height, 120px);
  flex-shrink: 0;
}

.pack-card-slot .card.flip-in {
  animation: pack-flip 0.52s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.pack-card-label {
  font-size: 11px;
  color: rgba(232, 213, 255, 0.55);
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-height: 14px;
}
.pack-card-label.is-new  { color: #7dff7d; opacity: 1; text-shadow: 0 0 6px rgba(125,255,125,0.5); }
.pack-card-label.is-dupe { color: #f5c842; opacity: 0.90; }
.pack-card-label.is-holo {
  background: linear-gradient(90deg, #ff6af5, #5dffff, #ffe45d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

#pack-coins-earned {
  font-size: 17px;
  color: #f5c842;
  text-align: center;
  letter-spacing: 0.06em;
  min-height: 22px;
  text-shadow: 0 0 10px rgba(245, 200, 66, 0.4);
}

#pack-modal-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ================================================================== */
/* Stats Modal                                                         */
/* ================================================================== */
#stats-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 2, 20, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 450;
  padding: 20px;
}

#stats-modal-box {
  background: var(--overlay-bg, #14103a);
  border: 1px solid rgba(180, 100, 255, 0.30);
  border-radius: 12px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 500px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

#stats-modal-title {
  font-size: 20px;
  color: #f5c842;
  text-shadow: 0 0 14px rgba(245, 200, 66, 0.5);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  flex-shrink: 0;
}

#stats-hands-line {
  font-size: 13px;
  color: rgba(232, 213, 255, 0.45);
  text-align: center;
  letter-spacing: 0.06em;
}

#stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 100, 255, 0.18);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card-label {
  font-size: 10px;
  color: rgba(232, 213, 255, 0.45);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.stat-card-value {
  font-size: 26px;
  color: #e8d5ff;
  letter-spacing: 0.02em;
  line-height: 1;
}

.stat-card-value.highlight { color: #f5c842; }

.stat-card-sub {
  font-size: 11px;
  color: rgba(232, 213, 255, 0.40);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.stats-section-label {
  font-size: 11px;
  color: rgba(232, 213, 255, 0.45);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

#stats-seat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.seat-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 100, 255, 0.18);
  border-radius: 6px;
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.seat-stat-label {
  font-size: 10px;
  color: rgba(232, 213, 255, 0.45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.seat-stat-rate {
  font-size: 18px;
  color: #e8d5ff;
  letter-spacing: 0.02em;
}

.seat-stat-sub {
  font-size: 10px;
  color: rgba(232, 213, 255, 0.35);
}

/* ================================================================== */
/* Profile Modal                                                       */
/* ================================================================== */
#profile-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 2, 20, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 450;
  padding: 20px;
}

#profile-modal-box {
  background: var(--overlay-bg, #14103a);
  border: 1px solid rgba(180, 100, 255, 0.30);
  border-radius: 12px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 400px;
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#profile-modal-title {
  font-size: 20px;
  color: #f5c842;
  text-shadow: 0 0 14px rgba(245, 200, 66, 0.5);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

#profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

#profile-avatar {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 2px solid rgba(245, 200, 66, 0.4);
  background: rgba(255, 255, 255, 0.08);
  background-size: cover;
  background-position: center;
}

#profile-identity {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#profile-username {
  font-size: 18px;
  color: #8aff8a;
  letter-spacing: 0.04em;
}

#profile-coins {
  font-size: 13px;
  color: #f5c842;
  opacity: 0.85;
  letter-spacing: 0.04em;
}

#profile-theme-line {
  font-size: 10px;
  color: rgba(232, 213, 255, 0.40);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#profile-stats-row {
  display: flex;
  gap: 10px;
}

.profile-stat {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 100, 255, 0.18);
  border-radius: 8px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.profile-stat-val {
  font-size: 22px;
  color: #e8d5ff;
  letter-spacing: 0.02em;
  line-height: 1;
}

.profile-stat-val.highlight { color: #f5c842; text-shadow: 0 0 10px rgba(245,200,66,0.4); }

.profile-stat-label {
  font-size: 9px;
  color: rgba(232, 213, 255, 0.45);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.profile-section-label {
  font-size: 10px;
  color: rgba(232, 213, 255, 0.35);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 14px;
  margin-top: 2px;
}

/* Public-view mode: hide private elements */
#profile-modal-box.public-view #profile-coins        { display: none; }
#profile-modal-box.public-view .profile-section-label { display: none; }
#profile-modal-box.public-view #profile-delete-btn   { display: none; }
#profile-modal-box.public-view #profile-xp-section   { display: none; }
#profile-modal-box.public-view #profile-ach-btn      { margin-top: 10px; }

/* ── Level badge (start screen, next to username) ─────────────────── */
#level-badge {
  display: inline-block;
  background: rgba(245, 200, 66, 0.12);
  border: 1px solid rgba(245, 200, 66, 0.38);
  color: #f5c842;
  font-size: 8px;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.6;
}

/* ── XP bar (profile modal) ──────────────────────────────────────────*/
#profile-xp-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#profile-level-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#profile-level-badge {
  font-size: 11px;
  color: #f5c842;
  letter-spacing: 0.08em;
}

#profile-xp-label {
  font-size: 9px;
  color: rgba(232, 213, 255, 0.45);
  letter-spacing: 0.04em;
}

#profile-xp-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 3px;
  overflow: hidden;
}

#profile-xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c4dff, #f5c842);
  border-radius: 3px;
  transition: width 0.45s ease;
  width: 0%;
  min-width: 0;
}

/* ── Achievements nav button (profile modal) ─────────────────────────*/
#profile-ach-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: left;
  margin-top: 2px;
}

#profile-ach-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.20);
}

.profile-ach-btn-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 213, 255, 0.55);
}

.profile-ach-btn-right {
  font-size: 8px;
  color: rgba(232, 213, 255, 0.35);
  letter-spacing: 0.05em;
}

/* ── Achievements modal ──────────────────────────────────────────────*/
#achievements-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 2, 20, 0.94);
  display: flex;
  align-items: flex-start;   /* flex-start so the box can grow past viewport height */
  justify-content: center;
  z-index: 500;
  padding: 20px;
  overflow-y: auto;          /* outer container scrolls — not the inner box */
}

#ach-modal-box {
  background: #0e0820;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 22px 22px 18px;
  width: 100%;
  max-width: 480px;
  /* no max-height / no overflow-y — let the outer modal handle scrolling */
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(124, 77, 255, 0.08);
}

#ach-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

#ach-modal-title {
  font-size: 18px;
  color: rgba(232, 213, 255, 0.9);
  letter-spacing: 0.07em;
}

#ach-modal-count {
  font-size: 11px;
  color: rgba(232, 213, 255, 0.38);
  letter-spacing: 0.06em;
}

#ach-modal-bar-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 2px;
  overflow: hidden;
  margin-top: -6px;
}

#ach-modal-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c4dff, #f5c842);
  border-radius: 2px;
  transition: width 0.5s ease;
  width: 0%;
}

#ach-modal-list {
  display: flex;
  flex-direction: column;
}

.ach-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.ach-row:last-child { border-bottom: none; }

.ach-row-icon {
  font-size: 14px;
  color: rgba(232, 213, 255, 0.18);
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  padding-top: 1px;
  line-height: 1;
}

.ach-row.unlocked .ach-row-icon { color: #f5c842; }

.ach-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ach-row-name {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(232, 213, 255, 0.28);
  line-height: 1.4;
}

.ach-row.unlocked .ach-row-name { color: #f5c842; }

.ach-row-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.ach-row-desc {
  font-size: 10px;
  color: rgba(232, 213, 255, 0.42);
  line-height: 1.65;
  letter-spacing: 0.02em;
  flex: 1;
}

.ach-row.unlocked .ach-row-desc { color: rgba(232, 213, 255, 0.68); }

.ach-row-reward {
  font-size: 9px;
  color: rgba(232, 213, 255, 0.25);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 1px;
}

.ach-row.unlocked .ach-row-reward { color: rgba(232, 213, 255, 0.42); }

/* ── Achievement toast ───────────────────────────────────────────────*/
@keyframes ach-toast-in {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}
@keyframes ach-toast-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.ach-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  background: #18102e;
  border: 1px solid rgba(245, 200, 66, 0.5);
  border-radius: 8px;
  padding: 11px 20px 10px;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.75), 0 0 20px rgba(245, 200, 66, 0.18);
  animation: ach-toast-in 0.3s ease forwards;
  pointer-events: none;
}

.ach-toast-label {
  font-size: 6px;
  letter-spacing: 0.14em;
  color: rgba(245, 200, 66, 0.65);
  margin-bottom: 5px;
}

.ach-toast-name {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: #f5c842;
  margin-bottom: 6px;
}

.ach-toast-reward {
  font-size: 6.5px;
  letter-spacing: 0.05em;
  color: rgba(232, 213, 255, 0.45);
}

/* ── Daily Challenge modal ───────────────────────────────────────────*/
#daily-challenge-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 2, 20, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 450;
  padding: 20px;
  overflow-y: auto;
}

#dc-box {
  background: var(--overlay-bg, #14103a);
  border: 1px solid rgba(180, 100, 255, 0.30);
  border-radius: 12px;
  padding: 24px 22px 22px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 90vh;
  overflow-y: auto;
}

#dc-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

#dc-title {
  font-size: 18px;
  color: #f5c842;
  text-shadow: 0 0 14px rgba(245, 200, 66, 0.5);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#dc-date {
  font-size: 9px;
  color: rgba(232, 213, 255, 0.35);
  letter-spacing: 0.06em;
}

#dc-puzzle-type {
  font-size: 9px;
  color: rgba(180, 100, 255, 0.70);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

#dc-context-text {
  font-size: 11px;
  color: rgba(232, 213, 255, 0.75);
  letter-spacing: 0.04em;
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 10px 12px;
}

#dc-hand-display {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
}

.dc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 54px;
  background: #f8f6f0;
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  gap: 1px;
  flex-shrink: 0;
}

.dc-card.red  { color: #cc1a1a; }
.dc-card.black { color: #12112a; }

.dc-card-rank { font-size: 12px; }
.dc-card-suit { font-size: 16px; line-height: 1; }

.dc-card.trump-card {
  background: #fff8e6;
  border-color: rgba(200, 155, 12, 0.60);
  box-shadow: 0 0 8px rgba(245, 200, 66, 0.30);
}

#dc-question-text {
  font-size: 12px;
  color: #e8d5ff;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

#dc-options-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dc-option-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(180, 100, 255, 0.22);
  border-radius: 6px;
  padding: 10px 14px;
  color: #e8d5ff;
  font-family: var(--font);
  font-size: 10px;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: left;
  transition: background 0.13s, border-color 0.13s;
  line-height: 1.5;
}

.dc-option-btn:hover:not(:disabled) {
  background: rgba(180, 100, 255, 0.12);
  border-color: rgba(180, 100, 255, 0.45);
}

.dc-option-btn.correct {
  background: rgba(125, 255, 125, 0.10);
  border-color: rgba(125, 255, 125, 0.45);
  color: #8aff8a;
}

.dc-option-btn.wrong {
  background: rgba(255, 80, 80, 0.08);
  border-color: rgba(255, 80, 80, 0.35);
  color: rgba(255, 140, 140, 0.75);
}

#dc-result {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#dc-result-badge {
  font-size: 14px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

#dc-result-badge.correct { color: #8aff8a; }
#dc-result-badge.wrong   { color: #ff9090; }

#dc-explanation {
  font-size: 10px;
  color: rgba(232, 213, 255, 0.70);
  letter-spacing: 0.04em;
  line-height: 1.7;
}

#dc-xp-line {
  font-size: 12px;
  color: #f5c842;
  letter-spacing: 0.06em;
  text-shadow: 0 0 8px rgba(245, 200, 66, 0.4);
}

/* Clickable player name buttons (leaderboard rows, friends list) */
.lb-player-btn,
.friend-name-btn {
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.20);
  text-underline-offset: 2px;
  transition: color 0.12s, text-decoration-color 0.12s;
}
.lb-player-btn:hover,
.friend-name-btn:hover {
  color: #f5c842;
  text-decoration-color: rgba(245, 200, 66, 0.50);
}

/* ================================================================== */
/* Store Modal                                                         */
/* ================================================================== */
#store-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 2, 20, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 450;
  padding: 20px;
}

#store-modal-box {
  background: var(--overlay-bg, #14103a);
  border: 1px solid rgba(180, 100, 255, 0.30);
  border-radius: 12px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

#store-modal-title {
  font-size: 20px;
  color: #f5c842;
  text-shadow: 0 0 14px rgba(245, 200, 66, 0.5);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  flex-shrink: 0;
}

#store-coins-line {
  font-size: 15px;
  color: #f5c842;
  text-align: center;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

#store-items-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.store-loading,
.store-empty {
  color: rgba(232, 213, 255, 0.5);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
  letter-spacing: 0.06em;
}

.store-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 100, 255, 0.18);
  border-radius: 8px;
  padding: 12px 14px;
}

.store-item-preview {
  width: 52px;
  height: 72px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 3px;
}

.store-item-preview .card {
  transform: scale(0.619);
  transform-origin: top left;
  pointer-events: none;
}

.store-item-info {
  flex: 1;
  min-width: 0;
}

.store-item-name {
  font-size: 14px;
  color: #e8d5ff;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.store-item-desc {
  font-size: 11px;
  color: rgba(232, 213, 255, 0.50);
  letter-spacing: 0.04em;
  line-height: 1.5;
  margin-bottom: 5px;
}

.store-item-price {
  font-size: 13px;
  color: #f5c842;
  letter-spacing: 0.06em;
}

.store-item-owned {
  font-size: 12px;
  color: #7dff7d;
  letter-spacing: 0.06em;
}

.store-item-action {
  flex-shrink: 0;
}

/* ================================================================== */
/* Collection View (lives inside #overlay-body)                       */
/* ================================================================== */
.collection-coins-line {
  font-size: 16px;
  color: #f5c842;
  text-align: center;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.collection-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.collection-tab {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 2px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(232, 213, 255, 0.60);
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.07em;
  transition: background 0.12s, color 0.12s;
  text-transform: uppercase;
}
.collection-tab.active {
  background: rgba(245, 200, 66, 0.16);
  border-color: rgba(245, 200, 66, 0.52);
  color: #f5c842;
}

.collection-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 4px 0;
}

.collection-card-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.collection-card-slot .card {
  width:  54px;
  height: 78px;
  cursor: default;
  transition: none;
}
.collection-card-slot .card:hover { transform: none; box-shadow: none; }

.collection-card-slot .card .rank { font-size: 12px; top: 3px; left: 4px; }
.collection-card-slot .card .suit { font-size: 17px; }

.collection-card-slot.locked .card {
  filter: brightness(0.22) saturate(0);
  border-color: rgba(255,255,255,0.08) !important;
  box-shadow: none !important;
}

.coll-label {
  font-size: 10px;
  color: rgba(232, 213, 255, 0.48);
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-height: 13px;
}
.coll-label.owned { color: rgba(138, 255, 138, 0.80); }
.coll-label.holo-owned {
  background: linear-gradient(90deg, #ff6af5, #5dffff, #ffe45d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.collection-section-label {
  font-size: 11px;
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
  width: 100%;
  margin: 12px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.collection-progress {
  font-size: 13px;
  color: rgba(232, 213, 255, 0.65);
  text-align: center;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.collection-progress.complete { color: #8aff8a; }

.collection-equip-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 4px 4px;
  border-top: 1px solid rgba(255,255,255,0.10);
  margin-top: 10px;
}

/* Unequip button — muted amber to distinguish from the disabled Equipped checkmark */
#unequip-theme-btn {
  color: rgba(255, 165, 80, 0.80);
  border-color: rgba(255, 145, 55, 0.30);
}
#unequip-theme-btn:hover {
  color: rgba(255, 155, 60, 1);
  border-color: rgba(255, 145, 55, 0.60);
  background: rgba(255, 135, 40, 0.10);
}

/* Equipped theme tab — green checkmark tint */
.collection-tab.equipped-tab {
  color: rgba(138, 255, 138, 0.75);
  border-color: rgba(138, 255, 138, 0.28);
}
.collection-tab.equipped-tab.active {
  color: #8aff8a;
  border-color: rgba(138, 255, 138, 0.60);
  background: rgba(138, 255, 138, 0.10);
}

/* Leaderboard — highlight the current user's row */
.lb-table tr.lb-me td {
  color: #f5c842;
  background: rgba(245, 200, 66, 0.07);
}
.lb-table tr.lb-me td:nth-child(2) {
  color: #f5c842;
}

/* ------------------------------------------------------------------ */
/* Settings modal                                                      */
/* ------------------------------------------------------------------ */
#settings-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 2, 20, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 450;
  padding: 20px;
}

#settings-modal-box {
  background: var(--overlay-bg, #14103a);
  border: 1px solid rgba(180, 100, 255, 0.30);
  border-radius: 12px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#settings-modal-title {
  font-size: 20px;
  color: #f5c842;
  text-shadow: 0 0 14px rgba(245, 200, 66, 0.5);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  flex-shrink: 0;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
}

.settings-label {
  font-size: 11px;
  color: rgba(232, 213, 255, 0.85);
  letter-spacing: 0.08em;
  flex: 1;
}

/* Volume row */
.settings-volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.settings-vol-icon {
  font-size: 14px;
  color: rgba(232, 213, 255, 0.45);
  line-height: 1;
}
#settings-volume {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 2px;
  cursor: pointer;
  outline: none;
}
#settings-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e8d5ff;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(180, 100, 255, 0.5);
}
#settings-volume::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e8d5ff;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(180, 100, 255, 0.5);
}
#settings-volume::-webkit-slider-runnable-track {
  background: transparent;
}

#settings-close-btn { align-self: center; margin-top: 4px; }

/* Game-over pack/coins note — appears below the score after server awards */
.gameover-pack-note {
  font-size: 14px;
  color: #f5c842;
  letter-spacing: 0.06em;
  margin-top: 6px;
  opacity: 0.90;
  text-shadow: 0 0 8px rgba(245, 200, 66, 0.40);
}
