:root {
  --primary-color: #1a1a2e;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --light-color: #30475e;
  --dark-color: #121212;
  --text-color: #f0f0f0;
  --text-secondary: #b0b0b0;
  --card-bg: #222831;
  --card-hover: #333f50;
  --gray-color: #95a5a6;
  /* Token colors are imported from token-styles.css - no hardcoded values here */
}

/* First-paint: hide purchase CTA when a secure session is known (URL or localStorage resume). */
html[data-scratch-resume-pending='1'] #buy-now-btn,
body[data-scratch-session-active='true'] #buy-now-btn {
  display: none !important;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--dark-color);
  color: var(--text-color);
  /* margin-left comes from style.css (sidebar offset on desktop) — do not reset margin here */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background-color: var(--primary-color);
  color: var(--text-color);
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.back-link {
  color: var(--text-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  font-weight: 500;
}

.back-link i {
  margin-right: 5px;
}

main {
  flex: 1;
  padding: 2rem 0;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.scratch-page {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-details {
  margin-bottom: 1.5rem;
  text-align: center;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-details h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

/* Dynamic token badges */
.token-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 15px;
  background-color: var(--primary);
  color: white;
}

.token-badge.FREE {
  background-color: var(--success-color);
  color: white;
}

/* Token-specific classes for badges are applied from token-styles.css */

.card-price {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 0;
  display: block;
  text-align: center;
  order: -1;
}

.price-amount {
  display: inline-block;
  padding: 5px 15px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  font-weight: 600;
}

.card-description {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 12px auto 1.5rem;
}

.scratch-container-wrapper {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  aspect-ratio: 1/1;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  /* Remove token-specific left border if any was applied */
  border-left: none !important;
  isolation: isolate;
}

.scratch-container {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.payment-required-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-blend-mode: overlay;
}

.payment-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.payment-modal-content {
  background: #1a1d29;
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.payment-modal-content img {
  max-width: 250px;
  margin: 1rem auto;
  display: block;
}

.payment-modal-content p {
  margin: 1rem 0;
  color: #aaa;
}

.payment-required-message {
  background-color: rgba(26, 26, 46, 0.85);
  padding: 1.5rem;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-color);
  font-weight: 500;
  text-align: center;
  max-width: 85%;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.payment-required-message:hover {
  background-color: rgba(26, 26, 46, 0.9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  transform: translateY(-2px);
}

.scratch-purchase-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(320px, 90%);
  gap: 0.75rem;
}

.scratch-purchase-stack .payment-required-message {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.payment-required-message #scratch-purchase-buy-slot {
  align-self: stretch;
  width: 100%;
}

.scratch-purchase-stack #buy-now-btn {
  align-self: stretch;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 44px;
  margin: 0.9rem 0 0;
}

#scratch-purchase-buy-slot:empty,
#scratch-buy-home:empty {
  display: none;
}

.scratch-page:not(.is-playing) .scratch-music-control {
  display: none !important;
}

/* Dynamic token costs — layout; token-specific color via *-price classes in token-styles.css */
.token-cost {
  margin: 0.8rem 0;
  font-size: 1.6rem;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  animation: breathe 3s ease-in-out infinite;
}

.token-cost:not([class*="-price"]) {
  color: var(--primary);
}

@keyframes breathe {
  0%, 100% { 
    transform: scale(1);
    opacity: 1;
  }
  50% { 
    transform: scale(1.02);
    opacity: 0.95;
  }
}

/* Token-specific colors are applied from token-styles.css */



/* Scratch card quantity picker — separate from gifts.css .quantity-selector */
.scratch-quantity-selector {
  margin: 0.8rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0;
}

.scratch-quantity-selector label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.quantity-controls-hybrid {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: nowrap;
}

/* Pill buttons for popular quantities (1, 5, 10) */
.quantity-pill {
  min-width: 48px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  border-radius: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  padding: 0 0.8rem;
  -webkit-tap-highlight-color: transparent;
}

.quantity-pill:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.quantity-pill:active {
  transform: translateY(0) scale(0.98);
}

.quantity-pill.active {
  background: linear-gradient(180deg, #1c1f28 0%, #0c0d11 100%);
  border-color: color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 70%, transparent);
  color: #fff;
  box-shadow:
    0 0 12px color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 14%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* More quantity wrapper and dropdown */
.quantity-more-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quantity-more-btn {
  letter-spacing: 2px;
  font-size: 1.2rem;
  line-height: 1;
  padding-top: 0;
}

.quantity-more-select {
  position: absolute;
  opacity: 0;
  pointer-events: all;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: transparent;
  cursor: pointer;
  z-index: 10;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.quantity-more-select option {
  background-color: #1a1a2e;
  color: var(--text-color);
  padding: 0.5rem;
  text-align: center;
}

/* Hidden input to maintain compatibility */
#quantity-input {
  display: none;
}

/* Responsive adjustments for small screens */
@media (max-width: 380px) {
  .quantity-pill {
    min-width: 44px;
    height: 40px;
    font-size: 0.95rem;
  }
  
  .quantity-more {
    min-width: 75px;
    height: 40px;
    font-size: 0.95rem;
  }
}

.total-cost {
  margin: 0.4rem 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-color);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.total-cost .total-cost-label {
  color: var(--text-secondary);
  font-weight: 500;
  margin-right: 0.25rem;
}

.total-cost #total-price {
  font-weight: 700;
  margin-right: 0.35rem;
}

.scratch-page .payment-required-message .token-cost[class*="-price"],
.scratch-page .payment-required-message .token-cost[class*="-price"] #unit-price {
  color: var(--text-secondary) !important;
}

.scratch-page .total-cost #total-price {
  color: var(--scratch-token-color, #e6c97a);
}

@media (min-width: 901px) {
  .scratch-purchase-stack .payment-required-message > span,
  .scratch-purchase-stack .total-cost-label {
    display: block;
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.46);
  }

  .scratch-purchase-stack .token-cost,
  .scratch-purchase-stack .total-cost {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.15;
    animation: none;
  }

  .scratch-purchase-stack .token-cost[class*="-price"] {
    margin: 0;
    font-size: 1.8rem;
  }

  .scratch-purchase-stack #unit-price,
  .scratch-purchase-stack .total-cost #total-price {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.15;
  }

  .scratch-purchase-stack .token-cost-ticker,
  .scratch-purchase-stack .total-cost-token {
    display: block;
    margin: 0.28rem 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.2;
    color: var(--text-secondary) !important;
    text-shadow: none;
  }

  .scratch-purchase-stack .scratch-quantity-selector {
    margin: 1.8rem 0;
  }
}

.total-cost .total-cost-token {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Paid session: Plinko-style stats + action buttons */
.scratch-session-actions {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  max-width: 600px;
  margin: 0.75rem auto 0;
}

.scratch-play-lock-banner {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  background: #664d03;
  color: #fff;
  border-radius: 8px;
  font-size: 0.875rem;
  text-align: center;
  line-height: 1.45;
}

.scratch-play-lock-banner:not([hidden]) {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  width: auto;
  max-width: 520px;
  margin: 0 auto;
  z-index: 10050;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.scratch-play-lock-banner .play-lock-takeover-btn {
  display: inline-block;
  min-height: 44px;
  margin: 0.55rem 0 0;
  padding: 0.45rem 1rem;
  border: 0;
  border-radius: 8px;
  background: #f0d060;
  color: #3a2a00;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  -webkit-appearance: none;
  touch-action: manipulation;
}

.scratch-play-lock-banner .play-lock-takeover-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.scratch-play-lock-banner[hidden] {
  display: none !important;
}

.scratch-stats-band {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 0;
  padding: 0;
  box-sizing: border-box;
  width: 100%;
}

/* Purchase screen: no spacer — stats band only occupies space when session is active */
.scratch-stats-band:not(.is-active) {
  display: none;
}

@media (max-width: 900px) {
  .scratch-round-summary {
    display: none !important;
  }
}

.scratch-play-stats {
  display: none;
  gap: 0;
  margin: 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  width: 100%;
  pointer-events: none;
  user-select: none;
}

.scratch-play-stat {
  flex: 0 0 25%;
  min-width: 0;
  padding: 0.45rem 0.35rem;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.scratch-play-stat:last-child {
  border-right: none;
}

.scratch-play-stat.scratch-stat-highlight {
  flex: 0 0 50%;
}

.scratch-stat-label {
  display: block;
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 0.15rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scratch-stat-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.scratch-play-stat.scratch-stat-highlight .scratch-stat-value {
  font-size: 1.25rem;
  color: #fff;
}

@media (max-width: 420px) {
  .scratch-session-actions {
    gap: 0.75rem;
    margin-top: 0.75rem;
  }

  .scratch-play-stat {
    padding: 0.38rem 0.2rem;
  }

  .scratch-stat-label {
    font-size: 0.62rem;
  }

  .scratch-stat-value {
    font-size: 0.82rem;
  }

  .scratch-play-stat.scratch-stat-highlight .scratch-stat-value {
    font-size: 1.1rem;
  }
}

.scratch-play-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.scratch-play-actions[hidden] {
  display: none !important;
}

.scratch-auto-scratch-row {
  flex: 0 0 auto;
}

.scratch-auto-scratch-row:not([hidden]) {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
}

.scratch-auto-scratch-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.scratch-auto-scratch-label-short { display: none; }
.scratch-auto-scratch-label-long { display: inline; }

.scratch-auto-scratch-toggle {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.scratch-auto-scratch-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 55%, transparent);
  outline-offset: 2px;
}

.scratch-auto-scratch-toggle.is-on {
  background: color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 35%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 15%, transparent);
}

.scratch-auto-scratch-toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 3px;
  width: 20px;
  height: 20px;
  margin: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.20);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transform: translateY(-50%);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.scratch-auto-scratch-toggle.is-on::after {
  background: var(--scratch-token-color, var(--token-default, #6c757d));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transform: translate(18px, -50%);
}

.scratch-play-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

#play-again-btn i {
  width: 1.1em;
  text-align: center;
  flex-shrink: 0;
}

/* In session, stack the shared toolbar, play button, and All Cards. */
@media (min-width: 561px) {
  .scratch-page.is-playing .action-buttons {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .scratch-page.is-playing .action-buttons .scratch-play-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .scratch-page.is-playing .action-buttons .scratch-session-toolbar {
    grid-column: 1 / -1;
  }

  .scratch-page.is-playing .action-buttons .scratch-auto-scratch-row {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-start;
  }

  .scratch-page.is-playing .action-buttons #play-again-btn,
  .scratch-page.is-playing .action-buttons .btn-back {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
  }
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0;
  width: 100%;
  max-width: 600px;
}

.scratch-session-actions > .action-buttons {
  margin-top: 0;
}

/* Free cards: no .scratch-session-actions wrapper — keep air between card and CTAs */
.scratch-page > .action-buttons {
  margin-top: 0.75rem;
}

.btn {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  flex: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn i {
  margin-right: 0.5rem;
  font-size: 0.9em;
}

/* Base buy button — token *-btn classes in token-styles.css set background */
.btn-buy:not([class*="-btn"]) {
  background-color: var(--success-color);
}

.btn-buy {
  color: white;
  font-weight: 500;
}

/* Scratch pay CTA — dark fill + token-color border (overrides solid token fills) */
#buy-now-btn.btn-buy {
  background: linear-gradient(180deg, #1c1f28 0%, #0c0d11 100%) !important;
  border: 1px solid color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 65%, transparent);
  box-shadow:
    0 0 12px color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 11%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #fff;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, filter 0.15s ease, transform 0.15s ease;
}

#buy-now-btn.btn-buy:hover {
  filter: none;
  outline: none;
  border-color: color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 88%, transparent);
  background: linear-gradient(180deg, #22262f 0%, #14161c 100%) !important;
  box-shadow:
    0 0 16px color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 16%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.btn-buy:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* Token-specific buy buttons are styled by token-styles.css */
/* Default hover behavior for all token buttons */
.btn-buy[class*="-btn"]:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-reset {
  background-color: var(--light-color);
  color: var(--text-color);
}

.btn-reset:hover {
  background-color: #3e5973;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* Play / Play Next Card — same dark CTA as in-game spin, token color for border + soft inner tint */
#play-again-btn.btn-reset,
#play-free-card-btn.btn-reset,
.scratch-page #play-again-btn.btn-reset[class*="-btn"],
.scratch-page #play-free-card-btn.btn-reset[class*="-btn"] {
  background: linear-gradient(180deg, #1c1f28 0%, #0c0d11 100%) !important;
  color: #fff !important;
  border: 2px solid color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 78%, transparent);
  box-shadow:
    0 0 12px color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 9%, transparent),
    inset 0 0 22px color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 12%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  filter: none;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, filter 0.15s ease, transform 0.15s ease;
}

#play-again-btn.btn-reset:hover:not(:disabled),
#play-free-card-btn.btn-reset:hover:not(:disabled),
.scratch-page #play-again-btn.btn-reset[class*="-btn"]:hover:not(:disabled),
.scratch-page #play-free-card-btn.btn-reset[class*="-btn"]:hover:not(:disabled) {
  filter: none !important;
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 95%, transparent);
  background: linear-gradient(180deg, #22262f 0%, #14161c 100%) !important;
  box-shadow:
    0 0 16px color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 14%, transparent),
    inset 0 0 26px color-mix(in srgb, var(--scratch-token-color, var(--token-default, #6c757d)) 16%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-back {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-back:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Disabled button states */
.btn:disabled,
.btn.disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  transform: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.btn:disabled:hover,
.btn.disabled:hover {
  transform: none !important;
  filter: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* Result section */
.result-section {
  margin-top: 2rem;
  width: 100%;
  max-width: 600px;
  display: none;
}

.result-section.visible {
  display: block;
  animation: fadeIn 0.5s ease;
}

.result-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  text-align: center;
  color: var(--text-color);
}

.result-win {
  background-color: rgba(46, 204, 113, 0.15);
  border: 2px solid var(--success-color);
}

.result-win h3 {
  color: var(--success-color);
}

.result-lose h3 {
  color: var(--text-secondary);
}

.result-card h3 {
  margin-top: 0;
  font-size: 1.5rem;
}

.result-prize {
  font-size: 2rem;
  font-weight: 700;
  margin: 1rem 0;
  color: var(--text-color);
}

.result-message {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: var(--text-color);
  padding: 1rem 0;
  margin-top: auto;
}

footer .container {
  text-align: center;
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Loading indicator */
/* Enhanced Loading Indicator */
.loading-indicator {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 110;
  background: transparent;
  padding: 2rem;
  text-align: center;
  color: var(--text-color);
  min-width: 400px;
  width: auto;
}

.loading-indicator.visible {
  display: block;
  animation: loadingFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 140px;
  width: 100%;
}

/* Enhanced Spinner with Multiple Rings */
.spinner-enhanced {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid transparent;
  border-radius: 50%;
  animation: spinRing 2s linear infinite;
}

.spinner-ring:nth-child(1) {
  border-top-color: #4c6ef5;
  animation-delay: 0s;
  animation-duration: 1.5s;
}

.spinner-ring:nth-child(2) {
  border-top-color: #7c3aed;
  animation-delay: -0.5s;
  animation-duration: 2s;
  width: 75%;
  height: 75%;
  top: 12.5%;
  left: 12.5%;
}

.spinner-ring:nth-child(3) {
  border-top-color: #06d6a0;
  animation-delay: -1s;
  animation-duration: 2.5s;
  width: 50%;
  height: 50%;
  top: 25%;
  left: 25%;
}

/* Loading Text Container */
.loading-text-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  text-align: center;
}

#loading-title {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
  color: #f3e6b8;
  background: linear-gradient(90deg, #f6e7b4 0%, #e6c97a 45%, #fff6d4 55%, #e6c97a 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite;
  text-align: center;
  white-space: nowrap;
}

.scratch-loader-mark {
  width: 76px;
  height: 76px;
}

.scratch-loader-mark .spinner-ring {
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-width: 2px;
  border-color: rgba(230, 201, 122, 0.22);
  border-top-color: #e6c97a;
  animation-duration: 1.15s;
  animation-delay: 0s;
}

.scratch-loader-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 62%;
  height: 62%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
}

.loading-indicator .loading-dots span {
  background-color: #e6c97a;
}

#loading-subtitle {
  font-size: 0.9rem;
  margin: 0;
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Animated Dots */
.loading-dots {
  display: flex;
  gap: 4px;
  margin-top: 0.5rem;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
  animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Animations */
@keyframes loadingFadeIn {
  0% { 
    opacity: 0; 
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% { 
    opacity: 1; 
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes spinRing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes dotPulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}



/* Responsive adjustments */
@media (max-width: 768px) {
  .card-details h2 {
    font-size: 1.5rem;
  }
  
  .token-cost {
    font-size: 1.25rem;
  }
  
  .btn {
    min-width: 130px;
    font-size: 0.9rem;
  }
  
  .scratch-play-column {
    width: 100%;
    max-width: 100%;
    padding-left: 8px;
    padding-right: 8px;
  }

  .scratch-container-wrapper,
  .scratch-session-actions,
  .scratch-page > .action-buttons,
  .symbol-legend {
    max-width: none;
  }

  .scratch-container-wrapper {
    aspect-ratio: 1/1;
    width: 100%;
  }
}

/* Phone: All Cards and Winning Combinations share one row. The prize list opens full width under them. */
@media (max-width: 560px) {
  .scratch-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: 0.5rem;
    row-gap: 0.75rem;
    align-items: stretch;
    width: 100%;
  }

  .scratch-container-wrapper,
  .scratch-stats-band,
  .scratch-play-lock-banner,
  .scratch-play-actions,
  #buy-now-btn,
  #play-free-card-btn,
  .legend-content,
  .related-cards-section {
    grid-column: 1 / -1;
  }

  .scratch-session-actions,
  .action-buttons,
  .scratch-session-toolbar,
  .scratch-legend-row,
  .symbol-legend {
    display: contents;
  }

  .scratch-page .scratch-session-toolbar {
    display: contents;
  }

  .scratch-page .scratch-auto-scratch-row {
    grid-column: 1 / -1;
    order: 4;
  }

  .scratch-page .scratch-play-actions {
    order: 5;
  }

  .scratch-page .btn-back {
    order: 6;
  }

  .scratch-page .scratch-audio-stack {
    order: 7;
  }

  .scratch-page .legend-header {
    order: 8;
  }

  .scratch-page .related-cards-section {
    order: 20;
  }

  .scratch-page .scratch-audio-btn.game-settings-audio {
    width: 44px;
    height: 44px;
  }

  .scratch-page .btn-back {
    grid-column: 1;
    width: 100%;
    min-width: 0;
    margin: 0;
    flex: none;
  }

  .scratch-page .scratch-audio-stack {
    grid-column: 2;
    align-self: stretch;
  }

  .scratch-page .legend-header {
    grid-column: 3;
    min-width: 0;
    justify-content: center;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
  }

  .scratch-page:not(:has(.btn-back)) .scratch-audio-stack {
    grid-column: 1;
  }

  .scratch-page:not(:has(.btn-back)) .legend-header {
    grid-column: 2 / -1;
  }

  .scratch-page.is-playing {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .scratch-page.is-playing .scratch-auto-scratch-row {
    grid-column: 1;
    order: 7;
    width: auto;
    align-self: center;
    justify-content: flex-start;
  }

  .scratch-page.is-playing .scratch-audio-stack {
    grid-column: 2;
    order: 8;
    align-self: center;
  }

  .scratch-page.is-playing .legend-header {
    grid-column: 3;
    order: 9;
  }

  .scratch-page .legend-header h3 {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    min-width: 0;
  }

  .scratch-page .legend-header h3 i {
    font-size: 0.9em;
    margin-right: 0.5rem;
  }

  .scratch-page .legend-content {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
  }

  .scratch-page:not(.is-playing) {
    grid-template-columns: 1fr 1fr;
  }

  .scratch-page:not(.is-playing) #scratch-buy-home,
  .scratch-page:not(.is-playing) #buy-now-btn,
  .scratch-page:not(.is-playing) #play-free-card-btn {
    grid-column: 1 / -1;
  }

  .scratch-page:not(.is-playing) .btn-back {
    grid-column: 1;
  }

  .scratch-page:not(.is-playing) .legend-header {
    grid-column: 2;
  }
}

@media (max-width: 900px) {
  .scratch-page:not(.is-playing) #scratch-buy-home {
    width: 100%;
    grid-column: 1 / -1;
  }

  .scratch-page:not(.is-playing) #scratch-buy-home #buy-now-btn,
  .scratch-page:not(.is-playing) #play-free-card-btn {
    display: flex;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 44px;
  }

  .scratch-page:not(.is-playing) .scratch-session-toolbar,
  .scratch-page:not(.is-playing) .scratch-auto-scratch-row,
  .scratch-page:not(.is-playing) .scratch-audio-stack {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .scratch-page .scratch-auto-scratch-label-long { display: inline; }
  .scratch-page .scratch-auto-scratch-label-short { display: none; }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.2rem;
  }
  
  .card-details h2 {
    font-size: 1.25rem;
  }
  
  .scratch-container-wrapper {
    aspect-ratio: 1/1;
    width: 100%;
    max-width: none;
  }
  
  .action-buttons {
    flex-direction: column;
  }

  .scratch-page .scratch-auto-scratch-label-long,
  .scratch-auto-scratch-label-long { display: none; }
  .scratch-page .scratch-auto-scratch-label-short,
  .scratch-auto-scratch-label-short { display: inline; }
  .scratch-auto-scratch-toggle { width: 38px; height: 22px; }
  .scratch-auto-scratch-toggle::after {
    width: 16px;
    height: 16px;
    left: 3px;
  }
  .scratch-auto-scratch-toggle.is-on::after {
    transform: translate(16px, -50%);
  }
  .scratch-play-actions .btn {
    padding: 0.72rem 0.65rem;
    font-size: 0.92rem;
  }
  
  .btn {
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 1rem;
  }

  .legend-header {
    min-height: 44px;
    padding: 0.6rem 1rem;
  }

  .legend-header h3 {
    font-size: 0.9rem;
  }
  
  .payment-required-message {
    padding: 1.25rem;
    max-width: 90%;
    border-radius: 12px;
  }
}

/* Symbol Legend Styles */
.symbol-legend {
  margin-top: 0.75rem;
  padding: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: none;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  /* Remove token-specific left border if any was applied */
  border-left: none !important;
  overflow: hidden;
}

/* Collapsed state is the same bar as All Cards */
.symbol-legend.collapsed {
  padding: 0;
}

.symbol-legend h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  color: var(--text-color);
  text-align: center;
}

.symbol-list {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-bottom: 20px;
}

.symbol-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.symbol-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.symbol-list .symbol {
  flex: 0 0 40px;
  font-size: 1.5rem;
  margin-right: 1rem;
  text-align: center;
}

.symbol-list .symbol.custom-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 1rem;
  vertical-align: middle;
}

.symbol-list .symbol-image {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 4px;
}

.symbol-list .prize {
  flex: 0 0 auto;
  text-align: right;
}

.prize {
  color: var(--success-color);
  font-weight: bold;
  margin-left: auto;
}

.hash-mapping {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hash-mapping:after {
  content: '';
  clear: both;
  display: table;
}

.hash-mapping h4 {
  font-size: 0.9rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.hash-mapping small {
  display: block;
  margin-bottom: 5px;
}

.prize-note {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  text-align: center;
}

.prize-note p {
  color: var(--success-color);
  margin: 0;
}

/* Win notification overlay — dim only (no backdrop-filter; avoids WebGL compositor issues) */
.win-notification-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.win-notification-overlay.visible {
  display: flex;
  opacity: 1;
  /* Promote overlay above WebGL canvas on mobile GPUs */
  transform: translateZ(0);
}

.win-notification-content {
  background-color: rgba(46, 204, 113, 0.28);
  border: 2px solid var(--success-color);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  max-width: 80%;
  box-shadow: 0 0 30px rgba(46, 204, 113, 0.5);
}

/* Win icon and title */
.win-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.win-title {
  font-size: 2.5rem;
  margin: 0 0 1rem 0;
  color: var(--success-color);
  font-weight: 700;
}

.win-prize {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: white;
}

.win-message {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.win-symbol-display {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 15px 0;
  font-size: 1.1rem;
  color: #f8f9fa;
}

.win-symbol-text,
.win-pattern-text {
  color: #e9ecef;
  font-weight: 500;
}

.win-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 8px;
  font-size: 1.5rem;
  min-width: 32px;
  min-height: 32px;
}

.win-symbol.custom-symbol {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px;
}

.win-symbol .symbol-image {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 4px;
}

.lose-style .win-notification-content {
  background-color: rgba(108, 117, 125, 0.45) !important;
  border: 2px solid rgba(134, 142, 150, 0.6) !important;
  box-shadow: 0 0 20px rgba(108, 117, 125, 0.3) !important;
  max-width: 320px !important;
  padding: 25px !important;
  transform: scale(0.85) !important;
}

/* Scratch win: "YOU WON" + amount over a dimmed board, slots style. Panel mode keeps the
   boxed look for free cards with a bonus link, since that needs a claim button. */
.win-text-style.win-text-style--panel .win-notification-content {
  max-width: 320px;
  padding: 25px;
  transform: scale(0.85);
}

.win-text-style:not(.win-text-style--panel) {
  background: radial-gradient(ellipse at center, rgba(4, 10, 24, 0.42) 0%, rgba(2, 6, 16, 0.68) 70%, rgba(0, 0, 0, 0.74) 100%);
  pointer-events: none;
  transition: opacity 0.45s ease;
  /* Stays a compositor layer while it fades out, after .visible (and its translateZ) is gone. */
  will-change: opacity;
}

/* backwards, not both: a finished fill-both animation keeps holding opacity at 1, and
   Chrome then skips the opacity transition, so the overlay vanished without its fade. */
.win-text-style:not(.win-text-style--panel).visible {
  animation: winTextDimIn 0.28s ease-out backwards;
}

.win-text-style:not(.win-text-style--panel) .win-notification-content {
  position: relative;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0 1rem;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.win-text-style:not(.win-text-style--panel) .win-notification-content::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150%;
  height: 230%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(255, 196, 60, 0.32) 0%, rgba(255, 170, 30, 0.12) 38%, rgba(255, 170, 30, 0) 68%);
  pointer-events: none;
  z-index: -1;
  animation: winTextHalo 0.9s ease-out both;
}

.win-text-style:not(.win-text-style--panel) .win-icon,
.win-text-style:not(.win-text-style--panel) .win-message,
.win-text-style:not(.win-text-style--panel) .win-symbol-display {
  display: none !important;
}

.win-text-style:not(.win-text-style--panel) .win-title {
  position: relative;
  z-index: 1;
  transform-origin: center bottom;
  margin: 0;
  font-size: clamp(2.3rem, 10vw, 3.8rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  background: linear-gradient(100deg, #ffd25e 0%, #ffe9a8 30%, #ffffff 46%, #ffe9a8 54%, #f5b301 78%, #ffd25e 100%);
  background-size: 260% 100%;
  background-position: 120% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  -webkit-text-stroke: 1px rgba(120, 62, 0, 0.55);
  filter:
    drop-shadow(0 0 10px rgba(255, 205, 80, 0.85))
    drop-shadow(0 0 26px rgba(255, 160, 20, 0.55))
    drop-shadow(0 3px 0 rgba(110, 55, 0, 0.75))
    drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6));
  animation: winTextPop 0.62s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}

.win-text-style:not(.win-text-style--panel) .win-prize {
  position: relative;
  z-index: 3;
  margin: 0.7rem 0 0;
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  line-height: 1.1;
  white-space: nowrap;
  color: #fff8e6;
  -webkit-text-stroke: 0.6px rgba(120, 62, 0, 0.45);
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.45),
    0 0 16px rgba(255, 214, 102, 0.9),
    0 0 30px rgba(255, 170, 30, 0.6),
    0 2px 0 rgba(110, 55, 0, 0.6),
    0 4px 10px rgba(0, 0, 0, 0.75);
  animation: winTextRise 0.48s ease-out 0.22s both;
}

.win-text-style:not(.win-text-style--panel) .win-prize.is-landed {
  animation: winTextLand 0.36s ease-out both;
}

/* Linked mode (cluster and Find the Symbol wins): the board animation throws its comets
   at the centre and the text bursts out of that point. The board dims a little under the
   text; when the text goes, the dim goes with it and the winning icons stay lit. */
.win-text-style.win-text-style--linked:not(.win-text-style--panel) {
  background: radial-gradient(ellipse at center, rgba(4, 10, 24, 0.34) 0%, rgba(2, 6, 16, 0.5) 70%, rgba(0, 0, 0, 0.56) 100%);
}

.win-text-style.win-text-style--linked:not(.win-text-style--panel) .win-notification-content::before {
  display: none;
}

.win-text-style.win-text-style--linked:not(.win-text-style--panel) .win-title {
  animation: winTextBurst 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}

@keyframes winTextBurst {
  0% { opacity: 0; transform: scale(0.15); }
  45% { opacity: 1; transform: scale(1.2); }
  70% { transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes winTextDimIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes winTextHalo {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  45% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
}

@keyframes winTextPop {
  0% { opacity: 0; transform: scale(0.35) rotate(-6deg); }
  45% { opacity: 1; transform: scale(1.16) rotate(3deg); }
  65% { transform: scale(0.95) rotate(-1.5deg); }
  82% { transform: scale(1.04) rotate(0.5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes winTextSheen {
  from { background-position: 120% 0; }
  to { background-position: -20% 0; }
}

@keyframes winTextRise {
  from { opacity: 0; transform: translateY(14px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes winTextLand {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .win-text-style:not(.win-text-style--panel).visible,
  .win-text-style:not(.win-text-style--panel) .win-notification-content::before,
  .win-text-style:not(.win-text-style--panel) .win-title,
  .win-text-style.win-text-style--linked:not(.win-text-style--panel) .win-title,
  .win-text-style:not(.win-text-style--panel) .win-prize,
  .win-text-style:not(.win-text-style--panel) .win-prize.is-landed {
    animation: none;
  }
}

/* iPhone drops background-clip text over the WebGL board. A stuck fade then
   leaves YOU WON invisible until the next card rebuilds the layer. Solid fill
   and no opacity animation cannot land on a transparent frame. */
@supports (-webkit-touch-callout: none) {
  .win-text-style:not(.win-text-style--panel).visible {
    animation: none;
    opacity: 1;
  }

  .win-text-style:not(.win-text-style--panel) .win-notification-content::before {
    animation: none;
    opacity: 0.85;
  }

  .win-text-style:not(.win-text-style--panel) .win-title,
  .win-text-style.win-text-style--linked:not(.win-text-style--panel) .win-title {
    color: #ffe9a8;
    -webkit-text-fill-color: #ffe9a8;
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    filter: none;
    text-shadow:
      0 0 10px rgba(255, 205, 80, 0.85),
      0 0 26px rgba(255, 160, 20, 0.55),
      0 3px 0 rgba(110, 55, 0, 0.75),
      0 8px 14px rgba(0, 0, 0, 0.6);
    animation: winTextBurstOpaque 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25);
  }

  .win-text-style:not(.win-text-style--panel) .win-prize,
  .win-text-style:not(.win-text-style--panel) .win-prize.is-landed,
  .win-text-style.win-tier-big:not(.win-text-style--panel) .win-prize,
  .win-text-style.win-tier-mega:not(.win-text-style--panel) .win-prize,
  .win-text-style.win-tier-epic:not(.win-text-style--panel) .win-prize {
    animation: winTextRiseOpaque 0.48s ease-out 0.12s;
  }

  .win-text-style.win-tier-big:not(.win-text-style--panel) .win-title,
  .win-text-style.win-tier-mega:not(.win-text-style--panel) .win-title,
  .win-text-style.win-tier-epic:not(.win-text-style--panel) .win-title {
    filter: none;
  }

  .win-text-style.win-tier-big:not(.win-text-style--panel) .win-title {
    text-shadow:
      0 0 12px rgba(255, 205, 80, 0.95),
      0 0 28px rgba(255, 160, 20, 0.7),
      0 3px 0 rgba(110, 55, 0, 0.75);
  }

  .win-text-style.win-tier-mega:not(.win-text-style--panel) .win-title {
    text-shadow:
      0 0 16px rgba(255, 220, 120, 1),
      0 0 40px rgba(255, 150, 20, 0.85),
      0 0 70px rgba(255, 120, 0, 0.45),
      0 3px 0 rgba(110, 55, 0, 0.75);
  }

  .win-text-style.win-tier-epic:not(.win-text-style--panel) .win-title {
    text-shadow:
      0 0 18px rgba(255, 236, 170, 1),
      0 0 48px rgba(255, 170, 30, 0.95),
      0 0 90px rgba(255, 90, 0, 0.55),
      0 3px 0 rgba(110, 55, 0, 0.8);
  }
}

@keyframes winTextBurstOpaque {
  0% { transform: scale(0.86); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes winTextRiseOpaque {
  from { transform: translateY(10px) scale(0.96); }
  to { transform: translateY(0) scale(1); }
}

.win-text-style.win-tier-big:not(.win-text-style--panel) .win-title,
.win-text-style.win-tier-mega:not(.win-text-style--panel) .win-title,
.win-text-style.win-tier-epic:not(.win-text-style--panel) .win-title,
.win-text-style.win-tier-big:not(.win-text-style--panel) .win-prize,
.win-text-style.win-tier-mega:not(.win-text-style--panel) .win-prize,
.win-text-style.win-tier-epic:not(.win-text-style--panel) .win-prize {
  max-width: 100%;
}

/* Tier titles play the normal entrance first, then their pulse. Without the entrance
   BIG/MEGA/EPIC WIN appeared fully drawn on the first frame, before the comets landed. */
.win-text-style.win-tier-big:not(.win-text-style--panel) .win-title {
  animation:
    winTextPop 0.62s cubic-bezier(0.2, 0.9, 0.3, 1.25) both,
    winTextTierBig 1.6s ease-out 0.62s;
  filter:
    drop-shadow(0 0 12px rgba(255, 205, 80, 0.95))
    drop-shadow(0 0 28px rgba(255, 160, 20, 0.7))
    drop-shadow(0 3px 0 rgba(110, 55, 0, 0.75));
}

.win-text-style.win-tier-mega:not(.win-text-style--panel) .win-title {
  animation:
    winTextPop 0.62s cubic-bezier(0.2, 0.9, 0.3, 1.25) both,
    winTextTierMega 2.4s ease-out 0.62s;
  filter:
    drop-shadow(0 0 16px rgba(255, 220, 120, 1))
    drop-shadow(0 0 40px rgba(255, 150, 20, 0.85))
    drop-shadow(0 0 70px rgba(255, 120, 0, 0.45))
    drop-shadow(0 3px 0 rgba(110, 55, 0, 0.75));
}

.win-text-style.win-tier-epic:not(.win-text-style--panel) .win-title {
  animation:
    winTextPop 0.62s cubic-bezier(0.2, 0.9, 0.3, 1.25) both,
    winTextTierEpic 3.4s ease-out 0.62s;
  filter:
    drop-shadow(0 0 18px rgba(255, 236, 170, 1))
    drop-shadow(0 0 48px rgba(255, 170, 30, 0.95))
    drop-shadow(0 0 90px rgba(255, 90, 0, 0.55))
    drop-shadow(0 3px 0 rgba(110, 55, 0, 0.8));
}

/* Linked wins (cluster, Find the Symbol): burst out of the comet landing point. */
.win-text-style.win-text-style--linked.win-tier-big:not(.win-text-style--panel) .win-title {
  animation:
    winTextBurst 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25) both,
    winTextTierBig 1.6s ease-out 0.5s;
}

.win-text-style.win-text-style--linked.win-tier-mega:not(.win-text-style--panel) .win-title {
  animation:
    winTextBurst 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25) both,
    winTextTierMega 2.4s ease-out 0.5s;
}

.win-text-style.win-text-style--linked.win-tier-epic:not(.win-text-style--panel) .win-title {
  animation:
    winTextBurst 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25) both,
    winTextTierEpic 3.4s ease-out 0.5s;
}

.win-text-style.win-tier-big:not(.win-text-style--panel) .win-notification-content::before,
.win-text-style.win-tier-mega:not(.win-text-style--panel) .win-notification-content::before,
.win-text-style.win-tier-epic:not(.win-text-style--panel) .win-notification-content::before {
  display: block;
  width: min(92vw, 520px);
  height: 180%;
}

.win-text-style.win-tier-mega:not(.win-text-style--panel) .win-notification-content,
.win-text-style.win-tier-epic:not(.win-text-style--panel) .win-notification-content {
  animation: winTierShake 1.2s ease-out;
}

.win-text-style.win-tier-epic:not(.win-text-style--panel) .win-notification-content {
  animation-duration: 1.7s;
}

.win-text-style.win-tier-mega:not(.win-text-style--panel) .win-prize {
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.7),
    0 0 22px rgba(255, 214, 102, 1),
    0 0 40px rgba(255, 150, 20, 0.75),
    0 2px 0 rgba(110, 55, 0, 0.6);
}

.win-text-style.win-tier-epic:not(.win-text-style--panel) .win-prize {
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.9),
    0 0 28px rgba(255, 230, 140, 1),
    0 0 56px rgba(255, 140, 20, 0.85),
    0 2px 0 rgba(110, 55, 0, 0.7);
}

/* Pulses start at scale(1), where the entrance leaves the title. */
@keyframes winTextTierBig {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes winTextTierMega {
  0% { transform: scale(1); }
  35% { transform: scale(1.06); }
  58% { transform: scale(1); }
  76% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes winTextTierEpic {
  0% { transform: scale(1); }
  28% { transform: scale(1.07); }
  48% { transform: scale(1); }
  66% { transform: scale(1.05); }
  82% { transform: scale(1); }
  100% { transform: scale(1); }
}

@keyframes winTierShake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-4px); }
  36% { transform: translateX(4px); }
  54% { transform: translateX(-2px); }
  72% { transform: translateX(2px); }
}

/* The tier title rules above outrank the iPhone and reduced-motion overrides earlier in
   the file, so repeat those overrides here for tier titles. iPhone keeps an entrance
   with no opacity change (see the note on the earlier @supports block). */
@supports (-webkit-touch-callout: none) {
  .win-text-style.win-tier-big:not(.win-text-style--panel) .win-title,
  .win-text-style.win-text-style--linked.win-tier-big:not(.win-text-style--panel) .win-title {
    animation:
      winTextBurstOpaque 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25),
      winTextTierBig 1.6s ease-out 0.5s;
  }

  .win-text-style.win-tier-mega:not(.win-text-style--panel) .win-title,
  .win-text-style.win-text-style--linked.win-tier-mega:not(.win-text-style--panel) .win-title {
    animation:
      winTextBurstOpaque 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25),
      winTextTierMega 2.4s ease-out 0.5s;
  }

  .win-text-style.win-tier-epic:not(.win-text-style--panel) .win-title,
  .win-text-style.win-text-style--linked.win-tier-epic:not(.win-text-style--panel) .win-title {
    animation:
      winTextBurstOpaque 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25),
      winTextTierEpic 3.4s ease-out 0.5s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .win-text-style.win-tier-big:not(.win-text-style--panel) .win-title,
  .win-text-style.win-tier-mega:not(.win-text-style--panel) .win-title,
  .win-text-style.win-tier-epic:not(.win-text-style--panel) .win-title,
  .win-text-style.win-text-style--linked.win-tier-big:not(.win-text-style--panel) .win-title,
  .win-text-style.win-text-style--linked.win-tier-mega:not(.win-text-style--panel) .win-title,
  .win-text-style.win-text-style--linked.win-tier-epic:not(.win-text-style--panel) .win-title,
  .win-text-style.win-tier-mega:not(.win-text-style--panel) .win-notification-content,
  .win-text-style.win-tier-epic:not(.win-text-style--panel) .win-notification-content {
    animation: none;
  }
}

/* Payment redirect overlay */
.payment-redirect-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.redirect-now-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  margin-top: 15px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  min-width: 120px;
}

.redirect-now-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* Payment processing overlay */
.payment-processing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.processing-container {
  background-color: var(--primary-color);
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  max-width: 90%;
  width: 400px;
  color: var(--text-color);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.small-text {
  font-size: 12px;
  color: var(--text-secondary);
}

/* QR Code Modal */
#qr-code-modal.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qr-code-modal .modal-content {
  background-color: var(--primary-color);
  padding: 20px;
  border-radius: 8px;
  max-width: 90%;
  width: 400px;
  text-align: center;
  color: var(--text-color);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

#qr-code-modal .close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
}

#qr-code-modal .close-modal:hover {
  color: var(--text-color);
}

.qr-container {
  margin: 20px 0;
  background-color: white;
  padding: 15px;
  border-radius: 8px;
  display: inline-block;
}

#qr-code-image {
  max-width: 100%;
  display: block;
}

.modal-instructions {
  margin-bottom: 10px;
  color: var(--text-color);
}

.qr-notes {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 5px;
  font-size: 14px;
  margin-top: 15px;
  color: var(--text-secondary);
}

.qr-notes strong {
  color: var(--warning-color);
}

/* Toast notification (aligned with plinko/dice: top-centered, dark success) */
#toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10000;
  max-width: 90%;
  text-align: center;
  transition: opacity 0.3s;
}

/* Waiting for ledger overlay */
.ledger-waiting-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ledger-waiting-container {
  background-color: var(--primary-color);
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  max-width: 90%;
  width: 400px;
  color: var(--text-color);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.ledger-waiting-container h3 {
  color: var(--primary);
  margin-top: 15px;
}

.ledger-waiting-container .small-text {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 0.5rem;
}

/* Winning Combinations opens a centered modal. */
button.legend-header {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

.legend-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  padding: 0.6rem 1rem;
  min-height: 44px;
  border-bottom: none;
  margin: 0;
  user-select: none;
  transition: background-color 0.2s ease;
}

.scratch-legend-modal {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.scratch-legend-modal[hidden] {
  display: none !important;
}

body.scratch-legend-open {
  overflow: hidden;
}

.scratch-legend-modal-panel {
  width: min(640px, 100%);
  max-height: min(80vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #10141c;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color: #fff;
}

.scratch-legend-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.scratch-legend-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.scratch-legend-modal-header h3 i {
  margin-right: 0.45rem;
}

.scratch-legend-modal-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.scratch-legend-modal .legend-content {
  display: block;
  overflow: auto;
  padding: 1rem 1.1rem 1.2rem;
}

.scratch-legend-modal .winnings-table {
  width: 100%;
}

.prize-rule-note {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
  color: rgba(255, 255, 255, 0.62);
}

.prize-rtp-note {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.62);
}

.scratch-page .game-settings-toggle.is-on {
  background: color-mix(in srgb, var(--scratch-token-color, #a6843c) 22%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--scratch-token-color, #a6843c) 48%, transparent);
}

.symbol-legend:not(.collapsed) .legend-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.symbol-legend:not(.collapsed) .legend-content {
  padding: 0.75rem 1rem 1rem;
}

.legend-header:hover,
.symbol-legend.collapsed .legend-header:hover {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 0.6rem 1rem;
}

.legend-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.legend-header h3 i {
  margin-right: 0.5rem;
  font-size: 0.9em;
}

.scratch-legend-row {
  width: 100%;
  max-width: 600px;
  margin: 0.75rem auto 0;
}

@media (min-width: 561px) {
  .scratch-legend-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.75rem;
  }

  .scratch-legend-row .symbol-legend {
    display: contents;
    margin-top: 0;
  }

  .scratch-legend-row .legend-header {
    grid-column: 1 / -1;
    grid-row: 1;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
  }

  .scratch-session-toolbar .scratch-audio-stack {
    margin-left: auto;
  }
}

/* Desktop: one framed session, card on the left and a full-height rail on the right. */
@media (min-width: 901px) {
  .scratch-play-column {
    width: 100%;
    max-width: 920px;
  }

  .scratch-page {
    display: grid;
    grid-template-columns: minmax(0, 600px) 320px;
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 0;
    row-gap: 0;
    align-items: stretch;
    justify-items: stretch;
    width: min(920px, 100%);
    margin: 0 auto;
  }

  .scratch-container-wrapper {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 600px;
    max-width: 100%;
    margin: 0;
    border-radius: 16px 0 0 16px;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 0;
  }

  .scratch-session-actions,
  .scratch-page > .action-buttons {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    width: 100%;
    max-width: none;
    margin: 0;
    gap: 0.65rem;
    padding: 0.85rem 0.85rem 0.45rem;
    background: #0c1016;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 0;
    border-radius: 0 16px 0 0;
  }

  .scratch-legend-row {
    grid-column: 2;
    grid-row: 2;
    align-self: stretch;
    align-content: start;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.15rem 0.85rem 0.85rem;
    background: #0c1016;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-top: 0;
    border-radius: 0 0 16px 0;
  }

  .scratch-page .related-cards-section {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    margin-top: 1.25rem;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
  }

  .scratch-page .related-cards-container {
    padding-left: 0;
    padding-right: 0;
  }

  .scratch-page .scratch-play-stats {
    flex-direction: column;
    gap: 0.45rem;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    overflow: visible;
  }

  .scratch-page .scratch-round-summary {
    order: -1;
    width: 100%;
  }

  .scratch-page .scratch-stat-cards-left {
    display: none;
  }

  .scratch-page .scratch-play-stat:not(.scratch-stat-cards-left) {
    order: 1;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    text-align: center;
  }

  .scratch-page .scratch-play-stat.scratch-stat-highlight {
    order: 2;
    background: rgba(47, 158, 68, 0.1);
    box-shadow: inset 0 0 18px rgba(47, 158, 68, 0.12);
  }

  .scratch-page .scratch-play-stat:not(.scratch-stat-cards-left) .scratch-stat-label {
    margin: 0;
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.15;
    color: rgba(255, 255, 255, 0.55);
  }

  .scratch-page .scratch-play-stat:not(.scratch-stat-cards-left) .scratch-stat-value {
    font-size: 1.22rem;
    line-height: 1.05;
    text-align: center;
  }

  .scratch-page .scratch-play-stat.scratch-stat-highlight .scratch-stat-value {
    font-size: 1.55rem;
    color: #4ade80;
  }

  .scratch-page.is-playing .action-buttons {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .scratch-page.is-playing .action-buttons .scratch-play-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.55rem;
  }

  .scratch-page .scratch-session-toolbar {
    width: 100%;
  }

  .scratch-page .scratch-auto-scratch-row {
    width: auto;
    justify-content: flex-start;
  }

  .scratch-page.is-playing .action-buttons #play-again-btn,
  .scratch-page.is-playing .action-buttons .btn-back,
  .scratch-page > .action-buttons .btn {
    width: 100%;
    min-width: 0;
  }

  .scratch-legend-row .legend-header h3 {
    font-size: 0.95rem;
    white-space: nowrap;
  }

  /* In session, pin All Cards and Prizes to the bottom of the rail. */
  .scratch-page.is-playing {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  }

  .scratch-page.is-playing::before {
    content: "";
    grid-column: 2;
    grid-row: 1 / span 6;
    background: #0c1016;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 0;
    border-radius: 0 16px 16px 0;
    z-index: 0;
  }

  .scratch-page.is-playing .scratch-container-wrapper {
    grid-row: 1 / span 6;
  }

  .scratch-page.is-playing .scratch-session-actions,
  .scratch-page.is-playing .action-buttons,
  .scratch-page.is-playing .scratch-legend-row,
  .scratch-page.is-playing .symbol-legend {
    display: contents;
  }

  .scratch-page.is-playing .scratch-stats-band,
  .scratch-page.is-playing .scratch-session-toolbar,
  .scratch-page.is-playing #scratchPlayActions,
  .scratch-page.is-playing .btn-back,
  .scratch-page.is-playing .legend-header {
    grid-column: 2;
    z-index: 1;
    width: auto;
    min-width: 0;
    margin-left: 0.85rem;
    margin-right: 0.85rem;
  }

  .scratch-page.is-playing .scratch-stats-band {
    grid-row: 1;
    margin-top: 0.85rem;
  }

  .scratch-page.is-playing .scratch-session-toolbar,
  .scratch-page.is-playing .action-buttons .scratch-session-toolbar {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0.65rem;
  }

  .scratch-page.is-playing #scratchPlayActions {
    grid-row: 3;
    align-self: start;
    margin-top: 0.55rem;
  }

  .scratch-page.is-playing .action-buttons .btn-back {
    grid-row: 5;
    align-self: end;
    justify-self: stretch;
    width: auto;
    max-width: 100%;
  }

  .scratch-page.is-playing .legend-header {
    grid-row: 6;
    align-self: end;
    margin-top: 0.55rem;
    margin-bottom: 0.85rem;
  }

  .scratch-page.is-playing .related-cards-section {
    grid-row: 7;
  }

  /* Purchase screen uses the same card-and-rail frame. Controls sit in the rail. */
  .scratch-page:not(.is-playing) {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }

  .scratch-page:not(.is-playing)::before {
    content: "";
    grid-column: 2;
    grid-row: 1 / span 4;
    background: #0c1016;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 0;
    border-radius: 0 16px 16px 0;
    z-index: 0;
  }

  .scratch-page:not(.is-playing) .scratch-container-wrapper {
    grid-row: 1 / span 4;
  }

  .scratch-page:not(.is-playing) .scratch-session-actions,
  .scratch-page:not(.is-playing) .action-buttons,
  .scratch-page:not(.is-playing) .scratch-legend-row,
  .scratch-page:not(.is-playing) .symbol-legend {
    display: contents;
  }

  .scratch-page:not(.is-playing) .scratch-session-toolbar,
  .scratch-page:not(.is-playing) #scratchPlayActions,
  .scratch-page:not(.is-playing) .scratch-stats-band {
    display: none !important;
  }

  .scratch-page:not(.is-playing) #scratch-purchase-rail,
  .scratch-page:not(.is-playing) #play-free-card-btn,
  .scratch-page:not(.is-playing) .btn-back,
  .scratch-page:not(.is-playing) .legend-header {
    grid-column: 2;
    z-index: 1;
    width: auto;
    min-width: 0;
    margin-left: 0.85rem;
    margin-right: 0.85rem;
  }

  .scratch-page:not(.is-playing) #scratch-purchase-rail,
  .scratch-page:not(.is-playing) #play-free-card-btn {
    grid-row: 1;
    margin-top: 0.85rem;
  }

  .scratch-page:not(.is-playing) .btn-back {
    grid-row: 3;
    align-self: end;
  }

  .scratch-page:not(.is-playing) .legend-header {
    grid-row: 4;
    align-self: end;
    margin-top: 0.55rem;
    margin-bottom: 0.85rem;
  }

  .scratch-page:not(.is-playing) .related-cards-section {
    grid-row: 5;
  }

  #scratch-purchase-rail .scratch-purchase-stack {
    width: 100%;
  }

  #scratch-purchase-rail .payment-required-message,
  #scratch-purchase-rail .payment-required-message:hover {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.15rem 0.1rem 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    transform: none;
  }

  #scratch-purchase-rail #buy-now-btn {
    width: 100%;
  }

  .scratch-page:not(.is-playing) #scratch-purchase-overlay:not(:has(.scratch-purchase-stack)) {
    display: block !important;
    pointer-events: none;
  }

  /* VIP-locked: the message and button sit in the rail, directly above All Cards. */
  .scratch-page:has(#scratch-vip-overlay) #scratch-vip-overlay .payment-required-message {
    display: none;
  }

  .scratch-page:not(.is-playing):has(#scratch-vip-overlay) {
    grid-template-rows: minmax(0, 1fr) auto auto auto;
  }

  .scratch-page:not(.is-playing) .scratch-vip-notice,
  .scratch-page:not(.is-playing):has(#scratch-vip-overlay) #scratch-buy-home,
  .scratch-page:not(.is-playing):has(#scratch-vip-overlay) #play-free-card-btn {
    grid-column: 2;
    z-index: 1;
    width: auto;
    min-width: 0;
    margin: 0 0.85rem 0.55rem;
  }

  .scratch-page:not(.is-playing) .scratch-vip-notice {
    display: block;
    grid-row: 1;
    align-self: end;
    margin-top: 0.85rem;
  }

  .scratch-page:not(.is-playing):has(#scratch-vip-overlay) #scratch-buy-home,
  .scratch-page:not(.is-playing):has(#scratch-vip-overlay) #play-free-card-btn {
    grid-row: 2;
  }

  .scratch-page:has(#scratch-vip-overlay) #scratch-buy-home #buy-now-btn {
    width: 100%;
    min-height: 44px;
    margin: 0;
  }
}

.scratch-vip-notice {
  display: none;
  padding: 0.9rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #f0f0f0;
  text-align: center;
}

.scratch-vip-notice-title {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #e6c97a;
}

.scratch-vip-notice p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* All Cards is only on the buy screen. During play it stays disabled, so it is hidden. */
.scratch-page.is-playing .btn-back,
.scratch-page.is-playing #scratch-buy-home,
.scratch-page.is-playing #scratch-purchase-rail {
  display: none !important;
}

/* Secondary actions stay dark like Buy, with a quiet grey edge. */
.scratch-page .btn-back,
.scratch-page a.btn-back:link,
.scratch-page a.btn-back:visited,
.scratch-page .legend-header,
.scratch-page .legend-header h3 {
  background: linear-gradient(180deg, #1c1f28 0%, #0c0d11 100%);
  color: #f0f0f0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  filter: none;
  font-weight: 500;
  opacity: 1;
}

.scratch-page .legend-header h3 {
  background: none;
  border: 0;
  box-shadow: none;
}

.scratch-page .legend-header h3 i {
  color: #f0f0f0;
  font-weight: 900;
  font-style: normal;
}

.scratch-page .btn-back:hover,
.scratch-page a.btn-back:hover,
.scratch-page .legend-header:hover,
.scratch-page .symbol-legend.collapsed .legend-header:hover,
.scratch-page .legend-header:hover h3 {
  background: linear-gradient(180deg, #22262f 0%, #14161c 100%);
  color: #f0f0f0;
  border-color: rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  filter: none;
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.scratch-page .legend-header:hover h3 {
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

@media (min-width: 901px) {
  .scratch-page .legend-header {
    justify-content: center;
    text-align: center;
  }
}

.scratch-audio-stack {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.scratch-audio-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.scratch-audio-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.scratch-audio-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

.scratch-audio-btn.is-muted {
  color: rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.2);
}

.scratch-audio-btn i {
  font-size: 1rem;
  pointer-events: none;
  margin: 0;
}

.scratch-audio-btn .scratch-audio-icon-off {
  display: none;
}

.scratch-audio-btn.is-muted .scratch-audio-icon-on {
  display: none;
}

.scratch-audio-btn.is-muted .scratch-audio-icon-off {
  display: inline;
}

.scratch-music-btn {
  position: relative;
}

.scratch-music-btn.is-muted::after {
  content: '';
  position: absolute;
  left: 18%;
  right: 18%;
  top: 50%;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transform: rotate(-40deg);
  pointer-events: none;
}

.scratch-music-control,
.scratch-sfx-control {
  position: relative;
  display: inline-flex;
}

.scratch-sfx-control .scratch-audio-pop {
  left: auto;
  right: 0;
  transform: none;
}

.scratch-audio-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 148px;
  padding: 0.55rem 0.7rem 0.6rem;
  border-radius: 10px;
  background: rgba(12, 16, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.scratch-audio-pop[hidden] {
  display: none !important;
}

.scratch-audio-pop-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.46);
}

.scratch-audio-pop input[type="range"] {
  width: 100%;
  height: 28px;
  margin: 0;
  accent-color: #e6c97a;
  cursor: pointer;
  touch-action: none;
}

.scratch-audio-stack:has(.scratch-audio-pop:not([hidden])),
.scratch-page.is-playing .scratch-session-toolbar:has(.scratch-audio-pop:not([hidden])) {
  position: relative;
  z-index: 40;
}

.legend-toggle-icon {
  transition: transform 0.3s ease;
  font-size: 1rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.legend-content {
  transition: all 0.3s ease;
  overflow: hidden;
}

/* Related Cards Section */
.related-cards-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: transparent;
  border-radius: 12px;
  box-shadow: none;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.related-cards-section h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  color: var(--text-color);
  text-align: center;
}

.related-cards-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  padding: 0 42px; /* Space for nav arrows (compact on small screens) */
}

.related-cards-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.related-cards-scroll::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Navigation arrows (all viewports; primary scroll affordance on touch devices) */
.cards-nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(34, 40, 49, 0.9); /* Dark background */
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-color); /* Light text on dark background */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.cards-nav-arrow:hover {
  background-color: rgba(34, 40, 49, 1);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.3);
}

.cards-nav-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.cards-nav-arrow.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.cards-nav-arrow-left {
  left: 2px;
}

.cards-nav-arrow-right {
  right: 2px;
}

.related-card {
  flex: 0 0 200px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.related-card-image {
  width: 100%;
  height: 120px;
  overflow: hidden;
  position: relative;
}

.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.related-card:hover .related-card-image img {
  transform: scale(1.05);
}

.related-card-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.related-card-info h4 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-color);
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.related-card-price {
  display: flex !important; /* Force display */
  align-items: center;
  justify-content: center;
  margin: 0.25rem 0;
  opacity: 1 !important; /* Force full opacity */
  visibility: visible !important; /* Force visibility */
  transition: none; /* Prevent price from changing on hover */
}

.free-badge {
  background-color: var(--success-color);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 1 !important; /* Always visible */
  visibility: visible !important; /* Always visible */
  display: inline-block !important; /* Force display */
  transition: none; /* Keep badge stable */
}

.price-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  /* Remove default white color to let token colors work */
  opacity: 1 !important; /* Always visible */
  visibility: visible !important; /* Always visible */
  display: inline-block !important; /* Force display */
  transition: none; /* Keep badge stable */
}

/* Token-specific price badge colors for related cards - remove background */
.related-cards-section .price-badge[class*="-price-badge"],
.related-cards-section .price-badge {
  background-color: transparent !important;
  border: none !important;
  padding: 0.2rem 0.4rem !important;
  /* Remove the generic color override to let token-specific colors work */
}

/* Override token-specific background colors in related cards */
.related-cards-section .xrp-price-badge {
  background-color: transparent !important;
  color: var(--xrp-color) !important;
}

.related-cards-section .csc-price-badge {
  background-color: transparent !important;
  color: var(--csc-color) !important;
}

/* More specific selectors for all token price badges in related cards */
.related-cards-section .related-card .price-badge[class*="-price-badge"],
.related-cards-section .related-card-info .price-badge[class*="-price-badge"],
.related-cards-section .related-card-price .price-badge[class*="-price-badge"] {
  background-color: transparent !important;
  border: none !important;
}

/* Specific token overrides with highest specificity */
.related-cards-section .related-card .xrp-price-badge,
.related-cards-section .related-card-info .xrp-price-badge,
.related-cards-section .related-card-price .xrp-price-badge {
  color: var(--xrp-color) !important;
}

.related-cards-section .related-card .csc-price-badge,
.related-cards-section .related-card-info .csc-price-badge,
.related-cards-section .related-card-price .csc-price-badge {
  color: var(--csc-color) !important;
}

/* Keep FREE badges with their green background */
.related-cards-section .free-badge,
.related-card .free-badge,
.related-card-price .free-badge,
.related-card-info .free-badge {
  background-color: var(--success-color) !important;
  color: white !important;
  border: none !important;
}

/* Ensure token-specific price badge colors work in related cards */
.related-cards-section .price-badge[class*="-price-badge"] {
  background-color: transparent !important;
  border: none !important;
  /* Color will be set by the token-specific classes from app.js */
}

/* Base price badge in related cards - remove any default styling */
.related-cards-section .price-badge:not(.free-badge) {
  background-color: transparent !important;
  color: inherit !important;
  border: none !important;
}

/* Force removal of any default colors for all price badges in related cards */
.related-cards-section .price-badge,
.related-cards-section .related-card .price-badge,
.related-cards-section .related-card-info .price-badge,
.related-cards-section .related-card-price .price-badge {
  background-color: transparent !important;
  border: none !important;
  /* Don't set any default color - let token-specific classes handle it */
}

/* Ultra-specific selectors for token-specific price badges with maximum specificity */
.related-cards-section .related-card-info .related-card-price span.price-badge[class*="-price-badge"] {
  background-color: transparent !important;
  border: none !important;
  font-weight: 600 !important;
}

/* Force token colors with maximum specificity - these should override everything */
.related-cards-section span.price-badge.csc-price-badge,
.related-cards-section .related-card span.price-badge.csc-price-badge,
.related-cards-section .related-card-info span.price-badge.csc-price-badge,
.related-cards-section .related-card-price span.price-badge.csc-price-badge {
  color: var(--csc-color) !important;
  background-color: transparent !important;
  border: none !important;
}

.related-cards-section span.price-badge.xrp-price-badge,
.related-cards-section .related-card span.price-badge.xrp-price-badge,
.related-cards-section .related-card-info span.price-badge.xrp-price-badge,
.related-cards-section .related-card-price span.price-badge.xrp-price-badge {
  color: var(--xrp-color) !important;
  background-color: transparent !important;
  border: none !important;
}

/* Override any token-specific hiding rules for related cards */
.related-card .price-badge,
.related-card .free-badge,
.related-card .price-badge[class*="-tag"],
.related-card-price .price-badge,
.related-card-price .free-badge,
.related-card-info .price-badge,
.related-card-info .free-badge {
  opacity: 1 !important;
  visibility: visible !important;
  display: inline-block !important;
  transform: none !important;
  /* Fix for token-tag positioning override */
  position: static !important;
  top: auto !important;
  left: auto !important;
  /* Remove background for clean appearance */
  background-color: transparent !important;
  border: none !important;
  padding: 0.2rem 0.4rem !important;
  /* Let token-specific colors work - don't override color here */
}

/* Comprehensive override for ALL token-tag classes within related cards */
.related-cards-section [class*="-tag"],
.related-cards-section [class*="-price-badge"] {
  position: static !important;
  top: auto !important;
  left: auto !important;
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Force visibility on hover states too */
.related-card:hover .price-badge,
.related-card:hover .free-badge,
.related-card:hover .related-card-price {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
  transform: none !important;
  /* Fix for token-tag positioning override */
  position: static !important;
  top: auto !important;
  left: auto !important;
}

.related-card:hover .price-badge,
.related-card:hover .free-badge {
  display: inline-block !important;
  /* Fix for token-tag positioning override */
  position: static !important;
  top: auto !important;
  left: auto !important;
}

.related-card-btn {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: #fff !important;
  background: linear-gradient(180deg, #1c1f28 0%, #0c0d11 100%) !important;
  border: 1px solid color-mix(in srgb, var(--related-token-color, var(--token-default, #6c757d)) 65%, transparent);
  box-shadow:
    0 0 10px color-mix(in srgb, var(--related-token-color, var(--token-default, #6c757d)) 11%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, filter 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.related-cards-section a.related-card-btn[class*="-btn"],
.related-cards-section .related-card a.related-card-btn {
  background: linear-gradient(180deg, #1c1f28 0%, #0c0d11 100%) !important;
  border: 1px solid color-mix(in srgb, var(--related-token-color, var(--token-default, #6c757d)) 65%, transparent);
  box-shadow:
    0 0 10px color-mix(in srgb, var(--related-token-color, var(--token-default, #6c757d)) 11%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #fff !important;
  filter: none;
}

.related-card-btn:hover,
.related-cards-section a.related-card-btn[class*="-btn"]:hover,
.related-cards-section .related-card a.related-card-btn:hover {
  transform: translateY(-1px);
  filter: none;
  border-color: color-mix(in srgb, var(--related-token-color, var(--token-default, #6c757d)) 88%, transparent);
  background: linear-gradient(180deg, #22262f 0%, #14161c 100%) !important;
  box-shadow:
    0 0 14px color-mix(in srgb, var(--related-token-color, var(--token-default, #6c757d)) 16%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.related-card-btn i {
  font-size: 0.7rem;
}

/* Placeholder and error states */
.related-card-placeholder,
.no-related-cards,
.related-cards-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  min-height: 120px;
}



.no-related-cards p,
.related-cards-error p {
  margin-bottom: 1rem;
}

/* Desktop optimizations for related cards */
@media (min-width: 769px) {
  .related-cards-section {
    max-width: 900px; /* Even wider on larger screens */
  }
  
  .related-cards-container {
    padding: 0 58px;
  }
  
  .cards-nav-arrow {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
  
  .cards-nav-arrow-left {
    left: 6px;
  }
  
  .cards-nav-arrow-right {
    right: 6px;
  }
  
  .related-card {
    flex: 0 0 220px; /* Slightly larger cards on desktop */
  }
  
  .related-card-image {
    height: 130px;
  }
}

/* Mobile optimizations for related cards — edge-to-edge strip (escapes 90% .container) */
@media (max-width: 768px) {
  .related-cards-section {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 1.25rem 0.5rem;
    box-sizing: border-box;
    border-radius: 0;
  }

  .related-cards-container {
    padding: 0 36px;
  }
  
  .related-card {
    flex: 0 0 clamp(150px, 46vw, 190px);
  }
  
  .related-card-image {
    height: 100px;
  }
  
  .related-card-info {
    padding: 0.75rem;
  }
  
  .related-card-info h4 {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .related-cards-section {
    padding: 1rem 0.35rem;
  }
  
  .related-cards-container {
    padding: 0 32px;
  }

  .cards-nav-arrow {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .related-card {
    flex: 0 0 clamp(140px, 42vw, 168px);
  }
  
  .related-card-image {
    height: 90px;
  }
  
  .related-card-info {
    padding: 0.6rem;
  }
  
  .related-card-info h4 {
    font-size: 0.8rem;
  }
  
  .related-card-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
  
  /* Enhanced Loading Indicator Mobile Styles */
  .loading-indicator {
    padding: 1.5rem;
    min-width: 280px;
  }
  
  .spinner-enhanced {
    width: 70px;
    height: 70px;
  }
  
  #loading-title {
    font-size: 1.4rem;
  }
  
  #loading-subtitle {
    font-size: 0.8rem;
  }
  
  .loading-dots span {
    width: 5px;
    height: 5px;
  }
}

/* Add styles for the winnings table */
.winnings-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.winnings-table th, 
.winnings-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.winnings-table th {
  font-weight: 600;
  background-color: rgba(0, 0, 0, 0.2);
}

.winnings-table tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.05);
}

.winnings-table tr:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Custom symbol styling in winnings table */
.winnings-table .symbol.custom-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin: 0 2px;
}

.winnings-table .symbol-image {
  width: 12px;
  height: 12px;
  object-fit: contain;
  border-radius: 3px;
}

/* Promo codes row: wrapper for click/tap popover */
.promo-reward-info-wrap {
  position: relative;
}

/* Inline info next to ‡ PROMO CODES — tap opens popover; title still for hover (desktop) */
.promo-legend-info-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 0 4px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: rgba(244, 208, 63, 0.55);
  font-size: 0.85rem;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-width: 32px;
  min-height: 32px;
  box-sizing: border-box;
}

.promo-legend-info-popover {
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(244, 208, 63, 0.35);
  border-radius: 6px;
  z-index: 5;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.promo-legend-info-popover[hidden] {
  display: none !important;
}

.promo-legend-info-popover-inner {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
}

.promo-legend-info-popover-inner a,
#promo-message a {
  color: #7ec8ff;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(126, 200, 255, 0.25);
}

.promo-legend-info-popover-inner a:hover,
.promo-legend-info-popover-inner a:focus-visible,
#promo-message a:hover,
#promo-message a:focus-visible {
  color: #a8dcff;
  outline: none;
}

.promo-legend-info-inline:hover,
.promo-legend-info-inline:focus-visible {
  color: #f4d03f;
  outline: none;
}

.promo-legend-info-inline:focus-visible {
  box-shadow: 0 0 0 1px rgba(244, 208, 63, 0.45);
  border-radius: 50%;
}

/* 5×5 “find a symbol” — large target preview above the prize table */
.find-symbol-target-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
  margin: 0 0 1.15rem;
  padding: 0.85rem 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.find-symbol-target-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.find-symbol-target-frame {
  width: 120px;
  height: 120px;
  max-width: min(120px, 100%);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

.find-symbol-target-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.find-symbol-target-emoji {
  font-size: clamp(3rem, 14vw, 4.75rem);
  line-height: 1;
  display: block;
}

.find-symbol-target-hint {
  margin: 0;
  max-width: 26rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.58);
}

@media (max-width: 400px) {
  .find-symbol-target-frame {
    width: min(120px, 88vw);
    height: min(120px, 88vw);
  }
}

/* Power tile bonus info styling */
.power-tile-info {
  margin-top: 15px;
  padding: 12px 15px;
  background: linear-gradient(45deg, rgba(76, 175, 80, 0.1), rgba(139, 195, 74, 0.1));
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 8px;
  text-align: center;
}

.power-tile-info p {
  margin: 0;
  font-size: 0.9rem;
  color: #81c784;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.power-tile-info strong {
  color: #66bb6a;
  font-weight: 600;
}

/* Find the Symbol info styling */
.find-symbol-info {
  margin-top: 15px;
  padding: 12px 15px;
  background: linear-gradient(45deg, rgba(33, 150, 243, 0.1), rgba(63, 81, 181, 0.1));
  border: 1px solid rgba(33, 150, 243, 0.3);
  border-radius: 8px;
  backdrop-filter: blur(5px);
}

.find-symbol-info p {
  margin: 0 0 8px 0;
  font-size: 0.9rem;
  color: #64b5f6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.find-symbol-info p:last-child {
  margin-bottom: 0;
}

.find-symbol-info strong {
  color: #42a5f5;
  font-weight: 600;
}

/* Find Symbol Win Notification Display */
.find-symbol-display {
  text-align: center;
  margin: 15px 0;
  padding: 15px;
  background: linear-gradient(45deg, rgba(33, 150, 243, 0.1), rgba(63, 81, 181, 0.1));
  border: 1px solid rgba(33, 150, 243, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(5px);
}

.find-symbol-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
  min-height: 40px;
  align-items: center;
}

.target-symbol {
  font-size: 1.8rem;
  display: inline-block;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(33, 150, 243, 0.4);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: symbolGlow 1.5s ease-in-out infinite alternate;
}

.symbol-more {
  font-size: 1.5rem;
  color: #64b5f6;
  font-weight: bold;
  margin: 0 5px;
}

@keyframes symbolGlow {
  from {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 8px rgba(33, 150, 243, 0.3);
  }
  to {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 16px rgba(33, 150, 243, 0.6);
  }
}

/* Hash mapping table */
.hash-mapping-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.hash-mapping-table th, 
.hash-mapping-table td {
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hash-mapping-table th {
  font-weight: 600;
  background-color: rgba(0, 0, 0, 0.2);
}

.hash-mapping-table tr:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.symbol-mapping {
  margin-bottom: 10px;
}

/* Hash mapping inline style */
.hash-mapping-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 10px;
  background-color: rgba(0, 0, 0, 0.1);
  padding: 8px 12px;
  border-radius: 6px;
}

.mapping-item {
  font-size: 0.9rem;
  color: var(--text-color);
  white-space: nowrap;
}

.mapping-item:not(:last-child)::after {
  content: '•';
  margin-left: 10px;
  color: var(--text-secondary);
  opacity: 0.5;
}

/* Verification Mapping Styles */
.verify-mapping-section {
  margin-top: 15px;
  text-align: center;
}

.verify-mapping-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: none;
}

.verify-mapping-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-color);
  border-color: rgba(255, 255, 255, 0.3);
  transform: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.verify-mapping-btn:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

.verify-mapping-btn:disabled i {
  color: rgba(255, 255, 255, 0.4);
}

/* Verification Modal Styles */
.verification-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.verification-modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  margin: 2% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid #334155;
  color: #f1f5f9;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.verification-modal-header {
  background: var(--card-bg);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding: 20px 25px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.verification-modal-header h3 {
  margin: 0;
  color: var(--text-color);
  font-size: 20px;
  font-weight: 600;
}

.verification-modal-close {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.verification-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-color);
  border-color: rgba(255, 255, 255, 0.3);
  transform: none;
}

.verification-modal-body {
  padding: 25px;
}

.verification-step {
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.verification-step:last-child {
  margin-bottom: 0;
}

.verification-step h4 {
  margin: 0 0 15px 0;
  color: #e2e8f0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.verification-step h4::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin-right: 10px;
  border-radius: 2px;
}

/* Hash Display */
.hash-display {
  background-color: #0f172a;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #334155;
  overflow: hidden;
}

.hash-display a {
  background: rgba(15, 23, 42, 0.8);
  color: #67d6ed;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) rgba(255, 255, 255, 0.06);
  min-height: 24px;
  line-height: 1.4;
  display: block;
  word-spacing: 2px;
  letter-spacing: 0.5px;
  box-sizing: border-box;
  text-decoration: none;
  transition: all 0.2s ease;
}

.hash-display a:hover {
  color: #38bdf8;
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(56, 189, 248, 0.4);
  transform: none;
}

.hash-display a::-webkit-scrollbar {
  height: 6px;
}

.hash-display a::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
}

.hash-display a::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

.hash-display a::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Mapping Explanation */
.mapping-explanation {
  margin-bottom: 15px;
}

.mapping-explanation p {
  margin: 0;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.5;
}

/* Hash Breakdown */
.hash-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.hash-pair {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  transition: all 0.2s ease;
}

.hash-pair:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  background: rgba(255, 255, 255, 0.12);
}

.hash-pair-label {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 5px;
  font-weight: 500;
}

.hash-pair-value {
  font-size: 16px;
  font-weight: bold;
  color: #e2e8f0;
  margin-bottom: 5px;
}

.hash-pair-symbol {
  font-size: 20px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.hash-pair-symbol.custom-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hash-pair-symbol .symbol-image {
  width: 12px;
  height: 12px;
  object-fit: contain;
}

/* Symbol Ranges */
.symbol-ranges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.symbol-range {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  transition: all 0.2s ease;
}

.symbol-range:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.symbol-range-symbol {
  font-size: 24px;
  margin-bottom: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  color: #f1f5f9;
}

.symbol-range-symbol.custom-symbol .symbol-image {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.symbol-range-description {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 5px;
  font-weight: 500;
}

.symbol-range-hex {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: #667eea;
}

.symbol-range-probability {
  color: #34d399;
  font-weight: 600;
  margin-top: 8px;
}

/* Grid Result */
.grid-result {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 300px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.08);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.grid-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  color: #f1f5f9;
}

.grid-cell:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #667eea;
  transform: scale(1.05);
}

.grid-result .grid-cell.custom-symbol .symbol-image,
.grid-cell.custom-symbol .symbol-image {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  object-fit: contain;
}

/* Remove default background for 5x5_find_symbol grid cells */
.grid-result[data-grid-type="5x5_find_symbol"] .grid-cell,
.grid-result[data-grid-type="5x5_find_cluster"] .grid-cell {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
}

.grid-result[data-grid-type="5x5_find_symbol"] .grid-cell:hover,
.grid-result[data-grid-type="5x5_find_cluster"] .grid-cell:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: #667eea !important;
  box-shadow: none !important;
}

/* Specifically override center cell for 5x5_find_symbol */
.grid-result[data-grid-type="5x5_find_symbol"].grid-5x5 .grid-cell:nth-child(13),
.grid-result[data-grid-type="5x5_find_cluster"].grid-5x5 .grid-cell:nth-child(13) {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
}

.grid-result[data-grid-type="5x5_find_symbol"].grid-5x5 .grid-cell:nth-child(13):hover,
.grid-result[data-grid-type="5x5_find_cluster"].grid-5x5 .grid-cell:nth-child(13):hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: #667eea !important;
  box-shadow: none !important;
}

/* Special styling for center position in 5x5 grid (power tile position) - only for power tile grids */
.grid-result.grid-5x5[data-grid-type="5x5"] .grid-cell:nth-child(13) {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 193, 7, 0.1));
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.2);
}

.grid-result.grid-5x5[data-grid-type="5x5"] .grid-cell:nth-child(13):hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 193, 7, 0.15));
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.verification-modal-footer {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px 25px;
  border-radius: 0 0 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.verification-note {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.verification-note i {
  color: #667eea;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .verification-modal-content {
    width: 95%;
    margin: 5% auto;
    max-height: 85vh;
  }
  
  .verification-modal-header,
  .verification-modal-body,
  .verification-modal-footer {
    padding: 15px 20px;
  }
  
  .verification-modal-header h3 {
    font-size: 18px;
  }
  
  .verification-step {
    padding: 15px;
    margin-bottom: 20px;
  }
  
  .verification-step h4 {
    font-size: 15px;
  }
  
  .hash-display {
    padding: 12px;
    gap: 8px;
    flex-direction: column;
  }
  
  .hash-display code {
    font-size: 13px;
    padding: 12px;
  }
  
  .copy-btn {
    align-self: center;
    min-width: 80px;
  }
  
  .hash-breakdown {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
  }
  
  .hash-pair {
    padding: 8px;
  }
  
  .hash-pair-value {
    font-size: 14px;
  }
  
  .hash-pair-symbol {
    font-size: 16px;
    padding: 6px;
  }
  
  .symbol-ranges {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .symbol-range {
    padding: 12px;
  }
  
  .symbol-range-symbol {
    font-size: 20px;
    min-height: 40px;
    padding: 8px;
  }
  
  .grid-result {
    max-width: 250px;
    padding: 15px;
    gap: 8px;
  }
  
  .grid-cell {
    font-size: 16px;
  }
  
  .verification-note {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .verification-modal-content {
    width: 98%;
    margin: 2% auto;
    border-radius: 8px;
  }
  
  .verification-modal-header {
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
  }
  
  .verification-modal-header h3 {
    font-size: 16px;
  }
  
  .verification-modal-close {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
  
  .verification-modal-body {
    padding: 15px;
  }
  
  .verification-step {
    padding: 12px;
    margin-bottom: 15px;
  }
  
  .verification-step h4 {
    font-size: 14px;
    margin-bottom: 10px;
  }
  
  .hash-display {
    padding: 10px;
  }
  
  .hash-display code {
    font-size: 11px;
    padding: 6px;
  }
  
  .hash-breakdown {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  
  .hash-pair {
    padding: 6px;
  }
  
  .hash-pair-label {
    font-size: 10px;
  }
  
  .hash-pair-value {
    font-size: 12px;
  }
  
  .hash-pair-symbol {
    font-size: 14px;
    padding: 4px;
  }
  
  .grid-result {
    max-width: 200px;
    padding: 12px;
    gap: 6px;
  }
  
  .grid-cell {
    font-size: 14px;
  }
  
  .verification-modal-footer {
    padding: 12px 15px;
  }
}

/* ===================================
   MODERN CARD HERO SECTION
   =================================== */

.card-hero-modern {
  background: #0a0a0b;
  padding: 3.15rem 0 1.75rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.card-hero-modern::before {
  content: none;
}

.card-details-modern {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.card-title-gradient {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  background: none;
  -webkit-text-fill-color: #f5f5f5;
  color: #f5f5f5;
  animation: none;
  line-height: 1.15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.card-title-gradient i {
  font-size: 1.2rem;
  background: none;
  -webkit-text-fill-color: #e8c047;
  color: #e8c047;
  animation: none;
}

.card-title-name {
  position: relative;
  background: none;
  -webkit-text-fill-color: #f5f5f5;
  color: #f5f5f5;
  animation: none;
}

.card-title-gradient .lht-level-label {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: #c5ced8;
  color: #c5ced8;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  animation: none;
}

@media (min-width: 901px) {
  .card-title-gradient .fa-sparkles,
  .card-title-gradient .lht-level-label {
    position: absolute;
    top: 50%;
    white-space: nowrap;
  }

  .card-title-gradient .fa-sparkles {
    right: calc(100% + 0.5rem);
    margin-top: -1rem;
  }

  .card-title-gradient .lht-level-label {
    left: calc(100% + 0.65rem);
    transform: translateY(-50%);
  }
}

.card-description-modern {
  color: #a3a3a6;
  font-size: 0.95rem;
  max-width: 40rem;
  margin: 0 auto 1.75rem auto;
  line-height: 1.45;
  opacity: 1;
}

.card-marketing-message {
  max-width: 600px;
  margin: 0 auto 0.85rem auto;
}

.card-marketing-message p {
  color: #e8f4f8;
  font-size: 1rem;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  border-left: 3px solid rgba(0, 212, 255, 0.6);
  margin: 0;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-marketing-message a {
  color: #00d4ff;
  text-decoration: underline;
  font-weight: 600;
  transition: all 0.3s ease;
}

.card-marketing-message a:hover {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.9;
}

.card-price-modern {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
}

.price-value {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.price-value:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.free-badge-modern {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.free-badge-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

@keyframes gradientFloat {
  0%, 100% { 
    background-position: 0% 50%; 
  }
  50% { 
    background-position: 100% 50%; 
  }
}

@keyframes sparkle {
  0% { 
    transform: rotate(0deg) scale(1);
    opacity: 0.8;
  }
  100% { 
    transform: rotate(10deg) scale(1.1);
    opacity: 1;
  }
}

/* Responsive Design for Modern Hero */
@media (max-width: 768px) {
  .card-hero-modern {
    padding: 2rem 0;
  }

  .card-title-gradient {
    font-size: 2rem;
  }

  .card-title-gradient i {
    font-size: 1.8rem;
  }

  .card-description-modern {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .card-marketing-message {
    padding: 0 1rem;
  }
  
  .card-marketing-message p {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }
}

@media (max-width: 480px) {
  .card-title-gradient {
    font-size: 1.8rem;
  }

  .price-value,
  .free-badge-modern {
    font-size: 1.2rem;
  }
}

/* Phone header: title, a full-width description, then the Slots-style link pill.
   The marketing copy stays behind the info button. */
.card-marketing-compact {
  display: none;
}

.scratch-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.card-project-links__bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  min-height: 34px;
  padding: 3px 4px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.card-project-links__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 28px;
  min-width: 0;
  padding: 0 0.65rem;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

body a.card-project-links__btn:link,
body a.card-project-links__btn:visited,
body a.card-project-links__btn:hover,
body a.card-project-links__btn:active,
body a.card-project-links__btn:focus-visible,
button.card-project-links__btn {
  color: rgba(210, 214, 224, 0.82);
  text-decoration: none;
}

.card-project-links__btn i,
.card-project-links__btn .card-project-links__icon-x {
  font-size: 0.78rem;
  color: rgba(190, 196, 210, 0.7);
}

.card-project-links__btn .fas {
  font-weight: 900;
}

.card-project-links__btn .fab {
  font-weight: 400;
}

.card-project-links__icon-x {
  width: 0.78rem;
  height: 0.78rem;
  flex-shrink: 0;
  fill: currentColor;
  display: block;
}

button.card-project-links__btn {
  width: 32px;
  padding: 0;
  justify-content: center;
}

button.card-project-links__btn[aria-expanded="true"],
body a.card-project-links__btn:hover,
body a.card-project-links__btn:focus-visible,
button.card-project-links__btn:hover,
button.card-project-links__btn:focus-visible {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  outline: none;
}

.card-marketing-modal {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.card-marketing-modal[hidden] {
  display: none !important;
}

.card-marketing-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.card-marketing-modal__panel {
  position: relative;
  width: min(440px, 100%);
  max-height: min(70vh, 520px);
  overflow: auto;
  background: #14161c;
  border: 1px solid rgba(230, 201, 122, 0.35);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.card-marketing-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.card-marketing-modal__header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: #e6c97a;
}

.card-marketing-modal__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.card-marketing-modal__body {
  padding: 0.95rem 1rem 1.1rem;
}

.card-marketing-modal__body p {
  margin: 0;
  color: #e8f4f8;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: left;
}

.card-marketing-modal__body a {
  color: #e6c97a;
}

.scratch-buy-cover,
.scratch-mobile-purchase,
.card-marketing-info,
.scratch-row-chevron {
  display: none;
}

.card-project-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.95rem;
  margin: 0 auto 0.85rem;
}

body a.card-project-links__link:link,
body a.card-project-links__link:visited,
body a.card-project-links__link:hover,
body a.card-project-links__link:active {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(210, 214, 224, 0.78);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.card-project-links__link i,
.card-project-links__icon-x {
  color: rgba(190, 196, 210, 0.72);
  font-size: 0.85rem;
}

.card-project-links__link .fas { font-weight: 900; }
.card-project-links__link .fab { font-weight: 400; }

.card-project-links__icon-x {
  width: 0.9rem;
  height: 0.9rem;
  fill: currentColor;
  display: block;
}

.card-marketing-info {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #e6c97a;
  background: transparent;
  color: #e6c97a;
  cursor: pointer;
}

.card-marketing-info[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
  .card-hero-modern {
    padding: 1.05rem 0 0.2rem;
    text-align: left;
  }

  .card-hero-modern .container {
    width: 100%;
    max-width: none;
    padding: 0 12px;
  }

  .card-details-modern {
    max-width: none;
    padding: 0;
  }

  .card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
  }

  .card-title-gradient {
    justify-content: flex-start;
    text-align: left;
    font-size: 1.45rem;
    margin: 0;
    gap: 0.35rem;
    flex: 1 1 auto;
  }

  .card-title-gradient .fa-sparkles {
    display: none;
  }

  .card-title-gradient .lht-level-label {
    flex: 0 0 auto;
    align-self: center;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    background: none;
    -webkit-text-fill-color: rgba(197, 206, 216, 0.82);
    color: rgba(197, 206, 216, 0.82);
  }

  .card-marketing-info {
    display: inline-flex;
    margin-top: 0.15rem;
  }

  .card-description-modern {
    max-width: none;
    width: 100%;
    margin: 0.28rem 0 0.2rem;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.35;
    text-align: left;
  }

  .card-project-links {
    justify-content: flex-start;
    margin: 0 0 0.15rem;
  }

  .card-project-links__link,
  body a.card-project-links__link:link,
  body a.card-project-links__link:visited {
    font-size: 0.78rem;
  }

  .card-marketing-message {
    display: none;
  }

  .scratch-play-column {
    padding-left: 12px;
    padding-right: 12px;
  }

  main {
    padding-top: 0.35rem;
  }

  .scratch-page:not(.is-playing) {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    position: relative;
    width: 100%;
  }

  .scratch-page:not(.is-playing) .scratch-buy-cover {
    display: block;
    order: 1;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #12141a;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  }

  .scratch-page:not(.is-playing) .scratch-buy-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .scratch-page:not(.is-playing) .scratch-mobile-purchase {
    display: block;
    order: 2;
    width: 100%;
  }

  .scratch-page:not(.is-playing) .scratch-mobile-purchase:empty {
    display: none !important;
  }

  .scratch-page:not(.is-playing) .scratch-container-wrapper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    visibility: hidden;
    pointer-events: none;
  }

  .scratch-page:not(.is-playing):has(#scratch-vip-overlay) .scratch-container-wrapper,
  .scratch-page:not(.is-playing):has(#play-schedule-disabled-overlay) .scratch-container-wrapper,
  .scratch-page:not(.is-playing):has(#free-card-wallet-overlay:not([style*="display: none"])) .scratch-container-wrapper {
    position: relative;
    visibility: visible;
    pointer-events: auto;
    order: 1;
    aspect-ratio: 16 / 9;
  }

  .scratch-page:not(.is-playing):has(#scratch-vip-overlay) .scratch-buy-cover,
  .scratch-page:not(.is-playing):has(#play-schedule-disabled-overlay) .scratch-buy-cover,
  .scratch-page:not(.is-playing):has(#free-card-wallet-overlay:not([style*="display: none"])) .scratch-buy-cover {
    display: none;
  }

  .scratch-page:not(.is-playing) .scratch-session-actions,
  .scratch-page:not(.is-playing) .action-buttons,
  .scratch-page:not(.is-playing) .scratch-legend-row,
  .scratch-page:not(.is-playing) .symbol-legend {
    display: contents;
  }

  .scratch-page:not(.is-playing) #scratch-buy-home,
  .scratch-page:not(.is-playing) #play-free-card-btn {
    order: 3;
    width: 100%;
  }

  .scratch-page:not(.is-playing) #buy-now-btn,
  .scratch-page:not(.is-playing) #play-free-card-btn {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    justify-content: center;
  }

  .scratch-page:not(.is-playing) .legend-header,
  .scratch-page:not(.is-playing) .btn-back {
    order: 4;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 0 0.95rem;
    border-radius: 12px;
    grid-column: auto;
  }

  .scratch-page:not(.is-playing) .btn-back {
    order: 5;
  }

  .scratch-page:not(.is-playing) .legend-header h3 {
    margin: 0;
    text-align: left;
    font-size: 0.95rem;
  }

  .scratch-page:not(.is-playing) .scratch-row-chevron {
    display: inline-block;
    margin-left: auto;
    font-size: 0.72rem;
    opacity: 0.55;
  }
}

/* The locked message has to fit inside the 16:9 art on narrow phones. */
@media (max-width: 480px) {
  .scratch-page #scratch-vip-overlay .payment-required-message {
    max-width: calc(100% - 20px);
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .scratch-page #scratch-vip-overlay .payment-required-message p {
    margin: 0.25rem 0 0;
    font-size: inherit;
    line-height: inherit;
  }
}

.scratch-mobile-purchase .scratch-purchase-stack {
  width: 100%;
  max-width: none;
  align-items: stretch;
}

.scratch-mobile-purchase .payment-required-message {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.95rem 0.2rem 0.85rem;
  background: #14161c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: none;
  text-align: left;
  backdrop-filter: none;
}

.scratch-mobile-purchase .payment-required-message:hover {
  transform: none;
  background: #14161c;
  box-shadow: none;
}

.scratch-mobile-purchase .payment-required-message > span {
  display: none;
}

.scratch-mobile-purchase .token-cost,
.scratch-mobile-purchase .total-cost {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--scratch-token-color, #f2d48a);
  line-height: 1.15;
}

.scratch-mobile-purchase .token-cost-ticker,
.scratch-mobile-purchase .total-cost-token {
  display: block;
  margin-top: 0.22rem;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-shadow: none;
}

.scratch-mobile-purchase .payment-required-message .token-cost[class*="-price"],
.scratch-mobile-purchase .payment-required-message .token-cost[class*="-price"] #unit-price {
  color: var(--text-secondary) !important;
}

.scratch-mobile-purchase .token-cost {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  animation: none;
  padding: 0 0.85rem 0.15rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.scratch-mobile-purchase .total-cost {
  grid-column: 2;
  grid-row: 1;
  align-items: center;
  margin: 0;
  padding: 0 0.85rem 0.15rem;
  text-align: center;
}

.scratch-mobile-purchase .total-cost-label {
  display: none;
}

.scratch-mobile-purchase .token-cost::before,
.scratch-mobile-purchase .total-cost::before {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.46);
}

.scratch-mobile-purchase .token-cost::before { content: "Price per card"; }
.scratch-mobile-purchase .total-cost::before { content: "Total"; }

.scratch-mobile-purchase .scratch-quantity-selector {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  margin: 0.75rem 0 0;
  padding: 0 0.85rem;
  text-align: left;
}

.scratch-mobile-purchase .scratch-quantity-selector label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.46);
}

.scratch-mobile-purchase .quantity-controls-hybrid {
  justify-content: stretch;
  width: 100%;
}

.scratch-mobile-purchase .quantity-pill {
  flex: 1 1 0;
  background: #1a1d24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.scratch-mobile-purchase .quantity-pill:hover {
  transform: none;
}

.scratch-mobile-purchase .quantity-pill.active {
  background: #14161c;
  border-color: var(--scratch-token-color, #e6c35c);
  color: var(--scratch-token-color, #f2d48a);
  box-shadow: none;
}

.scratch-mobile-purchase #scratch-purchase-buy-slot {
  display: none;
}

/* Legacy card-hero cleanup - ensure no conflicts */
.card-hero {
  display: none;
}

/* ===================================
   SCRATCH GESTURE HINT
   First-time user guidance animation
   =================================== */

.scratch-gesture-hint {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50; /* Below payment overlay (100) but above canvas */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none; /* Don't block scratching */
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  animation: hintFadeIn 0.4s ease-out;
}

.scratch-gesture-hint.hidden {
  animation: hintFadeOut 0.3s ease-out forwards;
}

/* Gesture icon container */
.gesture-icon-container {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 1.5rem;
}

/* Hand icon for mobile */
.gesture-hand {
  font-size: 5rem;
  position: absolute;
  top: 30px;
  left: 30px;
  animation: handDrag 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

/* Cursor icon for desktop */
.gesture-cursor {
  font-size: 4rem;
  position: absolute;
  top: 30px;
  left: 30px;
  animation: cursorDrag 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
  transform: rotate(-45deg);
}

/* Hint text */
.gesture-hint-text {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.8);
  letter-spacing: 1px;
  animation: textPulse 2s ease-in-out infinite;
  text-transform: uppercase;
}

/* Animations */
@keyframes hintFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes hintFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes handDrag {
  0% {
    transform: translate(-75px, 0) scale(1);
    opacity: 0.95;
  }
  25% {
    transform: translate(75px, 0) scale(1.05);
    opacity: 1;
  }
  50% {
    transform: translate(-75px, 22px) scale(1);
    opacity: 0.95;
  }
  75% {
    transform: translate(75px, 22px) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translate(-75px, 0) scale(1);
    opacity: 0.95;
  }
}

@keyframes cursorDrag {
  0% {
    transform: translate(-75px, 0) rotate(-45deg) scale(1);
    opacity: 0.95;
  }
  25% {
    transform: translate(75px, 0) rotate(-45deg) scale(1.05);
    opacity: 1;
  }
  50% {
    transform: translate(-75px, 22px) rotate(-45deg) scale(1);
    opacity: 0.95;
  }
  75% {
    transform: translate(75px, 22px) rotate(-45deg) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translate(-75px, 0) rotate(-45deg) scale(1);
    opacity: 0.95;
  }
}

@keyframes textPulse {
  0%, 100% {
    opacity: 0.9;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .gesture-icon-container {
    width: 150px;
    height: 150px;
  }
  
  .gesture-hand {
    font-size: 4rem;
    top: 25px;
    left: 25px;
  }
  
  .gesture-hint-text {
    font-size: 1.3rem;
  }
  
  @keyframes handDrag {
    0% {
      transform: translate(-60px, 0) scale(1);
      opacity: 0.95;
    }
    25% {
      transform: translate(60px, 0) scale(1.05);
      opacity: 1;
    }
    50% {
      transform: translate(-60px, 18px) scale(1);
      opacity: 0.95;
    }
    75% {
      transform: translate(60px, 18px) scale(1.05);
      opacity: 1;
    }
    100% {
      transform: translate(-60px, 0) scale(1);
      opacity: 0.95;
    }
  }
}

@media (max-width: 480px) {
  .gesture-icon-container {
    width: 120px;
    height: 120px;
  }
  
  .gesture-hand {
    font-size: 3.5rem;
    top: 20px;
    left: 20px;
  }
  
  .gesture-hint-text {
    font-size: 1.1rem;
  }
  
  @keyframes handDrag {
    0% {
      transform: translate(-45px, 0) scale(1);
      opacity: 0.95;
    }
    25% {
      transform: translate(45px, 0) scale(1.05);
      opacity: 1;
    }
    50% {
      transform: translate(-45px, 14px) scale(1);
      opacity: 0.95;
    }
    75% {
      transform: translate(45px, 14px) scale(1.05);
      opacity: 1;
    }
    100% {
      transform: translate(-45px, 0) scale(1);
      opacity: 0.95;
    }
  }
} 