* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
    background: #000;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    overscroll-behavior: none;
}

.app {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 7px 8px 12px;
}

/* HEADER */

.header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    margin-bottom: 7px;
}

.logo {
    height: 43px;
    max-width: 230px;
    object-fit: contain;
}

.back {
    position: absolute;
    left: 0;
    top: 7px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
}

.nickname {
    position: absolute;
    right: 0;
    top: 8px;
    max-width: 120px;
    padding: 7px 9px;
    border-radius: 999px;
    background: rgba(255,43,214,0.15);
    border: 1px solid rgba(255,43,214,0.45);
    font-size: 11px;
    font-weight: 900;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* CARDS */

.game-card,
.leader-card {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: rgba(255,255,255,0.035);
    padding: 10px;
    margin-bottom: 8px;
    box-shadow: 0 0 18px rgba(255,43,214,0.08);
}

.game-card {
    background:
        radial-gradient(circle at top, rgba(255,43,214,0.22), transparent 38%),
        rgba(255,255,255,0.035);
}

/* STATS */

.top-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.top-stats div {
    background: rgba(0,0,0,0.48);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 12px;
    padding: 7px 6px;
    text-align: center;
}

.top-stats span {
    display: block;
    font-size: 10px;
    opacity: .7;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.top-stats strong {
    display: block;
    color: #ffeb00;
    font-size: 21px;
}

/* WORD AREA */

.word {
    min-height: 78px;
    border-radius: 17px;
    border: 1px solid rgba(255,235,0,0.3);
    background: rgba(0,0,0,0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px;
    font-size: 34px;
    line-height: 1;
    letter-spacing: 4px;
    font-weight: 950;
    text-align: center;
    text-shadow: 0 0 14px rgba(255,43,214,0.8);
    margin-bottom: 6px;
}

.word.correct {
    animation: pop .22s ease;
}

.word.wrong {
    animation: shake .22s ease;
}

.hint {
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,.68);
    margin-bottom: 8px;
}

/* FORM */

#guessForm {
    display: grid;
    grid-template-columns: 1fr 88px;
    gap: 7px;
}

input {
    width: 100%;
    height: 46px;
    border-radius: 13px;
    border: 1px solid rgba(255,255,255,0.18);
    background: #fff;
    color: #111;
    padding: 0 12px;
    font-size: 18px;
    font-weight: 900;
    outline: none;
}

input::placeholder {
    color: rgba(0,0,0,0.45);
}

input:focus {
    border-color: #ff2bd6;
    box-shadow: 0 0 0 2px rgba(255,43,214,0.25);
}

button {
    border: 0;
    border-radius: 13px;
    font-weight: 950;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
}

#submit {
    height: 46px;
    background: #ff2bd6;
    color: #fff;
    box-shadow: 0 0 13px rgba(255,43,214,0.28);
}

#submit:active {
    transform: scale(0.98);
}

/* MESSAGE */

.message {
    min-height: 26px;
    margin-top: 8px;
    padding: 7px 8px;
    border-radius: 11px;
    background: rgba(255,255,255,0.055);
    text-align: center;
    font-size: 13px;
    font-weight: 850;
    color: rgba(255,255,255,0.78);
}

.message.good {
    color: #ffeb00;
}

.message.bad {
    color: #ff7bbf;
}

/* LEADERBOARD */

.leader-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    font-size: 14px;
    font-weight: 950;
    margin-bottom: 7px;
}

#clearBtn {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.75);
    font-size: 11px;
    font-weight: 900;
}

.leaderboard {
    display: grid;
    gap: 5px;
}

.leader-row {
    display: grid;
    grid-template-columns: 36px 1fr 48px;
    align-items: center;
    gap: 6px;
    border-radius: 10px;
    background: rgba(0,0,0,0.38);
    border: 1px solid rgba(255,255,255,0.07);
    padding: 7px 8px;
    font-size: 13px;
}

.rank {
    color: #ffeb00;
    font-weight: 950;
}

.player {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.points {
    text-align: right;
    color: #ff2bd6;
    font-weight: 950;
}

.empty {
    padding: 10px;
    text-align: center;
    color: rgba(255,255,255,0.65);
    font-size: 13px;
}

/* POINTS TOAST */

.points-toast {
    position: fixed;
    left: 50%;
    bottom: 88px;
    transform: translateX(-50%) translateY(20px);
    background: #ffeb00;
    color: #000;
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 15px;
    font-weight: 950;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 18px rgba(255,235,0,0.45);
    transition: opacity .25s ease, transform .25s ease;
}

.points-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ANIMATIONS */

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-3px);
    }

    100% {
        transform: translateX(0);
    }
}

/* SMALL SCREENS */

@media (max-width: 380px) {
    .logo {
        height: 38px;
        max-width: 190px;
    }

    .nickname {
        max-width: 92px;
        font-size: 10px;
        padding: 6px 7px;
    }

    .word {
        min-height: 70px;
        font-size: 29px;
        letter-spacing: 3px;
    }

    #guessForm {
        grid-template-columns: 1fr 78px;
    }

    input,
    #submit {
        height: 43px;
        font-size: 16px;
    }
}