﻿@keyframes flashGreen {
    0% {
        background-color: white;
        color: black;
    }

    50% {
        background-color: lawngreen;
        color: white;
    }

    100% {
        background-color: white;
        color: black;
    }
}

.winning-cell {
    animation: flashGreen 0.5s alternate infinite;
}

@keyframes flashRed {
    0% {
        background-color: white;
        color: black;
    }

    50% {
        background-color: red;
        color: white;
    }

    100% {
        background-color: white;
        color: black;
    }
}

.losing-cell {
    animation: flashRed 0.5s alternate infinite;
}

.game-grid {
	width: 100%;
	border-collapse: collapse;
}

	.game-grid td, .game-grid th {
		border: 1px solid black;
		width: 100px;
		height: 100px;
		text-align: center;
		vertical-align: middle;
	}

.club-crest-cell {
    border: 1px solid #000;
    background-color: #333333; /* Match the background color */
    position: relative;
    overflow: visible;
}

    .club-crest-cell.special {
        background-color: #808080; /* Gray color */
    }

.club-crest {
    max-height: 60px;
    height: auto;
    width: auto;
    position: relative;
}


/* ── your existing rules ── */
.tooltip {
    position: absolute;
    bottom: 100%; /* sit just above the cell */
    left: 50%; /* center horizontally */
    transform: translateX(-50%);
    background-color: black;
    color: white;
    padding: 5px;
    border-radius: 5px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    font-size: 0.75em;
    font-family: 'HemiHead', sans-serif;
    z-index: 1000;
}

.club-crest-cell:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* ── now “stack” each tooltip by bumping its bottom ↑ ── */
/* first real crest is the 2nd <th> in the top row (1st is blank corner) */
.game-grid tr:first-child th.club-crest-cell.special:nth-child(2) .tooltip {
    bottom: calc(100% + 0px);
}

.game-grid tr:first-child th.club-crest-cell.special:nth-child(3) .tooltip {
    bottom: calc(100% + 20px);
}

.game-grid tr:first-child th.club-crest-cell.special:nth-child(4) .tooltip {
    bottom: calc(100% + 0px);
}

.game-grid tr:first-child th.club-crest-cell.special:nth-child(5) .tooltip {
    bottom: calc(100% + 60px);
}

.game-grid tr:first-child th.club-crest-cell.special:nth-child(6) .tooltip {
    bottom: calc(100% + 80px);
}
/* add more rules if you have more than 6 columns */

.modal-content {
    background-color: #36454F; /* Charcoal color */
    color: white; /* Ensure text is visible on dark background */
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}


.disconnect-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #666; /* slightly darker grey */
    color: #fff;
    padding: 1em;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    z-index: 1001;
}

    .disconnect-popup button {
        margin-top: 0.5em;
        background: none;
        border: 1px solid #fff;
        color: #fff;
        padding: 0.25em 0.5em;
        border-radius: 4px;
        cursor: pointer;
    }

        .disconnect-popup button:hover {
            background: rgba(255,255,255,0.1);
        }
/* in your game_styles.css or base stylesheet */

/* put this in your sitewide stylesheet (or inline in <style> after you include game_styles.css) */

#game-demo {
    /* you already have these */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 350px; /* fixed height of your demo box */
    width: 80%;
    max-width: 600px;
}

    #game-demo .container {
        /* fill the demo box completely */
        box-sizing: border-box;
        width: 100%;
        height: 100%;
        padding: 1rem; /* optional breathing room so your grid doesn’t butt right against the green border */
        overflow: visible; /* if anything overflows, allow scroll */
        display: flex; /* now center the grid inside this container */
        align-items: center;
        justify-content: center;
    }

    #game-demo .game-grid-container {
        /* size your actual square grid to whatever fits */
        width: 100%;
        max-height: 100%;
        overflow: visible;
    }

    /* Force the table to split its available width evenly */
    #game-demo .game-grid {
        width: 100%; /* fill the demo box */
        table-layout: fixed; /* fixed layout: columns share width */
        border-collapse: collapse;
    }

        /* Make inputs respect their cell’s width */
        #game-demo .game-grid input[type="text"] {
            width: 100%;
            box-sizing: border-box; /* include padding & border when sizing */
        }

        #game-demo .game-grid th,
        #game-demo .game-grid td {
            width: 33.3333%;
            height: 33.3333%;
            padding: 0.5rem; /* tweak as you like */
            box-sizing: border-box;
        }
    /* inside the home‐page demo we don’t want the controls or feedback to show */
    #game-demo .controls,
    #game-demo #feedback-message {
        display: none;
    }


/* flash-green-once */
@keyframes flashGreenOnce {
    0% {
        background-color: transparent;
    }

    50% {
        background-color: lawngreen;
    }

    100% {
        background-color: transparent;
    }
}

.correct-cell {
    animation: flashGreenOnce 1s ease-in-out;
}

/* flash-red-once */
@keyframes flashRedOnce {
    0% {
        background-color: transparent;
    }

    50% {
        background-color: red;
    }

    100% {
        background-color: transparent;
    }
}

.incorrect-cell {
    animation: flashRedOnce 1s ease-in-out;
}


.highlight-crest {
    background-color: rgba(124, 252, 0, 0.2); /* subtle neon fill */
    box-shadow: inset 0 0 8px #7CFC00; /* inner neon glow */
    transition: background-color .2s, box-shadow .2s;
}