/* FCC Family Game Center — Phase 1 styles
 * Scoped to .fcc-games-* classes. Reuses .section-card / .ios-card from styles.css.
 */

.fcc-games-shell { display: block; }
.fcc-games-home { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Hero ---------- */
.fcc-games-hero {
  display: grid; grid-template-columns: 1fr auto; gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, rgba(108,99,255,0.10), rgba(255,138,200,0.10));
  border: 1px solid rgba(108,99,255,0.18);
  border-radius: 24px;
}
.fcc-games-hero__eyebrow {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0.65; margin-bottom: 6px;
}
.fcc-games-hero__title {
  font-size: 28px; line-height: 1.1; margin: 0 0 6px; font-weight: 700;
}
.fcc-games-hero__sub { margin: 0 0 14px; opacity: 0.78; }
.fcc-games-hero__pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.fcc-games-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(108,99,255,0.14); color: inherit;
  border: 1px solid rgba(108,99,255,0.20);
}
.fcc-games-pill--muted {
  background: rgba(120,120,128,0.10); border-color: rgba(120,120,128,0.18); opacity: 0.85;
}
.fcc-games-hero__cta { display: flex; flex-wrap: wrap; gap: 10px; }
.fcc-games-hero__art {
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  min-width: 120px;
}
.fcc-games-hero__sparkle {
  font-size: 56px; line-height: 1;
  filter: drop-shadow(0 8px 18px rgba(108,99,255,0.35));
}

/* ---------- Avatars ---------- */
.fcc-games-avatar-row { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 100%; }
.fcc-games-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  width: 32px; height: 32px; border-radius: 999px;
  background: rgba(120,120,128,0.16);
  overflow: hidden; border: 2px solid rgba(255,255,255,0.55);
  font-weight: 700; font-size: 13px;
}
.fcc-games-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fcc-games-avatar.is-emoji {
  font-size: 18px;
  line-height: 1;
}
.fcc-games-avatar.is-initials {
  font-weight: 700;
  font-size: 12px;
}
.fcc-games-avatar__fallback { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.fcc-games-avatar-more {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 8px; border-radius: 16px;
  background: rgba(120,120,128,0.16); font-size: 12px; font-weight: 600;
}

/* ---------- Buttons ---------- */
.fcc-games-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 14px;
  border: 1px solid rgba(120,120,128,0.24);
  background: rgba(255,255,255,0.6);
  color: inherit;
  font-weight: 600; font-size: 14px;
  cursor: pointer; transition: transform 0.06s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.fcc-games-btn:hover { background: rgba(255,255,255,0.85); }
.fcc-games-btn:active { transform: scale(0.97); }
.fcc-games-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.fcc-games-btn--primary {
  background: linear-gradient(135deg, #6c63ff, #ff8ac8);
  color: #fff; border-color: transparent;
  box-shadow: 0 8px 20px -8px rgba(108,99,255,0.55);
}
.fcc-games-btn--primary:hover { filter: brightness(1.05); background: linear-gradient(135deg, #6c63ff, #ff8ac8); }
.fcc-games-btn--ghost { background: transparent; border-color: transparent; }

/* ---------- Section heads ---------- */
.fcc-games-section-title { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.fcc-games-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.fcc-games-section-head .fcc-games-section-title { margin: 0; }

/* ---------- Empty states ---------- */
.fcc-games-empty__body {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 20px 0;
}
.fcc-games-empty__emoji { font-size: 36px; opacity: 0.75; }

/* ---------- Active game cards ---------- */
.fcc-games-active-grid {
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.fcc-games-active-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: rgba(255,255,255,0.5); border: 1px solid rgba(120,120,128,0.18);
  border-radius: 16px; text-align: left; cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease;
}
.fcc-games-active-card:hover { box-shadow: 0 8px 24px -16px rgba(0,0,0,0.25); }
.fcc-games-active-card:active { transform: scale(0.98); }
.fcc-games-active-card__emoji { font-size: 28px; }
.fcc-games-active-card__title { font-weight: 700; }
.fcc-games-active-card__players { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; max-width: 100%; }

/* ---------- Featured game cards ---------- */
.fcc-games-card-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.fcc-games-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; border-radius: 20px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(120,120,128,0.16);
  transition: transform 0.08s ease, box-shadow 0.18s ease;
  position: relative;
}
.fcc-games-card.is-ready {
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(108,99,255,0.06));
  border-color: rgba(108,99,255,0.22);
}
.fcc-games-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -20px rgba(0,0,0,0.30); }
.fcc-games-card__top { display: flex; align-items: center; justify-content: space-between; }
.fcc-games-card__emoji { font-size: 32px; line-height: 1; }
.fcc-games-card__title { margin: 2px 0 0; font-size: 16px; font-weight: 700; }
.fcc-games-card__desc { margin: 0; font-size: 13px; opacity: 0.75; min-height: 36px; }
.fcc-games-card__meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0;
  font-size: 11px;
}
.fcc-games-card__meta div { display: flex; flex-direction: column; gap: 2px; }
.fcc-games-card__meta dt { opacity: 0.55; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.fcc-games-card__meta dd { margin: 0; font-weight: 600; }
.fcc-games-card__cta { margin-top: 6px; }
.fcc-games-card__cta .fcc-games-btn { width: 100%; }

.fcc-games-badge {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.fcc-games-badge--ready { background: rgba(48,209,88,0.18); color: #0a7c2f; }
.fcc-games-badge--beta { background: rgba(255,159,10,0.20); color: #9a5a00; }
.fcc-games-badge--soon  { background: rgba(120,120,128,0.16); color: inherit; opacity: 0.8; }

/* ---------- Leaderboard ---------- */
.fcc-games-leader-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.fcc-games-leader-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 12px; background: rgba(255,255,255,0.45);
  border: 1px solid rgba(120,120,128,0.12);
}
.fcc-games-leader-rank { font-weight: 700; opacity: 0.7; width: 28px; }
.fcc-games-leader-name { flex: 1; font-weight: 600; }
.fcc-games-leader-score { font-variant-numeric: tabular-nums; }

/* ---------- Achievements ---------- */
.fcc-games-badge-grid {
  list-style: none; padding: 0; margin: 8px 0 0;
  display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.fcc-games-badge-card {
  padding: 12px; border-radius: 16px;
  background: rgba(255,255,255,0.45); border: 1px solid rgba(120,120,128,0.14);
  text-align: center;
}
.fcc-games-badge-card__emoji { font-size: 28px; }
.fcc-games-badge-card__title { font-weight: 700; margin-top: 4px; }

/* ---------- Parent controls ---------- */
.fcc-games-parent-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; opacity: 0.78; }

/* ---------- Tic-Tac-Toe game ---------- */
.fcc-games-game { display: flex; flex-direction: column; gap: 14px; }
.fcc-games-game__header {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
}
.fcc-games-game__title { font-size: 18px; font-weight: 700; text-align: center; }
.fcc-games-game__status { text-align: right; }

.fcc-games-ttt__players {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 12px;
}
.fcc-games-ttt__player {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 14px;
  background: rgba(255,255,255,0.5); border: 1px solid rgba(120,120,128,0.18);
  transition: box-shadow 0.18s ease, transform 0.08s ease;
}
.fcc-games-ttt__player.is-active {
  border-color: rgba(108,99,255,0.5);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.18);
  transform: translateY(-1px);
}
.fcc-games-ttt__player-name { font-weight: 600; }
.fcc-games-ttt__player-mark { font-weight: 800; opacity: 0.7; }

.fcc-games-ttt__board {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  max-width: 360px; margin: 0 auto; aspect-ratio: 1;
}
.fcc-games-ttt__cell {
  aspect-ratio: 1; font-size: 44px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(120,120,128,0.20);
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.fcc-games-ttt__cell:hover:not(:disabled) { background: rgba(255,255,255,0.95); }
.fcc-games-ttt__cell:active:not(:disabled) { transform: scale(0.95); }
.fcc-games-ttt__cell:disabled { cursor: default; }
.fcc-games-ttt__cell.is-filled { background: rgba(108,99,255,0.10); }

.fcc-games-ttt__actions {
  display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap;
}

/* ---------- Player picker (Phase 2) ---------- */
.fcc-games-picker { display: flex; flex-direction: column; gap: 14px; }
.fcc-games-picker-slot { margin-top: 14px; }
.fcc-games-picker-slot__label {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0.7; font-weight: 700; margin-bottom: 8px;
}
.fcc-games-picker-slot__options {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.fcc-games-picker-option {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(120,120,128,0.18);
  cursor: pointer;
  font: inherit; color: inherit; text-align: left;
  transition: transform 0.08s ease, box-shadow 0.18s ease, background 0.15s ease;
}
.fcc-games-picker-option:hover:not(:disabled) {
  background: rgba(255,255,255,0.85);
  box-shadow: 0 6px 18px -12px rgba(0,0,0,0.25);
}
.fcc-games-picker-option:active:not(:disabled) { transform: scale(0.98); }
.fcc-games-picker-option.is-selected {
  border-color: rgba(108,99,255,0.55);
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(108,99,255,0.10));
  box-shadow: 0 0 0 3px rgba(108,99,255,0.18);
}
.fcc-games-picker-option.is-locked { opacity: 0.40; cursor: not-allowed; }
.fcc-games-picker-option__name { flex: 1; font-weight: 600; }
.fcc-games-picker-option__check { font-weight: 800; color: #6c63ff; }
.fcc-games-picker__actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Connect Four (Phase 2) ---------- */
.fcc-games-c4 { display: flex; flex-direction: column; gap: 10px; }
.fcc-games-c4__meta { text-align: center; }

.fcc-games-c4__drops {
  display: grid; gap: 6px;
  grid-template-columns: repeat(7, 1fr);
  max-width: 420px; margin: 0 auto; width: 100%;
}
.fcc-games-c4__drop {
  aspect-ratio: 1; border-radius: 12px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(120,120,128,0.18);
  font-size: 18px; font-weight: 700; cursor: pointer;
  color: inherit; opacity: 0.85;
  transition: transform 0.08s ease, background 0.15s ease;
}
.fcc-games-c4__drop:hover:not(:disabled) { background: rgba(108,99,255,0.18); opacity: 1; }
.fcc-games-c4__drop:active:not(:disabled) { transform: translateY(2px); }
.fcc-games-c4__drop:disabled { opacity: 0.25; cursor: default; }

.fcc-games-c4__board {
  display: grid;
  grid-template-columns: repeat(var(--c4-cols, 7), 1fr);
  gap: 6px;
  max-width: 420px; margin: 0 auto;
  padding: 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(108,99,255,0.18), rgba(108,99,255,0.10));
  border: 1px solid rgba(108,99,255,0.22);
  box-shadow: inset 0 2px 12px rgba(0,0,0,0.06);
  width: 100%;
}
.fcc-games-c4__cell {
  aspect-ratio: 1; border-radius: 50%;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(120,120,128,0.14);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.fcc-games-c4__token {
  display: block; width: 82%; height: 82%; border-radius: 50%;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.15);
  animation: fcc-games-c4-drop 0.32s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.fcc-games-c4__cell--p1 .fcc-games-c4__token {
  background: radial-gradient(circle at 30% 30%, #ff8ac8, #c93b8a);
}
.fcc-games-c4__cell--p2 .fcc-games-c4__token {
  background: radial-gradient(circle at 30% 30%, #ffd166, #d49426);
}
.fcc-games-c4__cell.is-last-drop { box-shadow: 0 0 0 2px rgba(108,99,255,0.45); }
.fcc-games-c4__cell.is-win {
  box-shadow: 0 0 0 3px #30d158, 0 0 12px rgba(48,209,88,0.6);
  animation: fcc-games-c4-winpulse 1.6s ease-in-out infinite;
}

.fcc-games-c4__player-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  margin-left: 4px;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.18);
}
.fcc-games-c4__player--p1 .fcc-games-c4__player-dot {
  background: radial-gradient(circle at 30% 30%, #ff8ac8, #c93b8a);
}
.fcc-games-c4__player--p2 .fcc-games-c4__player-dot {
  background: radial-gradient(circle at 30% 30%, #ffd166, #d49426);
}

@keyframes fcc-games-c4-drop {
  0%   { transform: translateY(-340%); opacity: 0.6; }
  85%  { transform: translateY(8%); }
  100% { transform: translateY(0); }
}
@keyframes fcc-games-c4-winpulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .fcc-games-c4__token { animation: none; }
  .fcc-games-c4__cell.is-win { animation: none; }
  .fcc-games-board__cell.is-capture::after { animation: none; }
}

/* ---------- Shared board games (Phase 5) ---------- */
.fcc-games-board-wrap { display: flex; flex-direction: column; gap: 10px; }
.fcc-games-board-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.fcc-games-board-segments {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(120,120,128,0.10);
  border: 1px solid rgba(120,120,128,0.16);
}
.fcc-games-segment {
  border: 0;
  border-radius: 10px;
  padding: 7px 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.fcc-games-segment.is-active {
  background: rgba(255,255,255,0.78);
  box-shadow: 0 4px 12px -8px rgba(0,0,0,0.32);
}
.fcc-games-board-note,
.fcc-games-board-message,
.fcc-games-board-help {
  width: min(92vw, 480px);
  max-width: 100%;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid rgba(120,120,128,0.18);
}
.fcc-games-board-note {
  padding: 8px 12px;
  background: rgba(120,120,128,0.10);
  font-size: 12px;
  font-weight: 650;
  opacity: 0.86;
}
.fcc-games-board-message {
  padding: 9px 12px;
  background: rgba(255,204,0,0.16);
  border-color: rgba(255,204,0,0.34);
  color: #8a5b00;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}
.fcc-games-board-message--warn {
  background: rgba(255,159,10,0.18);
  border-color: rgba(255,159,10,0.34);
}
.fcc-games-board-help {
  padding: 12px 14px;
  background: rgba(255,255,255,0.68);
  font-size: 13px;
  line-height: 1.4;
}
.fcc-games-board-help strong { display: block; margin-bottom: 4px; }
.fcc-games-board-help p { margin: 6px 0 0; }
.fcc-games-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  width: min(92vw, 480px);
  max-width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 8px;
  gap: 3px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(60,60,67,0.12), rgba(108,99,255,0.10));
  border: 1px solid rgba(120,120,128,0.20);
  box-shadow: inset 0 2px 12px rgba(0,0,0,0.06);
}
.fcc-games-board__cell {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: box-shadow 0.14s ease, transform 0.08s ease, background 0.14s ease;
}
.fcc-games-board__cell.is-light { background: rgba(255,255,255,0.72); }
.fcc-games-board__cell.is-dark { background: rgba(108,99,255,0.22); }
.fcc-games-board__cell:disabled { cursor: default; }
.fcc-games-board__cell:not(:disabled):active { transform: scale(0.96); }
.fcc-games-board__cell.is-selected {
  box-shadow: inset 0 0 0 3px rgba(108,99,255,0.78), 0 0 0 2px rgba(255,255,255,0.65);
}
.fcc-games-board__cell.is-legal::after {
  content: '';
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: rgba(48,209,88,0.72);
  box-shadow: 0 0 0 5px rgba(48,209,88,0.16);
  position: absolute;
}
.fcc-games-board__cell.is-capture::after {
  width: 72%;
  height: 72%;
  background: transparent;
  border: 3px solid rgba(255,69,58,0.82);
  box-shadow: 0 0 0 4px rgba(255,69,58,0.14);
  animation: fcc-games-capture-pulse 1.3s ease-in-out infinite;
}
.fcc-games-board__cell.is-last {
  box-shadow: inset 0 0 0 2px rgba(255,204,0,0.72);
}
.fcc-games-board__piece {
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.fcc-games-board__piece--checker {
  width: 74%;
  height: 74%;
  border-radius: 50%;
  box-shadow: inset 0 -4px 7px rgba(0,0,0,0.22), 0 3px 8px rgba(0,0,0,0.18);
}
.fcc-games-board__piece--checker.fcc-games-board__piece--p1 {
  background: radial-gradient(circle at 30% 28%, #ff9acb, #c93b8a);
}
.fcc-games-board__piece--checker.fcc-games-board__piece--p2 {
  background: radial-gradient(circle at 30% 28%, #f5f5f7, #8e8e93);
}
.fcc-games-board__king {
  width: 56%;
  height: 56%;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.78);
  color: #1c1c1e;
  font-size: clamp(10px, 2.4vw, 16px);
  font-weight: 900;
}
.fcc-games-board__piece--chess {
  font-size: clamp(24px, 7vw, 44px);
  line-height: 1;
  text-shadow: 0 2px 5px rgba(0,0,0,0.18);
}
.fcc-games-board__piece--chess.fcc-games-board__piece--p1 { color: #fff; }
.fcc-games-board__piece--chess.fcc-games-board__piece--p2 { color: #1c1c1e; }
.fcc-games-board__warning {
  margin-top: 3px;
  font-size: 12px;
  color: #bf4d00;
}
.fcc-games-board__player .fcc-games-ttt__player-mark { min-width: 34px; text-align: right; }
.fcc-games-board--replay .fcc-games-board__cell { cursor: default; }

.fcc-games-board-theme--soft-glass .fcc-games-board {
  background: linear-gradient(180deg, rgba(255,255,255,0.50), rgba(108,99,255,0.10));
  border-color: rgba(255,255,255,0.42);
  box-shadow: inset 0 2px 14px rgba(255,255,255,0.28), 0 14px 32px -26px rgba(0,0,0,0.32);
}
.fcc-games-board-theme--soft-glass .fcc-games-board__cell.is-light { background: rgba(255,255,255,0.78); }
.fcc-games-board-theme--soft-glass .fcc-games-board__cell.is-dark { background: rgba(120,120,128,0.22); }
.fcc-games-board-theme--high-contrast .fcc-games-board {
  background: #111;
  border-color: #111;
}
.fcc-games-board-theme--high-contrast .fcc-games-board__cell.is-light { background: #f7f7f7; }
.fcc-games-board-theme--high-contrast .fcc-games-board__cell.is-dark { background: #2f2f32; }
.fcc-games-board-theme--high-contrast .fcc-games-board__cell.is-selected {
  box-shadow: inset 0 0 0 4px #007aff, 0 0 0 2px #fff;
}
.fcc-games-board-theme--high-contrast .fcc-games-board__cell.is-legal::after {
  background: #30d158;
  box-shadow: 0 0 0 5px rgba(48,209,88,0.28);
}
.fcc-games-board-theme--high-contrast .fcc-games-board__piece--checker.fcc-games-board__piece--p2 {
  background: radial-gradient(circle at 30% 28%, #fff, #c7c7cc);
}
.fcc-games-replay__label {
  display: inline-flex;
  align-self: center;
  margin: 0 auto 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(108,99,255,0.14);
  border: 1px solid rgba(108,99,255,0.22);
  font-size: 12px;
  font-weight: 800;
}

@keyframes fcc-games-capture-pulse {
  0%,100% { transform: scale(1); opacity: 0.88; }
  50% { transform: scale(0.92); opacity: 1; }
}

/* ---------- Soft banner (Phase 3.1) ---------- */
.fcc-games-soft-banner {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(108,99,255,0.16), rgba(255,138,200,0.14));
  border: 1px solid rgba(108,99,255,0.28);
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fcc-games-soft-banner.is-fading { opacity: 0; transform: translateY(-6px); }

/* ---------- Cloud status (Phase 3) ---------- */
.fcc-games-cloud-pill { font-weight: 700; }
.fcc-games-cloud-pill--on {
  background: rgba(48,209,88,0.18);
  border-color: rgba(48,209,88,0.32);
  color: #0a7c2f;
}
.fcc-games-cloud-pill--off {
  background: rgba(120,120,128,0.12);
  border-color: rgba(120,120,128,0.20);
}
.fcc-games-badge-card.is-earned {
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(48,209,88,0.12));
  border-color: rgba(48,209,88,0.32);
  position: relative;
}
.fcc-games-badge-card__count {
  position: absolute; top: 6px; right: 8px;
  font-size: 11px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(48,209,88,0.22); color: #0a7c2f;
}

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  .fcc-games-btn { background: rgba(60,60,67,0.55); border-color: rgba(255,255,255,0.10); }
  .fcc-games-btn:hover { background: rgba(80,80,90,0.7); }
  .fcc-games-card, .fcc-games-active-card, .fcc-games-leader-row, .fcc-games-badge-card,
  .fcc-games-ttt__player, .fcc-games-ttt__cell {
    background: rgba(60,60,67,0.45); border-color: rgba(255,255,255,0.08);
  }
  .fcc-games-card.is-ready {
    background: linear-gradient(180deg, rgba(60,60,67,0.6), rgba(108,99,255,0.18));
  }
  .fcc-games-badge--ready { background: rgba(48,209,88,0.22); color: #69e08b; }
  .fcc-games-badge--beta { background: rgba(255,159,10,0.24); color: #ffd08a; }
  .fcc-games-board {
    background: linear-gradient(180deg, rgba(60,60,67,0.55), rgba(108,99,255,0.18));
    border-color: rgba(255,255,255,0.10);
  }
  .fcc-games-board__cell.is-light { background: rgba(235,235,245,0.18); }
  .fcc-games-board__cell.is-dark { background: rgba(108,99,255,0.34); }
  .fcc-games-board__piece--chess.fcc-games-board__piece--p2 { color: #050505; }
  .fcc-games-segment.is-active,
  .fcc-games-board-help {
    background: rgba(60,60,67,0.72);
  }
  .fcc-games-board-message { color: #ffd08a; }
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .fcc-games-hero { grid-template-columns: 1fr; }
  .fcc-games-hero__art { align-items: flex-start; flex-direction: row; }
  .fcc-games-hero__sparkle { font-size: 44px; }
  .fcc-games-game__header { grid-template-columns: 1fr; text-align: center; }
  .fcc-games-game__status { text-align: center; }
  .fcc-games-ttt__cell { font-size: 36px; border-radius: 14px; }
  .fcc-games-c4__drops, .fcc-games-c4__board { max-width: 100%; }
  .fcc-games-c4__drops { gap: 4px; }
  .fcc-games-c4__board { gap: 4px; padding: 8px; }
  .fcc-games-c4__drop { font-size: 14px; border-radius: 10px; }
  .fcc-games-board { width: min(94vw, 420px); gap: 2px; padding: 6px; border-radius: 14px; }
  .fcc-games-board__cell { border-radius: 6px; }
  .fcc-games-board-tools { justify-content: center; }
  .fcc-games-board-segments { width: 100%; justify-content: center; }
  .fcc-games-segment { flex: 1; min-width: 0; padding-left: 6px; padding-right: 6px; }
  .fcc-games-picker-slot__options { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (prefers-color-scheme: dark) {
  .fcc-games-picker-option,
  .fcc-games-c4__drop {
    background: rgba(60,60,67,0.45); border-color: rgba(255,255,255,0.08);
  }
  .fcc-games-picker-option.is-selected {
    background: linear-gradient(180deg, rgba(60,60,67,0.65), rgba(108,99,255,0.20));
  }
  .fcc-games-c4__cell { background: rgba(60,60,67,0.55); border-color: rgba(255,255,255,0.06); }
  .fcc-games-c4__board {
    background: linear-gradient(180deg, rgba(108,99,255,0.30), rgba(108,99,255,0.18));
    border-color: rgba(108,99,255,0.35);
  }
}

/* ════════════════════════════════════════════════════════════
 * Phase 4 — invites, history, replay, toasts, presence
 * ════════════════════════════════════════════════════════════ */

/* ---------- Incoming invites ---------- */
.fcc-games-invites { border-color: rgba(108,99,255,0.32); }
.fcc-games-invite-list {
  list-style: none; padding: 0; margin: 8px 0 0;
  display: flex; flex-direction: column; gap: 10px;
}
.fcc-games-invite-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(108,99,255,0.10), rgba(255,138,200,0.08));
  border: 1px solid rgba(108,99,255,0.22);
  flex-wrap: wrap;
}
.fcc-games-invite-card__from { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.fcc-games-invite-card__copy { min-width: 0; }
.fcc-games-invite-card__title { font-weight: 700; }
.fcc-games-invite-card__sub { margin-top: 2px; }
.fcc-games-invite-card__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Completed history ---------- */
.fcc-games-history-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.fcc-games-history-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; border-radius: 18px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(120,120,128,0.16);
}
.fcc-games-history-card__head { display: flex; align-items: center; gap: 8px; }
.fcc-games-history-card__emoji { font-size: 24px; }
.fcc-games-history-card__title { font-weight: 700; flex: 1; }
.fcc-games-history-card__players { display: flex; gap: 4px; flex-wrap: wrap; }
.fcc-games-history-card__winner { font-weight: 700; font-size: 14px; }
.fcc-games-history-card__actions { display: flex; gap: 8px; margin-top: 4px; }
.fcc-games-history-card__actions .fcc-games-btn { flex: 1; }

/* ---------- Replay viewer ---------- */
.fcc-games-replay { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.fcc-games-replay__board { display: flex; justify-content: center; }
.fcc-games-replay__bar {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.fcc-games-replay__slider {
  width: 100%; max-width: 420px; margin: 0 auto;
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, #6c63ff, #ff8ac8);
  outline: none; cursor: pointer;
}
.fcc-games-replay__slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid #6c63ff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  cursor: pointer;
}
.fcc-games-replay__slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid #6c63ff;
  cursor: pointer;
}
.fcc-games-replay__meter { text-align: center; }

/* ---------- Tournament preview (UI only) ---------- */
.fcc-games-tournament__bracket {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-top: 12px; padding: 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(108,99,255,0.06));
  border: 1px dashed rgba(108,99,255,0.30);
  overflow-x: auto;
}
.fcc-games-tournament__round { display: flex; flex-direction: column; gap: 10px; }
.fcc-games-tournament__slot {
  width: 80px; height: 28px; border-radius: 8px;
  background: rgba(120,120,128,0.16);
  border: 1px solid rgba(120,120,128,0.22);
}
.fcc-games-tournament__slot--final {
  width: 96px; height: 56px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(255,209,102,0.40), rgba(255,138,200,0.30));
  border-color: rgba(212,148,38,0.45);
  font-size: 22px;
}

/* ---------- Presence pills ---------- */
.fcc-games-presence {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  font-size: 8px;
  margin-left: 4px;
  vertical-align: middle;
}
.fcc-games-presence.is-active   { filter: drop-shadow(0 0 4px rgba(48,209,88,0.6)); }
.fcc-games-presence.is-away     { filter: drop-shadow(0 0 4px rgba(255,159,10,0.6)); }
.fcc-games-presence.is-offline  { opacity: 0.65; }

/* ---------- Achievement toasts ---------- */
.fcc-games-toast-host {
  position: fixed; top: env(safe-area-inset-top, 12px); right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.fcc-games-toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(108,99,255,0.10));
  border: 1px solid rgba(108,99,255,0.28);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.30);
  min-width: 240px;
  max-width: 360px;
  transform: translateX(120%); opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.25s ease;
  backdrop-filter: blur(20px) saturate(160%);
}
.fcc-games-toast.is-in { transform: translateX(0); opacity: 1; }
.fcc-games-toast.is-out { transform: translateX(120%); opacity: 0; }
.fcc-games-toast__emoji {
  font-size: 28px; line-height: 1; flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(108,99,255,0.30));
  animation: fcc-games-toast-pop 0.6s cubic-bezier(0.34, 1.6, 0.64, 1);
}
.fcc-games-toast__title { font-weight: 800; font-size: 14px; }
.fcc-games-toast__sub { font-size: 12px; opacity: 0.7; margin-top: 1px; }
.fcc-games-toast.is-demo { opacity: 0.85; }
@keyframes fcc-games-toast-pop {
  0% { transform: scale(0.4) rotate(-10deg); }
  60% { transform: scale(1.2) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .fcc-games-toast { transition: opacity 0.2s ease; transform: translateX(0); }
  .fcc-games-toast__emoji { animation: none; }
}

@media (max-width: 640px) {
  .fcc-games-toast-host { right: 8px; left: 8px; }
  .fcc-games-toast { min-width: 0; max-width: none; }
  .fcc-games-invite-card { flex-direction: column; align-items: stretch; }
  .fcc-games-invite-card__actions { justify-content: stretch; }
  .fcc-games-invite-card__actions .fcc-games-btn { flex: 1; }
  .fcc-games-tournament__bracket { gap: 12px; padding: 12px; }
  .fcc-games-tournament__slot { width: 56px; }
  .fcc-games-tournament__slot--final { width: 72px; height: 40px; font-size: 18px; }
}

@media (prefers-color-scheme: dark) {
  .fcc-games-history-card { background: rgba(60,60,67,0.45); border-color: rgba(255,255,255,0.08); }
  .fcc-games-toast {
    background: linear-gradient(135deg, rgba(50,50,60,0.96), rgba(108,99,255,0.20));
    border-color: rgba(108,99,255,0.45);
  }
  .fcc-games-invite-card { background: linear-gradient(135deg, rgba(108,99,255,0.20), rgba(255,138,200,0.12)); }
}

/* ---------- Word Search Battle (scoped .fcc-games-ws) ---------- */
.fcc-games-ws .fcc-games-ws-board-wrap {
  margin-top: 8px;
}
.fcc-games-ws .fcc-games-ws-board {
  max-width: min(100%, 440px);
  margin: 0 auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.fcc-games-ws .fcc-games-ws-board.fcc-games-ws-board--selecting,
.fcc-games-ws .fcc-games-ws-board.is-ws-selecting {
  touch-action: none;
}
.fcc-games-ws .fcc-games-ws-board .fcc-games-ws-cell {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-size: clamp(11px, 2.8vw, 20px);
  border-radius: 10px;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}
.fcc-games-ws .fcc-games-ws-board .fcc-games-ws-cell.fcc-games-ws-cell--path {
  background: rgba(108, 99, 255, 0.32);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.42);
}
.fcc-games-ws .fcc-games-ws-board .fcc-games-ws-cell.fcc-games-ws-cell--found {
  background: rgba(74, 222, 128, 0.2);
}
.fcc-games-ws .fcc-games-ws-words {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
  padding: 0 4px;
  max-width: 100%;
}
.fcc-games-ws .fcc-games-ws-chip.fcc-games-ws-chip--found {
  opacity: 0.58;
}
.fcc-games-ws .fcc-games-ws-chip.fcc-games-ws-chip--hint:not(:disabled) {
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.38);
}
@media (min-width: 768px) {
  .fcc-games-ws .fcc-games-ws-board .fcc-games-ttt__cell {
    font-size: clamp(13px, 1.6vw, 19px);
  }
}
