/* Interactive Frontend Wordsearch Gameplay Styles */

.wordsearch-game-container {
    margin: 1.5rem auto;   
	margin-bottom: -.5rem;
}

/* Gameplay Interactive Arena Grid - Balanced Fluid Elastic Layout */
.wordsearch-grid-wrapper {
    background-color: rgba(255, 255, 255, 0.65);
    padding: .50rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
}

.wordsearch-play-grid {
    width: 100%;
    table-layout: fixed; /* Forces columns to distribute space perfectly evenly across rows */
    border-collapse: separate;
    border-spacing: 2px;
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.wordsearch-game-cell {
    font-weight: 800;
    text-align: center;
    vertical-align: middle;
    background-color: #ffffff;
    color: #000000;
    border: 2px solid #667686;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
    padding: 0;
    position: relative; /* Context anchor for layout scaling */
    transition: background-color 0.1s ease, transform 0.05s ease;
}

/* Aspect Ratio Lock Helper - Keeps cells perfectly square on all screen widths fluidly */
.wordsearch-game-cell::before {
    content: "";
    display: inline-block;
    vertical-align: middle;
    padding-top: 100%; /* Forces height to exactly mirror fluid width */
    pointer-events: none; /* Allows click/touch events to pass through directly to the data cell data attributes underneath */
}

/* Mouse Hover State (Only active when not currently dragging a selection) */
.wordsearch-play-grid:not(.grid-dragging) .wordsearch-game-cell:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: scale(1.04);
}

/* Current Selecting Trail Path State (Yellow) */
.wordsearch-game-cell.cell-selecting {
    background-color: #ffc107 !important;
    color: #000000 !important;
    border-color: #ffb300 !important;
}

/* Dynamic Alert Background Track Themes matching the Grid Highlights */

/* Unified Puzzle Solution Trace Highlights */
.tcc-track-0 { background-color: #d1ecf1 !important; color: #0c5460 !important; } /* Blue Tint */
.tcc-track-1 { background-color: #fff3cd !important; color: #856404 !important; } /* Yellow Tint */
.tcc-track-2 { background-color: #f8d7da !important; color: #721c24 !important; } /* Red Tint */
.tcc-track-3 { background-color: #d4edda !important; color: #155724 !important; } /* Green Tint */
.tcc-track-4 { background-color: #e2d9f3 !important; color: #383d41 !important; } /* Purple Tint */

/* Permanently Found Word States - Multi-Color Trace Paths */
/* Track 0: Soft Sky Blue Pastel */
.wordsearch-game-cell.cell-found.found-track-0 {
    background-color: #cff4fc !important;
    color: #055160 !important;
    border-color: #b6effb !important;
}

/* Track 1: Warm Amber Pastel */
.wordsearch-game-cell.cell-found.found-track-1 {
    background-color: #fff3cd !important;
    color: #856404 !important;
    border-color: #ffeeba !important;
}

/* Track 2: Soft Mint Green Pastel */
.wordsearch-game-cell.cell-found.found-track-2 {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
    border-color: #badbcc !important;
}

/* Track 3: Soft Rose Pink Pastel */
.wordsearch-game-cell.cell-found.found-track-3 {
    background-color: #f8d7da !important;
    color: #842029 !important;
    border-color: #f5c2c7 !important;
}

/* Track 4: Soft Lavender Purple Pastel */
.wordsearch-game-cell.cell-found.found-track-4 {
    background-color: #e8dbf2 !important;
    color: #563d7c !important;
    border-color: #dfc9f1 !important;
}


/* Track 0: Pastel Sky Blue Theme */
.game-action-container-box.alert-track-0 {
    background-color: #cff4fc !important;
    border-color: #b6effb !important;
}
.game-action-container-box.alert-track-0 h6 { color: #055160 !important; }


/* Track 1: Pastel Amber Theme */
.game-action-container-box.alert-track-1 {
    background-color: #fff3cd !important;
    border-color: #ffeeba !important;
}
.game-action-container-box.alert-track-1 h6 { color: #856404 !important; }

/* Track 2: Pastel Mint Green Theme */
.game-action-container-box.alert-track-2 {
    background-color: #d1e7dd !important;
    border-color: #badbcc !important;
}
.game-action-container-box.alert-track-2 h6 { color: #0f5132 !important; }


/* Track 3: Pastel Rose Pink Theme */
.game-action-container-box.alert-track-3 {
    background-color: #f8d7da !important;
    border-color: #f5c2c7 !important;
}
.game-action-container-box.alert-track-3 h6 { color: #842029 !important; }

/* Track 4: Pastel Lavender Purple Theme */
.game-action-container-box.alert-track-4 {
    background-color: #e8dbf2 !important;
    border-color: #dfc9f1 !important;
}
.game-action-container-box.alert-track-4 h6 { color: #563d7c !important; }

/* Word Checklist Container - Fluid Badge Wrap Layout */
.wordsearch-word-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;         /* Switched from grid to flex for natural inline wrapping */
    flex-wrap: wrap;       /* Allows badges to drop to the next line cleanly */
    gap: 8px;              /* Consistent spacing between horizontal and vertical items */
}

/* Individual Word Checklist Badges */
.wordsearch-list-item {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem; /* Tighter vertical padding with wider horizontal bounds */
    background-color: #f1f3f5;
    color: #000000;
    border: 1px solid #ced4da;
    border-radius: 20px;     /* Pill-style rounded edges matching your reference app */
    letter-spacing: 0.5px;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    user-select: none;
}

/* Found Word Cross-out & Fade States */
.wordsearch-list-item.word-found {
    text-decoration: line-through;
    color: #6c757d;
    background-color: #e2e6ea;
    border-color: #dae0e5;
    opacity: 0.6;
}

/* Game Win Splash Callout */
.wordsearch-win-banner {
    animation: bounceIn 0.6s ease-out forwards;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); opacity: 0.8; }
    70% { transform: scale(0.9); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

/* Ensure the Instruction/Explanation box has a stable height profile */
.game-action-container-box {
    height: 50%;
	min-height: 375px; /* Adjust slightly based on your layout spacing preferences */
    transition: background-color 0.4s ease, border-color 0.4s ease; /* Smooth pastel transitions */
}

/* Revealed Answers Fallback Styling State */
.wordsearch-game-cell.cell-revealed-fallback {
    background-color: #e9ecef !important;
    color: #495057 !important;
    border-color: #ced4da !important;
    font-style: italic;
}

/* Gameplay Grid Event Freeze State */
.wordsearch-play-grid.grid-locked .wordsearch-game-cell {
    cursor: not-allowed !important;
    pointer-events: none !important; /* Disables all selection/dragging clicks instantly */
}

/* Unsolved Checklist Word Preview Layout State */
.game-action-container-box.alert-track-hint {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
}
.game-action-container-box.alert-track-hint h6 { color: #495057 !important; }

/* Interactive Hover Feedback for Checklist Badges */
.wordsearch-list-item {
    cursor: pointer !important; /* Forces the hand icon on desktop */
}

.wordsearch-list-item:hover {
    background-color: #e9ecef !important; /* Slightly darker grey tint */
    border-color: #adb5bd !important;
    transform: translateY(-1px); /* Gentle upward lift */
    box-shadow: 0 2px 5px rgba(0,0,0,0.08); /* Soft shadow depth */
}

/* Custom Wordsearch Reveal Action Button Styling */
.btn-reveal-utility {
    background-color: #ffffff !important;
    color: #6c757d !important;
    border: 1px solid #ced4da !important;
    transition: all 0.2s ease-in-out;
}

/* Crisp, predictable hover state transition */
.btn-reveal-utility:hover {
    background-color: #f8f9fa !important; /* Soft gray background hint */
    color: #495057 !important;            /* Darker, high-contrast text */
    border-color: #adb5bd !important;      /* Defined border profile */
}

/* Ensure the text color stays dark if the tooltip gains focus */
.btn-reveal-utility:focus {
    background-color: #ffffff !important;
    color: #6c757d !important;
    box-shadow: 0 0 0 0.25rem rgba(108, 117, 125, 0.25);
}

/* ==========================================================================
   4. Control Deck & Tab Directories
   ========================================================================== */

.tcc-clues-card {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 20px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.target-game-tabs .nav-link {
    color: #495057;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6 !important;
    transition: all 0.15s ease-in-out;
}

.target-game-tabs .nav-link:hover {
    color: #0d6efd;
    background: #e9ecef;
}

.target-game-tabs .nav-link.active {
    color: #0d6efd !important;
    background: #ffffff !important;
    border-bottom: 2px solid #0d6efd !important;
}

.tcc-clues-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #212529;
    border-bottom: 2px solid #f1f3f5;
    padding-bottom: 4px;
}

.tcc-clue-item {
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
    padding-left: 6px;
    padding-right: 6px;
}

.tcc-clue-item:hover {
    background-color: #f1f3f5;
    color: #212529 !important;
}

.tcc-clue-item.tcc-clue-active {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
    font-weight: 700;
    border-radius: 0.25rem;
}

.border-bottom-dashed {
    border-bottom: 1px dashed #dee2e6;
}

