:root {
    --game-container-width: 120vmin;
    --game-container-height: 100vmin;
    --background-color: #F5ECDE;
    --box-color-1: #e3f1f1;
    --box-color-2: #b8dad9;
    --button-color: #197278;
    --button-color-active: #197278;
    --error-color: #be2e23;
    --correct-color: #197278;
    --toggle-color: #be2e23;
    --given-color: #333;
    --font-size-small: 1.3vmin;
    --font-size-medium: 3vmin;
    --font-size-normal: 3vmin;
    --font-size-large: 5vmin;
    --grid-size: 4;
    --numkey-size: 33%;
}

body {
    margin: 0;
    background-color: var(--background-color);
    font-family: 'Montserrat', sans-serif;
}

*, *::before, *::after {
    text-decoration: none;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    list-style: none;
}

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

.game-container {
    width: var(--game-container-width);
    height: var(--game-container-height);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2vmin;

    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.board-container {
    width: calc(0.7 * var(--game-container-height));
    height: calc(0.7 * var(--game-container-height));
    display: grid;
    align-items: stretch;
    justify-items: stretch;
}

/* Number cells */
.number-cell {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-large);
    border: 0.15em solid #333;
    background-color: var(--box-color-1);
    cursor: pointer;
    transition: all ease 0.2s;
}

.number-cell.given {
    font-weight: bold;
    color: var(--given-color);
    cursor: default;
    background-color: var(--box-color-2);
}

.number-cell.selected {
    background-color: #333;
    color: white;
}

.number-cell.error-box {
    background-color: var(--error-color);
    animation: error-box-animation 1s;
}

.number-cell.correct-box {
    animation: correct-box-animation 1s;
    background-color: var(--correct-color);
}

.number-cell.animate-correct-back-to-normal-bg {
    animation: correct-back-to-normal-bg-animation 1s;
}

@keyframes correct-box-animation {
    to { background-color: var(--correct-color); }
}

@keyframes correct-back-to-normal-bg-animation {
    from { background-color: var(--correct-color); }
}

@keyframes error-box-animation {
    to { background-color: var(--error-color); }
}

/* Constraint cells */
.constraint-h, .constraint-v {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-medium);
    font-weight: bold;
    color: #555;
}

.corner {
    width: 100%;
    height: 100%;
}

/* Notes inside cells */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    font-size: var(--font-size-small);
    font-weight: bold;
}

.notes-grid span {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Options panel */
.options-container {
    width: calc(0.3 * var(--game-container-width));
    height: var(--game-container-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-title {
    font-size: var(--font-size-normal);
}

.numpad {
    width: 100%;
    text-align: center;
    font-size: var(--font-size-normal);
    border-spacing: 1vmin;
}

.numkey {
    cursor: pointer;
    background-color: var(--button-color);
    color: white;
    padding: 2vmin;
    width: var(--numkey-size);
    height: var(--numkey-size);
    border: 0.02em solid black;
    border-radius: 0.5em;
    transition: all ease 0.1s;
}

.numkey:active {
    background-color: var(--button-color-active);
    position: relative;
    top: 2px;
    left: 2px;
}

.notes-mode-off {
    cursor: pointer;
    background-color: grey;
    padding: 1vmin;
    width: 33%;
    height: 33%;
    border: 0.02em solid black;
    border-radius: 0.5em;
}

.notes-mode-on {
    cursor: pointer;
    background-color: var(--button-color);
    color: white;
    padding: 1vmin;
    width: 33%;
    height: 33%;
    border: 0.02em solid black;
    border-radius: 0.5em;
}

.signal-errors-mode-off {
    cursor: pointer;
    background-color: grey;
    padding: 1vmin;
    width: 33%;
    height: 33%;
    border: 0.02em solid black;
    border-radius: 0.5em;
}

.signal-errors-mode-on {
    cursor: pointer;
    background-color: var(--button-color);
    color: white;
    padding: 1vmin;
    width: 33%;
    height: 33%;
    border: 0.02em solid black;
    border-radius: 0.5em;
}

.verify-button {
    cursor: pointer;
    background-color: var(--correct-color);
    padding: 1vmin;
    width: 33%;
    height: 33%;
    border: 0.02em solid black;
    border-radius: 0.5em;
    display: none;
    color: white;
}

.verify-button-on {
    cursor: pointer;
    display: table-cell;
}

hr {
    width: var(--game-container-width);
    height: 0.3em;
    background-color: black;
    margin-top: 2em;
}

.generate_new {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3em;
}

.circles {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: fit-content;
}

.circle_content {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1vmin;
    width: calc(var(--game-container-width) / 5);
}

.generate_new_title {
    font-size: var(--font-size-large);
    margin: 1rem 1rem 3vmin;
    font-weight: bolder;
    text-align: center;
}

.button_new_puzzle {
    margin-left: 2vmin;
    margin-right: 2vmin;
    position: relative;
    width: 4vmin;
    height: 4vmin;
    border-radius: 50%;
    vertical-align: middle;
    border: 0.02em solid black;
}

.button_new_puzzle_easy {
    background-color: #90BE6D;
}

.button_new_puzzle_medium {
    background-color: #F9C74F;
}

.button_new_puzzle_hard {
    background-color: #F8961E;
}

.button_new_puzzle_expert {
    background-color: #F94144;
}

.button_new_puzzle_diabolical {
    background-color: #7B2D8E;
}

.difficulty_text {
    text-decoration: none;
    margin-top: 1vmin;
    font-size: var(--font-size-normal);
}

.text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3em;
}

.text-div {
    text-align: left;
    line-height: 1.6;
    font-size: var(--font-size-normal);
    width: var(--game-container-width);
}

.links {
    font-size: var(--font-size-normal);
}


/* modal */

.modal {
    font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif;
}

.modal__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal__container {
    background-color: #fff;
    padding: 30px;
    max-width: 120vmin;
    max-height: 100vh;
    border-radius: 4px;
    overflow-y: auto;
    box-sizing: border-box;
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal__title {
    margin-top: 0;
    margin-bottom: 0;
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1.25;
    color: #00449e;
    box-sizing: border-box;
}

.modal__close {
    background: transparent;
    border: 0;
}

.modal__header .modal__close:before {
    content: "\2715";
}

.modal__content {
    margin-top: 2rem;
    margin-bottom: 2rem;
    line-height: 1.5;
    color: rgba(0, 0, 0, .8);
}

.modal__btn {
    text-decoration: none;
    font-size: .875rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: .5rem;
    padding-bottom: .5rem;
    color: rgba(0, 0, 0, .8);
    border-radius: .25rem;
    border: 0.02em solid black;
    cursor: pointer;
    -webkit-appearance: button;
    text-transform: none;
    overflow: visible;
    line-height: 1.15;
    margin: 1vmin;
    will-change: transform;
    -moz-osx-font-smoothing: grayscale;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    transition: -webkit-transform .25s ease-out;
    transition: transform .25s ease-out;
    transition: transform .25s ease-out, -webkit-transform .25s ease-out;
}

.modal__btn:focus, .modal__btn:hover {
    -webkit-transform: scale(1.05);
    transform: scale(1.05);
}

.modal__btn-primary {
    background-color: #00449e;
    color: #fff;
}


/**************************\
  Demo Animation Style
\**************************/
@keyframes mmfadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes mmfadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes mmslideIn {
    from { transform: translateY(15%); }
    to { transform: translateY(0); }
}

@keyframes mmslideOut {
    from { transform: translateY(0); }
    to { transform: translateY(-10%); }
}

.micromodal-slide {
    display: none;
}

.micromodal-slide.is-open {
    display: block;
}

.micromodal-slide[aria-hidden="false"] .modal__overlay {
    animation: mmfadeIn .3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.micromodal-slide[aria-hidden="false"] .modal__container {
    animation: mmslideIn .3s cubic-bezier(0, 0, .2, 1);
}

.micromodal-slide[aria-hidden="true"] .modal__overlay {
    animation: mmfadeOut .3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.micromodal-slide[aria-hidden="true"] .modal__container {
    animation: mmslideOut .3s cubic-bezier(0, 0, .2, 1);
}

.micromodal-slide .modal__container,
.micromodal-slide .modal__overlay {
    will-change: transform;
}
