/* cum_champion.css — Cum Champion mini-game (table of 6, hand-grip animation). */

/* ── Header launcher button ───────────────────────────────────────────── */
#cum-champion-btn {
  background: linear-gradient(135deg, #4a1830, #28081a);
  border: 1.5px solid #c04080;
  border-radius: 8px;
  color: #ffd0e8;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.2s;
  letter-spacing: 0.02em;
  box-shadow: 0 0 10px 2px rgba(220, 80, 160, 0.35), 0 0 20px 4px rgba(220, 80, 160, 0.18);
}
#cum-champion-btn:hover {
  background: linear-gradient(135deg, #6a2848, #3a1228);
  border-color: #ff60a0;
  color: #fff0f8;
  box-shadow: 0 0 14px 3px rgba(255, 120, 200, 0.55), 0 0 28px 6px rgba(220, 80, 160, 0.3);
}

/* ── Modal frame ──────────────────────────────────────────────────────── */
.cc-modal {
  width: 92vw;
  max-width: 1100px;
  max-height: 90vh;
  background: radial-gradient(ellipse at 50% 30%, #2a0820 0%, #14041c 70%, #08020e 100%);
  border: 1.5px solid #8a3070;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.75), 0 0 28px rgba(220, 80, 160, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: fadeInScale 0.25s ease;
  font-family: inherit;
  color: #f0d0e8;
}
.cc-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background: linear-gradient(180deg, #2a0a20 0%, #14041c 100%);
  border-bottom: 1px solid #6a2050;
  flex: 0 0 auto;
}
.cc-title {
  font-size: 26px;
  font-weight: 800;
  color: #ffb8d8;
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px rgba(255, 120, 200, 0.45);
  text-align: center;
}

/* ── Step container ───────────────────────────────────────────────────── */
.cc-step {
  padding: 18px 22px 22px;
  overflow: auto;
  min-height: 0;
}
.cc-step-title {
  font-size: 18px;
  font-weight: 800;
  color: #ffd0ec;
  margin-bottom: 4px;
  text-align: center;
}
.cc-step-pick .cc-step-title {
  font-size: 21px;
  animation: ccPickTitlePulse 1.6s ease-in-out infinite;
}
@keyframes ccPickTitlePulse {
  0%, 100% { transform: scale(1);    text-shadow: 0 0 6px rgba(255,160,220,0.35); }
  50%      { transform: scale(1.06); text-shadow: 0 0 14px rgba(255,160,220,0.75); }
}
.cc-step-sub {
  font-size: 13px;
  color: #c898b8;
  margin-bottom: 14px;
  text-align: center;
}

/* ── Step 1: Champion picker ──────────────────────────────────────────── */
.cc-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
}
.cc-pick-card {
  background: linear-gradient(180deg, #2a0820, #14041c);
  border: 1.5px solid #6a2050;
  border-radius: 10px;
  padding: 10px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.2s, filter 0.15s;
}
.cc-pick-card:hover {
  border-color: #ff60a0;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 120, 200, 0.35);
  filter: brightness(1.1);
}
.cc-pick-cyl {
  width: 36px;
  height: 80px;
  border-radius: 14px 14px 12px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.5),
    inset -2px -3px 5px rgba(0, 0, 0, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.4);
}
.cc-pick-name {
  font-size: 12px;
  font-weight: 700;
  color: #ffe0f0;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  width: 100%;
  line-height: 1.2;
}
.cc-pick-meta {
  font-size: 10px;
  color: #c898b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cc-pick-empty {
  text-align: center;
  color: #c898b8;
  font-style: italic;
  padding: 30px;
}

/* ── Step 2: Bet selector ─────────────────────────────────────────────── */
.cc-step-bet { text-align: center; }
.cc-champ-preview {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 120, 200, 0.08);
  border: 1.5px solid #6a2050;
  border-radius: 10px;
  margin-bottom: 16px;
}
.cc-champ-cyl {
  width: 28px;
  height: 60px;
  border-radius: 12px 12px 10px 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.5),
    inset -2px -3px 5px rgba(0, 0, 0, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.4);
}
.cc-champ-meta { text-align: left; }
.cc-champ-name { font-size: 15px; font-weight: 800; color: #fff; }
.cc-champ-rarity { font-size: 11px; color: #c898b8; text-transform: uppercase; letter-spacing: 0.05em; }
.cc-bet-grid {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 14px 0 18px;
  flex-wrap: wrap;
}
.cc-bet-card {
  background: linear-gradient(180deg, #3a1028, #1c0414);
  color: #ffe0f0;
  border: 1.5px solid #c04080;
  border-radius: 10px;
  padding: 14px 28px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.2s;
  box-shadow: 0 0 12px rgba(220, 80, 160, 0.3);
}
.cc-bet-card:hover:not(:disabled) {
  background: linear-gradient(180deg, #5a1840, #2a0820);
  border-color: #ff60a0;
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(255, 120, 200, 0.55);
}
.cc-bet-card:disabled,
.cc-bet-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.5);
}
.cc-bet-amt {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.cc-bet-prize {
  font-size: 12px;
  color: #ffb8d8;
}
.cc-back-btn {
  background: transparent;
  color: #c898b8;
  border: 1px solid #6a2050;
  border-radius: 6px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cc-back-btn:hover {
  background: rgba(255, 120, 200, 0.1);
  color: #ffd0ec;
}

/* ── Step 3: The table ────────────────────────────────────────────────── */
.cc-modal-table { max-width: 1200px; }
.cc-table-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 12px 18px 18px;
  min-height: 0;
  gap: 10px;
}
.cc-bet-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  background: rgba(255, 120, 200, 0.08);
  border: 1px solid #6a2050;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  width: 30%;
  margin: 0 auto;
  text-align: center;
}
.cc-bet-info-champ {
  text-shadow: 0 0 6px rgba(255, 120, 200, 0.45);
}
.cc-bet-info-amt { color: #ffe0a0; }

.cc-table {
  position: relative;
  flex: 1 1 auto;
  min-height: 480px;
  padding: 50px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Square inner box keeps the felt circular regardless of modal width. */
.cc-table-inner {
  position: relative;
  width: min(90%, 67.5vh, 630px);
  aspect-ratio: 1 / 1;
}
.cc-table-biscuit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26%;
  height: 26%;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55));
}
.cc-table-felt {
  position: absolute;
  inset: 14%;                    /* circle, equal margin all sides */
  border-radius: 50%;
  /* Wood-grain top: dark grain streaks layered over a warm base gradient. */
  background:
    repeating-linear-gradient(89deg,
      transparent 0 4px,
      rgba(38, 18, 8, 0.45) 4px 5px,
      transparent 5px 11px,
      rgba(60, 30, 14, 0.32) 11px 12px,
      transparent 12px 22px),
    repeating-linear-gradient(91deg,
      transparent 0 14px,
      rgba(50, 24, 10, 0.18) 14px 16px,
      transparent 16px 38px),
    radial-gradient(ellipse 75% 45% at 38% 32%,
      rgba(255, 220, 170, 0.18) 0%,
      rgba(255, 220, 170, 0) 70%),
    radial-gradient(ellipse at center,
      #b07842 0%,
      #8a4a20 38%,
      #5a2a10 80%,
      #3a1808 100%);
  border: 8px solid #3a1c0a;
  box-shadow:
    inset 0 0 50px rgba(0, 0, 0, 0.55),
    inset 0 0 0 4px #2a1408,
    0 14px 30px rgba(0, 0, 0, 0.55);
  z-index: 0;
}
.cc-table-seats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Seats are absolutely positioned via inline `top`/`left` set in JS so they
   can take random angles around the round felt. The --intensity custom
   property is updated each frame during the squeeze build-up. */
.cc-seat {
  position: absolute;
  width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  --intensity: 0;
}

.cc-seat-stage {
  position: relative;
  width: 28px;
  height: 92px;
  /* Grow up to ~1.35× as the squeeze approaches. */
  transform: scale(calc(1 + 0.35 * var(--intensity)));
  transform-origin: 50% 100%;
  transition: transform 0.18s linear;
  animation: cc-seat-wobble 1.2s ease-in-out infinite;
  /* Wobble accelerates with intensity. */
  animation-duration: calc(1.2s - 0.7s * var(--intensity));
}
.cc-seat-cyl {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 6px;
  border-radius: 12px 12px 9px 9px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  /* Base shadow + intensity-driven red glow for the "about to squeeze" build-up. */
  box-shadow:
    inset 1.5px 1.5px 3px rgba(255, 255, 255, 0.55),
    inset -1.5px -2px 4px rgba(0, 0, 0, 0.35),
    0 3px 6px rgba(0, 0, 0, 0.5),
    0 0 calc(18px * var(--intensity)) calc(4px * var(--intensity)) rgba(255, 60, 60, calc(0.85 * var(--intensity))),
    0 0 calc(36px * var(--intensity)) calc(10px * var(--intensity)) rgba(255, 110, 60, calc(0.55 * var(--intensity)));
  /* Redden via hue-rotate + saturation as intensity climbs. */
  filter: hue-rotate(calc(-25deg * var(--intensity))) saturate(calc(1 + 0.6 * var(--intensity))) brightness(calc(1 + 0.1 * var(--intensity)));
  transition: box-shadow 0.18s linear, filter 0.18s linear;
}
/* Invisible 0×0 marker pinned to the visible top-edge of the cylinder.
   Read its getBoundingClientRect each frame to find the rotated/animated
   "top of cylinder" in screen coords without doing the math by hand. */
.cc-seat-tip {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}
.cc-seat-hand {
  position: absolute;
  left: 50%;
  bottom: 4px;
  font-size: 18px;
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  animation: cc-grip 1.6s ease-in-out infinite;
  /* Hand grips harder/faster as intensity rises. */
  animation-duration: calc(1.6s - 1.0s * var(--intensity));
}
@keyframes cc-grip {
  0%, 100% { bottom: 4px;  transform: translateX(-50%) scale(1); }
  45%      { bottom: 56px; transform: translateX(-50%) scale(1.1); }
  55%      { bottom: 56px; transform: translateX(-50%) scale(1.1); }
}
@keyframes cc-seat-wobble {
  0%, 100% { rotate: 0deg; }
  25%      { rotate: -3deg; }
  75%      { rotate:  3deg; }
}

.cc-seat-info {
  text-align: center;
  background: rgba(10, 4, 14, 0.85);
  border: 1px solid rgba(255, 120, 200, 0.4);
  border-radius: 6px;
  padding: 3px 6px;
  width: 110px;
  max-width: 110px;
}
.cc-seat-name {
  font-size: 11px;
  font-weight: 800;
  color: #ffe0ec;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.2;
}
.cc-seat-meta {
  font-size: 9px;
  color: #c898b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cc-seat-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 120, 200, 0.18);
  color: #ffb8d8;
}
.cc-seat-tag-you {
  background: linear-gradient(135deg, #ffe060, #ff9040);
  color: #2a1408;
  font-weight: 800;
}
.cc-seat-player .cc-seat-info {
  border-color: #ffe060;
  box-shadow: 0 0 12px rgba(255, 224, 96, 0.45);
}
.cc-seat-player .cc-seat-cyl {
  outline: 2px solid #ffe060;
  outline-offset: 2px;
}

/* Winner / loser states */
.cc-seat-winner .cc-seat-cyl {
  animation: cc-celebrate 0.6s ease-in-out infinite;
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.55),
    inset -2px -3px 5px rgba(0, 0, 0, 0.35),
    0 3px 6px rgba(0, 0, 0, 0.5),
    0 0 18px 4px rgba(255, 224, 96, 0.85),
    0 0 32px 10px rgba(255, 180, 60, 0.4);
}
.cc-seat-winner .cc-seat-hand { animation: none; opacity: 0; }
.cc-seat-loser .cc-seat-stage { animation: none; transform: scale(1); }
.cc-seat-loser .cc-seat-cyl  { filter: grayscale(0.6) brightness(0.6); box-shadow:
    inset 1.5px 1.5px 3px rgba(255, 255, 255, 0.55),
    inset -1.5px -2px 4px rgba(0, 0, 0, 0.35),
    0 3px 6px rgba(0, 0, 0, 0.5); }
.cc-seat-loser .cc-seat-hand { animation: none; opacity: 0.35; bottom: 4px; }
@keyframes cc-celebrate {
  0%   { transform: translateY(0)    rotate(-10deg) scale(1); }
  25%  { transform: translateY(-22px) rotate(12deg)  scale(1.1); }
  50%  { transform: translateY(0)    rotate(-10deg) scale(1); }
  75%  { transform: translateY(-16px) rotate(14deg)  scale(1.06); }
  100% { transform: translateY(0)    rotate(-10deg) scale(1); }
}

.cc-table-status {
  text-align: center;
  font-size: 13px;
  color: #ffb8d8;
  font-style: italic;
  min-height: 18px;
}

/* Winner droplet spray (mirrors racing-droplet) */
.cc-droplet {
  position: absolute;
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.95) 0%, rgba(200,235,255,0.85) 45%, rgba(120,200,255,0.7) 100%);
  box-shadow: inset -1px -1px 2px rgba(80, 150, 220, 0.45), 0 0 6px rgba(140, 210, 255, 0.5);
  pointer-events: none;
  z-index: 5;
  animation: cc-droplet-fly 1.3s cubic-bezier(0.2, 0.65, 0.55, 1) forwards;
}
@keyframes cc-droplet-fly {
  0%   { transform: translate(0, 0)                  scale(0.6);  opacity: 0; }
  10%  { transform: translate(0, -4px)               scale(1);    opacity: 1; }
  70%  { transform: translate(calc(var(--rdx) * 0.75), calc(var(--rdy) * 0.9)) scale(1); opacity: 0.9; }
  100% { transform: translate(var(--rdx), var(--rdy)) scale(0.5); opacity: 0; }
}

/* ── Result / replay buttons ──────────────────────────────────────────── */
.cc-result {
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(255, 120, 200, 0.08);
  border: 1px solid #6a2050;
  border-radius: 8px;
}
.cc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.cc-result-win {
  color: #a8ffa8;
  font-size: 21px;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(160, 255, 160, 0.4);
}
.cc-result-lose {
  color: #ff9090;
  font-size: 18px;
  font-weight: 700;
}
.cc-result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cc-again-btn {
  background: linear-gradient(135deg, #3a1028, #1c0414);
  color: #ffd0ec;
  border: 1.5px solid #c04080;
  border-radius: 7px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.2s, transform 0.12s;
}
.cc-again-btn:hover {
  background: linear-gradient(135deg, #5a1840, #2a0820);
  box-shadow: 0 0 14px rgba(255, 120, 200, 0.55);
  transform: translateY(-1px);
}
.cc-again-same {
  border-color: #ffe060;
  color: #ffe0a0;
  box-shadow: 0 0 10px rgba(255, 224, 96, 0.35);
}
.cc-again-same:hover {
  box-shadow: 0 0 16px rgba(255, 224, 96, 0.65);
}
.cc-again-quit { border-color: #6a4878; color: #c0a0d0; }

@media (max-width: 720px) {
  .cc-table { min-height: 360px; padding: 6px; }
  .cc-table-inner { width: min(100%, 70vh, 520px); }
  .cc-seat { width: 80px; }
  .cc-seat-info { width: 80px; max-width: 80px; }
  .cc-seat-stage { width: 22px; height: 72px; }
  .cc-seat-hand { font-size: 14px; }
}
