:root {
  --bg: #1e1f29;
  --panel: #2a2c3a;
  --cell: #343650;
  --cell-hover: #3f4260;
  --text: #f2f2f5;
  --muted: #9a9cb5;
  --x-color: #ff6b6b;
  --o-color: #4ecdc4;
  --win: #ffd166;
  --accent: #6c63ff;
  --red-color: #ef4444;
  --blue-color: #3b82f6;
  --c4-frame: #2f5bd3;
  --c4-red: #ef4444;
  --c4-yellow: #facc15;
  /* Simulator outcomes: an ordered good / neutral / bad scale, checked for
     colorblind separation on the panel color. */
  --outcome-win: #0f9f9a;
  --outcome-draw: #c3c5d4;
  --outcome-loss: #e8590c;
  --outcome-ink: #111218;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.game {
  background: var(--panel);
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  width: min(90vw, 420px);
}

.game.c4-page {
  width: min(96vw, 560px);
  padding: 1.25rem;
}

.game.fence-page {
  width: min(96vw, 640px);
  padding: 1.25rem;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.settings-link {
  position: absolute;
  right: 0;
  color: var(--muted);
  display: flex;
  padding: 0.3rem;
}

.settings-link:hover {
  color: var(--text);
}

.gear-icon {
  width: 1.4rem;
  height: 1.4rem;
}

.menu-wrap {
  position: absolute;
  left: 0;
}

.menu-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  display: flex;
  padding: 0.3rem;
  cursor: pointer;
}

.menu-btn:hover {
  color: var(--text);
}

.menu-icon {
  width: 1.4rem;
  height: 1.4rem;
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.4rem;
  background: var(--cell);
  border-radius: 0.6rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 20;
  min-width: 9rem;
  text-align: left;
}

.menu-item {
  display: block;
  padding: 0.7rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.menu-item:hover {
  background: var(--cell-hover);
}

.menu-item.active {
  color: var(--accent);
  font-weight: 600;
}

.status {
  margin: 0 0 1.5rem;
  min-height: 1.4em;
  font-size: 1.1rem;
  color: var(--muted);
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 0 auto 1.5rem;
}

.fence-board {
  width: 100%;
  margin: 0 auto 1.5rem;
  background: var(--cell);
  border-radius: 0.6rem;
  padding: 0.5rem;
}

.fence-svg {
  width: 100%;
  height: auto;
  display: block;
}

.dot {
  fill: var(--text);
}

.edge-hit {
  stroke: transparent;
  stroke-width: 14;
  stroke-linecap: round;
  cursor: pointer;
  touch-action: manipulation;
}

.edge-line {
  stroke-width: 4;
  stroke-linecap: round;
  opacity: 0.25;
  transition: opacity 0.15s ease, stroke-width 0.15s ease;
}

.edge-line.drawn {
  stroke-width: 6;
  opacity: 1;
}

.box-label {
  font-size: 1.6rem;
  font-weight: 700;
}

.score .p1-label {
  color: var(--red-color);
}

.score .p2-label {
  color: var(--blue-color);
}

.cell {
  aspect-ratio: 1 / 1;
  background: var(--cell);
  border: none;
  border-radius: 0.6rem;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, transform 0.1s ease;
}

.cell:active:not(:disabled) {
  transform: scale(0.94);
}

.cell:hover:not(:disabled) {
  background: var(--cell-hover);
}

.cell:disabled {
  cursor: default;
}

.cell.x {
  color: var(--x-color);
}

.cell.o {
  color: var(--o-color);
}

.cell.win {
  background: rgba(255, 209, 102, 0.25);
  box-shadow: inset 0 0 0 2px var(--win);
}

.cell.valid-drop {
  background: rgba(108, 99, 255, 0.25);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.cell.invalid-shake {
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.cell .piece-stack {
  width: 78%;
  height: 78%;
  pointer-events: none;
}

.piece-stack circle {
  transition: r 0.1s ease;
}

.trays {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.tray {
  background: var(--cell);
  border-radius: 0.6rem;
  padding: 0.5rem;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.tray.active-tray {
  opacity: 1;
}

.tray-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.tray-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.tray-slot {
  position: relative;
  width: clamp(2rem, 14vw, 2.6rem);
  height: clamp(2rem, 14vw, 2.6rem);
  background: var(--panel);
  border: none;
  border-radius: 0.4rem;
  padding: 0.2rem;
  touch-action: none;
  flex: 0 0 auto;
}

.tray.active-tray .tray-slot:not(:disabled) {
  cursor: grab;
}

.tray-slot:disabled {
  opacity: 0.25;
}

.tray-slot .piece-stack {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tray-slot .slot-count {
  position: absolute;
  bottom: -0.3rem;
  right: -0.3rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 1.1rem;
  height: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2rem;
}

.tray-slot.selected {
  box-shadow: 0 0 0 2px var(--accent);
}

.drag-ghost {
  position: fixed;
  width: 3.2rem;
  height: 3.2rem;
  pointer-events: none;
  z-index: 50;
  transform: translate(-50%, -50%);
}

.drag-ghost .piece-stack {
  width: 100%;
  height: 100%;
}

.setting-block {
  text-align: left;
  margin-bottom: 1.5rem;
}

.setting-block label {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.setting-block input[type="range"] {
  width: 100%;
  margin-bottom: 1rem;
}

.preview-stack-wrap {
  width: 8rem;
  height: 8rem;
  margin: 0 auto 1rem;
  background: var(--cell);
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-stack-wrap .piece-stack {
  width: 85%;
  height: 85%;
}

.preview-classic {
  font-size: 2rem;
  font-weight: 700;
  color: var(--muted);
}

.settings-hint {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

.settings-actions {
  display: flex;
  justify-content: center;
}

.size-options {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.size-option {
  flex: 1;
  background: var(--cell);
  color: var(--text);
  border: 2px solid transparent;
  border-radius: 0.6rem;
  padding: 0.7rem 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.size-option:hover {
  background: var(--cell-hover);
}

.size-option.selected {
  border-color: var(--accent);
  background: var(--cell-hover);
}

.fence-preview {
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cell);
  border-radius: 0.6rem;
  padding: 0.5rem;
  max-width: 12rem;
}

.fence-preview svg {
  width: 100%;
  height: auto;
  display: block;
}

.scoreboard {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.score {
  flex: 1;
  background: var(--cell);
  border-radius: 0.6rem;
  padding: 0.6rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.score span {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.score strong {
  font-size: 1.3rem;
}

.reset-btn {
  background: var(--accent);
  color: var(--text);
  border: none;
  border-radius: 0.6rem;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.reset-btn:hover {
  filter: brightness(1.1);
}

/* --- Connect 4 --- */
.c4-board {
  display: grid;
  grid-template-columns: repeat(var(--c4-cols, 7), 1fr);
  gap: 0.3rem;
  margin: 0 auto 1.5rem;
  padding: 0.45rem;
  background: var(--c4-frame);
  border-radius: 0.8rem;
  overflow: hidden;
  touch-action: manipulation;
}

.c4-column {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease;
}

.c4-column:disabled {
  cursor: default;
}

.c4-board[data-player="1"] .c4-column:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.3);
}

.c4-board[data-player="2"] .c4-column:hover:not(:disabled) {
  background: rgba(250, 204, 21, 0.3);
}

.c4-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.45);
}

.c4-chip {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2), inset 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.c4-chip.p1 {
  background: var(--c4-red);
}

.c4-chip.p2 {
  background: var(--c4-yellow);
}

.c4-chip.dropping {
  animation: c4-drop calc(0.12s + var(--fall) * 0.05s) cubic-bezier(0.5, 0, 1, 1);
}

@keyframes c4-drop {
  from { transform: translateY(calc(var(--fall) * -118%)); }
  to { transform: translateY(0); }
}

.c4-slot.win {
  box-shadow: 0 0 0 3px var(--win), inset 0 3px 6px rgba(0, 0, 0, 0.45);
}

.c4-slot.win .c4-chip {
  animation: c4-pulse 0.9s ease-in-out 0.3s infinite alternate;
}

@keyframes c4-pulse {
  to { transform: scale(0.85); }
}

.status[data-player="1"] {
  color: var(--c4-red);
}

.status[data-player="2"] {
  color: var(--c4-yellow);
}

.score .c4-red-label {
  color: var(--c4-red);
}

.score .c4-yellow-label {
  color: var(--c4-yellow);
}

.size-options + label {
  margin-top: 0.4rem;
}

.c4-preview {
  margin: 0 auto 1rem;
  max-width: 14rem;
}

.c4-preview svg {
  width: 100%;
  height: auto;
  display: block;
}

/* --- WildFlip --- */
.game.cc-page {
  width: min(96vw, 480px);
  padding: 1.25rem;
}

.cc-page [hidden] {
  display: none !important;
}

/* Room for two lines so the board doesn't jump when a message wraps. */
.cc-page .status {
  margin-bottom: 0.8rem;
  min-height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status[data-color="red"] {
  color: var(--red-color);
}

.status[data-color="blue"] {
  color: var(--blue-color);
}

.cc-note {
  color: var(--muted);
  line-height: 1.4;
  margin: 0 0 1rem;
}

.cc-muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.cc-notice {
  background: rgba(108, 99, 255, 0.18);
  border: 1px solid var(--accent);
  border-radius: 0.6rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  margin: 0 0 0.8rem;
}

.cc-form {
  display: flex;
  gap: 0.5rem;
}

.cc-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  background: var(--cell);
  border: 2px solid transparent;
  border-radius: 0.6rem;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  padding: 0.65rem 0.8rem;
  -webkit-user-select: text;
  user-select: text;
}

.cc-input:focus {
  outline: none;
  border-color: var(--accent);
}

.cc-profile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  background: var(--cell);
  border-radius: 0.6rem;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.8rem;
  text-align: left;
}

.cc-profile-name {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cc-link {
  color: #a9a4ff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.cc-link:hover {
  text-decoration: underline;
}

/* Today's activities on Home (3.0). */
.cc-daily {
  margin-top: 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.cc-daily summary {
  cursor: pointer;
  font-weight: 700;
}

.cc-daily-list {
  list-style: none;
  margin: 0.6rem 0 0.4rem;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.cc-daily-task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.92rem;
}

.cc-daily-text {
  text-align: left;
}

.cc-daily-task.done .cc-daily-text {
  color: var(--muted);
  text-decoration: line-through;
}

.cc-daily-task.tough .cc-daily-text {
  font-weight: 600;
}

.cc-daily-bar {
  display: block;
  height: 5px;
  margin-top: 0.25rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.cc-daily-bar span {
  display: block;
  height: 100%;
  background: #f5c542;
}

.cc-daily-prize {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.cc-daily-all {
  margin: 0.3rem 0 0;
  font-weight: 600;
  text-align: left;
}

.cc-daily-all.done {
  color: #f5c542;
}

.cc-rules {
  text-align: left;
  margin-top: 1.2rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.cc-rules summary {
  cursor: pointer;
  color: var(--text);
  text-align: center;
}

.cc-rules ul {
  padding-left: 1.2rem;
  line-height: 1.45;
}

.cc-red-text {
  color: var(--red-color);
  font-weight: 700;
}

.cc-blue-text {
  color: var(--blue-color);
  font-weight: 700;
}

/* A card: four side numbers around a picture. Sizes scale with the card. */
.cc-card {
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr);
  grid-template-rows: 1fr 1.5fr 1fr;
  place-items: center;
  border: 3px solid var(--rarity-color, var(--muted));
  border-radius: 12%;
  background: linear-gradient(160deg, #474a6e, #2a2c3a);
  color: #fff;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
}

.cc-card.red {
  border-color: var(--red-color);
  background: linear-gradient(160deg, #c2414b, #6b1d26);
}

.cc-card.blue {
  border-color: var(--blue-color);
  background: linear-gradient(160deg, #3c6fd8, #1b326e);
}

.cc-num {
  font-size: 19cqw;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.cc-top { grid-area: 1 / 2; }
.cc-left { grid-area: 2 / 1; }
.cc-right { grid-area: 2 / 3; }
.cc-bottom { grid-area: 3 / 2; }

.cc-face {
  grid-area: 2 / 2;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3cqw;
}

.cc-icon {
  font-size: 32cqw;
  line-height: 1;
}

/* Card art (cards-art.js): the animal's picture in place of its emoji. */
.cc-art {
  display: block;
  width: 58cqw;
  height: 40cqw;
  max-width: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 0.8cqw 0.8cqw rgba(0, 0, 0, 0.35));
}

.cc-name {
  font-size: 10cqw;
  font-weight: 600;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-name.cc-name-mid {
  font-size: 8cqw;
}

.cc-name.cc-name-mid,
.cc-name.cc-name-long {
  line-height: 1.05;
  white-space: normal;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cc-name.cc-name-long {
  font-size: 7cqw;
}

/* Longer names sit below the side numbers, so they may use most of the
   card's width rather than only the middle column. */
.cc-name.cc-name-mid,
.cc-name.cc-name-long {
  width: 84cqw;
  max-width: none;
  flex: none;
}

/* Rare and better cards carry a gem in the corner, colored by rarity. */
.cc-gem {
  grid-area: 1 / 1;
  width: 12cqw;
  height: 12cqw;
  background: var(--rarity-color);
  border-radius: 2cqw;
  transform: rotate(45deg);
  box-shadow: 0 0 0 1.5cqw rgba(0, 0, 0, 0.35), 0 0 6cqw var(--rarity-color);
}

/* The set's element (WildFlip 2.0): a mini icon in the top-right corner. */
.cc-element {
  grid-area: 1 / 3;
  align-self: start;
  justify-self: end;
  margin: 4cqw 4cqw 0 0;
  font-size: 13cqw;
  line-height: 1;
  filter: drop-shadow(0 0 1.5cqw rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

/* Epic cards stand out from rares: a faceted violet gem with a sparkle, a
   violet-to-pink gradient border, and in play (where the border shows the
   player's color) a violet inner ring. */
.cc-card[data-rarity="epic"] {
  border-color: transparent;
  background:
    linear-gradient(160deg, #4f3f78, #2a2340) padding-box,
    linear-gradient(135deg, #f0abfc, #c084fc 45%, #7c3aed) border-box;
}

.cc-card[data-rarity="epic"].red {
  border-color: var(--red-color);
  background: linear-gradient(160deg, #c2414b, #6b1d26);
}

.cc-card[data-rarity="epic"].blue {
  border-color: var(--blue-color);
  background: linear-gradient(160deg, #3c6fd8, #1b326e);
}

.cc-card[data-rarity="epic"].red::after,
.cc-card[data-rarity="epic"].blue::after {
  content: "";
  position: absolute;
  inset: 3cqw;
  border: 1.5px solid #e9c2ff;
  border-radius: 9%;
  box-shadow: 0 0 4cqw rgba(192, 132, 252, 0.6);
  pointer-events: none;
}

.cc-card[data-rarity="epic"] .cc-gem {
  width: 14cqw;
  height: 14cqw;
  background: linear-gradient(135deg, #fdf4ff 0%, #f0abfc 30%, #c084fc 60%, #7c3aed 100%);
  box-shadow: 0 0 0 1.5cqw rgba(0, 0, 0, 0.35), 0 0 8cqw #e879f9;
}

@container (max-width: 90px) {
  .cc-name {
    display: none;
  }
}

.cc-card.cc-placed {
  animation: cc-place 0.25s ease-out;
}

@keyframes cc-place {
  from { transform: scale(1.15); opacity: 0.3; }
  to { transform: scale(1); opacity: 1; }
}

.cc-card.cc-flipping {
  animation: cc-flip 0.5s ease-in-out;
}

@keyframes cc-flip {
  0% { transform: perspective(400px) rotateY(0); }
  50% { transform: perspective(400px) rotateY(90deg); }
  100% { transform: perspective(400px) rotateY(0); }
}

.cc-slot,
.cc-hand-card,
.cc-pick {
  font: inherit;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  touch-action: manipulation;
}

/* Board */
.cc-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  width: min(100%, 330px);
  margin: 0.6rem auto;
  padding: 0.4rem;
  background: var(--cell);
  border-radius: 0.8rem;
}

/* The welcome gift of Holos, big, in the walkthrough. */
.cc-welcome-holos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin: 0.2rem 0 0.6rem;
  font-size: 2rem;
}

.cc-welcome-holos .cc-holo-icon {
  width: 2.2rem;
  height: 2.2rem;
}

/* A card's animation (cards-anim.js), drawn over the board. */
.cc-fly {
  position: absolute;
  z-index: 6;
  pointer-events: none;
}

/* The Ladder Prototype's 4 × 4 board (3.0). */
.cc-board.cc-board-4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  width: min(100%, 400px);
}

.cc-slot {
  aspect-ratio: 1 / 1;
  background: var(--bg);
  border-radius: 0.6rem;
  cursor: default;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.cc-board.placing .cc-slot:not(:disabled) {
  cursor: pointer;
}

.cc-board.placing .cc-slot:not(:disabled):hover {
  background: var(--cell-hover);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.cc-slot.cc-claimable .cc-card {
  box-shadow: 0 0 0 3px var(--win);
  animation: cc-glow 0.9s ease-in-out infinite alternate;
}

@keyframes cc-glow {
  to { box-shadow: 0 0 0 3px var(--win), 0 0 14px var(--win); }
}

/* Hands and player bars */
.cc-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.2rem 0.2rem;
}

.cc-who {
  font-weight: 700;
}

.cc-score {
  font-size: 1.3rem;
  min-width: 2.2rem;
  background: var(--cell);
  border-radius: 0.5rem;
  padding: 0.15rem 0.5rem;
}

.cc-side[data-color="red"] .cc-who,
.cc-side[data-color="red"] .cc-score {
  color: var(--red-color);
}

.cc-side[data-color="blue"] .cc-who,
.cc-side[data-color="blue"] .cc-score {
  color: var(--blue-color);
}

.cc-hand {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.35rem 0;
  transition: opacity 0.2s ease;
}

/* Keeps an empty hand from collapsing so the board doesn't jump. */
.cc-hand:empty::before {
  content: "";
  flex: 0 0 calc((100% - 1.6rem) / 5);
  aspect-ratio: 1 / 1;
}

.cc-hand.waiting {
  opacity: 0.55;
}

.cc-hand-card {
  flex: 0 0 calc((100% - 1.6rem) / 5);
  border-radius: 12%;
  cursor: pointer;
  transition: transform 0.15s ease;
}

/* The Ladder Prototype's 8-card hands and decks: two rows of 4 (3.0). */
.cc-ladder .cc-hand {
  flex-wrap: wrap;
}

.cc-ladder .cc-hand-card,
.cc-ladder .cc-hand:empty::before {
  flex-basis: calc((100% - 1.2rem) / 4);
  max-width: 96px;
}

.cc-hand-card:disabled,
div.cc-hand-card {
  cursor: default;
}

.cc-hand-card.selected {
  transform: translateY(-10%);
}

#oppHand .cc-hand-card.selected {
  transform: translateY(10%);
}

.cc-hand-card.selected .cc-card {
  box-shadow: 0 0 0 3px var(--win);
}

.cc-result {
  margin-top: 0.8rem;
}

.cc-result-score {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.cc-result .cc-hand-card {
  flex-basis: min(32%, 130px);
}

.cc-result .reset-btn {
  margin-top: 0.8rem;
}

.cc-hand-card.cc-claimed {
  animation: cc-place 0.35s ease-out;
}

/* Hand picker */
.cc-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.cc-pick {
  position: relative;
  border-radius: 12%;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.cc-pick.selected {
  transform: translateY(-4px);
}

.cc-pick.selected .cc-card {
  box-shadow: 0 0 0 3px var(--accent);
}

.cc-pick.selected::after {
  content: "✓";
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Collection page */
.cc-heading {
  font-size: 0.85rem;
  text-align: left;
  margin: 1.2rem 0 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.cc-collection {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.8rem;
}

.cc-collect-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.cc-collect-item.missing .cc-card {
  filter: grayscale(1) brightness(0.55);
}

.cc-caption {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  font-weight: 600;
  gap: 0.1rem;
}

.cc-caption .cc-muted {
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cc-count {
  background: var(--cell);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.cc-collect-item.missing .cc-count {
  color: var(--muted);
  font-weight: 400;
}

.cc-history {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  text-align: left;
}

.cc-history li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem;
  background: var(--cell);
  border-radius: 0.5rem;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.cc-win {
  color: #4ade80;
}

.cc-loss {
  color: var(--x-color);
}

.cc-draw {
  color: var(--win);
}

.cc-when {
  margin-left: auto;
  font-size: 0.75rem;
}

.cc-btn-link {
  display: inline-block;
  text-decoration: none;
}

.cc-danger {
  background: #b91c1c;
}

.setting-block .cc-input {
  margin-bottom: 0.4rem;
}

.setting-block .cc-danger {
  margin-top: 0.8rem;
}

/* Card Builder */
.cc-rarity-table {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cc-rarity-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.6fr 1.3fr;
  gap: 0.5rem;
  align-items: center;
  background: var(--cell);
  border-radius: 0.6rem;
  padding: 0.45rem 0.6rem;
  text-align: left;
  font-size: 0.9rem;
}

.cc-rarity-row.cc-rarity-head {
  background: none;
  padding: 0 0.6rem;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cc-rarity-name {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--rarity-color);
}

.cc-dot {
  flex: 0 0 auto;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  background: var(--rarity-color);
  transform: rotate(45deg);
}

.cc-pct-input {
  position: relative;
}

.cc-pct-input::after {
  content: "%";
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.cc-pct-input .cc-input {
  background: var(--panel);
  padding: 0.4rem 1.4rem 0.4rem 0.5rem;
  -moz-appearance: textfield;
}

.cc-pct-input .cc-input::-webkit-inner-spin-button,
.cc-pct-input .cc-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cc-rarity-actual small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.cc-chance-total {
  font-weight: 600;
  margin: 0.7rem 0;
  color: #4ade80;
}

.cc-chance-total.bad {
  color: var(--x-color);
}

#chanceForm .reset-btn {
  margin-top: 0.8rem;
}

.reset-btn:disabled {
  opacity: 0.5;
  cursor: default;
  filter: none;
}

.cc-builder {
  text-align: left;
}

.cc-builder label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.9rem 0 0.35rem;
}

.cc-builder-card {
  display: grid;
  grid-template-columns: auto min(160px, 42vw) auto;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
}

.cc-builder-preview {
  grid-area: 2 / 2;
}

.cc-sel-top { grid-area: 1 / 2; justify-self: center; }
.cc-sel-left { grid-area: 2 / 1; }
.cc-sel-right { grid-area: 2 / 3; }
.cc-sel-bottom { grid-area: 3 / 2; justify-self: center; }

.cc-side-select {
  background: var(--cell);
  color: var(--text);
  border: 2px solid transparent;
  border-radius: 0.5rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.35rem 0.4rem;
  cursor: pointer;
}

.cc-side-select:focus {
  outline: none;
  border-color: var(--accent);
}

.cc-emoji-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

.cc-emoji-picks button {
  font-size: 1.25rem;
  line-height: 1;
  background: var(--cell);
  border: none;
  border-radius: 0.4rem;
  padding: 0.3rem 0.35rem;
  cursor: pointer;
  touch-action: manipulation;
}

.cc-emoji-picks button:hover {
  background: var(--cell-hover);
}

.size-option.cc-rarity-option {
  color: var(--rarity-color);
  font-size: 0.8rem;
  padding: 0.6rem 0.2rem;
}

.size-option.cc-rarity-option.selected {
  border-color: var(--rarity-color);
}

.cc-error {
  color: var(--x-color);
  font-size: 0.9rem;
  margin: 0.6rem 0 0;
}

.cc-form-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cc-secondary {
  background: var(--cell);
}

.cc-pool-item {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.cc-pool-item.editing .cc-card {
  box-shadow: 0 0 0 3px var(--accent);
}

.cc-admin-back {
  margin-top: 1.5rem;
}

.setting-block .cc-admin-link {
  margin-top: 0.8rem;
}

/* Collection groups and Card Builder pool filters */
.cc-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cc-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.cc-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.cc-rarity-heading {
  font-size: 0.95rem;
  text-align: left;
  margin: 0.9rem 0 0.5rem;
}

.cc-none {
  text-align: left;
  margin: 0 0 0.5rem;
}

.cc-pool-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.cc-pool-filters .cc-input {
  padding: 0.5rem 0.7rem;
}

.cc-pool-filters .cc-side-select {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Card Viewer (3.20) */
.cc-viewer-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.cc-viewer-filters .cc-input {
  grid-column: 1 / -1;
  padding: 0.5rem 0.7rem;
}

.cc-viewer-filters .cc-select,
.cc-viewer-filters .reset-btn {
  width: 100%;
  min-width: 0;
  margin: 0;
  font-size: 0.85rem;
}

.cc-viewer-settings {
  margin-top: 1.6rem;
}

.cc-viewer-settings > summary {
  cursor: pointer;
}

.cc-btn-link[hidden] {
  display: none;
}

.cc-viewer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 2.2rem 0.6rem 0;
}

.cc-viewer-nav .reset-btn {
  margin: 0;
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
}

.cc-viewer-pos {
  font-size: 0.85rem;
  opacity: 0.75;
  white-space: nowrap;
}

.cc-viewer-ranks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.cc-viewer-ranks .size-option {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

/* Simulator */
.cc-sim-note {
  margin: -0.4rem 0 0.4rem;
  text-align: center;
}

.cc-fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 0.8rem;
  align-items: center;
  text-align: left;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

.cc-fields label {
  color: var(--muted);
}

.cc-select {
  width: 100%;
  min-width: 0;
  background: var(--cell);
  color: var(--text);
  border: 2px solid transparent;
  border-radius: 0.5rem;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.5rem;
  cursor: pointer;
}

.cc-select:focus {
  outline: none;
  border-color: var(--accent);
}

.cc-sim-preview {
  margin-bottom: 0.4rem;
}

.cc-sim-controls .size-options {
  margin-bottom: 0;
}

.cc-sim-controls .cc-form-actions {
  margin-top: 0.8rem;
}

#watchArea {
  margin-top: 1rem;
}

.cc-sim-results {
  margin-top: 1.2rem;
  text-align: left;
}

.cc-sim-title {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0 0 0.7rem;
}

/* One stacked bar: 2px panel-colored gaps between segments, rounded ends. */
.cc-outcome-bar {
  display: flex;
  gap: 2px;
  height: 2.2rem;
  border-radius: 4px;
  overflow: hidden;
  background: var(--panel);
}

.cc-outcome-seg {
  flex-basis: 0;
  min-width: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--outcome-ink);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.cc-outcome-win { background: var(--outcome-win); }
.cc-outcome-draw { background: var(--outcome-draw); }
.cc-outcome-loss { background: var(--outcome-loss); }

.cc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin: 0.55rem 0 1rem;
  font-size: 0.82rem;
  color: var(--text);
}

.cc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cc-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
}

.cc-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

.cc-sim-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.3rem;
  font-size: 0.9rem;
}

.cc-sim-table caption {
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.cc-sim-table th,
.cc-sim-table td {
  padding: 0.45rem 0.6rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cc-sim-table th:first-child {
  text-align: left;
}

.cc-sim-table thead th {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding-top: 0;
  padding-bottom: 0;
}

.cc-sim-table tbody th,
.cc-sim-table tbody td {
  background: var(--cell);
}

.cc-sim-table tbody th {
  border-radius: 0.5rem 0 0 0.5rem;
  font-weight: 600;
}

.cc-sim-table tbody td:last-child {
  border-radius: 0 0.5rem 0.5rem 0;
}

.setting-block .cc-admin-link + .cc-admin-link {
  margin-left: 0.4rem;
}

.cc-run-status {
  min-height: 1.3em;
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Coins and packs */
.cc-profile-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.cc-result-coins {
  margin: 0 0 0.6rem;
  font-weight: 700;
  color: var(--win);
}

.cc-wallet {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--cell);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  margin-bottom: 0.8rem;
}

.cc-pack-art {
  position: relative;
  width: min(170px, 48vw);
  aspect-ratio: 3 / 4;
  margin: 0.2rem auto 1rem;
  border-radius: 0.9rem;
  background: linear-gradient(155deg, #8b7dff 0%, #6c63ff 45%, #3b2f9e 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 3px rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  color: #fff;
  overflow: hidden;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.cc-pack-art:disabled {
  cursor: default;
  opacity: 1;
}

.cc-pack-art:not(:disabled):hover {
  transform: translateY(-3px) rotate(-1deg);
}

.cc-pack-art:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.cc-pack-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 10px, transparent 10px 20px);
}

.cc-pack-brand {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.85;
}

.cc-pack-icon {
  font-size: 3rem;
  line-height: 1;
}

.cc-pack-name {
  font-weight: 800;
  font-size: 1.05rem;
}

.cc-pack-size {
  font-size: 0.8rem;
  opacity: 0.85;
}

.cc-pack-tear {
  animation: cc-tear 0.7s ease-in forwards;
}

@keyframes cc-tear {
  0% { transform: rotate(0); }
  15% { transform: rotate(-4deg); }
  30% { transform: rotate(4deg); }
  45% { transform: rotate(-3deg); }
  60% { transform: rotate(2deg); opacity: 1; }
  100% { transform: scale(1.25); opacity: 0; }
}

.cc-odds-table {
  margin-top: 1rem;
}

.cc-odds-table .cc-rarity-name {
  font-weight: 600;
}

.cc-pack-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.4rem 0 0.6rem;
}

.cc-pack-slot {
  position: relative;
  flex: 0 0 min(30%, 130px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  animation: cc-deal 0.35s ease-out both;
}

.cc-pack-slot:disabled {
  cursor: default;
}

@keyframes cc-deal {
  from { transform: translateY(30px) scale(0.8); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.cc-card-back {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12%;
  border: 3px solid #8b7dff;
  background: repeating-linear-gradient(45deg, #4a3fb8 0 8px, #3b2f9e 8px 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  transition: transform 0.15s ease;
}

.cc-pack-slot:not(:disabled):hover .cc-card-back {
  transform: translateY(-4px);
}

.cc-card.cc-glow {
  box-shadow: 0 0 0 2px var(--rarity-color), 0 0 18px var(--rarity-color);
}

.cc-new-badge {
  position: absolute;
  top: -0.45rem;
  right: -0.45rem;
  background: var(--win);
  color: #1e1f29;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}

.cc-pack-slot .cc-caption {
  font-size: 0.8rem;
}

/* Collection groups: name, found / total, and a progress meter (the track
   is a darker step of the accent, the fill the accent itself). */
.cc-group-by {
  margin: 0.2rem 0 0.4rem;
}

.cc-group-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.3rem 0.5rem;
  margin: 1rem 0 0.6rem;
}

.cc-group-head .cc-rarity-heading {
  margin: 0;
}

.cc-group-count {
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cc-meter {
  grid-column: 1 / -1;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(108, 99, 255, 0.22);
  overflow: hidden;
}

.cc-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

/* The opponent's cards in hand: an outline in their color, face down. */
.cc-card-hidden {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12%;
  border: 3px solid var(--muted);
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 6px, transparent 6px 12px), var(--bg);
}

.cc-card-hidden.red {
  border-color: var(--red-color);
}

.cc-card-hidden.blue {
  border-color: var(--blue-color);
}

/* Catalog: unfound cards, tappable items and the close-up */
.cc-catalog-item {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.cc-catalog-item:focus-visible .cc-card,
.cc-catalog-item:focus-visible .cc-card-unfound {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.cc-card-unfound {
  container-type: inline-size;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12%;
  border: 3px dashed var(--rarity-color, var(--muted));
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4cqw;
}

.cc-unfound-no {
  font-size: 20cqw;
  font-weight: 800;
  color: var(--muted);
}

.cc-unfound-rarity {
  font-size: 10cqw;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rarity-color);
}

.cc-tap-hint {
  margin: 0.4rem 0 0;
}

.cc-dialog {
  border: none;
  border-radius: 1rem;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  width: min(92vw, 360px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.cc-dialog::backdrop {
  background: rgba(10, 10, 16, 0.7);
}

.cc-closeup {
  padding: 1.25rem;
  text-align: center;
}

.cc-closeup-card {
  width: min(200px, 56vw);
  margin: 0 auto 0.8rem;
}

.cc-closeup-title {
  margin: 0;
  font-size: 1.3rem;
}

.cc-closeup-meta {
  margin: 0.25rem 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.cc-closeup-stats {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin: 0 0 0.6rem;
  padding: 0.7rem 0.9rem;
  background: var(--cell);
  border-radius: 0.6rem;
  text-align: left;
  font-size: 0.9rem;
}

.cc-closeup-stats dt {
  color: var(--muted);
}

.cc-closeup-stats dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cc-closeup-stats:empty {
  display: none;
}

.cc-closeup .reset-btn {
  margin-top: 0.6rem;
}

/* Hand picker: Cards / My Decks tabs, saving a deck, the deck list */
.cc-tabs {
  margin-bottom: 0.8rem;
}

.cc-save-deck {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0.6rem;
}

.cc-save-deck .cc-input {
  flex: 1 1 10rem;
  padding: 0.55rem 0.7rem;
}

.cc-save-deck .reset-btn {
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
}

.cc-play-btn {
  margin-top: 0.2rem;
}

.cc-deck-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  text-align: left;
}

.cc-deck-row {
  background: var(--cell);
  border: 2px solid transparent;
  border-radius: 0.8rem;
  padding: 0.6rem 0.7rem 0.4rem;
  transition: border-color 0.15s ease;
}

.cc-deck-row.selected {
  border-color: var(--accent);
}

.cc-deck-pick {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.cc-deck-pick:disabled {
  cursor: default;
  opacity: 0.6;
}

.cc-deck-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.cc-deck-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
}

.cc-deck-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 0.35rem;
}

.cc-link-btn {
  background: none;
  border: none;
  padding: 0.25rem 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a9a4ff;
  cursor: pointer;
}

.cc-link-btn:hover {
  text-decoration: underline;
}

/* Online profile: Google sign-in button, status, profile choice */
.cc-cloud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.cc-google-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #747775;
  border-radius: 999px;
  padding: 0.55rem 1.1rem 0.55rem 0.9rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.cc-google-btn:hover {
  background: #f2f2f2;
}

.cc-google-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.cc-cloud-badge {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
}

.cc-cloud-badge:hover {
  color: var(--text);
}

.cc-setup-cloud {
  margin-top: 1rem;
}

.cc-setup-cloud .cc-cloud-actions {
  justify-content: center;
}

.cc-or {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 0.6rem;
}

.cc-or::before,
.cc-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--cell-hover);
}

/* Play buttons: the computer, or (online) another player. */
.cc-play-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

/* Find a Player: three cards shuffling while the queue looks. */
.cc-queue {
  padding: 1.2rem 0 0.4rem;
}

.cc-queue-cards {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* 3.28.2: animals hopping across the box while looking for a player. */
.cc-queue-parade {
  position: relative;
  width: 100%;
  max-width: 26rem;
  height: 7.5rem;
  margin: 0 auto 1rem;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(120, 200, 255, 0.10) 0%, rgba(120, 200, 255, 0.02) 62%, transparent 62%),
    linear-gradient(180deg, transparent 72%, rgba(120, 220, 140, 0.22) 72%, rgba(60, 140, 80, 0.30) 100%),
    rgba(20, 14, 34, 0.55);
}

.cc-queue-parade[hidden] {
  display: none;
}

.cc-parade-canvas {
  position: absolute;
  inset: 0;
}

.cc-queue-cards[hidden] {
  display: none;
}

.cc-queue-cards span {
  width: 3.2rem;
  aspect-ratio: 1 / 1;
  border-radius: 12%;
  background: linear-gradient(160deg, var(--accent), #3a3480);
  animation: cc-queue-bob 1.2s ease-in-out infinite;
}

.cc-queue-cards span:nth-child(2) {
  animation-delay: 0.2s;
}

.cc-queue-cards span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes cc-queue-bob {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(-0.5rem); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-queue-cards span {
    animation: none;
  }
}

/* Live games: the turn clock beside the player whose turn it is. */
.cc-bar .cc-timer {
  margin-left: auto;
  margin-right: 0.6rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--muted);
}

.cc-bar .cc-timer.cc-low {
  color: var(--win);
}

.cc-resign {
  display: block;
  margin: 0.2rem auto 0;
  color: var(--muted);
}

/* Strikes on an owned copy: marks in the card's bottom-right corner, clear
   of the bottom number. */
.cc-strikes {
  position: absolute;
  right: 8%;
  bottom: 6%;
  display: flex;
  gap: 2cqi;
}

.cc-strike {
  width: 9cqi;
  height: 9cqi;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.35);
}

.cc-strike.on {
  background: var(--red-color);
  border-color: #fff;
}

.cc-result-strikes .cc-note {
  margin-bottom: 0.2rem;
}

.cc-struck {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.cc-struck .cc-caption {
  font-size: 0.75rem;
}

.cc-struck.cc-lost .cc-card {
  filter: grayscale(1) brightness(0.6);
}

.cc-struck.cc-lost .cc-caption {
  color: var(--red-color);
}

/* Claim choices can carry a NEW tag in the corner. */
#claimChoices .cc-hand-card {
  position: relative;
}

/* Rarity filter chips (hand picker, collection): smaller than the main
   options, each rarity's chip edged in its color. */
.cc-filter {
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.cc-filter .size-option {
  flex: 0 1 auto;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 999px;
}

.cc-filter .size-option[style*="--rarity-color"] {
  box-shadow: inset 0 -2px 0 var(--rarity-color);
}

.cc-filter .size-option.selected[style*="--rarity-color"] {
  border-color: var(--rarity-color);
}

/* 3.24.0: Strongest Deck and Balanced Deck */
.cc-auto-deck {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
}

.cc-auto-deck .reset-btn {
  flex: 1;
  margin: 0;
  padding: 0.5rem 0.4rem;
  font-size: 0.92rem;
}

.cc-pick-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem 0.6rem;
}

.cc-pick-tools .cc-filter {
  margin-bottom: 0;
}

.cc-sort {
  width: auto;
  margin-left: auto;
  margin-bottom: 0.6rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

/* The pack shop: one offer per pack, side by side when there's room. */
.cc-pack-offers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 1.2rem;
}

.cc-pack-art[data-pack="legend"] {
  background: linear-gradient(155deg, #fff3b0 0%, #f59e0b 35%, #b45309 70%, #451a03 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 22px rgba(245, 158, 11, 0.65),
    inset 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.cc-pack-art[data-pack="apex"] {
  background: linear-gradient(155deg, #f0abfc 0%, #c084fc 35%, #7c3aed 70%, #3b1a6e 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 18px rgba(192, 132, 252, 0.55),
    inset 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Upgraded numbers: gold, with a soft glow. */
.cc-num.cc-up {
  color: #fcd34d;
  text-shadow: 0 0 4cqw rgba(252, 211, 77, 0.75), 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Level and XP in the profile bar. */
.cc-level-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.cc-level {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--win);
}

.cc-xp-bar {
  position: relative;
  width: 4.5rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--cell-hover);
  overflow: hidden;
}

.cc-xp-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--win);
  border-radius: 999px;
}

.cc-xp-text {
  font-size: 0.75rem;
}

.cc-result-xp {
  margin: -0.3rem 0 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.cc-result-xp.cc-level-up {
  color: var(--win);
  font-weight: 800;
}

/* Upgrading a copy (collection close-up). */
.cc-upgrade {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--cell-hover);
  text-align: left;
}

.cc-upgrade-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.cc-upgrade-copies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0;
}

.cc-upgrade-copies .cc-hand-card {
  flex: 0 0 3.6rem;
}

.cc-upgrade-sides {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  margin: 0.4rem 0;
}

.cc-upgrade-sides .size-option {
  padding: 0.5rem 0.3rem;
  font-size: 0.85rem;
}

.cc-upgrade-sides .size-option:disabled {
  opacity: 0.5;
  cursor: default;
}

.cc-upgrade-cost {
  margin: 0.2rem 0 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.cc-upgrade .reset-btn {
  width: 100%;
}

/* The close-up's Holos rows: what it does, then its price. */
.cc-holo-row {
  display: grid;
  gap: 0.4rem;
  padding: 0.5rem 0;
  border-top: 1px dashed var(--cell-hover);
}

.cc-holo-row:first-of-type {
  border-top: 0;
}

.cc-holo-row-text {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.cc-holo-row-text .cc-upgrade-cost {
  margin: 0;
}

/* The WildFlip logo beside the title. */
.cc-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.cc-logo {
  width: 1.3em;
  height: 1.3em;
}

/* Admin-only pages for everyone else: just the title, the note and the way back. */
.cc-locked > :not(h1):not(.cc-gate) {
  display: none !important;
}

/* --- The tour --- */
.cc-tour-dots {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.2rem 0 0.6rem;
}

.cc-tour-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--cell-hover);
}

.cc-tour-dot.done {
  background: var(--muted);
}

.cc-tour-dot.on {
  background: var(--win);
}

/* The coach: what to do now. */
.cc-coach {
  background: var(--cell);
  border-left: 4px solid var(--win);
  border-radius: 0.7rem;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.8rem;
  text-align: left;
}

.cc-coach-title {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.cc-coach-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.cc-tour-stage {
  min-height: 12rem;
}

/* Back and Next stay at the bottom of the screen, so moving on never
   needs a scroll, however long the step. */
.cc-tour-nav {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 1rem;
  padding: 0.7rem 0 calc(0.7rem + env(safe-area-inset-bottom, 0px));
  background: var(--panel);
  box-shadow: 0 -14px 14px -10px var(--panel);
}

.cc-tour-skip {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
}

/* Whatever the tour wants tapped next glows. */
.cc-tour-hint {
  animation: cc-tour-pulse 1.1s ease-in-out infinite;
  border-radius: 0.6rem;
}

@keyframes cc-tour-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--win); }
  50% { box-shadow: 0 0 0 4px var(--win), 0 0 16px var(--win); }
}

@media (prefers-reduced-motion: reduce) {
  .cc-tour-hint {
    animation: none;
    box-shadow: 0 0 0 3px var(--win);
  }
}

.cc-tour-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cc-tour-logo {
  width: 8rem;
  height: 8rem;
}

.cc-tour-list {
  text-align: left;
  line-height: 1.5;
  padding-left: 1.2rem;
}

.cc-tour-table {
  margin: 0.8rem 0;
}

.cc-tour-claim .cc-hand-card,
.cc-tour-copies .cc-hand-card {
  position: relative;
  flex-basis: min(30%, 110px);
}

/* 3.27.2 upgrade step: tap the card's number (a finger points at it), then confirm. */
.cc-tour-upgrade-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.6rem;
  margin: 0.6rem 0 0.2rem;
}

.cc-tour-upgrade-card {
  position: relative;
  width: min(42vw, 9.5rem);
}

.cc-tour-upgrade-card .cc-card {
  width: 100%;
}

.cc-tour-upgrade-card .cc-num {
  font-size: 1.15em;
}

.cc-tour-upgrade-spare {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: min(22vw, 5rem);
  opacity: 0.8;
  font-size: 0.75rem;
}

.cc-tour-upgrade-spare .cc-card {
  width: 100%;
}

.cc-tour-finger {
  position: absolute;
  z-index: 5;
  font-size: 1.9rem;
  line-height: 1;
  pointer-events: none;
  transform: translate(0, -50%);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  animation: cc-tour-finger-x 0.9s ease-in-out infinite;
}

.cc-tour-finger.cc-tour-finger-down {
  transform: translate(-50%, -100%);
  animation-name: cc-tour-finger-y;
}

@keyframes cc-tour-finger-x {
  0%, 100% { translate: 0 0; }
  50% { translate: -0.35rem 0; }
}

@keyframes cc-tour-finger-y {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 0.35rem; }
}

.cc-tour-alt {
  margin: 0.9rem 0 0.3rem;
  font-size: 0.8rem;
}

.cc-tour-sides .size-option {
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
}

@media (prefers-reduced-motion: reduce) {
  .cc-tour-finger {
    animation: none;
  }
}

.cc-tour-closeup {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cc-tour-closeup .cc-card {
  width: 7rem;
}

.cc-tour-link {
  display: inline-block;
  margin: 0.3rem 0 0.6rem;
}

/* Levels: cards not released yet, and packs not unlocked yet. */
.cc-unfound-lock {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
}

.cc-pack-locked .cc-pack-art {
  filter: grayscale(0.7) brightness(0.7);
}

/* --- Bottom navigation (cards-ui.js) ---
   Fixed to the bottom of the screen on every WildFlip page except during a
   game; pages leave room for it. */
body.cc-with-nav {
  padding-bottom: calc(4.6rem + env(safe-area-inset-bottom));
}

.cc-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  background: rgba(30, 31, 41, 0.96);
  border-top: 1px solid var(--cell);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.35);
  padding: 0.3rem env(safe-area-inset-right) calc(0.3rem + env(safe-area-inset-bottom)) env(safe-area-inset-left);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.cc-nav[hidden] {
  display: none;
}

.cc-nav-item {
  flex: 1;
  max-width: 7.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.2rem;
  border-radius: 0.6rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.cc-nav-item svg {
  width: 1.5rem;
  height: 1.5rem;
}

.cc-nav-item:hover {
  color: var(--text);
}

.cc-nav-item[aria-current="page"] {
  color: var(--text);
  background: rgba(108, 99, 255, 0.22);
}

.cc-nav-item[aria-current="page"] svg {
  color: #a9a4ff;
}

/* --- Top strip (cards-ui.js WildFlipBar): level and XP, coins, Holos.
   Fixed to the top on every WildFlip page except during a game. */
body.cc-with-topbar {
  padding-top: calc(2.6rem + env(safe-area-inset-top));
}

.cc-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  height: calc(2.3rem + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) calc(0.8rem + env(safe-area-inset-right)) 0 calc(0.8rem + env(safe-area-inset-left));
  background: rgba(30, 31, 41, 0.96);
  border-bottom: 1px solid var(--cell);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 0.8rem;
  color: var(--text);
}

.cc-topbar[hidden] {
  display: none;
}

.cc-topbar a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  border-radius: 0.5rem;
  padding: 0.2rem 0.3rem;
}

.cc-topbar a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cc-top-level {
  flex: 1;
  min-width: 0;
  max-width: 16rem;
  gap: 0.45rem;
}

.cc-top-lv {
  white-space: nowrap;
  color: var(--muted);
  font-weight: 600;
}

.cc-top-lv b {
  color: var(--text);
}

.cc-top-xp {
  flex: 1;
  min-width: 2.5rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--cell);
  overflow: hidden;
}

.cc-top-xp-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #6c63ff, #a9a4ff);
  transition: width 0.6s ease;
}

.cc-top-xp-text {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.cc-top-wallet {
  gap: 0.8rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cc-top-coins,
.cc-top-holos {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.cc-holo-icon {
  width: 1.05rem;
  height: 1.05rem;
}

@media (max-width: 360px) {
  .cc-top-xp-text {
    display: none;
  }
}

/* The play buttons stay in reach above the bottom bar on Home and Play. */
/* Under the deck on Home and Play (moved into .cc-play-slot by cards.js). */
.cc-play-bar {
  margin: 0.4rem 0 0.8rem;
}

.cc-play-bar {
  flex-wrap: nowrap;
}

.cc-play-bar .reset-btn {
  flex: 1 1 0;
  max-width: 13rem;
  margin-top: 0;
  padding: 0.7rem 0.6rem;
  font-size: 0.95rem;
}

#cardsTab .cc-tap-hint {
  margin-bottom: 0.7rem;
}

/* The deck's cards on Home and Play, with "+" for each empty slot. */
.cc-home-deck {
  margin-bottom: 0.2rem;
}

.cc-empty-slot {
  aspect-ratio: 1 / 1;
  border-radius: 12%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--cell-hover) !important;
  color: var(--muted);
  font-size: 1.4rem;
}

#homeView .cc-heading-row {
  margin-top: 0.4rem;
}

#homeView .cc-tour-link {
  display: inline-block;
  margin-top: 0.8rem;
}

/* Close-up extras: the corner close button, copies and deck panel. */
.cc-closeup {
  position: relative;
}

/* A big, easy target (at least 44 × 44 px), above everything in the
   close-up, so a tap near the corner always closes it. */
.cc-closeup-x {
  /* Pinned to the corner, even when a long close-up scrolls. */
  position: sticky;
  top: 0.35rem;
  margin: -0.85rem -0.85rem -2.9rem auto;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

/* An invisible margin around it that also counts as the button. */
.cc-closeup-x::after {
  content: "";
  position: absolute;
  inset: -0.5rem;
}

.cc-closeup-x:hover,
.cc-closeup-x:focus-visible {
  background: rgba(0, 0, 0, 0.7);
  border-color: var(--accent);
}

/* Room for the close button, so the title never runs under it. */
.cc-closeup-title {
  padding-right: 3.2rem;
  padding-left: 3.2rem;
}

.cc-closeup-copies {
  justify-content: center;
  margin: 0 0 0.6rem;
}

.cc-closeup-deck .reset-btn {
  width: 100%;
}

.cc-closeup-play {
  display: block;
  margin-top: 0.6rem;
  text-align: center;
}

.cc-dialog {
  max-height: 92dvh;
}

.cc-dialog [hidden] {
  display: none !important;
}

.cc-closeup-deck .cc-upgrade-copies {
  flex-wrap: nowrap;
}

.cc-closeup-deck .cc-upgrade-copies .cc-hand-card {
  flex: 1 1 0;
  min-width: 0;
}

/* --- Players waiting (online): Play in the bottom bar and Find a Player --- */
.cc-nav-item {
  position: relative;
}

.cc-nav-item.cc-nav-alert {
  color: var(--text);
  animation: cc-nav-glow 1.6s ease-in-out infinite;
}

.cc-nav-item.cc-nav-alert svg {
  color: var(--red-color);
}

@keyframes cc-nav-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.45); }
}

.cc-nav-badge {
  position: absolute;
  top: 0.15rem;
  right: calc(50% - 1.5rem);
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--red-color);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.15rem;
}

/* Find a Player: a bold full color of its own, as strong as Play the
   Computer, so live games draw the eye. */
.reset-btn.cc-find-btn {
  background: linear-gradient(135deg, #ff8a3d, #ff3d7f);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(255, 61, 127, 0.35);
}

.reset-btn.cc-find-btn:disabled {
  box-shadow: none;
}

.reset-btn.cc-find-hot {
  background: var(--red-color);
  color: #fff;
  animation: cc-nav-glow 1.6s ease-in-out infinite;
}

.cc-play-bar {
  flex-wrap: wrap;
}

.cc-lobby-note {
  flex-basis: 100%;
  margin: 0.2rem 0 0;
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 700;
}

/* --- Bonus notes --- */
.cc-toasts {
  position: fixed;
  top: calc(0.8rem + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: min(92vw, 380px);
  pointer-events: none;
}

.cc-toast {
  background: var(--panel);
  border: 1px solid var(--win);
  color: var(--win);
  border-radius: 0.8rem;
  padding: 0.7rem 0.9rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: cc-toast-in 0.35s ease-out;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.cc-toast-out {
  opacity: 0;
  transform: translateY(-0.5rem);
}

@keyframes cc-toast-in {
  from { opacity: 0; transform: translateY(-0.8rem) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* --- First upgrade walkthrough --- */
.cc-coach-note {
  margin: 0.4rem 0;
}

.cc-coach-pulse {
  border-radius: 0.6rem;
  animation: cc-coach-pulse 1.2s ease-in-out infinite;
}

@keyframes cc-coach-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0); }
  50% { box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.7); }
}

/* --- Flip effects: a ring from each flipped card, "+N" from the flipper --- */
.cc-slot {
  position: relative;
}

.cc-burst {
  position: absolute;
  inset: 8%;
  border-radius: 18%;
  border: 3px solid currentColor;
  pointer-events: none;
  animation: cc-burst 0.6s ease-out 0.15s both;
}

.cc-burst.red,
.cc-flip-count.red {
  color: var(--red-color);
}

.cc-burst.blue,
.cc-flip-count.blue {
  color: var(--blue-color);
}

@keyframes cc-burst {
  from { opacity: 0.9; transform: scale(0.85); }
  to { opacity: 0; transform: scale(1.35); }
}

.cc-flip-count {
  position: absolute;
  left: 50%;
  top: 10%;
  z-index: 2;
  font-size: 1.5rem;
  font-weight: 900;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 2px #fff;
  pointer-events: none;
  animation: cc-flip-count 1s ease-out both;
}

@keyframes cc-flip-count {
  0% { opacity: 0; transform: translate(-50%, 20%) scale(0.6); }
  25% { opacity: 1; transform: translate(-50%, -10%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}

/* --- Today's offer in the Store --- */
.cc-daily {
  background: linear-gradient(160deg, rgba(108, 99, 255, 0.22), rgba(255, 209, 102, 0.1));
  border: 1px solid var(--accent);
  border-radius: 0.9rem;
  padding: 0.8rem;
  margin-bottom: 1rem;
  text-align: center;
}

.cc-daily .cc-heading-row {
  align-items: center;
}

.cc-daily-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.cc-daily-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cc-daily-face {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  border-radius: 12%;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.cc-daily-face:not(:disabled):hover,
.cc-daily-face:not(:disabled):focus-visible {
  transform: translateY(-3px);
}

.cc-daily-face:disabled {
  cursor: default;
}

.cc-daily-bought .cc-daily-face {
  opacity: 0.5;
}

.cc-daily-buy {
  padding: 0.45rem 0.3rem;
  font-size: 0.9rem;
}

/* --- My Progress --- */
.cc-progress {
  text-align: left;
}

/* A finished objective: confetti and a callout (3.0). */
.cc-confetti {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1001;
}

.cc-celebrate {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 16px;
  background: transparent;
  color: var(--text);
  place-items: center;
  animation: cc-celebrate-fade 0.2s ease-out;
}

.cc-celebrate[open] {
  display: grid;
}

.cc-celebrate::backdrop {
  background: rgba(8, 10, 20, 0.55);
}

.cc-celebrate-card {
  width: min(360px, 100%);
  padding: 1.4rem 1.2rem 1.1rem;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(160deg, #2b2f55, #3d2a5c);
  border: 2px solid #f5c542;
  box-shadow: 0 0 0 4px rgba(245, 197, 66, 0.18), 0 18px 50px rgba(0, 0, 0, 0.5);
  animation: cc-celebrate-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.cc-celebrate-medal {
  font-size: 3.4rem;
  line-height: 1;
  animation: cc-celebrate-swing 1.2s ease-in-out 0.3s 2;
}

.cc-celebrate-card h2 {
  margin: 0.4rem 0 0.5rem;
  color: #f5c542;
  font-size: 1.35rem;
}

.cc-celebrate-card ul {
  list-style: none;
  margin: 0 0 0.4rem;
  padding: 0;
  line-height: 1.5;
}

.cc-celebrate-coins {
  margin: 0.4rem 0 0.9rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.cc-celebrate-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cc-celebrate-actions .reset-btn {
  text-decoration: none;
}

@keyframes cc-celebrate-fade {
  from { opacity: 0; }
}

@keyframes cc-celebrate-pop {
  from { transform: scale(0.6); opacity: 0; }
}

@keyframes cc-celebrate-swing {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-14deg) scale(1.1); }
  75% { transform: rotate(14deg) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .cc-celebrate,
  .cc-celebrate-card,
  .cc-celebrate-medal {
    animation: none;
  }
}

/* The objective a celebration linked to glows for a moment. */
.cc-objective-list li.cc-objective-new {
  color: var(--text);
  border-radius: 6px;
  animation: cc-objective-glow 2.4s ease-out 0.4s 2;
}

@keyframes cc-objective-glow {
  0%, 100% { background: transparent; }
  30% { background: rgba(245, 197, 66, 0.35); }
}

/* Player objectives on My Progress (3.0). */
.cc-objective-group summary {
  cursor: pointer;
  list-style: none;
}

.cc-objective-group summary::-webkit-details-marker {
  display: none;
}

.cc-objective-list {
  list-style: none;
  margin: 0.2rem 0 0.8rem;
  padding: 0 0 0 0.4rem;
  font-size: 0.88rem;
  line-height: 1.6;
}

.cc-objective-list li.done {
  color: var(--muted);
}

.cc-progress-block {
  margin-bottom: 1.2rem;
}

.cc-progress-row {
  background: var(--cell);
  border-radius: 0.6rem;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
}

.cc-progress-row p {
  margin: 0.3rem 0 0;
}

.cc-progress-row .cc-meter {
  margin-top: 0.4rem;
}

.cc-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.cc-progress-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.cc-progress-card {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .cc-nav-item.cc-nav-alert,
  .reset-btn.cc-find-hot,
  .cc-coach-pulse,
  .cc-burst,
  .cc-flip-count,
  .cc-toast {
    animation: none;
  }

  .cc-burst,
  .cc-flip-count {
    display: none;
  }
}

.cc-progress-card .cc-caption .cc-muted {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 0.75rem;
}

/* --- Background theme (GameTheme in cards-ui.js): the deck's set colors and
   animals, on a layer fixed behind the page. --- */
body.cc-themed::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    var(--theme-pattern, none) 0 0 / 240px 240px repeat,
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
    linear-gradient(160deg, var(--theme-a, var(--bg)), var(--theme-b, var(--bg)));
  transition: opacity 0.4s ease;
}

body.cc-themed {
  background: var(--bg);
}

body.cc-themed .game.cc-page,
body.cc-themed .game {
  background: rgba(42, 44, 58, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

body.cc-themed.cc-in-game .game.cc-page {
  background: rgba(42, 44, 58, 0.55);
}

/* Cards at the player's level (Collection, My Progress) */
.cc-avail-table {
  width: 100%;
}

.cc-avail-table td {
  font-variant-numeric: tabular-nums;
}

.cc-avail-total th,
.cc-avail-total td {
  font-weight: 800;
  border-top: 1px solid var(--cell-hover);
}

.cc-availability .settings-hint {
  margin-top: 0.4rem;
  text-align: left;
}

.cc-avail-next {
  display: block;
  font-size: 0.75rem;
}

/* A card's number on the cards to claim after a win. */
.cc-card-no {
  position: absolute;
  bottom: -1.35rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--cell-hover);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.cc-hand-card.cc-claimed {
  position: relative;
}

#claimChoices {
  padding-bottom: 1.6rem;
}

/* --- Analytics (admins) --- */
.game.cc-page.cc-wide {
  width: min(96vw, 960px);
}

.cc-an-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 1rem;
}

.cc-an-pick {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: left;
}

.cc-an-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cc-an-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: var(--cell);
  border-radius: 0.6rem;
  padding: 0.6rem 0.7rem;
  text-align: left;
}

.cc-an-kpi strong {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.cc-an-kpi-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.cc-an-recs {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cc-an-rec {
  background: var(--cell);
  border-left: 4px solid var(--muted);
  border-radius: 0.5rem;
  padding: 0.6rem 0.8rem;
}

.cc-an-rec p {
  margin: 0.25rem 0 0;
  line-height: 1.4;
  font-size: 0.92rem;
}

.cc-an-change {
  border-left-color: #e8590c;
}

.cc-an-watch {
  border-left-color: #22c55e;
}

.cc-an-ok {
  border-left-color: #0f9f9a;
}

.cc-an-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.cc-an-charts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.cc-an-chart {
  background: var(--cell);
  border-radius: 0.6rem;
  padding: 0.6rem 0.7rem;
  text-align: left;
}

.cc-an-chart-title {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
}

.cc-an-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.cc-an-bar {
  fill: #3987e5;
}

.cc-an-line {
  fill: none;
  stroke: #3987e5;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.cc-an-dot {
  fill: #3987e5;
  stroke: var(--cell);
  stroke-width: 2;
}

.cc-an-axis {
  stroke: var(--muted);
  stroke-width: 1;
}

.cc-an-grid {
  stroke: var(--cell-hover);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.cc-an-tick,
.cc-an-sub {
  fill: var(--muted);
  font-size: 11px;
}

.cc-an-sub {
  font-weight: 700;
}

.cc-an-hit {
  fill: transparent;
  cursor: default;
}

.cc-an-hit:hover,
.cc-an-hit:focus {
  fill: rgba(255, 255, 255, 0.06);
  outline: none;
}

.cc-an-tip {
  position: fixed;
  z-index: 60;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--cell-hover);
  border-radius: 0.4rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  pointer-events: none;
  white-space: nowrap;
}

.cc-an-table summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.cc-an-brief {
  text-align: left;
  background: var(--cell);
  border-radius: 0.6rem;
  padding: 0.6rem 1rem;
  line-height: 1.5;
  font-size: 0.92rem;
  -webkit-user-select: text;
  user-select: text;
}

.cc-an-brief h2 {
  font-size: 1.1rem;
}

.cc-an-brief h3 {
  font-size: 0.98rem;
  margin: 0.9rem 0 0.3rem;
}

.cc-an-brief ul {
  padding-left: 1.2rem;
  margin: 0.2rem 0;
}

/* Analytics: the Players table */
#playersBox {
  margin-top: 1rem;
}

.cc-an-search {
  flex: 0 1 14rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.9rem;
}

.cc-an-scroll {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.cc-an-players {
  width: 100%;
  min-width: 640px;
  font-variant-numeric: tabular-nums;
}

.cc-an-players thead button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-transform: inherit;
  letter-spacing: inherit;
}

.cc-an-players thead button::after {
  content: attr(data-arrow);
  margin-left: 0.25rem;
  font-size: 0.7em;
}

.cc-tour-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.2rem;
  margin: 0.8rem 0 0;
}

#homeView .cc-tour-links .cc-tour-link {
  margin-top: 0;
}

/* Cards with an upgrade ready: a bright yellow border, everywhere they show. */
:root {
  --upgrade-ready: #ffd400;
}

.cc-upgradable {
  position: relative;
}

.cc-upgradable .cc-card,
.cc-upgradable .cc-card-unfound {
  box-shadow: 0 0 0 3px var(--upgrade-ready), 0 0 14px rgba(255, 212, 0, 0.55);
  border-radius: 12%;
}

.cc-upgradable::before {
  content: "⬆";
  position: absolute;
  top: -0.45rem;
  left: -0.35rem;
  z-index: 2;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--upgrade-ready);
  color: #1e1f29;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1.25rem;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* The "ready to upgrade" banner at the top of Collection. */
.cc-ready {
  background: rgba(255, 212, 0, 0.12);
  border: 2px solid var(--upgrade-ready);
  border-radius: 0.9rem;
  padding: 0.8rem;
  margin-bottom: 1.2rem;
  text-align: center;
}

.cc-ready-title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--upgrade-ready);
}

.cc-ready-hint {
  margin: 0.2rem 0 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.cc-ready-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

.cc-ready-cards .cc-hand-card {
  flex: 0 0 calc((100% - 2.8rem) / 5);
  max-width: 5.2rem;
}

@media (prefers-reduced-motion: no-preference) {
  .cc-ready .cc-upgradable .cc-card {
    animation: cc-ready-glow 1.8s ease-in-out infinite;
  }
}

@keyframes cc-ready-glow {
  0%, 100% { box-shadow: 0 0 0 3px var(--upgrade-ready), 0 0 8px rgba(255, 212, 0, 0.35); }
  50% { box-shadow: 0 0 0 3px var(--upgrade-ready), 0 0 18px rgba(255, 212, 0, 0.75); }
}

/* Lost cards (third strike): greyed out in Collection and the close-up. */
.cc-lost-card .cc-card,
.cc-lost-face {
  filter: grayscale(1);
  opacity: 0.55;
}

.cc-lost-card .cc-count {
  background: var(--cell-hover);
  color: var(--muted);
}

/* BACK: a lost card that's on offer again. */
.cc-back-badge {
  background: #9ad7ff;
  color: #10202c;
}

/* Collection: search, sort and show controls */
.cc-collect-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.cc-collect-search {
  grid-column: 1 / -1;
  padding: 0.5rem 0.7rem;
  font-size: 0.95rem;
}

.cc-collect-tool {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cc-collect-tool .cc-select {
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

/* MAX (all upgrades) and ULTRA (two Max copies merged) cards */
/* The tag sits in the card's empty bottom-right corner. */
.cc-tier {
  position: absolute;
  bottom: 5%;
  right: 4%;
  z-index: 2;
  padding: 0.1em 0.35em;
  border-radius: 999px;
  font-size: 7.5cqw;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}

.cc-max .cc-tier {
  background: #ffd166;
  color: #1e1f29;
}

.cc-ultra {
  box-shadow: 0 0 0 2px #fff, 0 0 12px rgba(255, 255, 255, 0.5);
}

.cc-ultra .cc-tier {
  background: linear-gradient(90deg, #ff6b6b, #ffd166, #4ecdc4, #6c63ff, #f472b6);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.cc-merge .cc-closeup-play {
  margin-top: 0.4rem;
}

/* Legendary cards: a molten gold border and gem, a slow shimmer, and in play
   (where the border shows the player's color) a gold inner ring. */
.cc-card[data-rarity="legendary"] {
  border-color: transparent;
  background:
    linear-gradient(160deg, #5a3d12, #2b1c08) padding-box,
    linear-gradient(135deg, #fff3b0, #f59e0b 40%, #b45309 70%, #fde68a) border-box;
}

.cc-card[data-rarity="legendary"].red {
  border-color: var(--red-color);
  background: linear-gradient(160deg, #c2414b, #6b1d26);
}

.cc-card[data-rarity="legendary"].blue {
  border-color: var(--blue-color);
  background: linear-gradient(160deg, #3c6fd8, #1b326e);
}

.cc-card[data-rarity="legendary"].red::after,
.cc-card[data-rarity="legendary"].blue::after {
  content: "";
  position: absolute;
  inset: 3cqw;
  border: 1.5px solid #fde68a;
  border-radius: 9%;
  box-shadow: 0 0 5cqw rgba(245, 158, 11, 0.7);
  pointer-events: none;
}

.cc-card[data-rarity="legendary"] .cc-gem {
  width: 15cqw;
  height: 15cqw;
  background: linear-gradient(135deg, #fffbeb 0%, #fde68a 30%, #f59e0b 60%, #b45309 100%);
  box-shadow: 0 0 0 1.5cqw rgba(0, 0, 0, 0.35), 0 0 9cqw #fbbf24;
}

@media (prefers-reduced-motion: no-preference) {
  .cc-card[data-rarity="legendary"].neutral::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 236, 160, 0.22) 50%, transparent 65%);
    background-size: 250% 100%;
    animation: cc-legend-shine 3.5s ease-in-out infinite;
    pointer-events: none;
  }
}

@keyframes cc-legend-shine {
  0% { background-position: 120% 0; }
  60%, 100% { background-position: -120% 0; }
}

/* A card whose strikes a win just cleared. */
.cc-cleared .cc-caption {
  color: #6ee7b7;
}

/* --- BlurryWare studio splash (blurryware-splash.js): plays once a session
   over the game page while the player's data loads. --- */
html.bw-splash-on,
html.bw-splash-on body {
  overflow: hidden;
}

.bw-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background: radial-gradient(130% 80% at 50% 42%, #182134 0%, #070a12 72%);
  perspective: 700px;
  cursor: pointer;
  transition: opacity 0.55s ease;
}

.bw-splash.bw-splash-out {
  opacity: 0;
  pointer-events: none;
}

/* Larger than the screen, so the tilted plane's edges stay out of view. */
.bw-splash-tilt {
  position: absolute;
  inset: -18%;
  transform-style: preserve-3d;
  transform: rotateX(12deg) rotateY(-14deg);
  animation: bw-splash-sway 9s ease-in-out infinite alternate;
}

@keyframes bw-splash-sway {
  from { transform: rotateX(14deg) rotateY(-16deg); }
  to { transform: rotateX(6deg) rotateY(13deg); }
}

.bw-splash-tilt canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bw-splash-soft {
  opacity: 0;
  will-change: filter, opacity, transform;
}

.bw-splash-loader {
  position: absolute;
  left: max(14%, env(safe-area-inset-left, 0px));
  right: max(14%, env(safe-area-inset-right, 0px));
  bottom: calc(11% + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 10px;
}

.bw-splash-row {
  display: flex;
  justify-content: space-between;
  font: 500 10px/1 "Unbounded", "Arial Black", Impact, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(196, 208, 230, 0.8);
  font-variant-numeric: tabular-nums;
}

.bw-splash-track {
  height: 3px;
  border-radius: 3px;
  background: rgba(196, 208, 230, 0.18);
  overflow: hidden;
}

.bw-splash-bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #c4d0e6, #ffb37a);
  box-shadow: 0 0 10px #ffb37a;
}

/* Privacy policy and terms */
.cc-legal {
  text-align: left;
  line-height: 1.55;
}

.cc-legal h1 {
  text-align: center;
}

.cc-legal h2 {
  font-size: 1.05rem;
  margin: 1.2rem 0 0.4rem;
}

.cc-legal ul {
  padding-left: 1.2rem;
  margin: 0.3rem 0;
}

.cc-legal li {
  margin-bottom: 0.35rem;
}

.cc-legal-draft {
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid var(--win);
  border-radius: 0.6rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
}

.cc-legal-links {
  margin-top: 1.2rem;
  text-align: center;
  font-size: 0.9rem;
}

/* Live game board: a small NEW (or BACK) on the opponent's cards the player
   doesn't have, so they know which ones are worth capturing to claim. */
.cc-slot .cc-tag-mini {
  top: 0.15rem;
  right: 0.15rem;
  z-index: 2;
  font-size: 0.5rem;
  padding: 0.08rem 0.3rem;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Cards to claim: how many copies the player already has. */
.cc-have-badge {
  position: absolute;
  top: -0.45rem;
  left: -0.45rem;
  background: var(--panel);
  border: 1px solid var(--cell-hover);
  color: var(--text);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  white-space: nowrap;
}

.cc-have-badge.cc-have-upgrade {
  border-color: #ffd23f;
  color: #ffd23f;
}

/* --- Playing as an alt (cards-online.js): a red bar across the top, above
   the top strip, on every page and in games, with Exit. --- */
.cc-alt-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  height: calc(2rem + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) calc(0.8rem + env(safe-area-inset-right)) 0 calc(0.8rem + env(safe-area-inset-left));
  background: #c62828;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.cc-alt-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-alt-exit {
  flex: none;
  background: #fff;
  color: #b71c1c;
  border: none;
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

body.cc-alt-mode {
  padding-top: calc(2rem + env(safe-area-inset-top));
}

body.cc-alt-mode.cc-with-topbar {
  padding-top: calc(4.6rem + env(safe-area-inset-top));
}

body.cc-alt-mode .cc-topbar {
  top: calc(2rem + env(safe-area-inset-top));
  height: 2.3rem;
  padding-top: 0;
}

/* Developer page */
.menu-item[hidden] {
  display: none;
}

.setting-block .cc-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}

.cc-check input {
  width: 1.15rem;
  height: 1.15rem;
}

.cc-dev-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.7rem;
  margin-top: 0.6rem;
}

.setting-block .cc-dev-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
}

.cc-dev-field:first-child,
.cc-dev-wide {
  grid-column: 1 / -1;
}

.cc-dev-alt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.4rem 1rem;
  margin: 0.6rem 0 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.7rem;
  background: var(--cell);
  text-align: left;
}

.cc-dev-alt div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.cc-dev-form {
  align-items: start;
}

.cc-dev .cc-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.cc-dev .cc-form-actions .reset-btn {
  margin: 0;
}

/* --- The ? button (cards-ui.js WildFlipFeedback): small, bottom right,
   above the bottom bar; hidden during games with the bar. On Home and Play
   it moves above the play buttons (cards-ui.js). --- */
.cc-help-fab {
  position: fixed;
  right: calc(0.8rem + env(safe-area-inset-right));
  bottom: calc(5.2rem + env(safe-area-inset-bottom));
  z-index: 29;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid var(--cell-hover);
  background: rgba(30, 31, 41, 0.92);
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  opacity: 0.85;
}

.cc-help-fab:hover,
.cc-help-fab:focus-visible {
  color: var(--text);
  opacity: 1;
}

.cc-help-fab[hidden] {
  display: none;
}


.cc-feedback-form {
  text-align: left;
}

.cc-feedback-form h2 {
  margin: 0 0 0.8rem;
  font-size: 1.2rem;
}

.cc-feedback-kinds {
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.cc-feedback-text {
  width: 100%;
  resize: vertical;
  min-height: 7rem;
  font: inherit;
}

.cc-feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.cc-feedback-actions .reset-btn {
  margin: 0;
}

/* Developer page: feedback list */
.cc-fb-filter {
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0 0.8rem;
}

.cc-fb-item {
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.6rem;
  border-radius: 0.7rem;
  background: var(--cell);
  border-left: 4px solid var(--muted);
}

.cc-fb-item.cc-fb-accepted {
  border-left-color: #22c55e;
}

.cc-fb-item.cc-fb-denied {
  border-left-color: var(--red-color);
  opacity: 0.75;
}

.cc-fb-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.cc-fb-kind {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}

.cc-fb-text {
  margin: 0.4rem 0 0.6rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.cc-fb-actions {
  display: flex;
  gap: 0.5rem;
}

.cc-fb-actions button {
  margin: 0;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
}

/* Help page */
.cc-help-version {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.7rem;
  background: var(--cell);
  font-size: 0.92rem;
}

.cc-help-version dt {
  color: var(--muted);
}

.cc-help-version dd {
  margin: 0;
  font-weight: 700;
}

.cc-release {
  padding: 0.6rem 0 0.4rem;
  border-top: 1px solid var(--cell);
}

.cc-release h3 {
  margin: 0;
  font-size: 1rem;
}

.cc-release h3 span {
  margin-left: 0.4rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.cc-release ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
}

.cc-release li {
  margin-bottom: 0.2rem;
}

.cc-help-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* --- Test site (cards-ui.js): lime green top strip and bottom bar, with a
   TEST tag. The live site keeps its usual colors. --- */
.cc-test-site .cc-topbar,
.cc-test-site .cc-nav {
  background: #84cc16;
  border-color: #65a30d;
  color: #1a2e05;
}

.cc-test-site .cc-top-lv,
.cc-test-site .cc-top-xp-text,
.cc-test-site .cc-nav-item {
  color: #1a2e05;
}

.cc-test-site .cc-top-lv b {
  color: #0b1402;
}

.cc-test-site .cc-top-xp {
  background: rgba(26, 46, 5, 0.25);
}

.cc-test-site .cc-top-xp-fill {
  background: #1a2e05;
}

.cc-test-site .cc-nav-item:hover,
.cc-test-site .cc-nav-item[aria-current="page"] {
  color: #0b1402;
  background: rgba(255, 255, 255, 0.35);
}

.cc-test-site .cc-nav-item[aria-current="page"] svg {
  color: #0b1402;
}

.cc-test-tag {
  flex: none;
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  background: #1a2e05;
  color: #d9f99d;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* --- Holos (cards-holos.js, the Store; the close-up's foil) --- */
.cc-holo-icon {
  vertical-align: -0.15em;
}

.cc-holos {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.4rem;
  padding: 1rem;
  border-radius: 1rem;
  background: var(--panel);
  border: 1px solid var(--cell-hover);
  text-align: left;
}

.cc-holos[hidden] {
  display: none;
}

.cc-holo-balance {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.15rem;
}

.cc-holo-balance .cc-holo-icon {
  width: 1.3rem;
  height: 1.3rem;
}

.cc-holo-why {
  display: grid;
  gap: 0.4rem;
  margin: 0.4rem 0 0.8rem;
  padding: 0.7rem 0.9rem 0.7rem 1.9rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.4;
}

.cc-holo-group {
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cc-holo-bundles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 0.5rem;
}

.cc-holo-bundle {
  display: grid;
  gap: 0.25rem;
  justify-items: center;
  padding: 0.6rem 0.4rem;
  border-radius: 0.8rem;
  background: var(--cell);
  text-align: center;
}

.cc-holo-bundle-name {
  font-size: 0.8rem;
  color: var(--muted);
}

.cc-holo-bundle strong {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.cc-holo-bonus {
  min-height: 1em;
  font-size: 0.7rem;
  font-weight: 700;
  color: #4ecdc4;
}

/* The Handful: exactly one Holo foil look (3.12.1). */
.cc-holo-bundle.cc-holo-bundle-perfect {
  box-shadow: inset 0 0 0 2px #f5c542;
}

.cc-holo-bonus.cc-holo-perfect {
  color: #f5c542;
}

.cc-holo-bundle .reset-btn {
  margin: 0.2rem 0 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.cc-holo-items {
  display: grid;
  gap: 0.5rem;
}

.cc-holo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.8rem;
  background: var(--cell);
  border-left: 4px solid var(--rarity-color, transparent);
}

.cc-holo-item-text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  font-size: 0.9rem;
}

.cc-holo-item-text .cc-muted {
  font-size: 0.8rem;
}

.cc-holo-buy {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.cc-holo-soon {
  opacity: 0.7;
}

.cc-holo-history summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
}

.cc-holo-hist {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--cell);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.cc-pos {
  color: #4ecdc4;
}

.cc-neg {
  color: var(--muted);
}

.cc-foil-word {
  background: linear-gradient(100deg, #7cf6ff, #b48cff 55%, #ff8ad8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The Holo foil look: a rainbow sheen sweeping across the card. */
.cc-foil-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg,
    transparent 20%, rgba(124, 246, 255, 0.35) 35%, rgba(180, 140, 255, 0.4) 45%,
    rgba(255, 138, 216, 0.35) 55%, rgba(255, 226, 122, 0.3) 65%, transparent 80%);
  background-size: 250% 250%;
  mix-blend-mode: screen;
  animation: cc-foil-sweep 4s ease-in-out infinite;
}

.cc-card.cc-foil {
  box-shadow: 0 0 0 1px rgba(180, 140, 255, 0.6), 0 0 10px rgba(124, 246, 255, 0.35);
}

/* In a game (red or blue): a thick holo ring inside the border instead of
   the sheen, so the card's color stays strong in the middle. */
.cc-card.cc-foil:is(.red, .blue) .cc-foil-sheen {
  inset: 0;
  padding: 7cqw;
  background: linear-gradient(115deg, #7cf6ff, #b48cff, #ff8ad8, #ffe27a, #7cf6ff, #b48cff) 0 0 / 300% 300%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mix-blend-mode: normal;
  opacity: 0.9;
  animation: cc-holo-ring 3s linear infinite;
}

.cc-card.cc-foil:is(.red, .blue) {
  box-shadow: 0 0 8px rgba(180, 140, 255, 0.7);
}

@keyframes cc-holo-ring {
  to { background-position: 300% 0; }
}

@keyframes cc-foil-sweep {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-foil-sheen,
  .cc-card.cc-foil:is(.red, .blue) .cc-foil-sheen {
    animation: none;
    background-position: 50% 50%;
  }
}

/* Close-up: the card's numbers pick the side to upgrade. */
.cc-pickable .cc-num-pick {
  cursor: pointer;
  border-radius: 999px;
  outline: 2px dashed rgba(255, 209, 102, 0.55);
  outline-offset: 0.12em;
  padding: 0 0.12em;
}

.cc-pickable .cc-num-pick:hover,
.cc-pickable .cc-num-pick:focus-visible {
  outline-style: solid;
  outline-color: #ffd166;
}

.cc-pickable .cc-num-picked {
  outline: 3px solid #ffd166;
  background: rgba(255, 209, 102, 0.25);
  color: #ffd166;
}

.cc-num-picked small {
  margin-left: 0.08em;
  font-size: 0.6em;
}

@media (prefers-reduced-motion: no-preference) {
  .cc-pickable .cc-num-picked {
    animation: cc-pick-pulse 1.2s ease-in-out infinite;
  }
}

@keyframes cc-pick-pulse {
  50% { outline-offset: 0.25em; }
}

/* --- Tips (cards-tips.js): a card in the middle, or a bubble pointing at
   ringed things. --- */
.cc-tip {
  text-align: left;
  display: grid;
  gap: 0.6rem;
  max-width: 26rem;
}

.cc-tip h2 {
  margin: 0;
  font-size: 1.25rem;
}

.cc-tip-step {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.cc-tip-body {
  display: grid;
  gap: 0.6rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.cc-tip-body p {
  margin: 0;
}

.cc-tip-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(3.6rem, 1fr));
  gap: 0.45rem;
  margin: 0.2rem 0;
}

.cc-tip-cards figure {
  max-width: 7.5rem; /* 3.24.0: a single card stays card-sized */
  justify-self: center;
  width: 100%;
  margin: 0;
  display: grid;
  gap: 0.25rem;
  text-align: center;
}

.cc-tip-cards figcaption {
  font-size: 0.7rem;
  font-weight: 700;
}

/* Deck power in tips: cost chips by rarity and the level ladder. */
.cc-dp-costs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cc-dp-cost {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 2px solid var(--rarity-color);
  font-size: 0.82rem;
  font-weight: 700;
}

.cc-dp-ladder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(3.6rem, 1fr));
  gap: 0.35rem;
}

.cc-dp-step {
  display: grid;
  justify-items: center;
  padding: 0.3rem 0.2rem;
  border-radius: 0.6rem;
  background: rgba(127, 127, 127, 0.12);
  font-variant-numeric: tabular-nums;
}

.cc-dp-step small {
  font-size: 0.68rem;
  opacity: 0.8;
}

.cc-dp-step b {
  font-size: 1rem;
}

.cc-dp-step.cc-dp-now {
  outline: 2px solid var(--accent);
}

.cc-dp-step.cc-dp-more {
  opacity: 0.75;
}

.cc-tip-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.cc-tip-actions .reset-btn {
  margin: 0;
}

.cc-tip-bubble {
  position: fixed;
  z-index: 60;
  width: min(20rem, calc(100vw - 24px));
  padding: 0.8rem 0.9rem;
  border-radius: 0.9rem;
  background: #fff7d6;
  color: #23210f;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  font-size: 0.92rem;
  line-height: 1.4;
  display: grid;
  gap: 0.55rem;
}

.cc-tip-bubble::before {
  content: "";
  position: absolute;
  left: calc(var(--arrow-x, 50%) - 8px);
  bottom: -8px;
  border: 8px solid transparent;
  border-bottom: 0;
  border-top-color: #fff7d6;
}

.cc-tip-bubble.cc-tip-below::before {
  bottom: auto;
  top: -8px;
  border: 8px solid transparent;
  border-top: 0;
  border-bottom-color: #fff7d6;
}

.cc-tip-bubble strong {
  color: #000;
}

.cc-tip-ok {
  justify-self: end;
  margin: 0;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.cc-tip-ring {
  outline: 3px solid #ffd166 !important;
  outline-offset: 3px;
  border-radius: 999px;
  position: relative;
  z-index: 2;
}

.cc-num.cc-tip-ring {
  background: rgba(255, 209, 102, 0.35);
}

@media (prefers-reduced-motion: no-preference) {
  .cc-tip-ring {
    animation: cc-tip-pulse 1.1s ease-in-out infinite;
  }
}

@keyframes cc-tip-pulse {
  50% { outline-offset: 7px; }
}

/* The result's "Change cards" link under Play Again. */
.cc-change-cards {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.9rem;
}

/* Help: the tips list */
.cc-tip-list {
  display: grid;
  gap: 0.5rem;
}

.cc-tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.7rem;
  background: var(--cell);
}

.cc-tip-row > div {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  font-size: 0.9rem;
}

.cc-tip-row .cc-muted {
  font-size: 0.8rem;
}

.cc-tip-row .reset-btn {
  flex: none;
  margin: 0;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.cc-side-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.7rem;
  margin-top: 0.6rem;
  font-size: 0.95rem;
}

.cc-side-confirm strong {
  color: #ffd166;
}

.cc-side-confirm .reset-btn {
  margin: 0;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
}

/* New player: age, then the adult or kid step */
.cc-setup-step {
  display: grid;
  gap: 0.8rem;
}

.cc-setup-step[hidden] {
  display: none;
}

.cc-kid-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.8rem;
  border-radius: 0.8rem;
  background: var(--cell);
  font-size: 1.3rem;
}

.cc-kid-name .reset-btn {
  margin: 0;
  padding: 0.35rem 0.7rem;
  font-size: 1.2rem;
}

#kidStep .cc-link-btn,
#ageBack {
  justify-self: center;
}

/* --- After a win: the cards to claim, all in view; one tap keeps one --- */
.cc-claim-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.6rem 0;
}

.cc-claim-grid .cc-hand-card {
  flex: 0 0 calc((100% - 1.2rem) / 3);
  max-width: 7rem;
  position: relative;
}

.cc-claim-grid .cc-hand-card:not(:disabled):hover {
  transform: translateY(-4px);
}

.cc-claim-pop h2 {
  margin: 0 0 0.2rem;
}

.cc-claim-pop .cc-link-btn {
  margin-top: 0.2rem;
}

/* --- Deck points (a rule experiment on the test site) --- */
.cc-pick { position: relative; }

/* A card's deck power cost, under the card (never over its numbers). */
.cc-pts-chip {
  display: block;
  width: fit-content;
  margin: 0.3rem auto 0;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.18);
  color: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
}

.cc-pick.cc-too-dear {
  opacity: 0.4;
}

.cc-points-note {
  margin: 0.2rem 0 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.cc-points-note.cc-over {
  color: #fca5a5;
  font-weight: 700;
}

.cc-dev-check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0.5rem 0;
  font-weight: 400;
  text-align: left;
  line-height: 1.4;
}

.cc-dev-check input {
  margin-top: 0.25rem;
  flex: none;
}

/* Collection: Stats and Cards at your level, folded by default. */
.cc-fold {
  margin-top: 0.4rem;
  border-bottom: 1px solid var(--cell-hover);
}

.cc-fold summary {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  cursor: pointer;
  list-style: none;
  padding: 0.3rem 0;
}

.cc-fold summary::-webkit-details-marker {
  display: none;
}

.cc-fold summary::before {
  content: "▸";
  color: var(--muted);
  transition: transform 0.15s ease;
}

.cc-fold[open] summary::before {
  transform: rotate(90deg);
}

.cc-fold summary .cc-heading {
  margin: 0.6rem 0;
}

.cc-fold-note {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--muted);
}

.cc-fold summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* --- Player Support (admins) --- */
.cc-support {
  text-align: left;
}

.cc-sup-list {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.4rem;
  max-height: 22rem;
  overflow-y: auto;
}

.cc-sup-row {
  display: grid;
  gap: 0.15rem;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--cell);
  border: 2px solid transparent;
  border-radius: 0.6rem;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
}

.cc-sup-row:hover {
  background: var(--cell-hover);
}

.cc-sup-row.selected {
  border-color: var(--accent);
}

.cc-sup-row .cc-muted,
.cc-sup-picked .cc-muted,
.cc-sup-gifts .cc-muted {
  font-size: 0.82rem;
}

.cc-sup-picked {
  display: grid;
  gap: 0.25rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid var(--accent);
  margin-bottom: 0.8rem;
}

.cc-sup-id {
  font-size: 0.78rem;
  word-break: break-all;
  user-select: all;
}

.cc-sup-copy {
  justify-self: start;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
}

.cc-sup-form {
  display: grid;
  gap: 0.7rem;
}

.cc-sup-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.cc-sup-amounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.cc-sup-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cc-sup-confirm {
  border: 1px solid var(--win);
  border-radius: 0.6rem;
  padding: 0.6rem 0.8rem;
}

.cc-sup-confirm p {
  margin: 0 0 0.5rem;
}

.cc-sup-gifts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.cc-sup-gifts li {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cc-sup-msg {
  font-size: 0.85rem;
  font-style: italic;
}

/* --- WildFlip Cascade (beta): its own colors, so it's clear which game
   you're in. Red and blue cards stay the same. --- */
body.cc-cascade {
  --bg: #0d2430;
  --panel: #133848;
  --cell: #1a4a5c;
  --cell-hover: #22596e;
  --muted: #8fbccb;
  --accent: #14b8a6;
  background: linear-gradient(180deg, #0d2430 0%, #0a3340 60%, #0d2430 100%);
}

body.cc-cascade .cc-title {
  color: #5eead4;
}

.cc-cascade-name {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  font-size: 0.78em;
}

.cc-beta {
  display: block;
  width: fit-content;
  margin: 0.3rem auto 0;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #14b8a6;
  color: #062a2a;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.cc-cascade-bar.cc-ladder-bar {
  border-color: #f5c542;
  background: rgba(245, 197, 66, 0.12);
}

.cc-cascade-bar {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.4rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid #14b8a6;
  border-radius: 0.7rem;
  background: rgba(20, 184, 166, 0.12);
  font-size: 0.88rem;
  text-align: left;
}

.cc-cascade-bar p {
  margin: 0;
}

/* A WildFlip Cascade game in My History. */
.cc-variant-tag {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.2);
  color: #5eead4;
  font-size: 0.75rem;
  font-weight: 700;
}

/* --- Cascade Analytics: Standard (indigo) against Cascade (teal) --- */
.cc-casc-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.cc-casc-legend i {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: -1px;
}

.cc-casc-std,
.cc-casc-bar-std {
  background: #6c63ff;
  fill: #6c63ff;
}

.cc-casc-cas,
.cc-casc-bar-cas {
  background: #14b8a6;
  fill: #14b8a6;
}

.cc-casc-alts {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.cc-casc-table td,
.cc-casc-table th {
  white-space: nowrap;
}

.cc-casc-notes ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: left;
}

.cc-casc-an #recentList {
  text-align: left;
}

/* A rented Max or Ultra: the tier tag with an hourglass. */
.cc-tier.cc-tier-rented {
  outline: 1px dashed currentColor;
  outline-offset: 1px;
}

/* A rental's countdown, bottom left (the tier tag is bottom right). */
.cc-rent-left {
  position: absolute;
  bottom: 5%;
  left: 4%;
  z-index: 2;
  padding: 0.1em 0.35em;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffd166;
  font-size: 6.5cqw;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}

.cc-rent-countdown {
  color: #ffd166;
}

/* The Wild a reward gives, as a small card (Today's activities). */
.cc-wild-tile {
  display: inline-grid;
  justify-items: center;
  gap: 0.1rem;
  width: 96px;
  margin: 0.2rem auto 0.4rem;
  padding: 0.7rem 0.4rem;
  border: 3px solid var(--rarity-color);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 18px var(--rarity-color);
  animation: cc-wild-in 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) 0.2s both;
}

.cc-wild-mark {
  font-size: 2.2rem;
  line-height: 1;
}

.cc-wild-tile strong {
  letter-spacing: 0.12em;
}

.cc-wild-tile span:last-child {
  color: var(--rarity-color);
  font-size: 0.85rem;
  font-weight: 700;
}

@keyframes cc-wild-in {
  from { transform: rotateY(90deg) scale(0.7); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-wild-tile { animation: none; }
}

.cc-rent-row {
  flex-wrap: wrap;
}

.cc-rent-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
}

.cc-rent-btn {
  flex: 1 1 8rem;
  font-size: 0.82rem;
  padding: 0.45rem 0.6rem;
}

/* Scout pass: the opponent's face-down cards show their rarity (border)
   and the player's tag for each; never the picture or numbers. */
.cc-card-hidden.cc-scouted {
  position: relative;
  border-color: var(--rarity-color);
  border-width: 4px;
  display: grid;
  place-items: center;
}

.cc-scout-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.cc-scout-tag.cc-scout-new {
  background: #16a34a;
}

.cc-scout-tag.cc-scout-back {
  background: #d97706;
}

.cc-scout-btn {
  font: inherit;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px dashed var(--muted);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

/* Settings: the code for the phone app, big and easy to read out. */
.cc-link-code {
  margin: 0.6rem 0 0.2rem;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  user-select: all;
}

/* --- Spark (3.0): the button under the hand, its side picker, the number
   it lifted and the squares where it flips an extra card. --- */
.cc-spark-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin: 0.1rem 0 0.25rem;
}

.cc-spark-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #f59e0b;
  background: transparent;
  color: #fbbf24;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.cc-spark-btn.cc-spark-on {
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #422006;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.cc-spark-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.cc-spark-sides {
  display: inline-flex;
  gap: 0.25rem;
}

.cc-spark-sides button {
  font: inherit;
  font-size: 0.85rem;
  min-width: 2.1rem;
  padding: 0.2rem 0.45rem;
  border-radius: 0.5rem;
  border: 1px solid var(--muted);
  background: var(--cell);
  color: var(--text);
  cursor: pointer;
}

.cc-spark-sides button.cc-spark-pick {
  border-color: #f59e0b;
  color: #fbbf24;
  font-weight: 700;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.cc-spark-sides button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* The number a Spark lifted: pale gold, glowing. */
.cc-num.cc-spark {
  color: #fef3c7;
  text-shadow: 0 0 5cqw rgba(245, 158, 11, 0.95), 0 1px 2px rgba(0, 0, 0, 0.7);
  animation: cc-spark-pulse 1.4s ease-in-out infinite alternate;
}

@keyframes cc-spark-pulse {
  to { text-shadow: 0 0 9cqw rgba(253, 230, 138, 1), 0 1px 2px rgba(0, 0, 0, 0.7); }
}

/* The card picked while Spark is on. */
.cc-hand-card.cc-sparked .cc-card {
  box-shadow: 0 0 0 3px #f59e0b, 0 0 14px rgba(245, 158, 11, 0.7);
}

/* Squares where Spark flips one more card. */
.cc-board .cc-slot.cc-spark-hint {
  box-shadow: inset 0 0 0 2px #f59e0b, 0 0 12px rgba(245, 158, 11, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .cc-num.cc-spark {
    animation: none;
  }
}

/* --- Special moves (3.0): lowered numbers, Ward's guard, the move button. --- */
.cc-num.cc-down {
  color: #fca5a5;
  text-shadow: 0 0 4cqw rgba(239, 68, 68, 0.7), 0 1px 2px rgba(0, 0, 0, 0.7);
}

.cc-guard {
  position: absolute;
  left: 6%;
  bottom: 5%;
  font-size: 16cqw;
  line-height: 1;
  pointer-events: none;
}

.cc-move-btn.cc-spark-on {
  background: linear-gradient(135deg, #c4b5fd, #7c3aed);
  color: #1e0b3b;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.6);
}

.cc-move-btn {
  border-color: #8b5cf6;
  color: #c4b5fd;
}

.cc-move-text {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  flex-basis: 100%;
}

.cc-trial-btn small {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
}

/* Below level 15: the reminder that every card's own move is coming. */
.cc-trial-btn small.cc-trial-soon {
  margin-top: 0.2rem;
  font-weight: 600;
  color: #f5c542;
  opacity: 1;
}

/* Awakening: each hand card's move icon. */
.cc-hand-card {
  position: relative;
}

.cc-move-badge {
  position: absolute;
  top: -6px;
  left: -4px;
  font-size: 0.8rem;
  line-height: 1;
  background: var(--cell);
  border-radius: 999px;
  padding: 2px 3px;
  pointer-events: none;
}

/* Settings: the special moves choice (3.0). */
.cc-moves-modes {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.setting-block .cc-moves-mode {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--cell);
  border-radius: 0.6rem;
  cursor: pointer;
  font-weight: 400;
}

.cc-moves-mode:has(input:checked) {
  border-color: var(--accent);
}

.cc-moves-mode input {
  margin-top: 0.2rem;
}

.cc-moves-mode strong {
  display: block;
}

/* --- Card close-up tabs (3.15): Card, Upgrade, Stats, Moves --- */
.cc-off-tab {
  display: none !important;
}

.cc-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  margin: 0 2.6rem 0.8rem 0;
  padding: 0.25rem;
  background: var(--cell);
  border-radius: 0.8rem;
}

.cc-tabs[hidden] {
  display: none;
}

.cc-tabs [role="tab"] {
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem 0.2rem;
  border: none;
  border-radius: 0.6rem;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.cc-tabs [role="tab"][aria-selected="true"] {
  background: var(--accent);
  color: #fff;
}

.cc-tabs [role="tab"]:focus-visible {
  outline: 2px solid var(--win);
  outline-offset: 1px;
}

/* The recommended number to upgrade next glows. */
.cc-pickable .cc-num-recommend {
  outline: 3px solid var(--win);
  animation: cc-recommend 1.2s ease-in-out infinite;
}

@keyframes cc-recommend {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0); }
  50% { box-shadow: 0 0 0 0.35em rgba(255, 209, 102, 0.55); }
}

.cc-path-steps {
  list-style: none;
  margin: 0.4rem 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.cc-path-steps li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.6rem;
  background: var(--cell);
  font-size: 0.9rem;
}

.cc-path-steps li.cc-path-next {
  outline: 2px solid var(--win);
}

.cc-path-have {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin: 0.6rem 0 0.2rem;
}

.cc-path-tile {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  width: 6rem;
  text-align: center;
  font-size: 0.8rem;
}

.cc-path-tile .cc-card {
  width: 3.6rem;
}

.cc-path-count {
  font-weight: 800;
  font-size: 1rem;
}

.cc-wild-mini {
  width: 3.6rem;
  margin: 0;
  padding: 0.3rem 0.2rem;
  border-width: 2px;
  box-shadow: 0 0 10px var(--rarity-color);
  font-size: 0.7rem;
  animation: none;
}

.cc-wild-mini .cc-wild-mark {
  font-size: 1.3rem;
}

.cc-short {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding: 0.7rem;
  border: 2px solid var(--win);
  border-radius: 0.8rem;
}

.cc-short[hidden] {
  display: none;
}

.cc-short-store {
  text-align: center;
  text-decoration: none;
}

.cc-anim-stage {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 1rem;
}

.cc-anim-board {
  grid-template-columns: 1fr;
  width: 7.5rem;
}

.cc-demo-title {
  margin: 0.9rem 0 0.2rem;
  font-size: 0.95rem;
}

.cc-demo-board {
  width: min(100%, 15rem);
}

.cc-demo-board .cc-slot.cc-demo-target {
  outline: 2px dashed var(--win);
  outline-offset: -2px;
}

.cc-demo-board .cc-slot.cc-demo-changed .cc-card {
  box-shadow: 0 0 0 3px var(--win);
}

.cc-demo-caption {
  min-height: 2.6em;
  margin: 0.3rem 0 0.5rem;
  text-align: center;
  font-size: 0.92rem;
}

.cc-move-line {
  margin: 0.2rem 0 0.5rem;
}

/* Pinned above the bottom bar, wherever the Store scrolls to. */
.cc-back-banner {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 0.75rem 1.1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  border-radius: 0.8rem;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .cc-pickable .cc-num-recommend { animation: none; }
}

/* 3.15.1: the Card tab's card opens Upgrade; why and how to upgrade */
.cc-card-link .cc-card {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.cc-card-link .cc-card:hover,
.cc-card-link .cc-card:focus-visible {
  transform: scale(1.03);
  outline: 3px solid var(--win);
  outline-offset: 2px;
}

.cc-card-hint {
  margin: 0.3rem 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.cc-card-hint[hidden] {
  display: none;
}

.cc-why-list {
  margin: 0.3rem 0 0.9rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.92rem;
  line-height: 1.4;
}

/* 3.15.1: The Climb's play button and the Move Trial, each on its own row
   under Play the Computer and Find a Player. */
.cc-play-bar .reset-btn.cc-climb-btn,
.cc-play-bar .reset-btn.cc-trial-btn {
  flex: 1 1 100%;
  max-width: 26.6rem;
  order: 2;
}

.cc-play-bar .reset-btn.cc-trial-btn {
  order: 3;
}

.cc-play-bar .cc-lobby-note,
.cc-play-bar .cc-cascade-bar {
  order: 4;
}

.reset-btn.cc-climb-btn {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  text-decoration: none;
  background: linear-gradient(135deg, #3b6d5c, #24443a);
  color: #fff;
}

.reset-btn.cc-climb-btn[hidden] {
  display: none;
}

.cc-climb-btn small {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.85;
}

/* --- Card frames and backgrounds (3.16, art/ui/) ---
   Each card: its colour (gray in hand and collection, blue or red in play)
   behind the art, and its rarity's frame over it, with the four numbers in
   the frame's holes (positions from tools/import_ui_art.py, below). These
   take over from the borders, gradients, gem and glow rings above. */
.cc-card,
.cc-card[data-rarity],
.cc-card[data-rarity].red,
.cc-card[data-rarity].blue {
  border: none;
  border-radius: 6%;
  background: none;
}

.cc-card[data-rarity]::before,
.cc-card[data-rarity]::after {
  content: none;
}

.cc-card > * {
  z-index: 3;
}

.cc-card > .cc-bg {
  position: absolute;
  inset: 4%;
  z-index: 0;
  border-radius: 7%;
  background: url("art/ui/bg-gray.webp") center / cover;
}

.cc-card.blue > .cc-bg {
  background-image: url("art/ui/bg-blue.webp");
}

.cc-card.red > .cc-bg {
  background-image: url("art/ui/bg-red.webp");
}

.cc-card > .cc-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--frame, url("art/ui/frame-common.webp")) center / 100% 100% no-repeat;
  pointer-events: none;
}

.cc-card > .cc-face {
  z-index: 1;
}

.cc-card .cc-gem {
  display: none;
}

.cc-card > .cc-num {
  /* Off the old grid: placed against the whole card, not a grid cell. */
  grid-area: auto;
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 14cqw;
  text-shadow: 0 0 1.5cqw #000, 0 1px 2px rgba(0, 0, 0, 0.9);
}

.cc-card > .cc-num.cc-top { left: var(--hole-top-x, 50%); top: var(--hole-top-y, 9%); }
.cc-card > .cc-num.cc-right { left: var(--hole-right-x, 92%); top: var(--hole-right-y, 50%); }
.cc-card > .cc-num.cc-bottom { left: var(--hole-bottom-x, 50%); top: var(--hole-bottom-y, 90%); }
.cc-card > .cc-num.cc-left { left: var(--hole-left-x, 8%); top: var(--hole-left-y, 50%); }

.cc-card > .cc-element {
  grid-area: auto;
  position: absolute;
  top: 15%;
  right: 17%;
  margin: 0;
  font-size: 10cqw;
}

.cc-card .cc-art {
  width: 52cqw;
  height: 38cqw;
}

.cc-card .cc-name.cc-name-mid,
.cc-card .cc-name.cc-name-long {
  width: 66cqw;
}

/* Small cards: numbers a little bigger to stay readable. */
@container (max-width: 90px) {
  .cc-card > .cc-num {
    font-size: 17cqw;
  }
}

/* UI ART (tools/import_ui_art.py): where each frame's number holes are */
.cc-card[data-rarity="common"] { --frame: url("art/ui/frame-common.webp"); --frame-aspect: 0.982; --hole-top-x: 49.8%; --hole-top-y: 9.5%; --hole-right-x: 92.1%; --hole-right-y: 50.5%; --hole-bottom-x: 49.8%; --hole-bottom-y: 89.6%; --hole-left-x: 7.6%; --hole-left-y: 50.4%; }
.cc-card[data-rarity="rare"] { --frame: url("art/ui/frame-rare.webp"); --frame-aspect: 0.982; --hole-top-x: 50.1%; --hole-top-y: 10.2%; --hole-right-x: 92.2%; --hole-right-y: 50.7%; --hole-bottom-x: 50.3%; --hole-bottom-y: 89.9%; --hole-left-x: 8.3%; --hole-left-y: 50.7%; }
.cc-card[data-rarity="epic"] { --frame: url("art/ui/frame-epic.webp"); --frame-aspect: 1.063; --hole-top-x: 49.8%; --hole-top-y: 9.2%; --hole-right-x: 91.9%; --hole-right-y: 50.0%; --hole-bottom-x: 49.8%; --hole-bottom-y: 89.1%; --hole-left-x: 7.9%; --hole-left-y: 50.1%; }
.cc-card[data-rarity="legendary"] { --frame: url("art/ui/frame-legendary.webp"); --frame-aspect: 1.085; --hole-top-x: 49.8%; --hole-top-y: 9.4%; --hole-right-x: 91.4%; --hole-right-y: 50.2%; --hole-bottom-x: 49.8%; --hole-bottom-y: 88.4%; --hole-left-x: 8.2%; --hole-left-y: 50.2%; }
/* END UI ART */

/* 3.16: the bottom bar's button pictures and the coin. */
.cc-nav-item svg[hidden] {
  display: none;
}

/* 3.16.2: pictures only, bigger; the words stay for screen readers. */
.cc-nav-item .cc-nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.cc-nav-item {
  padding: 0.25rem 0.2rem;
}

.cc-nav-img {
  width: 3.4rem;
  height: 3.4rem;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.15s ease;
}

.cc-nav-item[aria-current="page"] .cc-nav-img {
  transform: scale(1.12);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.45));
}

.cc-nav-item:not([aria-current="page"]) .cc-nav-img {
  opacity: 0.85;
}

img.cc-coin {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  object-fit: contain;
}

/* 3.16.1: the WildFlip logo between the BlurryWare splash and the game. */
html.wf-logo-on,
html.wf-logo-on body {
  overflow: hidden;
}

.wf-logo-splash {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: #000;
  cursor: pointer;
  transition: opacity 0.5s ease;
}

.wf-logo-splash img {
  width: min(70vw, 400px);
  height: auto;
  border-radius: 22%;
  box-shadow: 0 0 60px rgba(255, 196, 0, 0.35);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 1.4s cubic-bezier(0.2, 1, 0.3, 1);
  user-select: none;
}

.wf-logo-splash.wf-logo-in img {
  opacity: 1;
  transform: scale(1);
}

.wf-logo-splash.wf-logo-out {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .wf-logo-splash img { transition: opacity 0.3s ease; transform: none; }
}

/* A bottom-bar button named in text: its picture, at text size. */
img.cc-nav-inline {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  vertical-align: -0.4em;
  object-fit: contain;
  margin: 0 0.05em;
}

/* 3.16.3: The Climb's button is its picture (its words are part of it); the
   Move Trial's is its banner, with the day's move written on it. */
.cc-play-bar .reset-btn.cc-climb-btn {
  padding: 0;
  background: none;
  box-shadow: none;
  aspect-ratio: 900 / 189;
  height: auto;
  overflow: visible;
}

.cc-climb-btn img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.cc-climb-btn:hover img,
.cc-climb-btn:focus-visible img {
  transform: scale(1.02);
  filter: brightness(1.08);
}

.cc-play-bar .reset-btn.cc-trial-btn {
  aspect-ratio: 900 / 191;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0 7% 0 37%;
  border: none;
  border-radius: 1.2rem;
  background: url("art/ui/btn-trial.webp") center / 100% 100% no-repeat;
  box-shadow: none;
  color: #fff;
  text-align: left;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.cc-trial-btn .cc-trial-title {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
}

.cc-play-bar .reset-btn.cc-trial-btn small {
  font-size: 0.7rem;
  line-height: 1.2;
}

.cc-play-bar .reset-btn.cc-trial-btn:disabled {
  opacity: 0.75;
}

/* 3.16.3: Holo foil cards wear the Holo border (art/ui/holo-border.webp)
   over their frame. It shimmers two ways: the border's own colours roll
   through the rainbow, and a bright band of colour runs around it. */
.cc-card.cc-foil > .cc-foil-sheen,
.cc-card.cc-foil:is(.red, .blue) > .cc-foil-sheen {
  inset: 0;
  z-index: 2;
  padding: 0;
  border-radius: 0;
  opacity: 1;
  mix-blend-mode: normal;
  background: url("art/ui/holo-border.webp") center / 100% 100% no-repeat;
  -webkit-mask: none;
  mask: none;
  animation: cc-holo-hue 4s linear infinite;
}

.cc-card.cc-foil > .cc-foil-sheen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
    transparent 0%, #7cf6ff 12%, #b48cff 24%, #ff8ad8 36%, #ffe27a 48%, transparent 60%,
    transparent 100%) 0 0 / 300% 300%;
  -webkit-mask: url("art/ui/holo-border.webp") center / 100% 100% no-repeat;
  mask: url("art/ui/holo-border.webp") center / 100% 100% no-repeat;
  mix-blend-mode: screen;
  animation: cc-holo-run 2.4s linear infinite;
}

.cc-card.cc-foil,
.cc-card.cc-foil:is(.red, .blue) {
  box-shadow: 0 0 10px rgba(180, 140, 255, 0.55);
}

@keyframes cc-holo-hue {
  to { filter: hue-rotate(360deg); }
}

@keyframes cc-holo-run {
  0% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-card.cc-foil > .cc-foil-sheen,
  .cc-card.cc-foil > .cc-foil-sheen::after {
    animation: none;
  }
}

/* 3.16.4: an upgrade preview on the left or right side stacks its new
   number under the old one, so it stays inside the frame's hole. */
.cc-card > .cc-num.cc-num-picked.cc-left,
.cc-card > .cc-num.cc-num-picked.cc-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.95;
  padding: 0.05em 0.1em;
}

.cc-card > .cc-num.cc-num-picked.cc-left small,
.cc-card > .cc-num.cc-num-picked.cc-right small {
  margin-left: 0;
  font-size: 0.55em;
}

.cc-card > .cc-num.cc-num-picked.cc-top small,
.cc-card > .cc-num.cc-num-picked.cc-bottom small {
  font-size: 0.55em;
}

/* 3.16.4: deck power left unused. */
.cc-power-nudge {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.5rem 0 0.2rem;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--win);
  border-radius: 0.8rem;
  background: rgba(255, 209, 102, 0.1);
  font-size: 0.9rem;
  text-align: left;
}

.cc-power-nudge[hidden] {
  display: none;
}

.cc-power-nudge p {
  margin: 0;
  flex: 1;
}

.cc-power-nudge .reset-btn {
  margin: 0;
  flex: none;
  padding: 0.5rem 1rem;
}

.cc-power-tag {
  color: var(--win);
  font-weight: 700;
}

/* 3.16.4: the Collection page's tabs and its Resources tab. */
.cc-collect-tabs {
  grid-template-columns: repeat(2, 1fr);
  margin: 0.4rem 0 1rem;
}

.cc-resource-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.cc-resource-tile {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 0.9rem 0.6rem;
  border-radius: 0.9rem;
  background: var(--cell);
  color: var(--text);
  text-decoration: none;
}

.cc-resource-tile strong {
  font-size: 1.6rem;
}

.cc-resource-icon {
  font-size: 2rem;
  line-height: 1;
}

.cc-resource-icon img.cc-coin,
.cc-resource-icon .cc-holo-icon {
  width: 2.4rem;
  height: 2.4rem;
}

.cc-wild-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 0.4rem 0 1.2rem;
}

.cc-wild-slot {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  text-align: center;
  font-size: 0.75rem;
}

.cc-wild-tile.cc-wild-card {
  width: 100%;
  max-width: 5.5rem;
  margin: 0;
  padding: 0.5rem 0.2rem;
  animation: none;
  font-size: 0.75rem;
}

.cc-wild-card .cc-wild-mark {
  font-size: 1.8rem;
}

.cc-wild-count {
  font-weight: 800;
  font-size: 1rem;
}

.cc-wild-slot.cc-wild-none .cc-wild-card {
  opacity: 0.45;
  box-shadow: none;
}

/* 3.16.4: the rewards flying up to the top bar after a game. */
.cc-reward-fly {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  pointer-events: none;
  font-size: 22px;
  line-height: 26px;
  text-align: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.cc-top-xp-fill {
  transition: width 0.25s linear;
}

.cc-topbar.cc-top-counting .cc-top-coins b,
.cc-topbar.cc-top-counting .cc-top-xp-text {
  color: var(--win);
}

.cc-topbar.cc-top-counting .cc-top-coins img.cc-coin {
  animation: cc-coin-bump 0.3s ease-in-out infinite alternate;
}

@keyframes cc-coin-bump {
  to { transform: scale(1.25); }
}

#resourcesPanel .cc-resource-tips {
  text-align: left;
}

/* 3.17: The Climb's mountain panel. */
.cc-climb-panel {
  margin: 0.4rem 0 0.8rem;
  padding: 0.8rem;
  border-radius: 0.9rem;
  background: linear-gradient(160deg, rgba(59, 109, 92, 0.35), rgba(36, 68, 58, 0.35));
  border: 1px solid rgba(110, 200, 160, 0.35);
  text-align: left;
}

.cc-climb-panel[hidden] {
  display: none;
}

.cc-climb-title {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.cc-climb-mountain {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.cc-climb-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.cc-climb-name {
  display: grid;
  line-height: 1.15;
  font-weight: 700;
}

.cc-climb-name small {
  font-weight: 400;
  color: var(--muted);
}

.cc-climb-row.locked {
  opacity: 0.5;
}

.cc-climb-bar {
  position: relative;
  height: 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.cc-climb-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b6d5c, #7ee0b5);
}

.cc-climb-tick {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.35);
}

.cc-climb-tick.reached {
  background: var(--win);
}

.cc-climb-you {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -60%);
  font-size: 1.1rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.cc-climb-row.here .cc-climb-name {
  color: #7ee0b5;
}

.cc-climb-panel p {
  margin: 0.2rem 0;
  font-size: 0.85rem;
}

/* 3.19: The Climb's season: goals, standings. */
.cc-climb-season {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.cc-climb-goals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cc-climb-goal {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}

.cc-climb-goal.done {
  background: rgba(126, 224, 181, 0.25);
  color: #7ee0b5;
}

.cc-climb-standings h3 {
  margin: 0.6rem 0 0.3rem;
  font-size: 0.9rem;
}

.cc-climb-standings ol {
  margin: 0;
  padding-left: 1.4rem;
  font-size: 0.85rem;
}

.cc-climb-standings li {
  padding: 0.1rem 0;
}

.cc-climb-standings li span:last-child {
  float: right;
  color: var(--muted);
}

.cc-climb-standings li.me {
  color: #7ee0b5;
  font-weight: 700;
}

/* 3.20.1: Play the Computer and Find a Player are pictures with their
   words (art/ui/btn-computer.webp, btn-find.webp), side by side. Find a
   Player writes any other wording (sign in, Find a Climber) under it. */
.cc-play-bar .reset-btn.cc-pic-btn {
  position: relative;
  max-width: 13.3rem;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  aspect-ratio: 600 / 191;
  height: auto;
  overflow: visible;
  animation: none;
}

.cc-pic-btn img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.cc-pic-btn:not(:disabled):hover img,
.cc-pic-btn:focus-visible img {
  transform: scale(1.03);
  filter: brightness(1.08);
}

.cc-play-bar .reset-btn.cc-pic-btn:disabled {
  opacity: 0.55;
}

.cc-pic-btn[hidden] {
  display: none;
}

.cc-pic-note {
  position: absolute;
  left: 50%;
  bottom: -0.15rem;
  transform: translate(-50%, 50%);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(15, 16, 28, 0.92);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.cc-pic-note[hidden] {
  display: none;
}

/* Someone's waiting for a game: the picture glows. */
.cc-pic-btn.cc-find-hot img {
  animation: cc-pic-glow 1.6s ease-in-out infinite;
}

@keyframes cc-pic-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(239, 68, 68, 0)); }
  50% { filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.9)); }
}

@media (prefers-reduced-motion: reduce) {
  .cc-pic-btn.cc-find-hot img {
    animation: none;
  }
}

.cc-play-bar .reset-btn.cc-pic-btn:has(.cc-pic-note:not([hidden])) {
  margin-bottom: 0.55rem;
}

/* 3.21.3: the packs are their pictures (art/ui/pack-<id>.webp): Core
   (standard), Apex and Primal (legend), names and all. A pack saved under
   another id keeps the drawn look above. */
.cc-pack-art:is([data-pack="standard"], [data-pack="prowl"], [data-pack="apex"], [data-pack="legend"]) {
  background: center / contain no-repeat;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5));
}

.cc-pack-art[data-pack="standard"] { background-image: url("art/ui/pack-standard.webp"); }
.cc-pack-art[data-pack="prowl"] { background-image: url("art/ui/pack-prowl.webp"); } /* 3.26.1: the Red Panda */
.cc-pack-art[data-pack="apex"] { background-image: url("art/ui/pack-apex.webp"); }
.cc-pack-art[data-pack="legend"] { background-image: url("art/ui/pack-legend.webp"); }

.cc-pack-art:is([data-pack="standard"], [data-pack="prowl"], [data-pack="apex"], [data-pack="legend"])::before {
  display: none;
}

.cc-pack-art:is([data-pack="standard"], [data-pack="prowl"], [data-pack="apex"], [data-pack="legend"]) > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 3.21.3: the backdrop behind every screen (art/ui/backdrop-*.webp), in
   place of the deck's colors and scattered animals. Tall screens get the
   tall picture, wide ones the wide picture. */
body.cc-themed::before {
  background: #160d1f url("art/ui/backdrop-vertical.webp") center / cover no-repeat;
}

@media (min-aspect-ratio: 1 / 1) {
  body.cc-themed::before {
    background-image: url("art/ui/backdrop-horizontal.webp");
  }
}

/* 3.21.4: Home and the Play tab use the menu backdrop (one tall picture,
   stretched to cover on wide screens too). */
body.cc-themed.cc-menu-screen::before {
  background-image: url("art/ui/backdrop-menu.webp");
}

/* 3.23.0: rarity tags (art/ui/tag-<rarity>.webp, the "[tag:rare]" text in
   cards-ui.js) in filters and listings, and the deck power picture
   ("[power]", art/ui/power.webp) in place of the ⚡. */
.cc-rarity-tag {
  height: 1.45em;
  width: auto;
  vertical-align: middle;
  margin: -0.15em 0.05em;
}

.size-option .cc-rarity-tag {
  height: 1.7em;
  margin: -0.35em 0;
  pointer-events: none;
}

.cc-tag-cell {
  display: block;
  line-height: 1;
}

.cc-tag-cell .cc-rarity-tag {
  height: 1.25rem;
  margin: 0.1rem 0 0;
}

.cc-tag-cell .cc-muted {
  vertical-align: middle;
}

.cc-unfound-rarity .cc-rarity-tag {
  height: 1.3rem;
  margin: 0;
}

.cc-rarity-name .cc-rarity-tag {
  height: 1.5rem;
  margin: 0;
}

figcaption .cc-rarity-tag {
  height: 1.4rem;
}

.cc-power-icon {
  height: 1.15em;
  width: auto;
  vertical-align: -0.22em;
  margin: 0 0.12em 0 0;
}

/* FindAPlayer2.0 is a little taller than the Play Computer picture: both
   fit the same box. */
.cc-play-bar .reset-btn.cc-pic-btn img {
  height: 100%;
  object-fit: contain;
}

/* 3.23.0: The Climb's Play screen panel shows the InnerBackdrop
   (art/ui/panel-climb.webp) behind its cards and buttons. */
body.cc-ladder.cc-menu-screen .game.cc-page {
  background: rgba(16, 30, 38, 0.35) url("art/ui/panel-climb.webp") center / cover no-repeat;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* 3.23.0: Save as Deck is its picture (art/ui/btn-save-deck.webp); "Save
   Deck" and the Climb's wordings show under it. Play the Computer Instead
   (looking for a player) uses the Play Computer picture. */
.cc-save-deck .reset-btn.cc-save-pic {
  position: relative;
  flex: 0 1 11rem;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  aspect-ratio: 600 / 134;
}

.cc-save-pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.cc-save-pic:not(:disabled):hover img {
  transform: scale(1.03);
  filter: brightness(1.08);
}

.cc-save-deck .reset-btn.cc-save-pic:disabled {
  opacity: 0.5;
}

.cc-save-pic:has(.cc-pic-note:not([hidden])) {
  margin-bottom: 0.55rem;
}

.cc-form-actions .reset-btn.cc-cpu-instead {
  position: relative;
  width: min(14rem, 60%);
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  margin-bottom: 0.6rem;
}

.cc-cpu-instead img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.cc-cpu-instead[hidden] {
  display: none;
}

/* The 2.0 Play Computer and Find a Player pictures are taller. */
.cc-play-bar .reset-btn.cc-pic-btn {
  aspect-ratio: 600 / 240;
}

/* 3.24.0: the Upgrade tab's ways to the next upgrade */
.cc-options-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.cc-options-list li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.92rem;
  line-height: 1.35;
}

.cc-options-list li.cc-option-ok {
  background: rgba(105, 219, 124, 0.14);
  box-shadow: inset 3px 0 0 #69db7c;
}

.cc-option-icon {
  flex: 0 0 1.5rem;
  text-align: center;
  font-size: 1.15rem;
  line-height: 1.2;
}

/* 3.24.0: Daily & Progress in the top strip; it pulses while tasks are left */
.cc-top-daily {
  position: relative;
  flex: none;
  font-size: 1.15rem;
  padding: 0.15rem 0.35rem;
}

.cc-top-daily-n {
  position: absolute;
  top: -0.2rem;
  right: -0.35rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: #2f9e44;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.05rem;
  text-align: center;
}

.cc-top-daily.cc-pending {
  background: rgba(255, 107, 107, 0.16);
  box-shadow: 0 0 0 1.5px #ff6b6b inset;
  animation: cc-daily-pulse 1.8s ease-in-out infinite;
}

.cc-top-daily.cc-pending .cc-top-daily-n {
  background: #ff3b3b;
}

@keyframes cc-daily-pulse {
  0%, 100% { box-shadow: 0 0 0 1.5px #ff6b6b inset, 0 0 0 0 rgba(255, 107, 107, 0.5); }
  50% { box-shadow: 0 0 0 1.5px #ff6b6b inset, 0 0 0 6px rgba(255, 107, 107, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .cc-top-daily.cc-pending { animation: none; }
}

.cc-progress-tabs {
  margin-bottom: 0.8rem;
}

.cc-progress-tabs [role="tab"] {
  flex: 1;
  padding-inline: 0.3rem;
  font-size: 0.85rem;
}

.cc-progress-tabs [role="tab"].cc-pending {
  color: #ffb3b3;
}

.cc-daily-streak {
  margin: 0.5rem 0 0;
  font-weight: 600;
  color: #ffb070;
}

.cc-streaks {
  display: grid;
  gap: 0.8rem;
}

.cc-streak-status {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 176, 112, 0.12);
  font-weight: 600;
}

.cc-streak-status.safe {
  background: rgba(105, 219, 124, 0.14);
}

.cc-streak-card {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 3px 0 0 var(--rarity-color);
}

.cc-streak-card h3 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.cc-streak-card h3 span {
  color: var(--rarity-color);
  font-variant-numeric: tabular-nums;
}

.cc-streak-card p {
  margin: 0.55rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.cc-streak-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}

.cc-streak-day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--cell);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.cc-streak-day.won {
  background: rgba(255, 140, 60, 0.25);
}

.cc-streak-day.today {
  box-shadow: 0 0 0 2px #ffb070 inset;
  color: var(--text);
}

/* 3.24.0: the daily tasks walkthrough */
.cc-tour-daily {
  margin: 0.4rem 0 0;
  padding: 0;
  text-align: left;
}

.cc-tour-daily .cc-tick-now .cc-daily-check {
  display: inline-block;
  animation: cc-tick-pop 0.6s ease-out;
}

.cc-tour-daily .cc-tick-now {
  animation: cc-tick-glow 1.4s ease-out;
  border-radius: 8px;
}

@keyframes cc-tick-pop {
  0% { transform: scale(0.3); }
  60% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

@keyframes cc-tick-glow {
  0% { background: rgba(105, 219, 124, 0.45); }
  100% { background: transparent; }
}

.cc-tour-wilds {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 0.5rem 0;
}

.cc-tour-wilds figure {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  max-width: 9rem;
  font-size: 0.82rem;
  text-align: center;
}

/* TEST-SESSION (remove after testing): the Test Session page */
.cc-ts-switch,
.cc-ts-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.cc-ts-pill {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(105, 219, 124, 0.16);
  font-weight: 700;
}

.cc-ts-pill.off {
  background: rgba(255, 107, 107, 0.18);
}

.cc-ts-live {
  margin: 0 0 0.3rem;
}

.cc-ts-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.cc-ts-table {
  font-size: 0.8rem;
  white-space: nowrap;
}

/* TEST-SESSION: tabs, countdown, rankings and report */
.cc-ts-tabs {
  margin-bottom: 0.6rem;
}

.cc-ts-countdown {
  margin: 0 0 0.8rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 176, 112, 0.14);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.cc-ts-sort {
  all: unset;
  cursor: pointer;
  font: inherit;
  text-transform: inherit;
}

.cc-ts-report {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.cc-ts-card {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  overflow-x: auto;
}

.cc-ts-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.cc-ts-card th[scope="row"] {
  text-align: left;
  font-weight: 600;
  width: 45%;
}

.cc-ts-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 90px;
}

.cc-ts-bars span {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column-reverse;
  position: relative;
}

.cc-ts-bars i {
  display: block;
  min-height: 1px;
  background: linear-gradient(180deg, #a9a4ff, #6c63ff);
  border-radius: 3px 3px 0 0;
}

.cc-ts-bars b {
  font-size: 0.6rem;
  color: var(--muted);
  text-align: center;
}

.cc-ts-tabs {
  flex-wrap: nowrap;
}

.cc-ts-tabs [role="tab"] {
  flex: 1;
  min-width: 0;
  padding-inline: 0.3rem;
}

/* --- 3.25.1: iPhone status bar (iOS 26 Safari and the Home Screen app) ---
   3.26.5: that wasn't enough. iOS 26 lays its own frosted "edge" effect over
   whatever sits under a see-through status bar, our top bar included, so the
   Home Screen app now uses a solid black status bar
   (apple-mobile-web-app-status-bar-style "black", every page): the game
   starts below it and nothing of ours is under it. Safe-area insets are 0
   there; the rules below still serve Safari and older installs. */
   With viewport-fit=cover and the black-translucent status bar, the page
   draws behind the status bar. iOS 26 composites a fixed bar's
   backdrop-filter (and any gap where nothing is painted) into a blur under
   the status bar, so the top of the game looked smeared. The bars are now
   solid (they were 96% opaque, so they look the same), the backdrop layer
   covers the whole screen including behind the status bar, and the page's
   background under it matches the backdrop's edge (overscroll included). Interactive
   things stay inside the safe area. */
/* (The body's background fills the whole canvas, status bar and
   overscroll included; on themed screens it's the backdrop's own dark.) */
body.cc-themed {
  background: #160d1f;
}

.cc-topbar,
.cc-nav {
  background: rgb(30, 31, 41);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* The backdrop: from the very top of the screen (behind the status bar) to
   the very bottom, even while Safari's toolbars collapse (100lvh). */
body.cc-themed::before {
  top: 0;
  right: 0;
  left: 0;
  bottom: auto;
  height: 100%;
  height: max(100%, 100lvh);
  pointer-events: none;
}

/* Dialogs and celebrations stay clear of the status bar and home indicator. */
.cc-dialog {
  /* Centered, so the room above and below is the larger of the two insets. */
  max-height: calc(100dvh - 2 * max(env(safe-area-inset-top, 0px), env(safe-area-inset-bottom, 0px)) - 1.5rem);
}

.cc-celebrate {
  padding: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px))
    calc(16px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
}

/* --- 3.26.1: the WildFlip card back (art/ui/card-back.webp) ---
   Wherever a card shows its back: the opponent's hand (outlined in their
   colour; with a Scout pass, in its rarity's colour), packs before they're
   turned over, and a card turning over when it flips. */
.cc-card-hidden,
.cc-card-back {
  background: url("art/ui/card-back.webp") center / 100% 100% no-repeat;
  border: none;
  border-radius: 13%;
}

.cc-card-hidden.red,
.cc-card-hidden.blue,
.cc-card-hidden.cc-scouted {
  box-shadow: 0 0 0 2px var(--side-color), 0 0 10px var(--side-color);
}

.cc-card-hidden.red { --side-color: var(--red-color); }
.cc-card-hidden.blue { --side-color: var(--blue-color); }
.cc-card-hidden.cc-scouted { --side-color: var(--rarity-color); }

.cc-card-back > span {
  display: none; /* the "?" of the old placeholder */
}

/* A flip turns the card all the way over: its back shows halfway. */
.cc-card.cc-flipping {
  animation-name: cc-flip-over;
}

@keyframes cc-flip-over {
  0% { transform: perspective(500px) rotateY(0); }
  100% { transform: perspective(500px) rotateY(360deg); }
}

.cc-flip-back {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 13%;
  background: url("art/ui/card-back.webp") center / 100% 100% no-repeat;
  transform: scaleX(-1); /* reads the right way round while the card faces away */
  opacity: 0;
  pointer-events: none;
  animation: cc-flip-back 0.5s step-end;
  animation-delay: inherit;
}

@keyframes cc-flip-back {
  0% { opacity: 0; }
  25% { opacity: 1; }
  75% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-flip-back { display: none; }
}

/* === 3.27.0: the Neon HUD (WildFlip Neon HUD Asset Guide) ===
   The top strip as the guide draws it: a gold hex level badge, a teal neon
   XP bar in a metal frame, and metal pods for coins (our Rhino coin) and
   Holos (a crystal), each with a "+" to the Store; the 📋 Daily & Progress
   alert sits between them as a neon tile. Behind it, the guide's mountains
   and sunset (art/ui/hud-sky.webp). */
:root {
  --hud-h: 3.5rem;
  --hud-teal: #2ee6e6;
  --hud-teal-soft: rgba(46, 230, 230, 0.45);
  --hud-metal: linear-gradient(180deg, #2a4552 0%, #13262f 45%, #0a161d 100%);
  --hud-edge: rgba(170, 225, 235, 0.55);
}

body.cc-with-topbar {
  padding-top: calc(var(--hud-h) + 0.4rem + env(safe-area-inset-top));
}

.cc-topbar.cc-hud {
  height: calc(var(--hud-h) + env(safe-area-inset-top));
  gap: 0.45rem;
  padding: env(safe-area-inset-top) calc(0.5rem + env(safe-area-inset-right)) 0 calc(0.5rem + env(safe-area-inset-left));
  background:
    linear-gradient(180deg, rgba(5, 16, 24, 0.35) 0%, rgba(5, 16, 24, 0.82) 70%, #050f16 100%),
    url("art/ui/hud-sky.webp") center bottom / auto 100% repeat-x,
    #061019;
  border-bottom: 1px solid var(--hud-teal-soft);
  box-shadow: 0 1px 0 rgba(46, 230, 230, 0.25), 0 6px 22px rgba(0, 0, 0, 0.55), 0 2px 14px rgba(46, 230, 230, 0.12);
  font-size: 0.8rem;
  color: #eafcff;
}

.cc-topbar.cc-hud a {
  padding: 0;
  border-radius: 0;
}

.cc-topbar.cc-hud a:hover {
  background: none;
  filter: brightness(1.15);
}

/* Level: the hex badge overlapping the XP frame. */
.cc-hud .cc-top-level {
  flex: 1;
  min-width: 0;
  max-width: 24rem;
  gap: 0;
  position: relative;
}

.cc-hud-badge {
  position: relative;
  z-index: 2;
  flex: none;
  width: 2.75rem;
  height: 3.05rem;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 6px rgba(245, 181, 46, 0.45)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

.cc-hud-hex {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cc-hud .cc-top-lv {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  color: #cfe9ef;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-style: italic;
}

.cc-hud .cc-top-lv b {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0;
  text-shadow: 0 1px 0 #6b7c86, 0 2px 4px rgba(0, 0, 0, 0.8);
}

.cc-hud-xp {
  flex: 1;
  min-width: 0;
  margin-left: -0.55rem;
  padding: 0.22rem 0.9rem 0.32rem 0.85rem;
  background: var(--hud-metal);
  border: 1px solid var(--hud-edge);
  border-left: none;
  clip-path: polygon(0 0, calc(100% - 0.6rem) 0, 100% 50%, calc(100% - 0.6rem) 100%, 0 100%);
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.cc-hud-xp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  line-height: 1;
}

.cc-hud-xp-head i {
  color: var(--hud-teal);
  font-weight: 900;
  font-size: 0.72rem;
  text-shadow: 0 0 6px rgba(46, 230, 230, 0.6);
}

.cc-hud .cc-top-xp-text {
  color: #f2fdff;
  font-size: 0.68rem;
  font-weight: 700;
}

.cc-hud .cc-top-xp {
  flex: none;
  width: 100%;
  min-width: 0;
  height: 0.5rem;
  border-radius: 3px;
  background: #04121a;
  border: 1px solid rgba(46, 230, 230, 0.35);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
}

.cc-hud .cc-top-xp-fill {
  border-radius: 2px;
  background: linear-gradient(180deg, #b8ffff 0%, #2ee6e6 45%, #0fa9b5 100%);
  box-shadow: 0 0 8px rgba(46, 230, 230, 0.85);
}

/* The 📋 Daily & Progress alert: a neon tile. */
.cc-hud .cc-top-daily {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  justify-content: center;
  font-size: 1.05rem;
  border-radius: 0.55rem;
  background: var(--hud-metal);
  border: 1px solid var(--hud-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 8px rgba(46, 230, 230, 0.2);
}

.cc-topbar.cc-hud {
  justify-content: flex-start;
}

.cc-topbar.cc-hud .cc-top-daily {
  margin-left: auto; /* beside the coins on wide screens */
  border-radius: 0.55rem;
}

.cc-hud .cc-top-daily.cc-pending {
  border-color: #ff5a6a;
  background: linear-gradient(180deg, #4a1e2a 0%, #1f0d14 100%);
  animation: cc-hud-alert 1.8s ease-in-out infinite;
}

@keyframes cc-hud-alert {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 6px rgba(255, 90, 106, 0.45); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 14px rgba(255, 90, 106, 0.9); }
}

@media (prefers-reduced-motion: reduce) {
  .cc-hud .cc-top-daily.cc-pending { animation: none; }
}

.cc-hud .cc-top-daily-n {
  top: -0.3rem;
  right: -0.35rem;
  box-shadow: 0 0 0 1.5px #061019;
}

/* Coins and Holos: metal pods with a "+". */
.cc-hud .cc-top-wallet {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.cc-hud-pod {
  gap: 0.3rem;
  height: 2.1rem;
  padding: 0 0.18rem 0 0.25rem !important;
  border-radius: 0.6rem !important;
  background: var(--hud-metal);
  border: 1px solid var(--hud-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 8px rgba(46, 230, 230, 0.18);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cc-hud .cc-top-coins,
.cc-hud .cc-top-holos {
  gap: 0.28rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.cc-hud .cc-top-coins img.cc-coin {
  width: 1.45rem;
  height: 1.45rem;
  margin: 0;
  filter: drop-shadow(0 0 4px rgba(220, 235, 245, 0.35));
}

.cc-hud-gem {
  width: 1.05rem;
  height: 1.3rem;
  filter: drop-shadow(0 0 5px rgba(139, 125, 255, 0.7));
}

.cc-hud-plus {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.32rem;
  background: linear-gradient(180deg, #13706f 0%, #0a3d3e 100%);
  border: 1px solid var(--hud-teal);
  color: #eaffff;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 6px rgba(46, 230, 230, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Narrow phones: the "+" and the XP numbers make way. */
@media (max-width: 380px) {
  .cc-hud-plus {
    display: none;
  }
  .cc-hud .cc-top-xp-text {
    font-size: 0.6rem;
  }
}

@media (max-width: 340px) {
  .cc-hud .cc-top-xp-text {
    display: none;
  }
}

/* Playing as an alt: the HUD sits under the red alt bar. */
body.cc-alt-mode .cc-topbar.cc-hud {
  height: var(--hud-h);
}

body.cc-alt-mode.cc-with-topbar {
  padding-top: calc(2rem + var(--hud-h) + 0.4rem + env(safe-area-inset-top));
}

/* The test site keeps its lime mark: a lime edge and the TEST tag. */
.cc-test-site .cc-topbar.cc-hud {
  border-bottom: 3px solid #84cc16;
  color: #eafcff;
}

.cc-test-site .cc-hud .cc-top-lv,
.cc-test-site .cc-hud .cc-top-xp-text {
  color: #f2fdff;
}

.cc-test-site .cc-hud .cc-top-xp {
  background: #04121a;
}

.cc-test-site .cc-hud .cc-top-xp-fill {
  background: linear-gradient(180deg, #b8ffff 0%, #2ee6e6 45%, #0fa9b5 100%);
}


/* 3.28.5: new pictures.
   The WildFlip Mountain Adventure logo in place of the four-card logo and
   name (Home, the tour), and on the splash after BlurryWare's. */
.cc-title.cc-title-logo {
  display: flex;
  justify-content: center;
  margin: 0;
  line-height: 0;
}

.cc-logo-mountain {
  display: block;
  width: min(62vw, 15rem);
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  user-select: none;
}

.cc-logo-mountain.cc-logo-mountain-sm {
  width: min(40vw, 8.5rem);
}

.cc-tour-welcome .cc-tour-logo {
  width: min(80%, 16rem);
  height: auto;
}

.wf-logo-splash img.wf-logo-mountain {
  width: min(88vw, 560px);
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 0 40px rgba(0, 229, 255, 0.35));
}

/* Cancel is its picture (art/ui/btn-cancel.webp); the word stays for
   screen readers. */
.reset-btn.cc-cancel-btn {
  width: 4.6rem;
  aspect-ratio: 240 / 237;
  padding: 0;
  border: none;
  border-radius: 1rem;
  background: url("art/ui/btn-cancel.webp") center / contain no-repeat;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  overflow: hidden;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.reset-btn.cc-cancel-btn:hover,
.reset-btn.cc-cancel-btn:focus-visible {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.reset-btn.cc-cancel-btn:focus-visible {
  outline: 2px solid var(--win);
  outline-offset: 2px;
}

.reset-btn.cc-cancel-btn[hidden] {
  display: none;
}

/* The Cards and My Decks tabs (Play) are their pictures; the one shown
   glows, the other is dimmer. My Decks shows how many in a badge. */
.cc-tabs.cc-pic-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 0.2rem 0 0.9rem;
  padding: 0;
  background: none;
}

.cc-pic-tabs [role="tab"] {
  position: relative;
  width: min(30vw, 6.4rem);
  padding: 0;
  border: none;
  border-radius: 22%;
  background: none;
  opacity: 0.6;
  filter: saturate(0.6);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.cc-pic-tabs [role="tab"][aria-selected="true"] {
  background: none;
  opacity: 1;
  filter: none;
  transform: scale(1.06);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.55);
}

.cc-pic-tabs [role="tab"] img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.cc-tab-count {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #ffd166;
  color: #1a1030;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* The inner panel picture (art/ui/panel-inner.webp) behind the buttons on
   the screens in front of the Rhino and Wolf: Home, Play, a new player,
   looking for a player. Darkened a little so the words stay clear. */
body.cc-themed.cc-select-screen:not(.cc-ladder) .game.cc-page {
  background:
    linear-gradient(rgba(8, 20, 28, 0.38), rgba(8, 20, 28, 0.52)),
    url("art/ui/panel-inner.webp") center top / 100% 100% no-repeat;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}


/* 3.28.6: the raccoon after a game (art/ui/raccoon-<result>.webp).
   Win: creeps in, crouches and pounces, then breathes. Draw: rolls in
   tumbling, then wobbles. Loss: rushes in, smacks the wall (a shake and a
   dust puff), then sways dizzy with stars circling its head. */
.cc-raccoon {
  position: relative;
  display: grid;
  place-items: center;
  height: 9.5rem;
  margin: 0.2rem auto 0.4rem;
  overflow: visible;
  pointer-events: none;
}

.cc-raccoon[hidden] {
  display: none;
}

.cc-raccoon img {
  display: block;
  max-width: min(84%, 19rem);
  max-height: 100%;
  width: auto;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
  transform-origin: 50% 90%;
}

.cc-raccoon-draw img {
  max-height: 88%;
  transform-origin: 50% 50%;
}

/* Win: a pounce. */
.cc-raccoon-win img {
  animation: cc-rac-pounce 1.9s cubic-bezier(0.3, 0.7, 0.3, 1) both, cc-rac-breathe 1.8s ease-in-out 1.9s infinite;
}

@keyframes cc-rac-pounce {
  0% { opacity: 0; transform: translateX(-45%) scale(0.95); }
  25% { opacity: 1; transform: translateX(-8%) scale(1); }
  40% { transform: translateX(-6%) scale(1.06, 0.88); }
  48% { transform: translateX(-7%) rotate(-1deg) scale(1.08, 0.86); }
  62% { transform: translate(6%, -32%) rotate(-7deg) scale(0.96, 1.08); }
  76% { transform: translate(10%, 0) rotate(0) scale(1.08, 0.9); }
  86% { transform: translate(9%, -5%) scale(0.98, 1.03); }
  100% { opacity: 1; transform: translate(8%, 0) scale(1); }
}

@keyframes cc-rac-breathe {
  0%, 100% { transform: translate(8%, 0) scale(1); }
  50% { transform: translate(8%, 0) scale(1.015, 0.985); }
}

/* Win sparkles on landing. */
.cc-raccoon-win::before,
.cc-raccoon-win::after {
  content: "✨";
  position: absolute;
  top: 18%;
  font-size: 1.5rem;
  opacity: 0;
  animation: cc-rac-sparkle 1.1s ease-out 1.35s both;
}

.cc-raccoon-win::before { left: 18%; }
.cc-raccoon-win::after { right: 14%; top: 8%; animation-delay: 1.5s; }

@keyframes cc-rac-sparkle {
  0% { opacity: 0; transform: scale(0.3) rotate(0); }
  35% { opacity: 1; transform: scale(1.2) rotate(20deg); }
  100% { opacity: 0; transform: scale(0.8) translateY(-1rem) rotate(40deg); }
}

/* Draw: a tumble. */
.cc-raccoon-draw img {
  animation: cc-rac-tumble 1.6s cubic-bezier(0.25, 0.8, 0.3, 1) both, cc-rac-wobble 2.4s ease-in-out 1.6s infinite;
}

@keyframes cc-rac-tumble {
  0% { opacity: 0; transform: translateX(-90%) rotate(-540deg) scale(0.8); }
  20% { opacity: 1; }
  70% { transform: translateX(6%) rotate(12deg) scale(1); }
  85% { transform: translateX(-2%) rotate(-6deg); }
  100% { opacity: 1; transform: translateX(0) rotate(0); }
}

@keyframes cc-rac-wobble {
  0%, 100% { transform: rotate(0) translateY(0); }
  25% { transform: rotate(-8deg) translateY(-3%); }
  75% { transform: rotate(8deg) translateY(-3%); }
}

/* Loss: a wipeout. */
.cc-raccoon-loss img {
  transform-origin: 80% 70%;
  animation: cc-rac-crash 1.3s cubic-bezier(0.5, 0, 0.3, 1) both, cc-rac-dizzy 2.2s ease-in-out 1.3s infinite;
}

@keyframes cc-rac-crash {
  0% { opacity: 0; transform: translateX(-60%) skewX(-12deg); filter: blur(3px); }
  28% { opacity: 1; transform: translateX(4%) skewX(-6deg) scaleX(1.04); filter: blur(1px); }
  34% { transform: translateX(0) scale(0.94, 1.04); filter: none; }
  40% { transform: translateX(-3%) rotate(-1.5deg); }
  46% { transform: translateX(3%) rotate(1.5deg); }
  52% { transform: translateX(-2%) rotate(-1deg); }
  58% { transform: translateX(1.5%) rotate(0.5deg); }
  70%, 100% { opacity: 1; transform: translateX(0) rotate(0) scale(1); filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45)); }
}

@keyframes cc-rac-dizzy {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-1.2deg); }
  70% { transform: rotate(1deg); }
}

/* Stars circling its head, and the dust of the crash. */
.cc-raccoon-loss::before {
  content: "⭐";
  position: absolute;
  left: 58%;
  top: 18%;
  font-size: 1.05rem;
  opacity: 0;
  transform-origin: 1.3rem 0.9rem;
  animation: cc-rac-orbit 1.1s linear 0.5s infinite;
}

@keyframes cc-rac-orbit {
  0% { opacity: 1; transform: rotate(0) translateX(0); }
  100% { opacity: 1; transform: rotate(360deg) translateX(0); }
}

.cc-raccoon-loss::after {
  content: "";
  position: absolute;
  left: 22%;
  bottom: 12%;
  width: 5rem;
  height: 2.2rem;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(220, 210, 200, 0.75), rgba(220, 210, 200, 0) 70%);
  opacity: 0;
  animation: cc-rac-dust 1.2s ease-out 0.35s both;
}

@keyframes cc-rac-dust {
  0% { opacity: 0; transform: scale(0.3); }
  25% { opacity: 0.9; }
  100% { opacity: 0; transform: scale(1.8) translate(-1.2rem, -0.6rem); }
}

@media (prefers-reduced-motion: reduce) {
  .cc-raccoon img,
  .cc-raccoon::before,
  .cc-raccoon::after {
    animation: none !important;
  }
  .cc-raccoon::before,
  .cc-raccoon::after {
    display: none;
  }
}
