:root {
    --background: #fde8e9;
    --pink: #f7b9bf;
    --gray: #dedede;
    --yellow: #f7e493;
    --green: #a7d1a9;
    --text: #050505;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

button {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.side-bar {
    position: fixed;
    top: 8.5vh;
    bottom: 8.5vh;
    width: 47px;
    background: var(--pink);
}

.side-bar.left {
    left: 5vw;
}

.side-bar.right {
    right: 5vw;
}

.content {
    width: min(760px, 76vw);
    padding: 55px 0 70px;
}

h1 {
    margin: 0 0 88px;
    text-align: center;
    font-size: clamp(46px, 6vw, 72px);
    line-height: 1;
    font-weight: 800;
    letter-spacing: 1px;
}

.tile-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(72px, 1fr));
    gap: clamp(14px, 4vw, 44px);
    align-items: center;
}

.tile {
    border: none;
    aspect-ratio: 1 / 0.95;
    min-width: 0;
    display: grid;
    place-items: center;
    font-size: clamp(42px, 5vw, 64px);
    font-weight: 500;
    color: black;
    cursor: pointer;
    transition: transform 120ms ease, background-color 120ms ease;
}

.tile:hover {
    transform: translateY(-2px);
}

.tile:focus-visible,
.primary-button:focus-visible,
.text-button:focus-visible {
    outline: 3px solid #111;
    outline-offset: 4px;
}

.state-gray { background: var(--gray); }
.state-yellow { background: var(--yellow); }
.state-green { background: var(--green); }

.hint {
    margin: 18px 0 8px;
    text-align: center;
    font-size: 14px;
    opacity: 0.55;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 20px 0 48px;
}

.primary-button,
.text-button {
    border: 0;
    cursor: pointer;
    font-weight: 700;
    text-transform: lowercase;
}

.primary-button {
    padding: 12px 28px;
    background: #111;
    color: white;
}

.text-button {
    padding: 12px 12px;
    background: transparent;
    color: #111;
}

.results-panel {
    width: 100%;
}

.results-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.results-heading h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

#countText {
    font-size: 14px;
    opacity: 0.55;
}

.word-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 54px;
}

.word-option {
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1;
    font-weight: 500;
    text-align: left;
}

.empty-state {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 18px;
    opacity: 0.5;
}

.guess-history {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 42px;
}

.history-guess {
    display: flex;
    gap: 4px;
}

.history-tile {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 700;
}

.message {
    min-height: 20px;
    margin: 18px 0 0;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 700px) {
    .side-bar {
        width: 20px;
    }

    .side-bar.left { left: 16px; }
    .side-bar.right { right: 16px; }

    .content {
        width: calc(100vw - 88px);
        padding-top: 42px;
    }

    h1 {
        margin-bottom: 62px;
        font-size: 44px;
    }

    .tile-row {
        gap: 8px;
    }

    .tile {
        font-size: 35px;
    }

    .word-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 28px;
    }

    .word-option {
        font-size: 32px;
    }
}
