:root {
    --main-bg-color: white;
    --main-font-color: black;
    --error-font-color: red;
    --sudoku-main-border-color: black;
    --sudoku-inside-border-color: #494949;
    --sudoku-minor-border-color: #494949;
    --sudoku-cell-cursor-color: #FFF900;
    --sudoku-cell-frozen-color: #E4E4E4;;;
    --sudoku-conflict-circle-color: #D22020;
    --button-highlight-color: #E4E4E4;
}

:root[data-theme="dark"] {
    --main-bg-color: #282828;
    --main-font-color: #EDEDED;
    --error-font-color: #cd1919;
    --sudoku-main-border-color: #EDEDED;
    --sudoku-inside-border-color: #B7B7B7;
    --sudoku-minor-border-color: #777777;
    --sudoku-cell-cursor-color: #C7C200;
    --sudoku-cell-frozen-color: #3B3B3B;
    --sudoku-conflict-circle-color: #9c2323;
    --button-highlight-color: #646464;
}

dialog[data-theme="dark"] {
    background-color: var(--main-bg-color);
    color: var(--main-font-color);
}

a { all: unset; }

button, input[type="submit"], input[type="reset"] {
	background: none;
	color: inherit;
	border: none;
	padding: 0;
	font: inherit;
	cursor: pointer;
	outline: inherit;
}

button:active, input[type="button"]:active {
    outline: none;
}

.hide {
    display: none;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.prevent-select {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */

    cursor: default;
}

body {
    margin: 0;
    padding: 0;

    color: var(--main-font-color);
    background-color: var(--main-bg-color);
}

#top-bar {
    height: 90px;
    width: 100%;

    margin-bottom: 10px;
    @media screen and (max-width: 500px) {
        margin-bottom: 5px;
    }
}

#top-bar-content {
    height: 100%;
    width: 90vw;
    max-width: 675px;

    display: flex;
    flex-direction: row;
    align-content: space-between;
    justify-content: space-between;
    align-items: flex-end;
}

.top-bar-button {
    border: none;
    background: none;
    padding: .5em;

    font-size: 1.3em;
    @media screen and (max-width: 500px) {
        font-size: 1.2em;
    }
    @media screen and (max-width: 400px) {
        font-size: 1em;
    }
    @media screen and (max-width: 375px) {
        font-size: .8em;
    }

}

.top-bar-button:hover {
    background: var(--button-highlight-color);
    border-radius: 5px;
}

#new-game-button {
    margin-left: 5px;
}

#settings-button {
    margin-right: 5px;
}

#sudoku-title {
    font-size: 4em;
    cursor: default;

    @media screen and (max-width: 650px) {
        font-size: 3.0em;
    }
    @media screen and (max-width: 550px) {
        font-size: 2.5em;
    }
    @media screen and (max-width: 450px) {
        font-size: 2.0em;
    }
    @media screen and (max-width: 375px) {
        font-size: 1.5em;
    }
}

#main {
    width: 95vw;
    max-width: 675px;

    display: flex;
    align-items: center;
    flex-direction: column;

    gap: 20px;
    @media screen and (max-width: 500px) {
        gap: 10px;
    }
}

#sudoku-header {
    height: 50px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    flex-direction: row;
    align-items: center;
    margin-bottom: 5px;

    font-size: 1.5em;
    @media screen and (max-width: 500px) {
        font-size: 1.3em;
    }
    @media screen and (max-width: 400px) {
        font-size: 1.1em;
    }
}

#game-timer-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

#pause-button {
    width: .7em;
    height: .7em;
    margin: 0;
}

#sudoku-table {
    position: relative;

    width: 95vw;
    max-width: 675px;
    min-width: 250px;

    border-width: 5px;
    border-style: solid;
    border-color: var(--sudoku-main-border-color);
    border-collapse: collapse;

    @media screen and (max-width: 600px) {
        border-width: 3px;
    }

    @media screen and (max-width: 500px) {
        border-width: 2px;
    }

    @media screen and (max-width: 400px) {
        border-width: 2px;
    }
}

.sudoku-row {
    display: flex;
    align-items: stretch;
    flex-direction: row;
}

.conflict-circle {
    position: absolute;
    top: 75%;
    left: 45%;
    width: 12%;
    height: 12%;
    background-color: var(--sudoku-conflict-circle-color);
    border-radius: 50%;
}

.sudoku-cell {
    font-family: Helvetica, sans-serif;

    border-width: 1px;
    border-style: solid;
    border-color: var(--sudoku-minor-border-color);
    border-collapse: collapse;

    position: relative;
    width: 75px;
    aspect-ratio: 1/1;

    font-size: 2.5em;
    @media screen and (max-width: 600px) {
        font-size: 2em;
    }
    @media screen and (max-width: 500px) {
        font-size: 1.5em;
    }
    @media screen and (max-width: 400px) {
        font-size: 1.3em;
    }
}

.sudoku-cell-cursor {
    background: var(--sudoku-cell-cursor-color);
}

.sudoku-cell-highlight {
    background: color-mix(
        in srgb,
        var(--sudoku-cell-cursor-color) 20%,
        var(--main-bg-color)
    );
}

.sudoku-cell-highlight.sudoku-cell-frozen {
    background: color-mix(
        in srgb,
        var(--sudoku-cell-cursor-color) 25%,
        var(--sudoku-cell-frozen-color)
    );
}

.sudoku-cell-frozen {
    background: var(--sudoku-cell-frozen-color);
}

.sudoku-cell-cursor.sudoku-cell-frozen {
    background-color: color-mix(
        in srgb,
        var(--sudoku-cell-cursor-color) 60%,
        var(--sudoku-cell-frozen-color)
    );
}

.sudoku-vert-border {
    border-right: 3px solid var(--sudoku-inside-border-color);

    @media screen and (max-width: 600px) {
        border-right-width: 2px;
    }
}

.sudoku-horiz-border {
    border-bottom: 2px solid var(--sudoku-inside-border-color);

    @media screen and (max-width: 600px) {
        border-bottom-witdh: 1px;
    }
}

.hint-wrapper {
    width: 90%;
    aspect-ratio: 1/1;

    display: flex;
    align-items: stretch;
    flex-direction: column;
}

.hint-row {
    flex: 1 0;
    display: flex;
    align-items: stretch;
    flex-direction: row;
}

.hint {
    font-size: 18px;
    flex: 1 0;

    @media screen and (max-width: 600px) {
        font-size: 12px;
    }
    @media screen and (max-width: 500px) {
        font-size: 10px;
    }
    @media screen and (max-width: 400px) {
        font-size: 8px;
    }
}

#digit-btns {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.digit-btn-row {
    width: 95vw;
    max-width: 675px;
    min-width: 250px;

    display: flex;
    flex-direction: row;

    gap: 10px;
    @media screen and (max-width: 600px) {
        gap: 2px;
    }
}

.digit-btn-row > div {
    flex: 1;
}

.control-btn {
    font-family: Helvetica, sans-serif;

    border-collapse: collapse;
    border-radius: 5px;

    aspect-ratio: 5/6;


    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    font-size: 2.0em;
    @media screen and (max-width: 600px) {
        font-size: 2em;
    }
    @media screen and (max-width: 500px) {
        font-size: 1.5em;
    }
    @media screen and (max-width: 400px) {
        font-size: 1.3em;
    }
}

.control-btn:hover {
    background: var(--button-highlight-color);
    border-radius: 5px;
}

.digit-btn-text {
    font-size: 0.95em;

    font-size: 1.1em;
    @media screen and (max-width: 600px) {
        font-size: .9em;
    }
    @media screen and (max-width: 500px) {
        font-size: .75em;
    }
    @media screen and (max-width: 400px) {
        font-size: .50em;
    }
}

dialog::backdrop {
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}

.dialog-close-button {
    font-family: Helvetica, sans-serif;

    position: absolute;
    top: 10px;
    right: 10px;

    font-size: 1.5em;
    width: 25px;
    aspect-ratio: 1/1;

    display: flex;
    justify-content: center;
    align-items: center;
}

.dialog-close-button:hover {
    background: var(--button-highlight-color);
    border-radius: 5px;
}

.dialog-tittle {
    font-size: 2.5em;
}

.dialog-button {
    font-size: 1.5em;
    padding: 10px;
}

.dialog-button:hover {
    background: var(--button-highlight-color);
    border-radius: 5px;
}

#new-game-dialog {
    max-width: 600px;
    width: 80vw;
    height: 220px;
}

.dialog-content {
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 5px;
}

#pause-dialog {
    max-width: 600px;
    width: 80vw;
    height: 150px;
}

#settings-dialog {
    max-width: 600px;
    width: 80vw;
    height: 200px;
}

.toggle-setting {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 1.5em;

    @media screen and (max-width: 600px) {
        font-size: 1.3em;
    }
    @media screen and (max-width: 500px) {
        font-size: 1.2em;
    }
    @media screen and (max-width: 400px) {
        font-size: 1em;
    }
}

.toggle-options {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 20px;
}

.toggle-option {
    padding: 5px;
}

.toggle-option:hover {
    background: var(--button-highlight-color);
    border-radius: 5px;
}

.toggle-option-selected {
    background: var(--button-highlight-color);
    border-radius: 5px;
}

#end-game-dialog {
    max-width: 600px;
    width: 80vw;
    height: 150px;
}

/* ******/
/* auth */
/* ******/

.auth-form-container {
    max-height: 95vh;

    width: 600px;
    max-width: 90vw;

    border-color: var(--main-font-color);
    border-width: 3px;
    border-style: solid;

    padding: 10px;
    padding-bottom: 50px;
}

.auth-form-sudoku-header {
    font-size: 5em;
    text-align: center;
    margin: 20px;
}

.auth-form-wrapper {
    height: 100%;
    width: 70%;
}

.form-label {
    font-size: 1.5em
}

.form-input {
    font-family: "Times New Roman", serif;
    margin-top: 5px;

    height: 30px;
    width: 100%;
    font-size: 1.5em;
    padding-left: 10px;

    border-style: solid;
    border-width: 1px;
    border-color: var(--main-font-color);
}

.auth-form-submit-div {
    font-size: 2em;
}

.auth-form-errors {
    margin-bottom: .5em;
    color: var(--error-font-color);
    font-size: 1.1em;
}

.auth-form-submit {
    width: 40%
}

.auth-form-submit:hover {
    background: var(--button-highlight-color);
    border-radius: 5px;
}

.auth-other {
    font-size: 1.2em;
}

.auth-other-button {
    border: none;
    background: none;
    margin-bottom: 5px;
    padding: 8px;
}

.auth-other-button:hover {
    background: var(--button-highlight-color);
    border-radius: 5px;
}
