:root {
    --maincolor: #0f3460;
    --secondarycolor: #00d4ff;
    --accent: #ff006e;
    --RIP: #06d6a0;
    --RNP: #ffd60a;
    --WIB: #ff006e;
    --text-light: #f0f0f0;
    --bg-light: #e8e8e8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    position: relative;
    background: linear-gradient(135deg, #0f3460 0%, #16213e 50%, #0f3460 100%);
    background-attachment: fixed;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

h2 {
    text-align: center;
    margin: 60px 0 20px 0;
    font-size: 48px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: linear-gradient(135deg, var(--secondarycolor), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game {
    color: var(--text-light);
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 50px;
    margin: 30px auto;
    max-width: 1200px;
    background: rgba(15, 52, 96, 0.7);
    padding: 50px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37),
        inset 0 0 20px rgba(0, 212, 255, 0.1);
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game .main {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 30px;
    align-items: flex-start;
    padding: 25px;
    flex: 1;
}

.game .main .tries {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 10px;
    width: 100%;
}

.game .main .tries>div {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    font-size: 18px;
    align-items: center;
    width: 100%;
    animation: slideInLeft 0.6s ease-out backwards;
}

.game .main .tries>div:nth-child(2) {
    animation-delay: 0.1s;
}

.game .main .tries>div:nth-child(3) {
    animation-delay: 0.2s;
}

.game .main .tries>div:nth-child(4) {
    animation-delay: 0.3s;
}

.game .main .tries>div:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.game .main .tries>div span {
    text-transform: capitalize;
    padding: 8px 12px;
    text-align: center;
    font-weight: 600;
    color: var(--secondarycolor);
    min-width: 70px;
}

.game .main .tries>div .letter {
    width: 50px;
    height: 65px;
    border-radius: 12px;
    outline: none;
    border: 2px solid var(--secondarycolor);
    font-size: 24px;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    text-align: center;
    background-color: rgba(240, 240, 240, 0.05);
    color: var(--text-light);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: text;
}

.game .main .tries>div .letter:focus {
    border-color: var(--secondarycolor);
    background-color: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    transform: scale(1.05);
}

.game .main .tries>div .letter.rip {
    background: linear-gradient(135deg, var(--RIP), #04a777);
    border-color: var(--RIP);
    box-shadow: 0 0 20px rgba(6, 214, 160, 0.6);
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game .main .tries>div .letter.rnp {
    background: linear-gradient(135deg, var(--RNP), #ffb703);
    border-color: var(--RNP);
    box-shadow: 0 0 20px rgba(255, 214, 10, 0.6);
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game .main .tries>div .letter.wib {
    background: linear-gradient(135deg, var(--WIB), #c1121f);
    border-color: var(--WIB);
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.6);
    animation: shake 0.4s ease-in-out;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
    }

    50% {
        transform: scale(1.1);
    }

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

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.game .main .btns {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 5px 20px;
    width: 100%;
    gap: 20px;
}

.game .main .btns button {
    border: 2px solid var(--secondarycolor);
    border-radius: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--secondarycolor), #0099cc);
    color: var(--maincolor);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game .main .btns button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.5);
}

.game .main .btns button:active {
    transform: translateY(-1px);
}

.game .guide {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: flex-start;
    justify-content: space-around;
    padding: 30px;
    background: rgba(15, 52, 96, 0.4);
    border-radius: 15px;
    border: 1px solid rgba(0, 212, 255, 0.1);
    animation: fadeIn 0.8s ease-out 0.2s backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.game .guide .discription {
    font-size: 16px;
    letter-spacing: 0.5px;
    line-height: 26px;
    color: var(--text-light);
    text-align: center;
    font-weight: 500;
}

.game .guide .color {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.game .guide .color .lon {
    width: 40px;
    height: 43px;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.game .guide .color .lon:hover {
    transform: scale(1.1);
}

.game .guide .color .lon.awal {
    background: linear-gradient(135deg, var(--RIP), #04a777);
}

.game .guide .color .lon.tany {
    background: linear-gradient(135deg, var(--RNP), #ffb703);
}

.game .guide .color .lon.talet {
    background: linear-gradient(135deg, var(--WIB), #c1121f);
}

.game .guide .color p {
    padding-left: 10px;
    font-weight: 600;
    color: var(--text-light);
}

.result {
    position: fixed;
    top: 50%;
    left: 50%;
    background: linear-gradient(135deg, var(--secondarycolor), var(--accent));
    color: var(--maincolor);
    transform: translate(-50%, -50%) scale(0);
    padding: 60px 40px;
    border-radius: 20px;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: bold;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: resultPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    max-width: 90%;
    backdrop-filter: blur(20px);
}

@keyframes resultPopIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0) rotate(-10deg);
    }

    70% {
        transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

.result .msg {
    font-size: 48px;
    margin-bottom: 20px;
    animation: fadeInDown 0.6s ease-out 0.2s backwards;
}

.result p {
    font-size: 28px;
    margin: 20px 0;
}

.result h3 {
    font-size: 32px;
    margin: 20px 0;
    animation: fadeInDown 0.6s ease-out 0.4s backwards;
}

.result .fin {
    text-transform: capitalize;
    font-weight: 900;
}

.result .restart {
    font-weight: bold;
    font-size: 18px;
    border: 3px solid var(--maincolor);
    border-radius: 10px;
    cursor: pointer;
    padding: 12px 30px;
    background-color: var(--maincolor);
    color: var(--secondarycolor);
    margin-top: 20px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: fadeInUp 0.6s ease-out 0.6s backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result .restart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(15, 52, 96, 0.4);
}

.result .restart:active {
    transform: translateY(0);
}

/* responsive part */
@media (max-width: 992px) {
    .game {
        flex-direction: column-reverse;
        padding: 30px;
    }

    .game .guide {
        align-items: center !important;
        width: 100%;
    }

    .game .main {
        padding: 0 !important;
        width: 100%;
    }

    .game .main .tries>div {
        gap: 10px;
        justify-content: center;
        width: 100%;
    }

    .result {
        top: 60%;
        padding: 40px 30px;
    }

    .result .msg {
        font-size: 36px;
    }

    .result p {
        font-size: 22px;
    }

    .result h3 {
        font-size: 24px;
    }

    h2 {
        font-size: 36px;
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    .game {
        gap: 30px;
    }

    .game .main .tries>div span {
        display: none;
    }

    .game .main .btns {
        gap: 10px;
    }

    .game .main .btns button {
        padding: 10px 16px;
        font-size: 14px;
    }

    .result {
        top: 55%;
        padding: 30px 20px;
    }

    .result .msg {
        font-size: 28px;
    }

    .result h3 {
        font-size: 20px;
    }

    h2 {
        font-size: 28px;
        margin-top: 20px;
        margin-bottom: 20px;
    }
}