html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%; /* Ensure the body takes the full height of the viewport */
    display: flex; /* Enable flexbox for centering */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    background-color: #f9f9f9; /* Optional: Add a background color for the viewport */
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    /* padding-top: 1.1rem; */
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+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MuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Ordspin");
    }

code {
    color: #c02d76;
}

/* General Layout */
.game-container {
    width: 375px; /* Fixed width */
    height: 667px; /* Fixed height */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    font-family: Arial, sans-serif;
    background-color : white;
    margin: 5px;
}

.game-container:focus {
    outline: none; /* Removes the focus rectangle */
}
.header {
    display: flex;
    justify-content: center; /* Centers the title */
    align-items: center; /* Aligns the items vertically */
    position: relative;
    height: 30px; /* Height for the header */
    border-bottom: 1px solid grey; /* Thin grey line */
    padding: 0;
    width: 100%; /* Ensure it spans the full width */
    box-sizing: border-box;
    margin-bottom: 15px;
}

.title {
    flex-grow: 1;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase; /* Converts to all caps */
}

.help {
    position: absolute;
    right: 10px;
}

.help-link {
    text-decoration: none;
    color: black;
}

.help-circle {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1px solid grey;
    border-radius: 50%;
    text-align: center;
    line-height: 20px; /* Vertically centers the ? inside the circle */
    font-size: 16px;
    font-weight: bold;
}


.score {
    /* font-family: 'Press Start 2P', monospace;  Retro gaming font (use Google Fonts or local import) */
    font-size: 1.5em; /* Larger text for visibility */
    color: black; /* Bright green to mimic old digital screens */
    /* background-color: #000; /* Black background for contrast */
    /* border: 2px solid #00ff00; /* Green border for a digital display effect */
    padding: 5px 10px; /* Add some padding for a boxy look */
    border-radius: 8px; /* Slight rounding of corners */
    text-align: center; /* Center the text */
    width: fit-content; /* Shrink to fit the text */
    margin-top: 0px; /* Space above the score */
    margin-bottom: 5px; /* Space above the score */
    /* box-shadow: 0 0 10px #00ff00; /* Glow effect */
    letter-spacing: 2px; /* Space out the letters for a digital feel */
    /* text-shadow: 0 0 5px #00ff00; /* Extra glow for the text */
}

.queue-container {
    height: 55px;
    margin-bottom: 5px;
    text-align: center;
}

.queue-title {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.queue {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.queue-box {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: #ddd;
    border: 2px solid #bbb;
    border-radius: 4px;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

/* Timer Bar */
.timer {
    width: 100%;
    max-width: 500px;
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 20px;
}

.timer-bar {
    height: 100%;
    transition: width 0.05s linear;
}

/* Hover Letter */
.hover-container {
    position: relative;
    height: 50px; /* Space above grid for the hover letter */
    margin-bottom: 10px;
}

.hover-letter {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: #f9a825;
    border: 2px solid #f57f17;
    border-radius: 4px;
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    text-align: center;
    line-height: 40px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1); /* Normal size */
        opacity: 1; /* Full opacity */
    }

    50% {
        transform: scale(1.2); /* Slightly larger */
        opacity: 0.8; /* Slightly faded */
    }
}



/* Grid */
.grid {
    display: grid;
    grid-template-rows: repeat(6, 1fr); /* 5 rows + 1 hover row */
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    width: 100%; /* Ensure the grid takes full width */
    max-width: 300px; /* Constrain maximum grid size */
    margin: 0 auto;
}

.grid-cell {
    width: 100%;
    aspect-ratio: 1 / 1; /* Ensure square cells */
    border: 1px solid #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Prevent content overflow */
    font-size: 1em; /* Match font size with cell size */
}


@keyframes flash {
    0%, 100% {
        background-color: orange;
    }

    50% {
        background-color: lightgreen;
    }
}

.word-flash {
    animation: flash 0.5s linear 3; /* Flash 3 times */
}

.letter-cell, .dropping-letter, .dropped-letter, .flashing-letter  {
    background-color: lightgrey; /* Default light gray for landed letters */
    color: black; /* Default black text for landed letters */
    font-size: 1.5em; /* Match font size with dropping letter */
    font-weight: bold; /* Bold text */
    text-align: center;
    width: 100%; /* Full width of the cell */
    height: 100%; /* Full height of the cell */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px; /* Rounded edges */
}

/* Specific styling for the dropping letter */
.dropping-letter {
    background-color: #2196f3 !important;  /* Blue background for active dropping letter */
    color: white !important; /* White text */
    animation: pulse 1s infinite; /* Pulsing animation */
}

.dropped-letter {
    background-color: forestgreen; /* Blue background for active dropping letter */
    color: white; /* White text */
}

.flashing-letter {
    animation: flash 0.5s linear 3; /* Flash 3 times */
}


.grid-cell.hover-cell {
    background-color: transparent; /* Make the hover row distinct */
    border: none; /* Remove borders for hover row */
    font-weight: bold;
    color: #f57f17; /* Hover letter color */
}

/* Controls */
.controls {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    box-sizing : border-box;
    padding: 0 10px;
}
/* General button style */
.left-arrow, .right-arrow, .down-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px; /* Adjust for circle size */
    height: 60px; /* Matches width for perfect circle */
    font-size: 1.8em; /* Larger arrow size */
    font-weight: bold;
    color: black; /* Arrow color */
    background-color: transparent; /* Transparent background */
    border: 3px solid black; /* Thick black border */
    border-radius: 50%; /* Make the buttons circular */
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.2s;
    text-align: center; /* Ensure text is centered */
    line-height: 1; /* Prevent additional spacing for the arrow */
}

    /* Hover effect for buttons */
    .left-arrow:hover, .right-arrow:hover, .down-arrow:hover {
        background-color: #e0e0e0; /* Light gray on hover */
        box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3); /* Add a subtle shadow */
    }

    /* Use Unicode escape sequences for arrows */
    .left-arrow::before {
        content: "\25C0"; /* Unicode for  (black left-pointing triangle) */
    }

    .right-arrow::before {
        content: "\25B6"; /* Unicode for  (black right-pointing triangle) */
    }

    .down-arrow::before {
        content: "\25BC"; /* Unicode for  (black down-pointing triangle) */
    }
 

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 375px;
    text-align: center;
}

.mode-button {
    display: block;
    width: 80%;
    margin: 10px auto;
    padding: 10px;
    font-size: 1.2em;
    background-color: #0071c1;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .mode-button:hover {
        background-color: #005a9e;
    }

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #333;
}

* Pause button container */
.pause-container {
    position: absolute;
    top: 0;
    right: 10px;
    height: 100%; /* Aligns with the height of the header */
    display: flex;
    align-items: center; /* Centers the pause button vertically within the header */
}

/* Pause circle */
.pause-circle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; /* Smaller diameter */
    height: 20px; /* Matches the title size */
    border: 1px solid grey;
    border-radius: 50%;
    background-color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .pause-circle:hover {
        background-color: lightgrey;
    }

/* Pause bars */
.pause-bar {
    position: absolute;
    width: 2px; /* Narrower bar width */
    height: 8px; /* Matches the smaller circle size */
    background-color: black;
}

    .pause-bar.left {
        left: 6px; /* Position for the left bar */
    }

    .pause-bar.right {
        right: 6px; /* Position for the right bar */
    }
/* Pause Overlay */
.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.pause-content {
    text-align: center;
    color: white;
}

    .pause-content h2 {
        font-size: 2em;
        margin-bottom: 20px;
    }

.continue-button {
    padding: 10px 20px;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    background-color: #2196f3;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .continue-button:hover {
        background-color: #1976d2;
    }

.language-switcher {
    display: flex;
    gap: 10px;
    justify-content: center; /* Center the buttons horizontally */
    margin-bottom: 15px; /* Add some spacing between the buttons and other content */
}

    .language-switcher button {
        border: 1px solid gray;
        background-color: white;
        color: black;
        padding: 5px 10px;
        cursor: pointer;
        border-radius: 5px;
        font-weight: bold;
    }

        .language-switcher button:hover {
            background-color: lightgray;
        }

        .language-switcher button.selected {
            background-color: blue;
            color: white;
        }