* { box-sizing: border-box; margin: 0; padding: 0; }
button, a { touch-action: manipulation; } /* removes 300ms tap delay on mobile */

body {
  font-family: 'Courier New', monospace;
  background: #000;
  color: #f0f0f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 60px;
  overflow-x: hidden;
}

.bg-texture {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,107,107,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(78,205,196,0.07) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 700px;
}

/* ── Animations ── */
@keyframes flicker {
  0%,19%,21%,23%,25%,54%,56%,100% { opacity: 1; }
  20%,24%,55% { opacity: 0.7; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ballPulse {
  0%,100% { box-shadow: 0 0 30px rgba(255,107,107,0.6), 0 0 60px rgba(255,107,107,0.3); }
  50%      { box-shadow: 0 0 50px rgba(255,107,107,0.9), 0 0 80px rgba(255,107,107,0.5); }
}
@keyframes shine {
  from { left: -100%; }
  to   { left: 200%; }
}
@keyframes calledPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,107,107,0.7); }
  70%  { box-shadow: 0 0 0 6px rgba(255,107,107,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,107,107,0); }
}

/* Settle pulse when the roller lands on the thumb */
@keyframes thumbSettle {
  0%   { transform: scale(1.3);  box-shadow: 0 0 28px rgba(255,215,0,1); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1.18); box-shadow: 0 0 16px rgba(255,215,0,0.8), 0 0 32px rgba(255,215,0,0.4); }
}

/* Card cell flip when marked */
@keyframes cellFlip {
  0%   { transform: rotateY(90deg) scale(0.8); opacity: 0; }
  60%  { transform: rotateY(-8deg) scale(1.05); opacity: 1; }
  100% { transform: rotateY(0deg)  scale(1);    opacity: 1; }
}

/* ── Header ── */
h1 {
  font-size: 3rem;
  font-weight: 900;
  color: #ff6b6b;
  text-shadow: 0 0 10px rgba(255,107,107,0.8), 0 0 30px rgba(255,107,107,0.5), 0 0 60px rgba(255,107,107,0.3);
  letter-spacing: 4px;
  text-transform: uppercase;
  animation: flicker 12s infinite;
  margin-bottom: 4px;
}

.tagline {
  font-size: 0.75rem;
  color: #4ecdc4;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 20px;
  font-style: italic;
}

/* ── Ticker ── */
/* ── Bingo Wallet ────────────────────────────────────────────────────────────── */
.bingo-wallet-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.bingo-wallet-label {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ffd700;
  text-transform: uppercase;
}

.bingo-wallet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.bingo-wallet-address {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: #f0f0f0;
  word-break: break-all;
  text-align: center;
}

.bingo-wallet-copy {
  background: rgba(255,215,0,0.15);
  color: #ffd700;
  border: 1px solid #ffd700;
  border-radius: 5px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.2s, box-shadow 0.2s;
  touch-action: manipulation;
}

.bingo-wallet-copy:hover { background: rgba(255,215,0,0.28); box-shadow: 0 0 10px rgba(255,215,0,0.4); }

.card-price-badge {
  background: rgba(255,215,0,0.12);
  color: #ffd700;
  border: 1px solid rgba(255,215,0,0.5);
  border-radius: 5px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 900;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  white-space: nowrap;
}

.ticker-wrap {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid #1f1f1f;
  border-top: 2px solid #ff6b6b;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 22px;
}

.ticker-label {
  font-size: 0.65rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

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

/* Image thumbnails in the ticker */
.ticker-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #222;
  flex-shrink: 0;
  transition: transform 0.2s;
  position: relative;
  background: #111;
}

.ticker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ticker-letter {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 900;
  font-family: 'Courier New', monospace;
  line-height: 1.4;
  color: #fff;
  text-shadow:
    1px  1px 0 #cc0000,
   -1px -1px 0 #cc0000,
    1px -1px 0 #cc0000,
   -1px  1px 0 #cc0000;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  pointer-events: none;
  user-select: none;
}

.ticker-thumb.newest {
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255,215,0,0.8), 0 0 32px rgba(255,215,0,0.4);
  transform: scale(1.18);
  /* settle animation is triggered via JS after the roller lands */
}

.ticker-empty { font-size: 0.85rem; color: #444; font-style: italic; }

/* ── How to Play button ── */
.how-to-play-btn {
  background: transparent;
  color: #aaa;
  border: 1px solid #333;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 14px;
  cursor: pointer;
  margin-bottom: 18px;
  transition: color 0.2s, border-color 0.2s;
  touch-action: manipulation;
}

.how-to-play-btn:hover { color: #fff; border-color: #666; }

/* ── How to Play Modal ── */
.htp-modal {
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px 26px 32px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.htp-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #1c1c1c;
}

.htp-section:first-of-type { margin-top: 14px; }

.htp-heading {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ff6b6b;
  margin-bottom: 8px;
}

.htp-section p {
  font-size: 0.88rem;
  color: #ccc;
  line-height: 1.6;
  font-weight: 400;
}

.htp-section p strong { color: #fff; font-weight: 700; }

.htp-special {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.htp-special:last-child { margin-bottom: 0; }

.htp-tag {
  flex-shrink: 0;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

.punch-tag { background: rgba(255,107,107,0.15); color: #ff6b6b; border: 1px solid rgba(255,107,107,0.4); }
.tyler-tag { background: rgba(200,80,255,0.12);  color: #cc66ff; border: 1px solid rgba(200,80,255,0.35); }
.gold-tag  { background: rgba(255,215,0,0.12);   color: #ffd700; border: 1px solid rgba(255,215,0,0.4);  }

.htp-special p {
  margin: 0;
  font-size: 0.85rem;
  color: #bbb;
  line-height: 1.55;
  font-weight: 400;
}

.htp-special p strong { color: #fff; font-weight: 700; }

/* ── Give Me a Card button ── */
.give-card-btn {
  cursor: pointer;
  background: linear-gradient(45deg, #ff5252, #cc0000);
  color: #fff;
  border: 2px solid #ff6b6b;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 15px 38px;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(255,107,107,0.5);
  transition: box-shadow 0.2s, transform 0.1s;
  margin-bottom: 28px;
}

.give-card-btn:hover { box-shadow: 0 0 35px rgba(255,107,107,0.8); }
.give-card-btn:active { transform: scale(0.96); }

.cards-closed-notice {
  width: 100%;
  background: rgba(255,107,107,0.06);
  border: 1px solid rgba(255,107,107,0.3);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #ff6b6b;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

/* ── Player card list ── */
.section-label {
  width: 100%;
  font-size: 0.65rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 12px;
  border-bottom: 1px solid #111;
  padding-bottom: 8px;
}

.player-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.03);
  border: 1px solid #1a1a1a;
  border-radius: 6px;
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  animation: fadeIn 0.3s ease;
}

.player-row:hover {
  border-color: #ff6b6b;
  background: rgba(255,107,107,0.07);
  box-shadow: 0 0 14px rgba(255,107,107,0.2);
}

.player-row .pname {
  font-size: 1rem;
  font-weight: 700;
  color: #f0f0f0;
  letter-spacing: 1px;
}

.player-row .pview {
  font-size: 0.7rem;
  color: #ff6b6b;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.no-players {
  width: 100%;
  text-align: center;
  color: #333;
  font-style: italic;
  font-size: 0.9rem;
  padding: 20px 0;
}

/* ── Pending notice ── */
.pending-notice {
  width: 100%;
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #ffd700;
  margin-bottom: 12px;
  display: none;
  animation: fadeIn 0.3s ease;
}

/* ════════════════════════════════
   MODAL — Give Me a Card
════════════════════════════════ */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.overlay.active { display: flex; }

.modal {
  background: #0a0a0a;
  border: 2px solid #ff6b6b;
  border-radius: 10px;
  padding: 32px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 0 50px rgba(255,107,107,0.4);
  animation: slideUp 0.25s ease;
  position: relative;
}

.modal h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: #ff6b6b;
  text-shadow: 0 0 12px rgba(255,107,107,0.6);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.modal .modal-sub {
  font-size: 0.75rem;
  color: #555;
  letter-spacing: 1px;
  margin-bottom: 24px;
}

.modal label {
  display: block;
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.modal input {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  border-radius: 5px;
  color: #f0f0f0;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  padding: 11px 14px;
  margin-bottom: 18px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal input:focus {
  border-color: #ff6b6b;
  box-shadow: 0 0 10px rgba(255,107,107,0.35);
}

.modal input::placeholder { color: #333; }

.modal-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-submit {
  flex: 1;
  cursor: pointer;
  background: linear-gradient(45deg, #ff5252, #cc0000);
  color: #fff;
  border: 2px solid #ff6b6b;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 0 16px rgba(255,107,107,0.4);
  transition: box-shadow 0.2s, transform 0.1s;
}

.btn-submit:hover { box-shadow: 0 0 28px rgba(255,107,107,0.7); }
.btn-submit:active { transform: scale(0.96); }

.btn-cancel {
  cursor: pointer;
  background: transparent;
  color: #555;
  border: 1px solid #222;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.2s, border-color 0.2s;
}

.btn-cancel:hover { color: #888; border-color: #444; }

.modal .close-x {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: #444;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal .close-x:hover { color: #ff6b6b; }

.modal-error {
  color: #ff6b6b;
  font-size: 0.75rem;
  margin-top: -12px;
  margin-bottom: 12px;
  display: none;
}

/* ════════════════════════════════
   MODAL — Card Viewer
════════════════════════════════ */
.card-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card-overlay.active { display: flex; }

.card-modal {
  background: #0a0a0a;
  border: 2px solid #ff6b6b;
  border-radius: 10px;
  padding: 24px 20px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 0 50px rgba(255,107,107,0.4);
  animation: slideUp 0.25s ease;
  position: relative;
}

.card-modal.tyler-mode {
  overflow: visible;
}

/* Tyler rare event: portrait strip on the right of the card */
.tyler-side-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40%;
  max-width: 200px;
  z-index: 6;
  pointer-events: none;
  border-radius: 0 8px 8px 0;
  overflow: hidden;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.65);
}

.tyler-side-overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.cell.tyler-free-cell {
  padding: 3px;
  background: rgba(0, 0, 0, 0.45);
}

.tyler-hurry-btn {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 2px solid rgba(255, 60, 100, 0.65);
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-weight: 900;
  font-size: clamp(0.72rem, 4vw, 1.05rem);
  line-height: 1.28;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(180deg, #2a0810 0%, #080404 100%);
  touch-action: manipulation;
  animation: tylerHurryGlow 1.15s ease-in-out infinite;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: 4px 2px;
}

.tyler-hurry-btn:hover:not(:disabled) {
  filter: brightness(1.12);
}

.tyler-hurry-btn:disabled {
  cursor: default;
}

@keyframes tylerHurryGlow {
  0%, 100% {
    text-shadow:
      0 0 6px #ff4477,
      0 0 14px #ff0044,
      0 0 26px rgba(255, 0, 90, 0.85);
    box-shadow:
      inset 0 0 12px rgba(255, 40, 90, 0.45),
      0 0 10px rgba(255, 0, 60, 0.45);
  }
  50% {
    text-shadow:
      0 0 10px #ff88aa,
      0 0 22px #ff3366,
      0 0 38px rgba(255, 120, 160, 0.95);
    box-shadow:
      inset 0 0 18px rgba(255, 70, 120, 0.55),
      0 0 18px rgba(255, 60, 100, 0.6);
  }
}

/* Punch impact — whole card frame flashes (JS adds .punch-card-hit per hit) */
@keyframes punchModalOutlineHit {
  0% {
    border-color: #ffffff;
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, 1),
      0 0 28px rgba(255, 255, 255, 0.95),
      0 0 56px rgba(255, 60, 60, 1),
      0 0 110px rgba(255, 0, 0, 0.55),
      inset 0 0 22px rgba(255, 200, 200, 0.2);
    filter: brightness(1.2) contrast(1.08);
  }
  28% {
    border-color: #ff2222;
    box-shadow:
      0 0 0 8px rgba(255, 120, 120, 0.85),
      0 0 48px rgba(255, 0, 0, 1),
      0 0 96px rgba(255, 80, 0, 0.65);
    filter: brightness(1.35);
  }
  55% {
    border-color: #ff6b6b;
    box-shadow:
      0 0 0 4px rgba(255, 200, 200, 0.6),
      0 0 36px rgba(255, 50, 50, 0.85);
    filter: brightness(1.1);
  }
  100% {
    border-color: #ff6b6b;
    box-shadow: 0 0 50px rgba(255, 107, 107, 0.4);
    filter: none;
  }
}

@keyframes punchModalOutlineHitGold {
  0% {
    border-color: #fff8e0;
    box-shadow:
      0 0 0 4px rgba(255, 248, 200, 1),
      0 0 40px rgba(255, 215, 0, 1),
      0 0 90px rgba(255, 80, 40, 0.75),
      inset 0 0 24px rgba(255, 230, 150, 0.35);
    filter: brightness(1.25);
  }
  35% {
    border-color: #ff3333;
    box-shadow:
      0 0 0 8px rgba(255, 100, 100, 0.9),
      0 0 56px rgba(255, 0, 0, 1);
    filter: brightness(1.3);
  }
  100% {
    border-color: #ffd700;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.5), inset 0 0 10px rgba(255, 215, 0, 0.05);
    filter: none;
  }
}

.card-modal.punch-card-hit:not(.gold-active) {
  animation: punchModalOutlineHit 0.68s cubic-bezier(0.25, 0.85, 0.2, 1) forwards !important;
}

.card-modal.gold-active.punch-card-hit {
  animation: punchModalOutlineHitGold 0.68s cubic-bezier(0.25, 0.85, 0.2, 1) forwards !important;
}

@keyframes punchChOutlineHit {
  0% {
    border-color: #ffffff;
    box-shadow:
      0 0 14px rgba(255, 255, 255, 1),
      inset 0 0 10px rgba(255, 240, 200, 0.45);
    filter: brightness(1.4);
  }
  40% {
    border-color: #ff0000;
    box-shadow: 0 0 22px rgba(255, 0, 0, 1), inset 0 0 8px rgba(255, 100, 100, 0.5);
    filter: brightness(1.25);
  }
  100% {
    border-color: #ffffff;
    box-shadow: none;
    filter: none;
  }
}

.card-modal.punch-card-hit .ch-cell {
  animation: punchChOutlineHit 0.68s cubic-bezier(0.3, 0.8, 0.2, 1) forwards;
}

@keyframes punchGridFrameHit {
  0% {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.95),
      0 0 24px rgba(255, 40, 40, 0.95),
      inset 0 0 18px rgba(255, 100, 80, 0.22);
  }
  45% {
    box-shadow:
      0 0 0 3px rgba(255, 200, 200, 0.9),
      0 0 40px rgba(255, 0, 0, 0.85),
      inset 0 0 24px rgba(255, 50, 50, 0.2);
  }
  100% {
    box-shadow: none;
  }
}

.card-modal.punch-card-hit .card-grid {
  animation: punchGridFrameHit 0.68s cubic-bezier(0.25, 0.85, 0.2, 1) forwards;
  border-radius: 6px;
}

.card-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-modal-name {
  font-size: 1.2rem;
  font-weight: 900;
  color: #ff6b6b;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.card-modal-close {
  background: none;
  border: none;
  color: #444;
  font-size: 1.3rem;
  cursor: pointer;
  transition: color 0.2s;
}

.card-modal-close:hover { color: #ff6b6b; }

/* Card header row (F I G H T) */
.card-header-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-bottom: 5px;
}

.ch-cell {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 900;
  padding: 8px 0;
  border-radius: 5px;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  border: 2px solid #ffffff;
}

.ch-cell::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shine 3s infinite;
}

/* ── Column colours — red (B) fading to black (L) ───────────────────────────── */
/* B — full red */
.ch-cell.B { background: linear-gradient(135deg, #ff2020, #cc0000); color: #fff; }

/* R — red fading toward dark */
.ch-cell.R { background: linear-gradient(135deg, #aa0000, #550000); color: #fff; }

/* A — mid dark red */
.ch-cell.A { background: linear-gradient(135deg, #660000, #220000); color: #fff; }

/* W — near black with red tint */
.ch-cell.W { background: linear-gradient(135deg, #330000, #0a0000); color: #fff; }

/* L — black */
.ch-cell.L { background: linear-gradient(135deg, #111111, #000000); color: #fff; }

/* Card grid */
.card-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  perspective: 600px;
}

.cell {
  aspect-ratio: 1;
  background: #111;
  border: none;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  user-select: none;
  transition: box-shadow 0.3s;
}

/* Image fills the cell */
.cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s;
}

/* Called state — red tinted overlay + checkmark */
.cell.called {
  box-shadow: 0 0 10px rgba(255,0,0,0.5);
  animation: calledPulse 0.6s ease, cellFlip 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.cell.called img {
  opacity: 0.45;
}

.cell.called::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('img/splatter.png') center / cover no-repeat;
  pointer-events: none;
}

/* FREE cell */
.cell.free {
  background: rgba(78,205,196,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  font-weight: 900;
  color: #4ecdc4;
  text-shadow: 0 0 8px rgba(78,205,196,0.8);
  letter-spacing: 1px;
}

/* GOLD bonus — FREE cell */
@keyframes goldCellPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255,215,0,0.7), 0 0 20px rgba(255,215,0,0.4);
  }
  50% {
    box-shadow: 0 0 22px rgba(255,215,0,1), 0 0 44px rgba(255,215,0,0.7), 0 0 66px rgba(255,215,0,0.3);
  }
}

.cell.free.gold-active {
  background: rgba(255,215,0,0.12);
  animation: goldCellPulse 1.6s ease-in-out infinite;
}

.cell.free.gold-active img {
  opacity: 1;
}

/* FREE cell closes card (when not Tyler) — full-cell hit target like the header ✕ */
.cell.free .free-cell-close-btn {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.cell.free .free-cell-close-btn:focus-visible {
  outline: 2px solid #4ecdc4;
  outline-offset: 2px;
}

.cell.free.gold-active .free-cell-close-btn:focus-visible {
  outline-color: #ffd700;
}

@keyframes punchCellShake {
  0%   { transform: translate(0, 0) scale(1); }
  20%  { transform: translate(-3px, 2px) scale(1.04); }
  40%  { transform: translate(4px, -2px) scale(1.06); }
  60%  { transform: translate(-2px, -3px) scale(1.03); }
  80%  { transform: translate(2px, 1px) scale(1.02); }
  100% { transform: translate(0, 0) scale(1); }
}

.cell.free.punch-impact {
  animation: punchCellShake 0.45s ease-out;
  box-shadow: 0 0 18px rgba(255,60,60,0.95), inset 0 0 12px rgba(255,100,100,0.35);
}

/* GOLD bonus — card modal border */
@keyframes goldModalPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(255,215,0,0.5), inset 0 0 10px rgba(255,215,0,0.05); }
  50%       { box-shadow: 0 0 36px rgba(255,215,0,0.9), inset 0 0 20px rgba(255,215,0,0.12); }
}

.card-modal.gold-active {
  border-color: #ffd700 !important;
  animation: goldModalPulse 1.6s ease-in-out infinite;
}

/* Win claim button */
.win-claim-btn {
  display: none;
  width: 100%;
  margin-top: 16px;
  background: linear-gradient(45deg, #ff5252, #cc0000);
  color: #fff;
  font-family: 'Courier New', monospace;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 3px;
  padding: 16px 0;
  border-radius: 6px;
  border: 2px solid #ff6b6b;
  box-shadow: 0 0 40px rgba(255,107,107,0.8);
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  animation: ballPulse 0.8s infinite;
  transition: transform 0.1s, opacity 0.2s;
}

.win-claim-btn:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 0 60px rgba(255,107,107,1);
}

.win-claim-btn:active:not(:disabled) {
  transform: scale(0.97);
}

/* After claim is sent */
.win-claim-btn.claimed {
  background: linear-gradient(45deg, #27ae60, #1e8449);
  border-color: #2ecc71;
  box-shadow: 0 0 30px rgba(46,204,113,0.7);
  animation: none;
  cursor: default;
  opacity: 0.85;
}

/* ════════════════════════════════
   MOBILE — vertical portrait screens
════════════════════════════════ */
@media (max-width: 600px) {

  body { padding: 16px 12px 50px; }

  /* Header */
  h1 { font-size: 2rem; letter-spacing: 2px; margin-bottom: 2px; }
  .tagline { font-size: 0.65rem; letter-spacing: 2px; margin-bottom: 14px; }

  /* Ticker — horizontal scroll strip instead of wrapping rows */
  .ticker-wrap { padding: 10px 12px; margin-bottom: 14px; }
  .ticker-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;        /* Firefox */
  }
  .ticker-row::-webkit-scrollbar { display: none; } /* Chrome/Safari */
  .ticker-thumb { width: 44px; height: 44px; }

  /* Give Me a Card button — full width, touch-friendly */
  .give-card-btn {
    width: 100%;
    font-size: 0.95rem;
    padding: 14px 20px;
    letter-spacing: 1px;
    margin-bottom: 20px;
  }

  /* Player rows — bigger tap targets */
  .player-row { padding: 14px 12px; }
  .player-row .pname { font-size: 0.95rem; }

  /* ── Request modal ── */
  .overlay { align-items: flex-end; }   /* sheet slides up from bottom */

  .modal {
    border-radius: 14px 14px 0 0;
    padding: 24px 20px 32px;
    max-width: 100%;
  }

  .modal h2 { font-size: 1.15rem; letter-spacing: 2px; }

  /* Prevent iOS auto-zoom on focus */
  .modal input { font-size: 16px; padding: 13px 12px; }

  .modal-btn-row { flex-direction: column; gap: 8px; }
  .btn-submit  { padding: 14px; font-size: 0.95rem; }
  .btn-cancel  { padding: 12px; font-size: 0.9rem; }

  /* ── Card viewer — full screen on mobile ── */
  .card-overlay { padding: 0; align-items: flex-end; }

  .card-modal {
    border-radius: 14px 14px 0 0;
    padding: 18px 14px 28px;
    max-width: 100%;
    max-height: 96vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .card-modal-name { font-size: 1rem; letter-spacing: 1px; }
  .card-modal-close { font-size: 1.5rem; padding: 4px 8px; } /* bigger tap target */

  .ch-cell { font-size: 1.1rem; padding: 7px 0; }

  .card-header-row { gap: 3px; margin-bottom: 3px; }
  .card-grid { gap: 3px; }

  /* Checkmark scales with cell size on small screens */
  .cell.called::after { font-size: 1.4rem; }

  /* Win claim button */
  .win-claim-btn { font-size: 1rem; letter-spacing: 2px; padding: 14px 0; }
}

@media (max-width: 380px) {
  h1 { font-size: 1.65rem; }
  .ticker-thumb { width: 38px; height: 38px; }
  .ch-cell { font-size: 0.95rem; }
}
