.cf-game {
  width: 100%;
}

.cf-main-card {
  position: relative;
  overflow: hidden;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 246, .84);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
}

.cf-main-card::before {
  content: "";
  position: absolute;
  right: -4rem;
  top: -5rem;
  width: 13rem;
  height: 13rem;
  border-radius: 999px;
  background: rgba(217, 137, 79, .16);
  pointer-events: none;
}

.cf-status-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cf-status-bar h2 {
  margin: .35rem 0 .35rem;
  color: var(--ink);
  font-size: clamp(1.7rem, 3.2vw, 2.55rem);
  line-height: 1;
  letter-spacing: -.055em;
  font-weight: 900;
}

.cf-status-bar p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.cf-turn-pill {
  flex: 0 0 auto;
  padding: .55rem .85rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 40, 36, .09);
  background: rgba(255, 255, 255, .48);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .07em;
  transition:
    background .2s ease,
    color .2s ease,
    border-color .2s ease,
    transform .2s ease;
}

.cf-turn-pill.is-your-turn {
  color: #fffaf2;
  border-color: rgba(36, 72, 63, .18);
  background: var(--brand);
  box-shadow: 0 12px 26px rgba(36, 72, 63, .18);
  animation: cfTurnPulse 1.55s ease-in-out infinite;
}

.cf-turn-pill.is-opponent-turn {
  color: #7e5429;
  border-color: rgba(217, 137, 79, .18);
  background: rgba(217, 137, 79, .13);
}

.cf-turn-pill.is-finished {
  color: #285640;
  border-color: rgba(47, 114, 87, .17);
  background: rgba(47, 114, 87, .13);
}

.cf-board-wrap {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
  margin: 0 auto;
  padding-top: 2.25rem;
}

.cf-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: clamp(.38rem, 1vw, .72rem);
  padding: clamp(.7rem, 2vw, 1rem);
  border: 1px solid rgba(36, 72, 63, .16);
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 12%, rgba(255,255,255,.08), transparent 28%),
    linear-gradient(145deg, rgba(36, 72, 63, .96), rgba(21, 48, 42, .98));
  box-shadow:
    0 18px 42px rgba(36, 72, 63, .16),
    inset 0 1px 0 rgba(255,255,255,.10);
}

.cf-cell {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  box-shadow:
    inset 0 6px 15px rgba(0, 0, 0, .26),
    0 1px 0 rgba(255, 255, 255, .08);
  cursor: default;
  transition:
    background .16s ease,
    transform .16s ease,
    box-shadow .16s ease;
}

.cf-board[data-can-play="1"] .cf-cell {
  cursor: pointer;
}

.cf-board[data-can-play="1"] .cf-cell.is-column-hover {
  background: rgba(255, 255, 255, .19);
  transform: translateY(-1px);
}

.cf-board[data-can-play="1"] .cf-cell:hover {
  background: rgba(255, 255, 255, .22);
}

.cf-disc {
  display: block;
  width: 84%;
  height: 84%;
  border-radius: 999px;
  box-shadow:
    inset 0 -8px 14px rgba(0,0,0,.18),
    inset 0 4px 10px rgba(255,255,255,.20),
    0 8px 14px rgba(0,0,0,.16);
  transform-origin: center;
}

.cf-disc.is-p1,
.cf-preview-disc.is-p1 {
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.42), transparent 23%),
    linear-gradient(135deg, #c95f58, #963531);
}

.cf-disc.is-p2,
.cf-preview-disc.is-p2 {
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.54), transparent 23%),
    linear-gradient(135deg, #f0be63, #d9894f);
}

.cf-disc.is-dropping {
  animation: cfDrop .34s cubic-bezier(.22, .9, .24, 1.18);
}

.cf-cell.is-winning .cf-disc {
  animation: cfWinPulse 1.05s ease-in-out infinite;
  box-shadow:
    inset 0 -8px 14px rgba(0,0,0,.18),
    inset 0 4px 10px rgba(255,255,255,.24),
    0 0 0 4px rgba(255, 250, 242, .65),
    0 12px 24px rgba(36,72,63,.25);
}

.cf-column-preview {
  position: absolute;
  top: 0;
  height: 2.05rem;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition:
    left .12s ease,
    width .12s ease,
    opacity .12s ease;
  z-index: 4;
}

.cf-preview-disc {
  display: block;
  width: min(3.95rem, 84%);
  aspect-ratio: 1;
  border-radius: 999px;
  opacity: .78;
  transform: translateY(-.16rem);
  box-shadow: 0 10px 20px rgba(62, 48, 30, .14);
  animation: cfPreviewFloat 1.2s ease-in-out infinite;
}

.cf-help-row {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .95rem;
  color: var(--muted);
  font-size: .92rem;
}

.cf-help-row span:last-child {
  color: var(--brand);
  font-weight: 800;
}

.cf-game.is-my-turn .cf-main-card {
  border-color: rgba(36, 72, 63, .22);
}

.cf-game.is-finished .cf-board {
  filter: saturate(.96);
}

@keyframes cfDrop {
  0% {
    transform: translateY(-420%) scale(.94);
    opacity: .2;
  }

  70% {
    transform: translateY(7%) scale(1.02);
    opacity: 1;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes cfWinPulse {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

@keyframes cfTurnPulse {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@keyframes cfPreviewFloat {
  0%, 100% {
    transform: translateY(-.12rem);
  }

  50% {
    transform: translateY(-.34rem);
  }
}

@media (max-width: 900px) {
  .cf-status-bar {
    flex-direction: column;
  }

  .cf-turn-pill {
    width: fit-content;
  }

  .cf-board-wrap {
    width: 100%;
  }

  .cf-help-row {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .cf-main-card {
    padding: .85rem;
  }

  .cf-board {
    border-radius: 22px;
  }

  .cf-board-wrap {
    padding-top: 1.9rem;
  }

  .cf-column-preview {
    height: 1.75rem;
  }
}
.cf-rematch-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(29, 37, 34, .28);
  backdrop-filter: blur(10px);
}

.cf-rematch-modal-backdrop[hidden] {
  display: none;
}

.cf-rematch-modal {
  width: min(420px, 100%);
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 252, 246, .96);
  box-shadow: 0 24px 70px rgba(62, 48, 30, .22);
  animation: cfModalIn .18s ease-out;
}

.cf-rematch-modal h2 {
  margin: .35rem 0 .55rem;
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: -.045em;
  font-weight: 900;
}

.cf-rematch-modal p {
  color: var(--muted);
  line-height: 1.55;
}

.cf-rematch-actions {
  display: flex;
  gap: .65rem;
  margin-top: 1.1rem;
}

.cf-rematch-actions .btn {
  flex: 1;
}

@keyframes cfModalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
