:root {
    --bg1: #0f1226;
    --bg2: #1b1f45;
    --card: rgba(255, 255, 255, .07);
    --card-border: rgba(255, 255, 255, .14);
    --text: #eef0ff;
    --muted: #a5abd6;
    --accent: #7c5cff;
    --accent2: #22d3ee;
    --x: #22d3ee;
    --o: #ff7a59;
    --good: #34d399;
    --bad: #fb7185;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg1), var(--bg2));
    background-attachment: fixed;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .35;
    z-index: -1;
    animation: float 18s ease-in-out infinite alternate;
}

body::before {
    background: var(--accent);
    top: -160px;
    left: -140px;
}

body::after {
    background: var(--accent2);
    bottom: -180px;
    right: -120px;
    animation-duration: 22s;
}

@keyframes float {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(60px, 40px) scale(1.15);
    }
}

header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    padding: 10px 16px;
    background: rgba(15, 18, 38, .6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
}

.nav {
    display: flex;
    gap: 10px;
}

.nav-ico {
    position: relative;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, .06);
    background: rgba(255, 255, 255, .04);
    transition: color .2s, background .2s, border-color .2s, transform .2s var(--ease), box-shadow .25s;
}

.nav-ico svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-ico:hover {
    color: #fff;
    background: rgba(255, 255, 255, .1);
    transform: translateY(-2px);
}

.nav-ico:active {
    transform: scale(.92);
}

.nav-ico.active {
    color: #fff;
    background: rgba(135, 116, 225, .3);
    border-color: rgba(139, 120, 255, .6);
    box-shadow: 0 0 18px rgba(139, 120, 255, .3);
}

.nav-ico:focus-visible {
    outline: 2px solid #8b78ff;
    outline-offset: 2px;
}

main {
    max-width: 640px;
    margin: 32px auto 64px;
    padding: 0 16px;
    animation: rise .6s var(--ease) both;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

h1 {
    margin: 0 0 6px;
    font-size: 2em;
    letter-spacing: -.5px;
}

.lead {
    color: var(--muted);
    margin: 0 0 20px;
}

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 22px;
    padding: 26px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

.hero {
    text-align: center;
    margin-bottom: 28px;
}

.hero h1 {
    font-size: 2.6em;
}

.menu {
    display: grid;
    gap: 16px;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 22px;
    text-decoration: none;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    transition: transform .25s var(--ease), background .25s, border-color .25s, box-shadow .25s;
    animation: rise .6s var(--ease) both;
}

.menu a:nth-child(1) {
    animation-delay: .1s;
}

.menu a:nth-child(2) {
    animation-delay: .2s;
}

.menu a:nth-child(3) {
    animation-delay: .3s;
}

.menu a:hover {
    transform: translateY(-4px) scale(1.01);
    background: rgba(255, 255, 255, .12);
    border-color: rgba(124, 92, 255, .7);
    box-shadow: 0 14px 34px rgba(124, 92, 255, .3);
}

.menu .ico {
    flex: none;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    font-size: 2em;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    transition: transform .4s var(--ease);
}

.menu a:hover .ico {
    transform: rotate(-8deg) scale(1.1);
}

.menu b {
    font-size: 1.15em;
}

.menu small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 22px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), #5b8cff);
    box-shadow: 0 8px 20px rgba(124, 92, 255, .4);
    transition: transform .15s var(--ease), box-shadow .2s, filter .2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(124, 92, 255, .55);
}

.btn:active {
    transform: scale(.96);
}

.btn.secondary {
    background: rgba(255, 255, 255, .12);
    box-shadow: none;
    color: var(--text);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, .2);
}

.score {
    display: flex;
    gap: 10px;
    margin: 14px 0 18px;
    flex-wrap: wrap;
}

.score span {
    background: rgba(255, 255, 255, .08);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: .9em;
    color: var(--muted);
}

.score b {
    color: #fff;
    font-size: 1.1em;
    margin-left: 4px;
}

.status {
    margin: 16px 0;
    font-size: 1.15em;
    min-height: 1.6em;
    text-align: center;
}

.status.win {
    color: var(--good);
    font-weight: 700;
    animation: pop .6s var(--ease);
}

.status.lose {
    color: var(--bad);
    font-weight: 700;
    animation: shake .5s;
}

.status.draw {
    color: #fbbf24;
    font-weight: 700;
    animation: pop .6s var(--ease);
}

@keyframes pop {
    0% {
        transform: scale(.6);
        opacity: 0;
    }

    60% {
        transform: scale(1.12);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-9px);
    }

    40% {
        transform: translateX(9px);
    }

    60% {
        transform: translateX(-6px);
    }

    80% {
        transform: translateX(6px);
    }
}

#confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
}

@media (max-width: 520px) {
    h1 {
        font-size: 1.6em;
    }

    .card {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-delay: 0s !important;
        transition-duration: .01ms !important;
    }
}
