/* ── CSS Variables ─────────────────────────────────────────────────────────── */
:root {
  --ink: #1A1A1A;
  --bg: #FFFDE7;
  --red: #E8173B;
  --yellow: #FFD600;
  --blue: #0047AB;
  --white: #FFFFFF;
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow-md: 5px 5px 0 var(--ink);
  --shadow-lg: 7px 7px 0 var(--ink);
  --dot: rgba(0, 0, 0, 0.09);
}

/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--dot) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  font-family: 'Russo One', sans-serif;
  color: var(--ink);
}

/* ── App shell ────────────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: min(480px, 100vw);
  padding: 8px 16px 10px;
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-lg);
}

/* ── Challenge banner ────────────────────────────────────────────────────── */
#challenge-banner {
  width: 100%;
  background: var(--yellow);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 8px 14px;
  font-size: 0.78rem;
  font-family: 'Bangers', cursive;
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: 6px;
  line-height: 1.4;
}
#challenge-banner.hidden { display: none; }

/* ── Level progress bar ───────────────────────────────────────────────────── */
#level-progress {
  width: 100%;
  padding-bottom: 2px;
}

#level-progress-track {
  width: 100%;
  height: 20px;
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  overflow: hidden;
}

#level-progress-fill {
  height: 100%;
  width: 1%;
  background: var(--yellow);
  transition: width 0.5s ease;
}

#level-progress-label {
  font-size: 0.72rem;
  font-family: 'Bangers', cursive;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-align: center;
  margin-top: 3px;
}

/* ── HUD health bar ───────────────────────────────────────────────────────── */
#hud {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 4px;
}

.hud-player {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

#hud-cpu  { flex-direction: row; }
#hud-you  { flex-direction: row; }

.hud-name {
  font-size: 0.82rem;
  font-family: 'Bangers', cursive;
  letter-spacing: 0.12em;
  color: var(--ink);
  white-space: nowrap;
  min-width: 26px;
}

.hud-cards {
  font-size: 0.88rem;
  font-family: 'Bangers', cursive;
  font-weight: 400;
  color: var(--ink);
  min-width: 18px;
  text-align: center;
}

.health-track {
  flex: 1;
  height: 18px;
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  overflow: hidden;
}

/* CPU bar grows left-to-right from the left edge */
.cpu-track { direction: ltr; }
/* Player bar grows right-to-left (mirror) */
.you-track { direction: rtl; }

.health-fill {
  height: 100%;
  width: 50%;
  transition: width 0.4s ease, background 0.4s ease;
}

#cpu-bar    { background: var(--red); }
#player-bar { background: var(--blue); }

/* ── HUD centre (VS + streak) ─────────────────────────────────────────────── */
#hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 48px;
}

#hud-vs {
  font-size: 1.2rem;
  font-family: 'Bangers', cursive;
  color: var(--ink);
  letter-spacing: 0.18em;
  text-shadow: 2px 2px 0 var(--yellow);
}

#snap-streak {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  font-family: 'Bangers', cursive;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 1px 7px;
  white-space: nowrap;
}

#streak-fire {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
#snap-streak.hidden { display: none; }

@keyframes streak-pop {
  0%   { transform: scale(0.7); }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.streak-pop { animation: streak-pop 0.2s ease-out forwards; }

#level-badge {
  font-size: 0.75rem;
  font-family: 'Bangers', cursive;
  letter-spacing: 0.12em;
  color: var(--yellow);
  background: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--yellow);
  padding: 1px 8px;
}
#level-badge #level-num { font-size: 0.88rem; }

/* ── Snap counters ────────────────────────────────────────────────────────── */
#snap-counters {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 6px;
}

.snap-counter {
  display: flex;
  align-items: center;
  gap: 6px;
}

.snap-counter-label {
  font-size: 0.82rem;
  font-family: 'Bangers', cursive;
  letter-spacing: 0.08em;
  color: #888;
  text-transform: uppercase;
}

.snap-counter-value {
  font-size: 1.3rem;
  font-family: 'Bangers', cursive;
  color: var(--white);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  min-width: 28px;
  text-align: center;
  padding: 1px 8px;
  transition: transform 0.15s;
}

#cpu-snap-counter .snap-counter-value    { background: var(--red); }
#player-snap-counter .snap-counter-value { background: var(--blue); }

@keyframes counter-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.snap-counter-value.pop { animation: counter-pop 0.25s ease-out forwards; }

/* ── Table surface ────────────────────────────────────────────────────────── */
#table {
  width: 100%;
  background-color: #FFB3C6;
  background-image: radial-gradient(circle, rgba(255,255,255,0.55) 2px, transparent 2px);
  background-size: 12px 12px;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-md);
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas:
    "cpu-label  cpu-deck    ."
    ".          pile-area   ."
    "snap-stats player-deck you-label";
  align-items: center;
  gap: 12px 8px;
  position: relative;
}

/* Dog-ear corner fold */
#table::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 30px 30px 0;
  border-color: transparent var(--bg) transparent transparent;
  pointer-events: none;
  z-index: 1;
}

#cpu-label          { grid-area: cpu-label; }
#ai-deck-visual     { grid-area: cpu-deck; }
#pile-area          { grid-area: pile-area; }
#snap-stats         { grid-area: snap-stats; align-self: center; }
#player-deck-visual { grid-area: player-deck; }
#you-label          { grid-area: you-label; text-align: right; }

.player-label {
  font-size: 0.95rem;
  font-family: 'Bangers', cursive;
  letter-spacing: 0.08em;
  color: #888;
  white-space: nowrap;
}
.player-label strong {
  display: block;
  font-size: 1.3rem;
  color: var(--ink);
}

.turn-tag {
  display: block;
  font-size: 0.75rem;
  font-family: 'Bangers', cursive;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 3px 8px;
  margin-top: 3px;
  text-transform: uppercase;
  min-height: 1em;
}
.turn-tag:empty {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
@keyframes turn-pulse {
  from { opacity: 0.75; transform: scale(0.97); }
  to   { opacity: 1;    transform: scale(1.03); }
}
.turn-tag:not(:empty) {
  animation: turn-pulse 0.55s ease-in-out infinite alternate;
}

/* Card stack visualisation */
.card-stack {
  padding: 0 22px 22px 0;
  flex-shrink: 0;
}

.stack-card {
  width: 62px;
  height: 88px;
  background-color: var(--blue);
  background-image: radial-gradient(circle, rgba(0,0,0,0.25) 1.5px, transparent 1.5px);
  background-size: 8px 8px;
  border: 2px solid var(--ink);
  position: relative;
  transition: box-shadow 0.35s ease, opacity 0.3s ease;
}

.stack-card.empty {
  opacity: 0.2;
  box-shadow: none !important;
}

/* ── Snap stats bubble (in table) ─────────────────────────────────────────── */
#snap-stats-title {
  font-family: 'Bangers', cursive;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--yellow);
  text-align: center;
  padding: 3px 6px;
}

#snap-stats {
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 0;
  overflow: hidden;
}

.stat-header-row,
.stat-row {
  display: grid;
  grid-template-columns: 2.8rem 1fr 1fr;
  gap: 0;
  font-size: 0.72rem;
  font-family: 'Russo One', sans-serif;
  line-height: 1.65;
}

.stat-col-header {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  text-transform: uppercase;
  padding: 4px 2px 2px;
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
  overflow: hidden;
}

.stat-divider {
  border-top: 1px solid var(--ink);
  margin-top: 2px;
  padding-top: 2px;
}

.stat-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  padding: 1px 4px 1px 8px;
}

.stat-val {
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  padding: 1px 2px;
}

/* Column shading */
.stat-header-row span:nth-child(2),
.stat-row span:nth-child(2) { background: rgba(0,0,0,0.04); }

.stat-header-row span:nth-child(3),
.stat-row span:nth-child(3) { background: rgba(0,0,0,0.08); }

/* ── Central pile ─────────────────────────────────────────────────────────── */
#pile-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: filter 0.4s ease;
}

#pile-main {
  position: relative;
}

#pile-expression {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  width: 90px;
  height: 90px;
  object-fit: contain;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  user-select: none;
  transition: opacity 0.3s ease;
  z-index: 2;
}

#pile-cards {
  position: relative;
  width: 92px;
  height: 112px;
  transform-origin: center bottom;
  transition: transform 0.35s ease;
}

#pile-card-prev {
  position: absolute;
  top: 8px;
  left: 10px;
  transform: rotate(-6deg);
  z-index: 1;
  transition: box-shadow 0.35s ease;
}

#pile-card-top {
  position: absolute;
  top: 3px;
  left: 10px;
  transform: rotate(3deg);
  z-index: 2;
}

#pile-count {
  font-size: 0.95rem;
  font-family: 'Bangers', cursive;
  letter-spacing: 0.06em;
  color: #888;
  transition: color 0.4s ease, font-size 0.35s ease;
}

/* ── Snap flash overlay ───────────────────────────────────────────────────── */
#snap-flash {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%) scale(0);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  white-space: nowrap;
}

.flash-image {
  width: 180px;
  height: 180px;
  object-fit: contain;
  display: block;
}

.flash-emoji {
  font-size: 6rem;
  line-height: 1;
  filter: drop-shadow(0 0 20px currentColor);
}

.flash-label {
  font-size: 2.8rem;
  font-family: 'Bangers', cursive;
  letter-spacing: 0.18em;
  text-shadow: 3px 3px 0 var(--ink);
}

.flash-snap .flash-label { color: var(--yellow); }
.flash-deny .flash-label { color: var(--red); }

@keyframes flash-snap-anim {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.1) rotate(-15deg); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.25) rotate(5deg); }
  28%  { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  70%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9) translateY(-20px); }
}

@keyframes flash-deny-anim {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.1); }
  12%  { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(-8deg); }
  22%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(8deg); }
  32%  { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  70%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9) translateY(-20px); }
}

#snap-flash.flash-snap { animation: flash-snap-anim 1.4s ease-out forwards; }
#snap-flash.flash-deny { animation: flash-deny-anim 1.4s ease-out forwards; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  width: 72px;
  height: 100px;
  border: 2px solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: relative;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

.card.empty {
  background: rgba(255,255,255,0.1);
  border: 2px dashed rgba(0,0,0,0.2);
  box-shadow: none;
}

.card.red   { color: var(--red); }
.card.black { color: var(--ink); }

.corner {
  position: absolute;
  font-size: 14px;
  line-height: 1.2;
  font-family: 'Bangers', cursive;
  letter-spacing: 0.05em;
  text-align: center;
}
.top-left     { top: 5px; left: 6px; }
.bottom-right {
  bottom: 5px; right: 6px;
  transform: rotate(180deg);
}

.center-suit {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 38px;
  line-height: 1;
}

/* Card flip-in animation */
@keyframes flip-in {
  0%   { transform: perspective(400px) rotateX(90deg); opacity: 0.3; }
  65%  { transform: perspective(400px) rotateX(-8deg); opacity: 1; }
  100% { transform: perspective(400px) rotateX(0deg);  opacity: 1; }
}
.card.flip-in { animation: flip-in 0.2s ease-out forwards; }

/* ── Controls ─────────────────────────────────────────────────────────────── */
#controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-top: 8px;
}

#btn-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.kbd-hint { display: none; }
@media (hover: hover) and (pointer: fine) {
  .kbd-hint { display: inline; }
}

#status-msg {
  font-size: 0.85rem;
  font-family: 'Russo One', sans-serif;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  min-height: 1.4em;
  letter-spacing: 0.03em;
}

#snap-hint {
  font-size: 1rem;
  font-family: 'Russo One', sans-serif;
  font-weight: 700;
  color: var(--red);
  text-align: center;
  letter-spacing: 0.03em;
}
#snap-hint.hidden { display: none; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
#game-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 0.62rem;
  color: #888;
}
#game-footer a {
  color: #555;
  text-decoration: none;
}
#game-footer a:hover { text-decoration: underline; }
#btn-footer-share {
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-family: 'Bangers', cursive;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: transform 0.1s, box-shadow 0.1s;
}
#btn-footer-share:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}
#btn-footer-share:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.action-btn {
  padding: 12px 32px;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  font-family: 'Bangers', cursive;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s, box-shadow 0.1s, opacity 0.15s;
}
.action-btn:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}
.action-btn:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: none;
}
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

#btn-flip {
  background: var(--blue);
  color: var(--white);
  flex: 1;
}

/* ── SNAP! button ─────────────────────────────────────────────────────────── */

.snap-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 12px 32px;
  flex: 1;
  background: #FF3D78;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  touch-action: manipulation;
  transition: transform 0.1s, box-shadow 0.1s;
}

.snap-wrapper:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.snap-wrapper:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.snap-wrapper.snap-inactive {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.snap-text {
  font-family: 'Bangers', cursive;
  font-size: 1.1rem;
  color: var(--white);
  letter-spacing: 0.08em;
  user-select: none;
}

/* ── Game-over modal ──────────────────────────────────────────────────────── */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 30, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 16px;
}
#overlay[hidden] { display: none; }

@keyframes modal-pop-in {
  0%   { transform: scale(0.85) rotate(-2deg); opacity: 0; }
  100% { transform: scale(1)    rotate(0deg);  opacity: 1; }
}

#modal {
  width: 100%;
  max-width: 360px;
  border: 3px solid var(--ink);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--white);
}
#modal.modal-pop { animation: modal-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* ── Modal header ── */
#modal-header {
  position: relative;
  overflow: hidden;
  padding: 0 0 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#modal-banner {
  width: 100%;
  display: block;
  border-bottom: 3px solid var(--ink);
  margin-bottom: 4px;
}

#confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

@keyframes confetti-fall {
  0%   { transform: translateY(0)     rotate(0deg);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(200px) rotate(720deg); opacity: 0; }
}

.confetti-piece {
  position: absolute;
  top: -20px;
  animation: confetti-fall linear forwards;
}

@keyframes bounce-in {
  0%   { transform: scale(0);    opacity: 0; }
  60%  { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); }
}

#modal-title {
  font-size: 2rem;
  font-family: 'Bangers', cursive;
  color: var(--ink);
  letter-spacing: 0.08em;
  margin: 0;
}

#modal-subtitle {
  font-size: 0.9rem;
  font-family: 'Russo One', sans-serif;
  color: var(--ink);
  font-weight: 700;
  opacity: 0.7;
}

/* ── Modal body ── */
#modal-body {
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#modal-stats {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.stat-pill {
  flex: 1;
  background: var(--bg);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 8px 6px;
  text-align: center;
  font-family: 'Bangers', cursive;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-pill-value {
  font-size: 1.2rem;
  color: var(--ink);
}

/* New best badge */
#modal-best-badge {
  background: var(--yellow);
  color: var(--ink);
  font-family: 'Bangers', cursive;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 4px 14px;
  text-align: center;
  align-self: center;
}
#modal-best-badge.hidden { display: none; }

/* Level row */
#modal-level-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Bangers', cursive;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--ink);
}

#modal-level-label { white-space: nowrap; }
.modal-level-max   { white-space: nowrap; color: #888; }

#modal-level-track {
  flex: 1;
  height: 10px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  overflow: hidden;
  background: var(--white);
}

#modal-level-fill {
  height: 100%;
  transition: width 0.5s ease;
}
#modal-level-fill.win  { background: var(--red); }
#modal-level-fill.lose { background: var(--blue); }

/* Share box */
#modal-share-box {
  border: 2px dashed var(--ink);
  padding: 12px 14px;
  background: var(--bg);
}

#modal-share-text {
  font-family: 'Russo One', sans-serif;
  font-size: 0.8rem;
  color: var(--ink);
  line-height: 1.5;
  margin: 0;
}

/* Action buttons */
#modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#modal-game-btns {
  display: flex;
  gap: 8px;
}

.modal-btn {
  flex: 1;
  padding: 12px 16px;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.modal-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}
.modal-btn:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.modal-btn-outline {
  background: transparent;
  color: var(--ink);
}
.modal-btn-outline:hover { background: var(--bg); }

.modal-btn-purple {
  background: var(--blue);
  color: var(--white);
}

.modal-btn-coral {
  background: var(--red);
  color: var(--white);
}

@keyframes rematch-pulse {
  0%   { box-shadow: var(--shadow-sm); }
  100% { box-shadow: 6px 6px 0 var(--ink); }
}
.modal-btn-coral.modal-btn-pulse {
  animation: rematch-pulse 0.8s ease-in-out infinite alternate;
}

.modal-btn-ghost {
  background: transparent;
  border: 2px dashed var(--ink);
  color: #888;
  font-size: 0.85rem;
}
.modal-btn-ghost:hover { color: var(--ink); border-color: var(--ink); }
.modal-btn-ghost.hidden { display: none; }

