/* --- Animal Onet Connect Game Specific Styles --- */

.connect-game-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
}

/* Header Bar */
.cnt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-glass);
  flex-wrap: wrap;
  gap: 1rem;
}

.cnt-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cnt-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
}

.cnt-stats-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.6rem 1.25rem;
}

.cnt-stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.cnt-stat-val {
  font-family: 'Inter', monospace;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

/* Toast Banner */
.cnt-toast {
  background: rgba(118, 75, 162, 0.3);
  border: 1px solid rgba(118, 75, 162, 0.6);
  color: var(--text-accent);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  animation: fadeInExpand 0.25s ease-out;
}

.cnt-toast.hidden {
  display: none;
}

/* Board Wrapper with Outer Padding Space for SVG Lines */
.cnt-board-wrapper {
  position: relative;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem; /* Padding for outer border connecting paths */
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
}

/* SVG Overlay for Connecting Lines */
.cnt-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.cnt-path-line {
  fill: none;
  stroke: #ffd700;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px #00f2fe);
}

/* 6x8 Inner Grid Board */
.cnt-grid-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 0.4rem;
  width: 100%;
}

/* Tile Component */
.cnt-tile {
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  position: relative;
  z-index: 1;
}

.cnt-tile-icon {
  font-size: 1.8rem;
}

.cnt-tile:hover {
  transform: scale(1.06);
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--border-active);
}

.cnt-tile.is-selected {
  transform: scale(1.08);
  outline: 3px solid var(--accent-cyan);
  background: rgba(0, 242, 254, 0.25);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.6);
}

.cnt-tile.is-mismatched {
  animation: cardShake 0.3s ease-in-out;
  outline: 3px solid var(--error-color);
}

.cnt-tile.is-empty {
  visibility: hidden;
  pointer-events: none;
}

/* Shuffle animation */
.cnt-tile-shuffle {
  animation: shufflePulse 0.4s ease-out;
}

@keyframes shufflePulse {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Responsive Grid */
@media (max-width: 600px) {
  .cnt-board-wrapper {
    padding: 1rem;
  }

  .cnt-grid-board {
    gap: 0.25rem;
  }

  .cnt-tile-icon {
    font-size: 1.25rem;
  }
}
