/* ============================================================
   VEXONA FAMILY GAME HUB — connect4.css
   ============================================================ */

:root {
  --font: 'Outfit', system-ui, sans-serif;
  --bg: #060c1a;
  --surface: rgba(255,255,255,0.045);
  --border: rgba(255,255,255,0.1);
  --text: #e8eef8;
  --muted: rgba(200,215,240,0.55);
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex: 1;
  width: 100%;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* --- Menu Screen --- */
.menu-container {
  text-align: center;
  background: var(--surface);
  padding: 60px 80px;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
}

.menu-logo {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.menu-chip {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: inset 0 4px 8px rgba(255,255,255,0.4), 0 8px 16px rgba(0,0,0,0.4);
}

.chip-red {
  background: radial-gradient(circle at 30% 30%, #ff4d4d, #cc0000);
  border: 4px solid #ff1a1a;
}

.chip-yellow {
  background: radial-gradient(circle at 30% 30%, #ffd060, #d49a00);
  border: 4px solid #ffcc00;
}

.game-title {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ff4d4d 0%, #ffd060 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-subtitle {
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: 40px;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn {
  padding: 16px 32px;
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.2s, filter 0.2s;
  font-family: inherit;
}

.btn:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.btn-red { background: linear-gradient(135deg, #ff4d4d, #cc0000); }
.btn-yellow { background: linear-gradient(135deg, #e6b800, #b38f00); color: #fff; }
.btn-blue { background: linear-gradient(135deg, #3b9eff, #005ce6); }
.btn-primary { background: linear-gradient(135deg, #3b9eff, #005ce6); }
.btn-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* --- Game Layout --- */
.game-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  max-width: 1400px;
  width: 100%;
  padding: 20px;
}

/* --- Player Panels --- */
.player-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  width: 180px;
  opacity: 0.5;
  transition: opacity 0.3s, transform 0.3s, box-shadow 0.3s;
}

.player-panel.active-turn {
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.player-panel-1.active-turn { box-shadow: 0 0 30px rgba(255, 77, 77, 0.3); border-color: rgba(255, 77, 77, 0.5); }
.player-panel-2.active-turn { box-shadow: 0 0 30px rgba(255, 208, 96, 0.3); border-color: rgba(255, 208, 96, 0.5); }

.player-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-bottom: 16px;
}

.player-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.turn-indicator {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.active-turn .turn-indicator {
  color: var(--text);
}

/* --- Board Area --- */
.board-container {
  position: relative;
  margin-top: 50px;
}

.connect4-board {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 20px;
  background: #0f204a; /* Dark background for empty holes */
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 4px 10px rgba(255,255,255,0.2);
  border: 4px solid #133a9e;
  border-top-color: #3b73ff;
  border-left-color: #3b73ff;
  z-index: 10;
}

/* The front mask with holes */
.board-front {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at center, transparent 49px, #1a4fd6 50px);
  background-size: 114px 114px; /* column width (100) + gap (14) */
  background-position: 13px 13px;
  border-radius: 12px;
  z-index: 5;
}

.column {
  width: 100px;
  height: 670px; /* 6 slots * 100px + 5 gaps * 14px = 600 + 70 = 670 */
  display: flex;
  flex-direction: column-reverse; /* Chips stack from bottom up */
  gap: 14px;
  position: relative;
  cursor: pointer;
  border-radius: 50px;
  transition: background 0.2s;
  z-index: 1; /* Behind the front mask */
}

.column:hover {
  background: rgba(255,255,255,0.1);
}

.slot {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  position: relative;
}

.chip {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  position: absolute;
  left: 0;
  z-index: 2; /* In front of column background, behind board front */
  animation: drop 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.chip.win-highlight {
  animation: pulse-glow 1.2s infinite alternate !important;
  box-shadow: 0 0 20px 10px rgba(255,255,255,0.6), inset 0 0 10px rgba(255,255,255,0.4) !important;
  z-index: 6; /* Bring winning chips above the mask */
  transform: scale(1.05);
}

@keyframes drop {
  0% { transform: translateY(-700px); }
  60% { transform: translateY(0); }
  75% { transform: translateY(-40px); }
  85% { transform: translateY(0); }
  92% { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}

@keyframes shake {
  0% { transform: translateY(0); }
  25% { transform: translateY(4px); }
  50% { transform: translateY(-2px); }
  75% { transform: translateY(1px); }
  100% { transform: translateY(0); }
}

.shake {
  animation: shake 0.2s ease-in-out;
}

.chip.dimmed {
  filter: brightness(0.3) grayscale(0.5);
  transition: filter 0.5s;
}

@keyframes pulse-glow {
  0% { filter: brightness(1) drop-shadow(0 0 5px #fff); transform: scale(1.05); }
  100% { filter: brightness(1.3) drop-shadow(0 0 20px #fff); transform: scale(1.08); }
}

/* Ghost chip for hover */
.ghost-chip {
  position: absolute;
  top: -114px;
  left: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}

.column:hover .ghost-chip.red { background: radial-gradient(circle at 30% 30%, #ff4d4d, #cc0000); border: 4px solid #ff1a1a; }
.column:hover .ghost-chip.yellow { background: radial-gradient(circle at 30% 30%, #ffd060, #d49a00); border: 4px solid #ffcc00; }

/* Hint Indicator */
.hint-arrow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; 
  height: 0; 
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-top: 40px solid rgba(59, 158, 255, 0.9);
  animation: bounce-arrow 1s infinite;
  pointer-events: none;
  z-index: 10;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

@keyframes bounce-arrow {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 15px); }
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(5px);
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  background: var(--surface);
  padding: 50px 80px;
  border-radius: 24px;
  border: 1px solid var(--border);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.overlay-content h2 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 30px;
}

.overlay-content .btn {
  margin: 0 10px;
}
