:root {
    --bg: #001B3A;
    --blue: #4DB8FF;
    --orange: #FFA347;
    --grey: #7A7A7A;
    --outline: #2f5c8d;
    --keyboard: #19385f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
}

.container {
    width: min(95vw, 600px);
    margin: auto;
    padding: 15px;
}

/* ---------- Logo ---------- */

.logo {
    margin-bottom: 15px;
}

.logo-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 5px;
}

.logo-tile {
    width: 50px;
    height: 50px;

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 8px;

    font-size: 30px;
    font-weight: bold;

    box-shadow: 0 3px 8px rgba(0,0,0,.3);
}

.logo-tile.blue {
    background: var(--blue);
}

.logo-tile.orange {
    background: var(--orange);
}

/* Make HOBDLE larger */

.logo-tile.title {
    width: 60px;
    height: 60px;
    font-size: 36px;
}

/* ---------- Subtitle ---------- */

.subtitle {
    margin: 0 0 15px;
    font-size: 20px;
}

/* ---------- Message ---------- */

#message {
    min-height: 0;
    margin-top: 15px;
    margin-bottom: 15px;
    font-size: 20px;
}

/* ---------- Board ---------- */

#board {
    display: grid;
    grid-template-columns: repeat(5, min(13vw, 65px));
    gap: min(2vw, 8px);
    justify-content: center;
    margin-bottom: 30px;
}

.tile {
    width: min(13vw, 65px);
    height: min(13vw, 65px);

    border: 2px solid var(--outline);
    border-radius: 8px;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: min(7vw, 34px);
    font-weight: bold;
    text-transform: uppercase;

    transition:
        background-color .2s,
        border-color .2s,
        transform .2s;
}

.tile.correct {
    background: var(--blue);
    border-color: var(--blue);
}

.tile.present {
    background: var(--orange);
    border-color: var(--orange);
}

.tile.absent {
    background: var(--grey);
    border-color: var(--grey);
}

.tile.pop {
    transform: scale(1.1);
}

.tile.flip {
    animation: flip .5s ease;
}

@keyframes flip {
    0% {
        transform: rotateX(0);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0);
    }
}

/* ---------- Shake ---------- */

.board-shake {
    animation: shake .4s;
}

@keyframes shake {
    20%,60% {
        transform: translateX(-8px);
    }

    40%,80% {
        transform: translateX(8px);
    }
}

/* ---------- Keyboard ---------- */

#keyboard {
    margin-top: 10px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.key {
    width: min(9vw, 42px);
    height: min(12vw, 55px);

    margin: 2px;

    border: none;
    border-radius: 6px;

    background: var(--keyboard);
    color: white;

    font-size: min(4vw, 18px);
    font-weight: bold;

    cursor: pointer;
    transition: .15s;
}

.key:hover {
    transform: translateY(-2px);
}

.key:active {
    transform: translateY(1px);
}

.key.large {
    width: min(18vw, 90px);
}

.key.correct {
    background: var(--blue);
}

.key.present {
    background: var(--orange);
}

.key.absent {
    background: var(--grey);
}

/* ---------- Mobile ---------- */

@media (max-width: 500px) {

    .logo-tile {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .logo-tile.title {
        width: 44px;
        height: 44px;
        font-size: 26px;
    }

    .logo {
        margin-bottom: 10px;
    }

    .subtitle {
        margin: 8px 0 10px;
        font-size: 18px;
    }

    #message {
        min-height: 0;
        margin-bottom: 6px;
    }

    #board {
        margin-top: 5px;
        margin-bottom: 20px;
    }
}
#help-button {
    position: absolute;
    top: 20px;
    right: 20px;

    width: 40px;
    height: 40px;

    border: none;
    border-radius: 50%;

    background: #19385f;
    color: white;

    font-size: 24px;
    font-weight: bold;

    cursor: pointer;
}

.modal {
    display: none;

    position: fixed;
    inset: 0;

    background:
        rgba(0,0,0,.8);

    z-index: 999;
}

.modal-content {
    width: min(90vw, 500px);

    background: #001B3A;
    color: white;

    padding: 30px;
    border-radius: 12px;

    margin: 40px auto;

    text-align: left;
}

.modal-content h2 {
    margin-top: 0;
}

#close-help {
    float: right;
    font-size: 30px;
    cursor: pointer;
}

.example-row {
    display: flex;
    gap: 5px;
    margin: 15px 0;
}

.example {
    width: 45px;
    height: 45px;

    border: 2px solid #2f5c8d;
    border-radius: 6px;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 24px;
    font-weight: bold;
}

.example.blue {
    background: #4DB8FF;
    border-color: #4DB8FF;
}

.example.orange {
    background: #FFA347;
    border-color: #FFA347;
}

.example.grey {
    background: #7A7A7A;
    border-color: #7A7A7A;
}

@media (max-width: 500px) {

    .modal-content {
        margin: 20px;
        padding: 20px;
    }

    .example {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
}