* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --board-size: min(92vw, calc(100vh - 190px), 620px);
    --square-size: calc(var(--board-size) / 8);
    --piece-size: calc(var(--square-size) * 0.68);
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    padding: 18px;
    font-family: Arial, Helvetica, sans-serif;
    color: #f8fafc;
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.35), transparent 28rem),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.26), transparent 30rem),
        linear-gradient(135deg, #111827, #26170c 55%, #0f172a);
}

.game-shell {
    width: min(100%, 860px);
    min-height: calc(100vh - 36px);
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 14px;
    margin: 0 auto;
}

.back-link {
    justify-self: start;
    color: #fde68a;
    text-decoration: none;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 9px 14px;
}

.back-link:hover,
.back-link:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    outline: none;
}

.hero {
    text-align: center;
}

.eyebrow {
    color: #fbbf24;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

h1 {
    font-size: clamp(2.1rem, 7vw, 4rem);
    line-height: 1;
    text-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

#tog {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 9px 18px;
    border-radius: 999px;
    color: #1f1307;
    background: linear-gradient(135deg, #fef3c7, #f59e0b);
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.25);
    font-size: clamp(1rem, 3vw, 1.3rem);
}

.board-card {
    width: min(100%, calc(var(--board-size) + 28px));
    padding: clamp(10px, 2vw, 14px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06)),
        rgba(15, 23, 42, 0.56);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
}

.board {
    display: grid;
    grid-template-columns: 1fr;
    width: var(--board-size);
    margin: 0 auto;
    overflow: hidden;
    border: 8px solid #3a2412;
    border-radius: 18px;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.22),
        0 18px 42px rgba(0, 0, 0, 0.35);
}

.divv {
    display: flex;
}

li {
    list-style: none;
    display: grid;
    place-items: center;
    font-size: 0px;
}

.box {
    width: var(--square-size);
    aspect-ratio: 1;
    height: auto;
    transition: filter 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.box:hover {
    filter: brightness(1.08);
}

.allimg {
    width: var(--piece-size);
    position: relative;
    bottom: 2px;
    filter: drop-shadow(0 7px 7px rgba(0, 0, 0, 0.34));
    transition: transform 160ms ease, filter 160ms ease;
}

.box:hover .allimg {
    transform: translateY(-2px) scale(1.05);
    filter: drop-shadow(0 11px 10px rgba(0, 0, 0, 0.42));
}

.allpawn {
    transform: scale(.72);
}

.box:hover .allpawn {
    transform: translateY(-2px) scale(.78);
}

@media (max-width: 650px) {
    :root {
        --board-size: min(94vw, calc(100vh - 178px));
    }

    body {
        padding: 12px;
    }

    .game-shell {
        min-height: calc(100vh - 24px);
        gap: 10px;
    }

    .back-link {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .board-card {
        border-radius: 20px;
    }

    ul {
        border-width: 5px;
        border-radius: 14px;
    }
}

@media (max-height: 560px) {
    :root {
        --board-size: min(86vw, calc(100vh - 150px), 620px);
    }

    .eyebrow {
        display: none;
    }

    .game-shell {
        gap: 8px;
    }

    #tog {
        margin-top: 6px;
        padding: 7px 14px;
    }
}