:root {
    --accent-color: #ff5722;
    /* Default accent color */
}

*, *::before, *::after {
    box-sizing: border-box;
}

.accent {
      color: var(--accent-color);
    }

.no-style-link {
    text-decoration: none;
    /* Removes the underline */
    color: inherit;
    /* Inherits the color from the parent element */
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #ffffff;
    overscroll-behavior: none;
}

/* New container to enforce portrait dimensions */
.portrait-container {
    max-width: 400px;
    /* Adjust to the desired portrait width */
    margin: 0 auto;
    /* Center the container horizontally */
    position: relative;
}

.response-container {
    display: flex;
    justify-content: center;
    /* align-items: center; */
    height: 40px;
    /* Set a fixed height for consistent spacing */
    margin-bottom: 10px;
    /* Space below the response area */
    margin-top: 2px;
    /* Ensure the response area and animations are visible below the menu */
    color: #fff;
    /* Default text color */
    font-size: 80px;
    /* Adjust size as needed */
    font-weight: bold;
    /* Bold text for visibility */
    text-align: center;
    z-index: 1;
    /* Ensure it’s below the overlay */
}

.response-container #response-message {
    pointer-events: none;
    /* Allows clicks to pass through */
    color: var(--accent-color);
    /* Default response color, e.g., orange */
    animation: fadeOut 2s forwards;
    /* Add fade-out effect */
    font-size: 40px;
    /* Default smaller size for info/error */
    z-index: 500;
}

/* Large font size for score responses */
#response-message.score-response {
    pointer-events: none;
    /* Allows clicks to pass through */
    font-size: 80px;
    font-weight: bold;
    z-index: 1500;
}

#response-message.info-response {
    pointer-events: none;
    /* Allows clicks to pass through */
    font-size: 40px;
    /* Already the default, but explicit is fine */
    font-weight: normal;
    z-index: 500;
}

/* If you want distinct styling for errors vs info */
#response-message.error-response {
    pointer-events: none;
    /* Allows clicks to pass through */
    font-size: 40px;
    font-weight: normal;
    /* Could add other styling if desired */
    z-index: 500;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.pangram {
    font-weight: bold;
    color: var(--accent-color);
}

.word-column a {
    text-decoration: none;
    color: inherit;
}

#restart-confirmation-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#restart-confirmation-overlay .confirmation-content {
    background: #000;
    color: #fff;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
}

#overlay-content {
    font-size: 24px;
    background-color: rgba(0, 0, 0, 0.9);
    scrollbar-width: thin; /* Makes the scrollbar thinner */
    scrollbar-color: var(--accent-color) rgba(0, 0, 0, 0.3); /* Thumb and track colors */
    padding: 20px;
    border-radius: 10px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    z-index: 1001;
}

/* General settings styling */
#settings-overlay h3 {
    margin-bottom: 10px;
}

#settings-overlay hr {
    border: none;
    height: 1px;
    background-color: #ccc;
    margin: 20px 0;
}

.direction-button,
.speed-button {
    background: none;
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    color: var(--accent-color);
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    margin: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.direction-button.active,
.speed-button.active {
    background-color: var(--accent-color);
    color: #000;
}

.direction-button:hover,
.speed-button:hover {
    background-color: var(--accent-color);
    color: #000;
}

/* Smaller buttons */
.small-button {
    padding: 5px 10px;
    font-size: 14px;
    border: 1px solid var(--accent-color);
    background-color: var(--accent-color);
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

.small-button:hover {
    opacity: 0.9;
}

/* Slider styling */
#autoshuffle-interval-slider {
    width: 100%;
    margin: 10px 0;
}

@keyframes explodeOrbit {
    0% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.5) rotate(180deg);
        /* Letters grow larger and rotate halfway */
    }

    100% {
        transform: scale(1) rotate(360deg);
        /* Return to original size and full rotation */
    }
}

.outer-letter.explode,
.center-letter.explode {
    animation: explodeOrbit 3s ease-in-out forwards;
    transform: none;
    /* Reset transform after animation */
}


#settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-overlay-content {
    position: relative;
    background: #333;
    scrollbar-width: thin; /* Makes the scrollbar thinner */
    scrollbar-color: var(--accent-color) rgba(0, 0, 0, 0.3); /* Thumb and track colors */
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 300px;
}

.rolling-number-fields {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.rolling-number-fields input {
    width: 40px;
    height: 60px;
    font-size: 24px;
    text-align: center;
    border: none;
    border-radius: 5px;
    background: #444;
    color: white;
    appearance: none;
    -webkit-appearance: none;
}


/* Style the input itself */
#word-input {
    background: #000;
    /* Match container background */
    border: 2px solid #fff;
    /* Remove border */
    color: #fff;
    /* White text */
    font-weight: bold;
    /* Bold text */
    font-size: 28px;
    /* Larger font size, adjust as desired */
    font-family: Arial, sans-serif;
    /* Same font family as the header, or set to what the header uses */
    text-align: center;
    /* Center text */
    width: 100%;
    /* Take up full width of the container */
    max-width: 250px;
    /* Optional: Limit width */
    outline: none;
    /* Remove focus outline */
    box-sizing: border-box;
    /* Ensure padding doesn't affect width */
    z-index: 600;
}

/* Change the placeholder color to a subtle gray */
#word-input::placeholder {
    color: #888;
    font-weight: normal;
    /* Placeholder not bold, so guess text stands out more */
}

#word-list-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 95vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1005;
}

#close-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: #000;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    line-height: 40px;
    cursor: pointer;
    z-index: 1002;
    box-shadow: 0 0 10px var(--accent-color);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#close-overlay:hover {
    background-color: var(--accent-color);
    opacity: 0.9;
    transform: scale(1.1);
}

.close-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: #000;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    line-height: 40px;
    cursor: pointer;
    z-index: 1002;
    box-shadow: 0 0 10px var(--accent-color);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.close-overlay:hover {
    background-color: var(--accent-color);
    opacity: 0.9;
    transform: scale(1.1);
}

.close-settings {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: #000;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    line-height: 40px;
    cursor: pointer;
    z-index: 1002;
    box-shadow: 0 0 10px var(--accent-color);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.close-settings:hover {
    background-color: var(--accent-color);
    opacity: 0.9;
    transform: scale(1.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    color: #ffffff;
}

th,
td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ffffff;
}

th {
    cursor: pointer;
    background-color: #333333;
    color: #ffffff;
    user-select: none;
}

th:hover {
    background-color: #555555;
}

td.word-column {
    font-family: "Courier New", monospace;
    text-align: right;
}

.header-bar {
    position: sticky;
    /* Ensure it stays at the top */
    top: 0;
    width: 100%;
    max-width: 400px;
    /* match this to your dialog input's max-width */
    height: 60px;
    /*example*/
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: #fff;
    white-space: nowrap;
    /* padding: 0 10px; */
}

/* No large fixed margins; let the grid and flex handle spacing */
.header-left,
.header-center,
.header-right-container {
    flex: 1;
    margin: 0 10px;
    overflow: hidden;
    /* If text is too long, it won't cause wrapping */
    text-overflow: ellipsis;
    font-size: 20px;
}

/* Position the hamburger menu */
.header-hamburger {
    justify-self: end;
    position: absolute;
    top: 100%;
    /* Just below the header bar */
    right: 10px;
    /* Align it near the right side */
    font-size: 24px;
    cursor: pointer;
    color: #fff;
    z-index: 1500;
}

.header-left {
    text-align: left;
}

/* Adjust colors or weights individually if you want contrast */
.header-center {
    font-size: 18px;
    text-align: center;
    color: var(--accent-color);
}

.header-right-container {
    text-align: right;
    justify-content: flex-end;
    padding-right: 10px;
}

.header-right {
    text-align: right;
}

@keyframes explodeOrbit {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(20px, 20px) rotate(180deg);
        /* Spin halfway */
    }

    100% {
        transform: translate(0, 0) rotate(360deg);
        /* Complete spin */
    }
}

.outer-letter.explode {
    animation: explodeOrbit 3s ease-in-out;
}

@keyframes grow-shrink {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(2);
    }

    100% {
        transform: scale(1);
    }
}
@media only screen and (min-width: 1701px) {
    .portrait-container {
        transform: scale(1.5);
        /* Increase the size */
        transform-origin: top center;
        /* Make sure it scales from the top center */
    }
}

@media only screen and (max-width: 1700px) {
    .portrait-container {
        transform: scale(1.2);
        /* Increase the size */
        transform-origin: top center;
        /* Make sure it scales from the top center */
    }
}

/* Adjust font sizes on small screens so everything fits on one line */
@media (max-width: 700px) {
    .portrait-container {
        transform: scale(1.0);
        /* Increase the size */
        transform-origin: top center;
        /* Make sure it scales from the top center */
    }
    .header-bar {
        font-size: 12px;
    }

    .header-hamburger {
        font-size: 20px;
    }
}

.hamburger-menu {
    display: inline-block;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
    background: none;
    border: none;
    padding: 0;
    z-index: 1000;
}

.hamburger-menu span {
    display: block;
    height: 4px;
    background-color: #fff;
    border-radius: 2px;
    margin-bottom: 4px;
    transition: all 0.3s ease-in-out;
}

#hamburger-button {
    background: none;
    border: none;
    padding: 0;
    align-items: center;
}

.menu-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #000;
    border: 1px solid var(--accent-color);
    padding: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    flex-direction: column;
    z-index: 9999;
}

.menu-links.show {
    display: block;
}

/* Style menu items */
.menu-links a {
    color: var(--accent-color);
    /* Match your theme highlight color */
    text-decoration: none;
    padding: 8px 12px;
    display: block;
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.2s ease;
}

.menu-links a:hover {
    background-color: #333;
    /* Slight highlight on hover */
    color: #fff;
}

.main-container {
    width: 100%;
    flex: 1;
    /* allow it to grow */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background-color: #121212;
}


.game-container {
    position: relative;
    align-items: center;
    /* text-align: center; */
    margin-top: 20px;
    /* Increased from 40px to 70px for more space */
    max-width: 400px;
    /* Constrain width */
    margin-left: auto;
    /* Center horizontally */
    margin-right: auto;
    /* Center horizontally */
}

.game-title {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    white-space: nowrap;
    margin-bottom: 10px;
}

.header-stats-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    /* Reduce gap so there's room for both texts on smaller screens */
    max-width: 100%;
    white-space: nowrap;
    box-sizing: border-box;
    /* Prevent wrapping of text */
}

/* FINAL SCORE FONT SIZE */
#final-score-table {
    font-size: 24px;
    /* Adjust the overall font size for the table */
    font-family: Arial, sans-serif;
    /* Example font family */
}


.header-stats .word-list h2,
.header-stats .scoreboard h2 {
    margin: 0;
    font-size: 24px;
    /* Reduce font size so both fit horizontally */
    font-weight: normal;
    color: var(--accent-color);
    white-space: nowrap;
}

.menu-container {
    position: absolute;
    top: 10px;
    right: 5px;
}


#score-animation,
#incorrect-animation {
    position: fixed;
    top: 150px;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    text-align: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease;
    white-space: nowrap;
    /* Prevents wrapping onto multiple lines */
}

/* The default font size/color will be set via JavaScript now,
   or if you want a default style, pick something neutral here */
#score-animation {
    color: green;
}

#incorrect-animation {
    color: red;
    font-size: 75px;
    /* This can remain fixed */
    z-index: 1;
}

/* Ensure letters-container is relative so absolute elements inside can be positioned correctly */
.letters-container {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto 20px;
    background-color: #121212;
}

.letter,
.center-letter {
    background-color: rgba(0, 255, 0, 0.3);
    z-index: 10;
    pointer-events: auto;
}

.letter {
    position: absolute;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: bold;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background-color: #333333;
    color: #ffffff;
    cursor: pointer;
}

.outer-letter {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #333333;
    color: #ffffff;
    font-size: 30px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    cursor: pointer;
}

.center-letter {
    background-color: var(--accent-color);
    color: #000000;
    font-size: 30px;
    font-weight: bold;
    width: 75px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    z-index: 100;
}

/* Position letters around a circle */
.letter[data-position="1"] {
    top: 50%;
    left: 50%;
    transform: rotate(0deg) translate(100px) rotate(-0deg);
}

.letter[data-position="2"] {
    top: 50%;
    left: 50%;
    transform: rotate(60deg) translate(100px) rotate(-60deg);
}

.letter[data-position="3"] {
    top: 50%;
    left: 50%;
    transform: rotate(120deg) translate(100px) rotate(-120deg);
}

.letter[data-position="4"] {
    top: 50%;
    left: 50%;
    transform: rotate(180deg) translate(100px) rotate(-180deg);
}

.letter[data-position="5"] {
    top: 50%;
    left: 50%;
    transform: rotate(240deg) translate(100px) rotate(-240deg);
}

.letter[data-position="6"] {
    top: 50%;
    left: 50%;
    transform: rotate(300deg) translate(100px) rotate(-300deg);
}

.input-container {
    display: flex;
    justify-content: center;
    text-align: center;
    /* align-items: center; */
    background: #000;
    /* Match the input background */
    padding: 10px;
    /* Ensure some space around the input */
    margin-bottom: 20px;
    /* Space below the container */
    cursor: text;
    /* Indicate that clicking will focus the input box */
    z-index: 200;
    /* Ensure it’s below the overlay */
}


input[type="text"] {
    width: 250px;
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    text-align: center;
}

.button-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    margin-top: 40px
}

button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: var(--accent-color);
    color: #000;
    transition: background-color 0.3s;
}

button:hover {
    background-color: var(--accent-color);
    opacity: 0.9;
}

#autoshuffle-container {
    margin: 10px;
}

#autoshuffle-settings {
    margin-top: 5px;
}

.toggle-button {
    padding: 5px 15px;
    font-size: 16px;
    background-color: #444;
    color: white;
    border: 2px solid var(--accent-color);
    /* Accent color */
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.toggle-button.on {
    background-color: var(--accent-color);
    color: #fff;
}

.toggle-button.off {
    background-color: #444;
    color: #fff;
}

.toggle-button:hover {
    opacity: 0.8;
}


.word-list,
.scoreboard {
    margin: 10px 0;
}

.overlay {
    display: none;
    /* Start hidden */
    position: fixed;
    /* Overlay on top of everything */
    top: 0;
    left: 0;
    width: 100vw;
    height: 95vh;
    background: rgba(0, 0, 0, 0.8);
    /* Dimmed background */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* Set a base z-index for all overlays */
}

.overlay .confirmation-content {
    background: #000;
    color: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 1001;
    /* Ensure it's on top of the dimmed background */
}

.hidden {
    display: none !important;
    /* Force hiding to prevent click interference */
}

.overlay-content {
    background: #000;
    color: #fff;
    scrollbar-width: thin; /* Makes the scrollbar thinner */
    scrollbar-color: var(--accent-color) rgba(0, 0, 0, 0.3); /* Thumb and track colors */
padding: 20px;
    border-radius: 5px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    z-index: 1001;
}

.overlay-content #close-menu,
.overlay-content #close-final-score {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: #000;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    line-height: 40px;
    cursor: pointer;
    z-index: 1002;
    box-shadow: 0 0 10px var(--accent-color);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.confirmation-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

@keyframes glow {
    0% {
        text-shadow: 0 0 10px #ff5722, 0 0 20px var(--accent-color);
    }

    100% {
        text-shadow: none;
    }
}