/* First-Party Games Shared Styling - CrazyGames Best */

:root {
  --fp-bg: #0c0f17;
  --fp-card: #141926;
  --fp-card-hover: #1b2234;
  --fp-border: rgba(255, 255, 255, 0.12);
  --fp-border-focus: rgba(242, 100, 30, 0.6);
  --fp-text: #f0f4fc;
  --fp-text-muted: #8b9bb4;
  --fp-orange: #f2641e;
  --fp-orange-glow: rgba(242, 100, 30, 0.25);
  --fp-gold: #f59e0b;
  --fp-blue: #2563eb;
  --fp-green: #10b981;
  --fp-red: #ef4444;
  
  /* Wordle colors */
  --wd-correct: #538d4e;
  --wd-present: #b59f3b;
  --wd-absent: #3a3a3c;
  --wd-tile-border: #3a3a3c;
  --wd-tile-text: #ffffff;
  --wd-key-bg: #818384;

  /* Connections colors */
  --cn-yellow: #f9df6d;
  --cn-green: #a0c35a;
  --cn-blue: #b0c4ef;
  --cn-purple: #ba81c5;
}

.fp-game-shell {
  max-width: 860px;
  margin: 0 auto 3rem;
  padding: 1rem;
}

.fp-board-card {
  background: var(--fp-card);
  border: 1px solid var(--fp-border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.fp-game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--fp-border);
}

.fp-title-group h2 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--fp-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fp-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(242, 100, 30, 0.15);
  color: var(--fp-orange);
  border: 1px solid rgba(242, 100, 30, 0.3);
}

.fp-actions-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.fp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
  text-decoration: none;
}

.fp-btn-primary {
  background: linear-gradient(135deg, var(--fp-orange), #d94b08);
  color: #fff;
  box-shadow: 0 4px 14px var(--fp-orange-glow);
}
.fp-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(242, 100, 30, 0.4);
}
.fp-btn-primary:active {
  transform: translateY(0);
}

.fp-btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--fp-text);
  border: 1px solid var(--fp-border);
}
.fp-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.fp-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   1. 82-0 & 32-0 Basketball Specifics
   ========================================================================== */

.court-preview {
  position: relative;
  background: linear-gradient(180deg, #101626, #090c14);
  border: 1px solid rgba(242, 100, 30, 0.3);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  margin-bottom: 1.5rem;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.court-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  z-index: 2;
}

.court-slot {
  background: rgba(20, 25, 38, 0.85);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  transition: all 0.2s ease;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.court-slot.is-filled {
  border-style: solid;
  border-color: var(--fp-orange);
  background: rgba(242, 100, 30, 0.08);
}

.slot-pos-tag {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--fp-orange);
  margin-bottom: 0.35rem;
}

.slot-player-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fp-text);
  line-height: 1.2;
}

.slot-player-meta {
  font-size: 0.75rem;
  color: var(--fp-text-muted);
  margin-top: 0.2rem;
}

.slot-empty-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
}

/* Slot Machine / Spinner Banner */
.spinner-banner {
  background: linear-gradient(135deg, rgba(242, 100, 30, 0.15), rgba(30, 41, 59, 0.8));
  border: 1px solid rgba(242, 100, 30, 0.4);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.spin-result-display {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.spin-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.spin-label {
  font-size: 0.8rem;
  color: var(--fp-orange);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.spin-target-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--fp-text);
  margin-top: 0.2rem;
}

.skips-remaining {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--fp-text-muted);
}

/* Draft Candidate Cards */
.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.candidate-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--fp-border);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.candidate-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--fp-orange);
  transform: translateY(-2px);
}

.candidate-card.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.cand-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.cand-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--fp-text);
  margin: 0;
}

.cand-ovr {
  font-size: 1rem;
  font-weight: 900;
  color: var(--fp-gold);
  background: rgba(245, 158, 11, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.cand-pos-list {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.cand-pos-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--fp-text-muted);
}

.cand-stats-table {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.3rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.5rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.cand-stat-item dt {
  font-size: 0.65rem;
  color: var(--fp-text-muted);
  text-transform: uppercase;
}
.cand-stat-item dd {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fp-text);
  margin: 0;
}

/* Simulation Result Screen */
.sim-result-box {
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(180deg, rgba(20, 25, 38, 0.95), rgba(12, 15, 23, 0.95));
  border-radius: 16px;
  border: 1px solid var(--fp-border);
}

.sim-record-banner {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0.5rem 0 1rem;
}

.sim-record-banner.is-perfect {
  color: var(--fp-gold);
  text-shadow: 0 0 25px rgba(245, 158, 11, 0.5);
}

.sim-record-banner.is-great {
  color: var(--fp-orange);
}

.sim-record-banner.is-good {
  color: var(--fp-blue);
}

.sim-grade-badge {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 900;
  padding: 0.3rem 1.2rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}

.sim-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  text-align: left;
  margin: 1.5rem 0;
}

.sim-detail-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--fp-border);
  border-radius: 12px;
  padding: 1rem;
}

.sim-detail-card h4 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fp-text-muted);
}

/* ==========================================================================
   2. Wordle Unlimited Specifics
   ========================================================================== */

.wd-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.wd-length-toggle {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.3rem;
  border-radius: 12px;
}

.wd-length-btn {
  padding: 0.4rem 1rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--fp-text-muted);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.wd-length-btn.is-active {
  background: var(--fp-orange);
  color: #fff;
}

.wd-board {
  display: grid;
  gap: 5px;
  padding: 4px;
}

.wd-row {
  display: grid;
  gap: 5px;
}

.wd-tile {
  width: 44px;
  height: 44px;
  border: 2px solid var(--wd-tile-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--wd-tile-text);
  text-transform: uppercase;
  border-radius: 6px;
  user-select: none;
  transition: transform 0.1s ease;
}

.wd-tile.is-active {
  border-color: #818384;
  animation: wdPop 0.1s ease-in-out;
}

.wd-tile.is-correct {
  background: var(--wd-correct);
  border-color: var(--wd-correct);
}
.wd-tile.is-present {
  background: var(--wd-present);
  border-color: var(--wd-present);
}
.wd-tile.is-absent {
  background: var(--wd-absent);
  border-color: var(--wd-absent);
}

@keyframes wdPop {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Keyboard */
.wd-keyboard {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  max-width: 480px;
}

.wd-key-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.wd-key {
  height: 40px;
  min-width: 30px;
  padding: 0 0.4rem;
  background: var(--wd-key-bg);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: all 0.1s ease;
}

.wd-key.key-wide {
  min-width: 60px;
  font-size: 0.8rem;
}

.wd-key.is-correct { background: var(--wd-correct); }
.wd-key.is-present { background: var(--wd-present); }
.wd-key.is-absent { background: var(--wd-absent); opacity: 0.55; }

/* ==========================================================================
   3. Connections Unlimited Specifics
   ========================================================================== */

.cn-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 620px;
  margin: 0 auto;
}

.cn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cn-tile {
  background: #252e42;
  border: 1px solid var(--fp-border);
  border-radius: 10px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--fp-text);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  word-break: break-word;
}

.cn-tile:hover {
  background: #313c54;
}

.cn-tile.is-selected {
  background: #5b6782;
  color: #fff;
  border-color: #fff;
  transform: translateY(-2px);
}

.cn-group-solved {
  grid-column: span 4;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  animation: cnFadeIn 0.3s ease-out;
}

.cn-group-solved.group-yellow { background: var(--cn-yellow); color: #000; }
.cn-group-solved.group-green { background: var(--cn-green); color: #000; }
.cn-group-solved.group-blue { background: var(--cn-blue); color: #000; }
.cn-group-solved.group-purple { background: var(--cn-purple); color: #000; }

.cn-group-solved h4 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cn-group-solved p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.cn-mistakes-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--fp-text-muted);
  font-size: 0.9rem;
}

.cn-bubble {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--fp-text-muted);
  display: inline-block;
}

.cn-bubble.is-lost {
  opacity: 0.2;
}

@keyframes cnFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .fp-board-card {
    padding: 0.75rem 0.5rem;
    border-radius: 14px;
  }
  .fp-game-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    gap: 0.5rem;
  }
  .fp-title-group h2 {
    font-size: 1.1rem;
  }
  .court-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
  }
  .court-slot {
    min-height: 85px;
    padding: 0.4rem 0.2rem;
  }
  .slot-player-name {
    font-size: 0.75rem;
  }
  .slot-pos-tag {
    font-size: 0.7rem;
  }
  .wd-board {
    gap: 3px;
    margin-bottom: 0.4rem;
  }
  .wd-tile {
    width: clamp(34px, 11vw, 40px);
    height: clamp(34px, 11vw, 40px);
    font-size: 1.15rem;
  }
  .wd-keyboard {
    gap: 3px;
  }
  .wd-key {
    height: 40px;
    min-width: 24px;
    font-size: 0.78rem;
    padding: 0 0.15rem;
  }
  .wd-key.key-wide {
    min-width: 38px;
    font-size: 0.72rem;
  }
  .cn-tile {
    min-height: 52px;
    font-size: 0.75rem;
    padding: 0.25rem;
  }
}
