.tray-card {
  min-width: 0;
}
.tray-card-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: center;
}
.tray-image {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(25, 33, 52, 0.72), rgba(7, 12, 24, 0.9));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.tray-card-button:hover .tray-image {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.36), 0 0 28px rgba(96, 165, 250, 0.12);
}
.update-pill {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 999px;
  background: rgba(6, 78, 59, 0.82);
  color: #8bffd2;
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.18);
}
.tray-logo {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
.tray-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tray-logo > span {
  color: var(--orange);
  font-weight: 950;
  font-size: 2rem;
}
.tray-card h3 {
  margin: 12px 0 0;
  overflow: hidden;
  font-size: 0.97rem;
  line-height: 1.22;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tray-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
  text-align: center;
}
.code-card,
.sponsored-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.66), rgba(2, 6, 23, 0.54));
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.24);
}
.code-card::before,
.sponsored-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: '';
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(96, 165, 250, 0.08), transparent 12rem);
}
.code-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.code-card-compact {
  gap: 10px;
  padding: 13px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(8, 13, 25, 0.72));
}
.code-card > *,
.sponsored-card > * {
  position: relative;
}
.code-card:hover {
  border-color: rgba(96, 165, 250, 0.46);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.3), var(--glow-blue);
  transform: none;
}
.code-game-row,
.sponsored-header,
.compact-code-head,
.compact-code-foot {
  display: flex;
  align-items: center;
  gap: 12px;
}
.compact-code-head,
.compact-code-foot {
  justify-content: space-between;
  align-items: flex-start;
}
.compact-code-action-row {
  display: grid;
  grid-template-columns: minmax(400px, 1fr) minmax(260px, 320px);
  gap: 18px;
  align-items: start;
}
.compact-code-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.compact-action-stack {
  display: grid;
  gap: 8px;
  justify-items: stretch;
}
.compact-button-row {
  display: flex;
  justify-content: stretch;
  width: 100%;
}
.compact-date-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.code-logo,
.sponsored-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 17px;
  background: rgba(2, 6, 23, 0.62);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.03);
}
.code-logo img,
.sponsored-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
}
.code-logo span,
.sponsored-logo span {
  color: var(--orange);
  font-weight: 950;
}
.code-card h3,
.sponsored-card h3 {
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.2;
}
.code-card p,
.sponsored-card p {
  margin: 6px 0 0;
  color: var(--muted);
}
.compact-reward {
  margin: 0 !important;
  color: var(--muted-strong) !important;
}
.code-meta,
.feedback-row,
.platform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.code-meta {
  margin-top: 0;
}
.code-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(4, auto);
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 4px 4px 4px 13px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(2, 6, 23, 0.04);
}
.code-value code {
  overflow: hidden;
  padding: 0 4px;
  color: #05060b;
  font-family: var(--mono);
  font-size: 0.94rem;
  font-weight: 950;
  letter-spacing: 0.055em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-button,
.used-toggle-button,
.feedback-button {
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 950;
}
.copy-button,
.used-toggle-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
}
.copy-button {
  background: rgba(37, 99, 235, 0.94);
  color: #ffffff;
}
.used-toggle-button {
  border: 1px solid rgba(22, 163, 74, 0.72);
  background: #bbf7d0;
  color: #065f46;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.used-toggle-button:hover {
  border-color: rgba(21, 128, 61, 0.84);
  background: #86efac;
  color: #064e3b;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}
.used-toggle-button:active,
.used-toggle-button.is-active {
  border-color: rgba(21, 128, 61, 0.9);
  background: #4ade80;
  color: #052e16;
  box-shadow: inset 0 0 0 1px rgba(21, 128, 61, 0.2);
}
.used-toggle-button.is-active:hover {
  border-color: rgba(22, 101, 52, 0.92);
  background: #22c55e;
  color: #052e16;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.used-toggle-button.is-active:active {
  border-color: rgba(20, 83, 45, 0.96);
  background: #16a34a;
  color: #052e16;
  box-shadow: inset 0 0 0 1px rgba(20, 83, 45, 0.22);
}
.copy-button svg,
.used-toggle-button svg,
.feedback-button svg,
.code-verified-icon svg {
  width: 20px;
  height: 20px;
}
.copy-button.is-copied {
  min-width: 82px;
  width: auto;
  padding: 0 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  box-shadow: none;
}
.code-verified-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(250, 204, 21, 0.52);
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.18);
  color: #facc15;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.14);
}
.used-code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(248, 113, 113, 0.58);
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  transition: opacity 0.14s ease, visibility 0.14s ease;
}
.used-code-badge.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.used-code-badge.is-visible {
  visibility: visible;
  opacity: 1;
}
.code-value.is-used {
  border-color: rgba(248, 113, 113, 0.58);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.1), 0 0 0 3px rgba(239, 68, 68, 0.08);
}
.feedback-button {
  grid-auto-flow: column;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.feedback-button:hover {
  transform: translateY(-1px);
}
.feedback-row.is-submitting .feedback-button {
  cursor: progress;
}
.compact-vote-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  justify-content: stretch;
  gap: 8px;
}
.compact-vote-actions .feedback-button {
  width: 100%;
  min-width: 0;
  height: 46px;
  min-height: 46px;
  padding: 0 10px;
  border-radius: 14px;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}
.compact-vote-actions .feedback-button svg {
  flex: 0 0 auto;
  color: currentColor;
}
.compact-vote-actions .feedback-button span {
  color: currentColor;
  font-weight: 950;
  white-space: nowrap;
}
.feedback-works {
  border-color: rgba(134, 239, 172, 0.38);
  background: rgba(187, 247, 208, 0.18);
  color: #86efac;
}
.feedback-fails {
  border-color: rgba(253, 164, 175, 0.38);
  background: rgba(254, 202, 202, 0.18);
  color: #fda4af;
}
.feedback-works:hover {
  border-color: rgba(134, 239, 172, 0.58);
  background: rgba(187, 247, 208, 0.28);
  color: #bbf7d0;
}
.feedback-fails:hover {
  border-color: rgba(253, 164, 175, 0.58);
  background: rgba(254, 202, 202, 0.28);
  color: #fecdd3;
}
.feedback-works.is-active,
.compact-vote-actions .feedback-works.is-active {
  border-color: rgba(52, 211, 153, 0.86);
  background: linear-gradient(135deg, #34d399, #059669);
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.18), 0 14px 26px rgba(16, 185, 129, 0.16);
}
.feedback-fails.is-active,
.compact-vote-actions .feedback-fails.is-active {
  border-color: rgba(251, 113, 133, 0.88);
  background: linear-gradient(135deg, #fb7185, #e11d48);
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.18), 0 14px 26px rgba(225, 29, 72, 0.16);
}
.compact-vote-actions .feedback-works,
.compact-vote-actions .feedback-fails {
  box-shadow: none;
}
.compact-vote-actions .feedback-works {
  border-color: rgba(134, 239, 172, 0.42);
  background: rgba(187, 247, 208, 0.18);
  color: #bbf7d0;
}
.compact-vote-actions .feedback-works:hover {
  border-color: rgba(134, 239, 172, 0.62);
  background: rgba(187, 247, 208, 0.28);
}
.compact-vote-actions .feedback-fails {
  border-color: rgba(253, 164, 175, 0.42);
  background: rgba(254, 202, 202, 0.18);
  color: #fecdd3;
}
.compact-vote-actions .feedback-fails:hover {
  border-color: rgba(253, 164, 175, 0.62);
  background: rgba(254, 202, 202, 0.28);
}
.feedback-button.is-active {
  outline: 0;
}
.feedback-progress {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr) auto;
  align-items: center;
  justify-self: stretch;
  width: 100%;
  gap: 8px;
}
.feedback-progress-track {
  display: flex;
  justify-self: stretch;
  width: 100%;
  height: 11px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
}
.feedback-progress-track span {
  display: block;
  min-width: 0;
  height: 100%;
  transition: width 0.2s ease;
}
.feedback-progress-works {
  background: linear-gradient(90deg, #10b981, #34d399);
}
.feedback-progress-fails {
  background: linear-gradient(90deg, #fb7185, #e11d48);
}
.feedback-progress-stat {
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 950;
  white-space: nowrap;
}
.feedback-progress-stat-works {
  color: #8bffd2;
}
.feedback-progress-stat-fails {
  color: #ff9caf;
}
.platform-tag,
.reward-tag,
.date-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.46);
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 850;
}
.platform-tag {
  border-color: rgba(34, 211, 238, 0.34);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(37, 99, 235, 0.2));
  color: #e0faff;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.1);
}
.reward-tag {
  border-color: rgba(168, 85, 247, 0.32);
  color: #e9d5ff;
}
.sponsored-slot {
  border-color: rgba(250, 204, 21, 0.26);
}
.sponsored-card {
  padding: 18px;
  border-color: rgba(250, 204, 21, 0.42);
  background: linear-gradient(145deg, rgba(113, 63, 18, 0.34), rgba(2, 6, 23, 0.72));
  box-shadow: 0 18px 45px rgba(250, 204, 21, 0.08);
}
.sponsored-card::before {
  background:
    linear-gradient(135deg, rgba(250, 204, 21, 0.16), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(250, 204, 21, 0.18), transparent 12rem);
}
.ads-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 25px;
  margin-bottom: 12px;
  padding: 0 9px;
  border: 1px solid rgba(250, 204, 21, 0.24);
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.13);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  margin-top: 14px;
  border-color: rgba(250, 204, 21, 0.28);
  background: rgba(250, 204, 21, 0.12);
  color: var(--gold);
}

@media (max-width: 640px) {
  .tray-grid[data-mode='games'] .tray-image {
    width: 80%;
    margin-inline: auto;
  }
}
@media (max-width: 760px) {
  .compact-code-head,
  .compact-code-action-row {
    grid-template-columns: 1fr;
    display: grid;
  }
  .compact-button-row {
    justify-content: stretch;
  }
  .compact-vote-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .compact-vote-actions .feedback-button {
    width: 100%;
  }
  .feedback-progress {
    grid-template-columns: auto minmax(80px, 1fr) auto;
    justify-self: stretch;
    width: 100%;
  }
  .feedback-progress-track {
    justify-self: stretch;
    width: 100%;
  }
  .compact-date-row {
    justify-content: flex-start;
  }
}


@media (max-width: 520px) {
  .code-value {
    grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  }
  .used-code-badge {
    grid-column: 1 / -1;
    justify-self: start;
    margin-left: 1px;
  }
  .copy-button,
  .used-toggle-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }
}
