.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin-top: 20px;
}

.game-title {
    font-size: 48px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

/* Layout: streak till vänster, spel i mitten, topplista till höger */
.game-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-column-gap: 80px;
    align-items: start;
    width: 100%;
    max-width: 1200px;
}

.streak-panel {
    justify-self: end;
    margin-top: 120px;
    margin-right: 50px;
}

.board-panel {
    justify-self: center;
}

.leaderboard-panel {
    justify-self: start;
    margin-top: 40px;
}

/* Streak-panelen till vänster */

.streak-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.streak-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
    
}

.streak-icon-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.streak-icon.large {
    width: 180px;
    height: 180px;
}

.streak-icon.small {
    width: 90px;
    height: 90px;
}

.streak-number {
    font-family: "Bahnschrift", sans-serif;
    font-weight: 700;
    font-size: 75px;
    font-weight: bold;
    position: relative;
    z-index: 1;
    margin-top: 60px;
    color: #894500;
}

.streak-number-small {
    font-family: "Bahnschrift", sans-serif;
    font-weight: 700;
    font-size: 35px;
    font-weight: bold;
    position: relative;
    z-index: 1;
    margin-top: 30px;
    color: #894500;
}

.streak-label, .streak-label-small {
    margin-top: 4px;
    font-weight: 600;
    text-align: center;
}

.streak-label {
    font-size: 22px;
}

.streak-label-small {
    font-size: 16px;
}

.streak-low {
    color: #894500;
}

.streak-mid {
    color: black;
}

.streak-high {
    color: green;
}

/* Behållare för rutnätet: 6 kolumner, 6 rader */
.board-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#board {
    display: grid;
    grid-template-columns: repeat(6, 50px);
    grid-auto-rows: 50px;
    grid-column-gap: 4px;
    grid-row-gap: 4px;
    justify-content: center;
}

    /* Enskild ruta */
    #board .tile {
        width: 50px;
        height: 50px;
        border: 2px solid gray;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 32px;
        font-weight: bold;
        text-transform: uppercase;
        transition: transform 0.15s ease;
    }

.green {
    background: #6aaa64;
    color: white;
}

.yellow {
    background: #c9b458;
    color: white;
}

.gray {
    background: #787c7e;
    color: white;
}

/* Pop-animation vid inmatning av bokstav */
.tile.pop {
    animation: pop 0.1s ease;
}

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Flip-animation när färgen avslöjas */
.tile.flip {
    animation: flip 0.25s ease;
}

@keyframes flip {
    0% {
        transform: rotateX(0deg);
    }

    50% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0deg);
    }
}

#keyboard {
    text-align: center;
}

    #keyboard div {
        margin-bottom: 2px;
    }

    #keyboard button {
        width: 44px;
        height: 48px;
        margin: 2px;
        font-size: 18px;
        border: none;
        background-color: rgb(211, 214, 218);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

        #keyboard button.key-enter {
            width: 80px;
        }

        #keyboard button.key-backspace {
            width: 80px;
        }


        #keyboard button.green {
            background: #6aaa64 !important;
            color: white;
        }

        #keyboard button.yellow {
            background: #c9b458 !important;
            color: white;
        }

        #keyboard button.gray {
            background: #787c7e !important;
            color: white;
        }

#message {
    margin-top: 10px;
    min-height: 24px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

/* Topplista till höger */
.leaderboard-panel {
    min-width: 220px;
}

.leaderboard-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
    text-align: center;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    row-gap: 6px;
}

.leaderboard-entry {
    position: relative;
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    background-color: #f3f3f3;
    cursor: pointer;
}

.leaderboard-entry.me {
    border: 2px solid #6aaa64;
}

.leaderboard-main {
    display: contents;
}

.leaderboard-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    gap: 8px;
    border-radius: 4px;
    background: #f3f3f3;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 5;
}

.leaderboard-entry.show-overlay .leaderboard-overlay {
    opacity: 1;
    pointer-events: auto;
}

.leaderboard-overlay-text {
    font-size: 14px;
    font-weight: 600;
}

.leaderboard-overlay-btn {
    padding: 4px 10px;
    border-radius: 4px;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
}

.leaderboard-overlay-btn.yes {
    background-color: #6aaa64;
    margin-right: 6px;
}

.leaderboard-overlay-btn.no {
    background-color: #d9534f;
}

.leaderboard-rank {
    width: 40px;
    text-align: left;
    font-weight: bold;
}

.leaderboard-username {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-streak-icon {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
}

.leaderboard-streak-number {
    font-family: "Bahnschrift", sans-serif;
    font-weight: 700;
    font-size: 17px;
    position: relative; 
    z-index: 1;
    margin-top: 12px;
}

.leaderboard-streak-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.shop-panel {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.shop-button,
.shop-button:visited,
.shop-button:focus {
    position: relative;
    display: inline-block;
    overflow: hidden;
    padding: 10px 28px;
    background-color: #f3f3f3;
    color: black !important;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none !important;
    border-radius: 6px;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.15s;
}

    /* Ljusreflektion som sveper över knappen vid hover */
    .shop-button::after {
        content: "";
        position: absolute;
        top: 0;
        left: -75%;
        width: 50%;
        height: 100%;
        background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
        transform: skewX(-20deg);
        transition: left 0.5s ease;
        pointer-events: none;
    }

    .shop-button:hover {
        background-color: #e4e4e4;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    }

        .shop-button:hover::after {
            left: 125%;
        }

/* ── Mörkläge ─────────────────────────────────────────────────────────── */
body.dark-mode .shop-button,
body.dark-mode .shop-button:visited,
body.dark-mode .shop-button:focus {
    background-color: #3a3a3a !important;
    color: #f0f0f0 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.40);
}

    body.dark-mode .shop-button::after {
        background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.20) 50%, transparent 100%);
    }

    body.dark-mode .shop-button:hover {
        background-color: #474747 !important;
        color: #f0f0f0 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
    }


:root {
    --leaderboard-name-width: 150px; /* ändra denna för maxlängd */
}

.restart-button {
    margin-top: 12px;
    padding: 6px 16px;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    background-color: #6aaa64;
    color: #fff;
    cursor: pointer;
}

.confetti {
    position: fixed;
    top: -10px;
    width: 8px;
    height: 14px;
    opacity: 0.9;
    animation: confettiFall 3s linear forwards;
    z-index: 9999;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotateZ(0deg);
    }

    100% {
        transform: translateY(100vh) rotateZ(360deg);
    }
}

/* ───────── Compact Suggestion Form ───────── */

.suggestion-wrapper {
    display: flex;
    justify-content: center;
    margin: 8px 0 4px;
}

.suggestion-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 14px;
    background: rgba(20,20,20,0.55);
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

.suggestion-header {
    display: none;
}

.suggestion-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-input {
    width: 140px;
    height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.05);
    color: white;
    font-size: 0.85rem;
    outline: none;
    transition: border-color .18s ease, background .18s ease;
}

    .suggestion-input:focus {
        border-color: #6aaa64;
        background: rgba(255,255,255,0.08);
    }

    .suggestion-input::placeholder {
        color: rgba(255,255,255,0.4);
    }

.suggestion-btn {
    height: 34px;
    padding: 0 12px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #6aaa64, #5b9655);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s ease, opacity .18s ease;
}

    .suggestion-btn:hover {
        transform: translateY(-1px);
        opacity: .95;
    }

    .suggestion-btn:active {
        transform: translateY(0);
    }