/* ======================================================
   ST AUGUSTINES SCOUTS - GAMES & RANDOMISER STYLES
   ====================================================== */

/* Hero Extra */
.games-hero {
    background: linear-gradient(135deg, #7413dc 0%, #4a0d8c 50%, #004851 100%);
    color: white;
    padding: 3.5rem 0 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.games-hero::before {
    content: "🎲 🏃 ⚽ 🎯 🧭 🎪";
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    font-size: 2.2rem;
    letter-spacing: 2rem;
    opacity: 0.12;
    pointer-events: none;
    user-select: none;
}

.games-hero h1 {
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.games-hero p {
    font-size: 1.15rem;
    max-width: 720px;
    margin: 0 auto 1.6rem;
    opacity: 0.95;
}

.games-hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-session-drawer {
    background: rgba(255, 255, 255, 0.18);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.65rem 1.4rem;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-session-drawer:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
    color: white;
}

.session-counter-badge {
    background: #ffc107;
    color: #212529;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 1rem;
}

/* Filter Controls Section */
.games-filter-container {
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 1.75rem;
    margin: -2rem auto 2.5rem;
    position: relative;
    z-index: 10;
    max-width: 1140px;
}

.search-box-wrap {
    position: relative;
    margin-bottom: 1.25rem;
}

.search-box-wrap input {
    width: 100%;
    padding: 0.9rem 1.2rem 0.9rem 2.8rem;
    font-size: 1.05rem;
    font-family: inherit;
    border: 2px solid #e2e8f0;
    border-radius: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fdfdfd;
}

.search-box-wrap input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(116, 19, 220, 0.15);
    background: #fff;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.15rem;
    pointer-events: none;
}

/* Category Pills */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.cat-pill {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.cat-pill:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.cat-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 3px 8px rgba(116, 19, 220, 0.25);
}

/* Secondary Filters Row */
.filter-dropdowns-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 180px;
}

.filter-group label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.filter-group select {
    padding: 0.6rem 0.9rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.6rem;
    font-family: inherit;
    font-size: 0.92rem;
    color: #1e293b;
    background: white;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-group select:focus {
    border-color: var(--primary-color);
}

.toggle-filter-chip {
    padding: 0.6rem 1rem;
    border-radius: 0.6rem;
    border: 1.5px solid #cbd5e1;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    transition: all 0.2s ease;
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 40px;
    user-select: none;
}

.toggle-filter-chip:hover {
    border-color: var(--secondary-color);
}

.toggle-filter-chip.active {
    background: #e6f7ef;
    border-color: var(--secondary-color);
    color: #007538;
}

.btn-clear-filters {
    padding: 0.6rem 1rem;
    border-radius: 0.6rem;
    border: 1px dashed #cbd5e1;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    align-self: flex-end;
    height: 40px;
    transition: all 0.2s ease;
}

.btn-clear-filters:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
}

/* Results Status Bar */
.results-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0 1.25rem;
    color: #64748b;
    font-size: 0.95rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.results-count {
    font-weight: 700;
    color: #1e293b;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

/* Game Card */
.game-card {
    background: white;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    padding: 1.4rem;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.game-card-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.8rem;
}

/* Badges & Tags */
.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.25rem 0.55rem;
    border-radius: 0.4rem;
    line-height: 1.2;
}

.badge-tag.section-beavers {
    background: #f3e8ff;
    color: #6b21a8;
}

.badge-tag.section-cubs {
    background: #e6f7ef;
    color: #007538;
}

.badge-tag.section-scouts {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-tag.section-all {
    background: #fef3c7;
    color: #92400e;
}

.badge-tag.energy-high {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-tag.energy-moderate {
    background: #ffedd5;
    color: #c2410c;
}

.badge-tag.energy-calm {
    background: #e0e7ff;
    color: #4338ca;
}

.badge-tag.tag-no-equip {
    background: #dcfce7;
    color: #15803d;
}

.badge-tag.tag-equip {
    background: #f1f5f9;
    color: #475569;
}

.badge-tag.tag-safety {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.game-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.game-aka {
    font-size: 0.82rem;
    color: #64748b;
    font-style: italic;
    margin-bottom: 0.75rem;
}

.game-category-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.game-summary {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.1rem;
    flex-grow: 1;
}

.game-equipment-note {
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 1.1rem;
    border-left: 3px solid #cbd5e1;
}

.game-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.btn-view-rules {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.55rem 1.1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    flex: 1;
    text-align: center;
}

.btn-view-rules:hover {
    background: #5d0eb3;
    transform: translateY(-1px);
}

.btn-bookmark-game {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: all 0.2s ease;
    color: #94a3b8;
}

.btn-bookmark-game:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #f59e0b;
}

.btn-bookmark-game.bookmarked {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #d97706;
}

/* Empty State */
.games-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.games-empty-state h3 {
    font-size: 1.4rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.games-empty-state p {
    color: #64748b;
    margin-bottom: 1.25rem;
}

/* Modal Popup */
.game-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.game-modal-overlay.open {
    display: flex;
}

.game-modal {
    background: white;
    border-radius: 1.25rem;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalAppear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.game-modal-header {
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.modal-header-text h2 {
    font-size: 1.6rem;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 0.2rem;
}

.modal-header-text .modal-aka {
    color: #64748b;
    font-size: 0.9rem;
    font-style: italic;
}

.btn-close-modal {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.btn-close-modal:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.game-modal-body {
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.modal-safety-banner {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 5px solid #ef4444;
    border-radius: 0.6rem;
    padding: 0.85rem 1.1rem;
    color: #991b1b;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.modal-safety-banner strong {
    color: #7f1d1d;
}

.modal-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 1.25rem 0 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-equipment-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    padding: 0.85rem 1.1rem;
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 1.2rem;
}

.modal-rules-list {
    padding-left: 1.4rem;
    color: #334155;
    font-size: 0.98rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.modal-rules-list li {
    margin-bottom: 0.5rem;
}

.modal-variations-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
    border-radius: 0.6rem;
    padding: 0.85rem 1.1rem;
    font-size: 0.9rem;
    color: #1e40af;
    margin-bottom: 1.2rem;
}

.modal-source-tag {
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: right;
    margin-top: 1rem;
    font-style: italic;
}

.game-modal-footer {
    padding: 1rem 1.75rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #fafafa;
}

/* Session Drawer / Slide-in Panel */
.session-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1500;
    display: none;
}

.session-drawer-overlay.open {
    display: block;
}

.session-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1510;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.session-drawer.open {
    right: 0;
}

.session-drawer-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.session-drawer-header h3 {
    font-size: 1.25rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.session-drawer-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.session-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    margin-bottom: 0.65rem;
    background: white;
}

.session-list-item:hover {
    border-color: #cbd5e1;
}

.session-item-info h4 {
    font-size: 0.95rem;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.session-item-info span {
    font-size: 0.78rem;
    color: #64748b;
}

.btn-remove-session {
    background: #f1f5f9;
    border: none;
    color: #ef4444;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-session:hover {
    background: #fee2e2;
}

.session-drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    gap: 0.75rem;
}

/* ======================================================
   RANDOMISER SPECIFIC STYLES
   ====================================================== */
.randomiser-control-panel {
    background: white;
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    max-width: 850px;
    margin: -2rem auto 2.5rem;
    position: relative;
    z-index: 10;
    text-align: center;
}

.randomiser-filters-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.btn-roll-dice {
    background: linear-gradient(135deg, #7413dc 0%, #00a650 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    border-radius: 3rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(116, 19, 220, 0.35);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-roll-dice:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 28px rgba(116, 19, 220, 0.45);
}

.btn-roll-dice:active {
    transform: translateY(1px) scale(0.98);
}

.btn-roll-dice.rolling i,
.btn-roll-dice.rolling .dice-icon {
    display: inline-block;
    animation: diceSpin 0.7s infinite linear;
}

@keyframes diceSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 3 Choices Grid */
.randomiser-choices-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

@media (max-width: 900px) {
    .randomiser-choices-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
}

.randomiser-choice-card {
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
    border: 2px solid transparent;
    padding: 1.75rem 1.4rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
    animation: choicePop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes choicePop {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.randomiser-choice-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

.choice-header-pill {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: white;
    padding: 0.3rem 1.1rem;
    border-radius: 2rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.randomiser-choice-card.selected-winner {
    border-color: #00a650;
    box-shadow: 0 0 0 4px rgba(0, 166, 80, 0.25), 0 16px 32px rgba(0, 166, 80, 0.15);
}

.randomiser-choice-card.selected-winner .choice-header-pill {
    background: #00a650;
}

.btn-reroll-single {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 0.45rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.btn-reroll-single:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-vote-choice {
    background: #e6f7ef;
    border: 1.5px solid #00a650;
    color: #007538;
    padding: 0.65rem 1.2rem;
    border-radius: 0.6rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
    margin-top: 0.75rem;
}

.btn-vote-choice:hover {
    background: #00a650;
    color: white;
}

/* Print Styles */
@media print {
    .navbar, footer, .games-hero, .games-filter-container, .btn-bookmark-game, .btn-view-rules, .btn-remove-session, .session-drawer-footer, .btn-session-drawer {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .session-drawer {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        box-shadow: none !important;
    }
}
