/* ═══ Famovo Connections ═════════════════════════════════════════════════ */
.conn-page {
  max-width: 540px; margin: 0 auto;
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 14px;
}
.conn-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.conn-title { text-align: center; display: flex; flex-direction: column; }
.conn-kicker { font-size: 18px; font-weight: 700; color: var(--ink); }
.conn-date { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.conn-instructions { text-align: center; font-size: 14px; }

.conn-solved-stack {
  display: flex; flex-direction: column; gap: 6px;
}
.conn-solved-row {
  border-radius: 8px; padding: 10px 12px;
  text-align: center;
  display: flex; flex-direction: column; gap: 4px;
  color: #111827;
  font-weight: 600;
}
.conn-diff-0 { background: #fef08a; }   /* yellow */
.conn-diff-1 { background: #bef264; }   /* green  */
.conn-diff-2 { background: #93c5fd; }   /* blue   */
.conn-diff-3 { background: #d8b4fe; }   /* purple */
.conn-solved-label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.conn-solved-words { font-size: 12px; opacity: 0.85; }
.conn-solved-revealed { opacity: 0.7; }

.conn-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.conn-tile {
  aspect-ratio: 1 / 1;
  min-height: 68px;
  background: #f3f4f6;
  border: 0; border-radius: 8px;
  color: var(--ink);
  font-size: clamp(11px, 3vw, 15px); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.02em;
  text-align: center; padding: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1.1;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  font-family: inherit;
  touch-action: manipulation;
  word-break: break-word;
}
.conn-tile:hover { background: #e5e7eb; }
.conn-tile.selected {
  background: #374151; color: #fff;
  transform: scale(0.96);
}
.conn-tile.shake { animation: conn-shake 0.4s; }
@keyframes conn-shake {
  0%,100% { transform: translateX(0) scale(0.96); }
  25% { transform: translateX(-5px) scale(0.96); }
  75% { transform: translateX(5px) scale(0.96); }
}

.conn-mistakes {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px;
}
.conn-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #374151;
  transition: background 0.3s;
}
.conn-dot-spent { background: #e5e7eb; }

.conn-actions {
  display: flex; gap: 10px; justify-content: center;
}
.conn-actions button { flex: 0 1 120px; }
.conn-actions .btn-primary:disabled {
  opacity: 0.35; cursor: default;
}

.conn-error {
  text-align: center;
  background: #fef3c7; border: 1px solid #fcd34d; color: #713f12;
  padding: 8px 12px; border-radius: 8px; font-size: 13px;
}
.conn-result {
  text-align: center; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px;
}
.conn-family { margin-top: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }


/* Difficulty hub — three picker cards mirroring the trivia hub. */
.conn-hub-page { max-width: 720px; margin: 0 auto; padding: 16px; }
.conn-hub-intro { margin: 16px 0 20px; }
.conn-hub-h1 { font-size: 24px; margin: 0 0 6px; font-weight: 700; }
.conn-hub-grid { display: grid; gap: 12px; }
.conn-tier-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 18px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface);
  text-decoration: none; color: var(--ink);
  transition: transform 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
}
.conn-tier-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.05); }
.conn-tier-easy   { border-color: #fbbf24; background: linear-gradient(135deg, #fffbe6, var(--surface)); }
.conn-tier-medium { border-color: #34d399; background: linear-gradient(135deg, #ecfdf5, var(--surface)); }
.conn-tier-hard   { border-color: #a78bfa; background: linear-gradient(135deg, #f5f3ff, var(--surface)); }
.conn-tier-won  { border-color: var(--accent); }
.conn-tier-active { border-color: var(--accent); }
.conn-tier-lost { opacity: 0.7; }
.conn-tier-head { display: flex; align-items: baseline; justify-content: space-between; }
.conn-tier-label { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.conn-tier-mistakes { font-size: 12px; }
.conn-tier-status { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.conn-tier-status strong { font-weight: 600; }
.conn-tier-progress { display: flex; gap: 6px; margin-top: 2px; }
.conn-tier-pip { width: 16px; height: 6px; border-radius: 3px; background: rgba(0,0,0,0.08); }
.conn-tier-pip.solved { background: var(--accent); }

/* ═══ Connections inside the games-shell (max-board) layout ═══════════════ */
.game-page-layout.max-board .conn-game {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: center;
  overflow-y: auto;
  max-height: 100%;
  padding: 8px 4px;
}
.game-page-layout.max-board .conn-grid {
  width: 100%;
}
