/* Connect Four — panels, buttons and status come from shared/games.css. */

.cf-wrap {
  width: 100%;
  max-width: 560px;
  padding: 10px;
  background: var(--gm-surface, #1b2740);
  border: 1px solid var(--gm-line, rgba(255, 255, 255, 0.09));
  border-radius: var(--gm-radius, 12px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
}

.cf-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  padding: 6px;
  overflow: hidden;
  background: var(--gm-surface-2, #22304a);
  border-radius: 10px;
  user-select: none;
  -webkit-user-select: none;
}

.cf-col {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  min-width: 44px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.cf-col:hover:not(:disabled),
.cf-col:focus-visible {
  background: var(--gm-accent-soft, rgba(255, 255, 255, 0.08));
}

.cf-col:focus-visible {
  outline: 3px solid var(--gm-accent-bright, #e0584a);
  outline-offset: -3px;
}

.cf-col:disabled { cursor: default; }

.cf-cell {
  position: relative;
  display: block;
  aspect-ratio: 1;
  padding: 7%;
}

.cf-cell::before {
  content: "";
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  background: var(--gm-bg, #0f1520);
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.45);
}

.cf-disc {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 0 0 4px rgba(0, 0, 0, 0.16), inset 0 0 0 9px rgba(255, 255, 255, 0.14);
}

.cf-disc.p1 { background: var(--gm-accent, #c0392b); }
.cf-disc.p2 { background: var(--gm-sq-light, #e9e0cc); }

/* second player's discs carry a centre dot, so the two sides differ by shape as well as colour */
.cf-disc.p2::after {
  content: "";
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
}

.cf-disc.is-drop {
  animation: cf-drop calc(0.22s + var(--rows, 1) * 0.07s) cubic-bezier(0.55, 0, 0.9, 0.6);
}

.cf-board.has-win .cf-disc:not(.is-win) { opacity: 0.4; }

.cf-disc.is-win {
  box-shadow: 0 0 0 3px var(--gm-text, #f2eee6), 0 0 14px 2px var(--gm-accent-bright, #e0584a), inset 0 0 0 4px rgba(0, 0, 0, 0.16);
  animation: cf-glow 1.1s ease-in-out infinite alternate;
}

@keyframes cf-drop {
  0% { transform: translateY(calc(var(--rows, 1) * -105%)); }
  80% { transform: translateY(0); }
  90% { transform: translateY(-9%); }
  100% { transform: translateY(0); }
}

@keyframes cf-glow {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .cf-disc.is-drop, .cf-disc.is-win, .gm-status.is-thinking .gm-dot { animation: none; }
}

.gm-seg button, .gm-actions .gm-btn { min-height: 44px; }

@media (max-width: 480px) {
  .cf-wrap { padding: 6px; }
  .cf-board { padding: 3px; }
}
