﻿body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f2f2f2;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh;
    margin: 0;
}

button {
    font-family: 'Montserrat', sans-serif;
}

#menu {
    height: 100%;
    width: 100%;
}

#menu-title {
    text-align: center;
    margin: 15px;
}

#phrase-selection-container {
    padding-bottom: 210px;
    background: #f2f2f2;
}

@media (max-width: 550px) {
    #phrase-selection-container {
        padding-bottom: 260px;
    }
}

#start-game-container {
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    background-color: #f2f2f2;
    padding: 15px 0px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 10px;
}

.ruzu-btn {
    padding: 10px 20px;
    color: black;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 30%;
    margin: 0% 10%;
    transition: background-color 0.3s ease;
}

.action-btn {
    font-size: 18px;
    background-color: #aaa5cc;
}

.action-btn:hover {
    background-color: #8a7cb3;
}

.option-btn {
    font-size: 16px;
    background-color: #eeeeee;
    border: 1px solid #ccc;
    text-align: center;
}

.option-btn:hover {
    background-color: #d7cfcd;
}

.game-overlay-btn {
    margin-top: 20px;
    width: auto;
    color: #ffffff;
    padding: 12px 24px;
}

#game-over-btn,
#next-lvl-btn {
    display: none;
}

#musicCheckBoxContainer {
    width: 100%;
}


#reveal-language-container {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#reveal-language-label {
    font-size: 14px;
}

#reveal-language-select {
    width: 100%;
    margin: 0;
    padding: 10px;
    font-family: 'Montserrat', sans-serif;
}

#voice-mode-container {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#voice-mode-label,
#pause-voice-mode-label {
    font-size: 14px;
}

#voice-mode-select,
#pause-voice-mode-select {
    width: 100%;
    margin: 0;
    padding: 10px;
    font-family: 'Montserrat', sans-serif;
}


@media (max-width: 480px) {

    #start-game-btn {
        width: 80%;
        margin: 0% 10%;
    }

    #options-btn {
        width: 80%;
        margin: 0% 10%;
    }


    #musicCheckBoxContainer {
        margin-top: 0px;
        width: 100%;
    }

    #reveal-language-container,
    #voice-mode-container {
        width: 100%;
        margin: 0;
    }
}

#musicCheckBoxLabel {
    display: inline-block;
    background-color: #eee;
    border: 1px solid #ccc;
    padding: 10px 0px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.3s ease;
    width: 100%;
    margin: 0px;
}

#menu-options-screen {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

#menu-options-content {
    width: min(460px, 90vw);
    background: #f2f2f2;
    border-radius: 8px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#menu-options-content h3 {
    margin: 0 0 8px;
    text-align: center;
}

#close-options-btn {
    width: 100%;
    margin: 8px 0 0;
}

#musicCheckBoxLabel:hover {
    background-color: #d7cfcd;
}

#menu-selected {
    padding-top: 10px;
}

#game-container {
    width: 80%;
    margin: 10%;
    text-align: center;
    max-width: 100vh;
    height: 100vh;
    height: 100dvh;
}

#score-container {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #f2f2f2;
    font-size: 1em;
    z-index: 100;
    border-radius: 5px;
    display: flex;
    align-items: center;
}

.score-text {
    height: 1em;
    margin-right: 10px;
    margin-left: 10px;
}

#lives-container {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #f2f2f2;
    font-size: 24px;
    z-index: 100;
    border-radius: 5px;
    display: flex;
    align-items: center;
}

#pause-container {
    position: fixed;
    bottom: max(0px, env(safe-area-inset-bottom));
    right: max(0px, env(safe-area-inset-right));
    background-color: #f2f2f2;
    border-radius: 5px;
    z-index: 100;
}

#pause-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    padding: 10px;
    cursor: pointer;
}

#pause-btn:hover {
    opacity: 0.75;
}

.heart-icon {
    width: 1em;
    height: 1em;
    padding: 10px;
    border-radius: 5px;
    z-index: 102;
}

#grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));

    @media (orientation: landscape) {
        grid-template-columns: repeat(5, 1fr);
    }

    @media (orientation: portrait) {
        grid-template-columns: repeat(4, 1fr);
    }

    @media (max-width: 450px) and (orientation: portrait) {
        grid-template-columns: repeat(3, 1fr);
    }

    gap: 10px;
    justify-content: center;
    align-items: center;
    margin: auto;
    height: 100%;
    /* Ensure the grid takes the full height */
    align-content: center;
    /* Center the grid items vertically */
}

.card {
    aspect-ratio: 1 / 1;
    /* Maintain a square aspect ratio */
    background-color: #e3e3e3;
    font-size: 1em;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    border: 1px solid #c7c6c6;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    font-family: 'Gowun Dodum', sans-serif;
    box-shadow: 0 .5em 1em -.125em rgba(10, 10, 10, .1), 0 0 0 1px rgba(10, 10, 10, .02);
}

#phrase-selection {
    font-family: 'Gowun Dodum', sans-serif;
}

#phrase-toolbar {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 8px;
    margin: 0 auto 10px;
    width: min(960px, 96%);
    align-items: center;
}

#phrase-toolbar .option-btn {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

#phrase-quick-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.phrase-action-btn {
    width: auto;
    margin: 0;
    flex: 1;
    padding: 8px 10px;
    font-size: 14px;
}

.favorite-btn {
    width: auto;
    margin: 0;
    padding: 4px 8px;
    min-width: 38px;
}

@media (max-width: 700px) {
    #phrase-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    #phrase-quick-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    #clear-filters-btn {
        grid-column: 1 / -1;
    }
}

#phrases-table {
    margin: auto;
}

table {
    border-collapse: collapse;
}

tr {
    /* display: flex; */
    width: 100%;
}

tr:hover {
    background-color: #e0e0e0;
    /* Slightly darken the row on hover */
}

tr.no-hover:hover {
    background-color: inherit;
    /* or any other property you want to reset */
    color: inherit;
    /* reset color if needed */
}

th,
td {
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 12px;
}

th {
    background-color: #f2f2f2;
    text-align: left;
}

td:first-child,
th:first-child {
    width: 8%;
}

td:nth-child(2),
th:nth-child(2) {
    width: 8%;
    text-align: center;
}

td:nth-child(3),
th:nth-child(3),
td:nth-child(4),
th:nth-child(4) {
    width: 36%;
}

td:nth-child(5),
th:nth-child(5) {
    width: 12%;
    text-align: center;
}

@media (max-width: 600px) {

    #game-container {
        width: 90%;
        margin: 5%;
    }

    #grid {
        gap: 5px;
    }
}

.card.dimmed {
    background-color: #aaa;
    /* Dimmed cards have a grayed-out background */
    color: #666;
    /* Text is also dimmed for better clarity */
    text-decoration: line-through;
    /* Optional: strike through to show it's used */
    pointer-events: none;
    /* Prevent interaction */
    cursor: default;
}


.card.first-reveal-blocked {
    background-color: #d1d1d1;
    border-color: #bababa;
    cursor: not-allowed;
}

.card.revealed {
    background: #fff;
    color: #000000;
    font-weight: bold;
    cursor: pointer;
}

.card.possibleAnswer {
    background: #fff;
    color: #000000;
    cursor: pointer;
}

.card.kPossibleAnswer {
    background: #D9C4EC;
    color: #000000;
    cursor: pointer;
}

#game-overlay-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffffed;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
    flex-direction: column;
    opacity: 0;
}

#pause-overlay-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffffed;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    box-sizing: border-box;
}

#pause-music-label {
    max-width: 260px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    padding: 12px 18px;
    border-radius: 5px;
}

.pause-overlay-btn {
    width: auto;
    margin: 0;
}

#resume-btn,
#return-menu-btn {
    max-width: 260px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.pause-confirmation {
    max-width: 420px;
    width: 100%;
    text-align: center;
    background-color: #ffffff;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    padding: 16px;
    box-sizing: border-box;
}

.pause-confirmation p {
    margin-top: 0;
}

.pause-confirmation-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

#game-overlay-title,
#game-overlay-text {
    text-align: center;
    padding: 0px 20px;
}


.phrase-preview-btn {
    width: auto;
    margin: 0;
    padding: 6px 10px;
    min-width: 40px;
}

#pause-voice-mode-container {
    width: 100%;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}
