body {
    background: radial-gradient(circle at center, #1a1a2e 0%, #0f0f1e 100%);
    color: white;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#layout {
    display: flex;
    width: 100%;
    max-width: 1200px;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.lang-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 204, 0, 0.6);
    border-radius: 6px;
    background: rgba(15, 15, 25, 0.8);
    color: #ffcc00;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.2s ease;
    z-index: 10;
    text-decoration: none;
}

.lang-switch:hover {
    background: #ffcc00;
    color: #0f0f19;
    transform: scale(1.05);
}

.side-title {
    text-align: center;
    opacity: 0.6;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

#abilities,
#skills {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-radius: 12px;
    background: rgba(15, 15, 25, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
    transition: transform 0.3s ease, border 0.3s ease;
    backface-visibility: hidden;
    transform: translateZ(0);
}

#center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 600px;
}

#timer-container {
    font-size: 42px;
    font-weight: bold;
    color: #ffcc00;
    min-height: 50px;
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.6);
    letter-spacing: 2px;
}

#orb-container {
    display: flex;
    gap: 10px;
    height: 65px;
}

.orb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.hero-box {
    position: relative;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #333;
}

.gif {
    width: 100%;
    display: block;
}

#target-spell-display {
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spell-card {
    text-align: center;
}

.result-screen {
    animation: fadeIn 0.5s ease;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.spell-card img {
    width: 80px;
    border: 2px solid #ffcc00;
    border-radius: 5px;
    margin-bottom: 5px;
}

.result-image {
    will-change: opacity, transform;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    color: white;
    transition: transform 0.1s;
}

button:hover {
    transform: scale(1.05);
}

.play-btn,
#restart-btn {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    background: #ffcc00;
    color: black;
    border-radius: 8px;
}

.play-btn:hover {
    background: #e6b800;
}

.ability,
.skill {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.ability img,
.skill img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
}

.key,
.combo {
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 3px;
    color: #ffcc00;
}

.name {
    font-size: 13px;
    color: #ccc;
}

.result-image {
    width: 80px;
    margin: 5px auto;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
}

.result-image.show {
    animation: rankAppear 2s ease forwards;
}

@keyframes rankAppear {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#abilities:hover,
#skills:hover {
    border: 1px solid rgba(255, 204, 0, 0.3);
    background: rgba(30, 30, 50, 0.7);
    transform: translateY(-5px);
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
}

#ability-description {
    max-width: 500px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Lora', serif;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: rgba(240, 230, 210, 0.6);
    padding: 0 25px;
    margin: 0 auto 10px auto;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0) 100%);
    border-top: 1px solid rgba(196, 160, 82, 0.15);
    border-bottom: 1px solid rgba(196, 160, 82, 0.15);
    backdrop-filter: blur(4px);
    box-sizing: border-box;
    overflow: visible;
    transition: all 0.5s ease;
}

#ability-description:not(:empty) {
    color: rgba(240, 230, 210, 0.85);
}

.fade {
    opacity: 0;
    filter: blur(8px);
    transform: scale(1.5);
}

.main-header {
    text-align: center;
    margin-top: -10px;
    margin-bottom: 5px;
}

.main-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    color: #ffcc00;
    letter-spacing: 4px;
    margin: 0;
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
    font-weight: 700;
}

.sub-header {
    font-family: 'Lora', serif;
    font-size: 10px;
    color: rgba(240, 230, 210, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 15px;
}

#abilities,
#skills,
#ability-description {
    will-change: transform;
}

#ability-description {
    font-size: 13px;
    padding: 5px 20px;
    min-height: 35px;
    margin-bottom: 10px;
    transform: scale(1.3);
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    transition: transform 1s ease, opacity 0.5s ease, filter 0.5s ease;
}


.seo-section {
    margin-top: 80px;
    padding: 60px 20px;
    background: linear-gradient(to bottom, transparent, rgba(15, 15, 25, 0.9));
    border-top: 1px solid rgba(255, 204, 0, 0.1);
    width: 100%;
    display: flex;
    justify-content: center;
}

.seo-content {
    max-width: 1000px;
    width: 100%;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.seo-item h3 {
    font-family: 'Cinzel', serif;
    color: #ffcc00;
    font-size: 1.2rem;
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

.seo-item p {
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(240, 230, 210, 0.7);
    margin: 0;
}

.seo-item strong {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.seo-footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
}

body {
    height: auto;
    min-height: 100vh;
    flex-direction: column;
    overflow-x: hidden;
}

#layout {
    min-height: 80vh;
}

@media (max-width: 768px) {
    #layout {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 50px 10px 20px 10px;
        height: auto;
        min-height: 100vh;
        gap: 10px;
    }

    .lang-switch {
        top: 10px;
        right: 10px;
        position: absolute;
    }

    #skills {
        order: 1;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
        width: 100%;
        max-width: 360px;
        padding: 10px;
        box-sizing: border-box;
        margin: 0 auto;
    }

    .skill {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1/1;
    }

    .skill img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    #center {
        order: 2;
        width: 100%;
        margin-top: 10px;
    }

    .main-header h1 {
        font-size: 18px;
        line-height: 1.2;
        margin-bottom: 10px;
    }

    #timer-container {
        font-size: 32px;
        min-height: 40px;
    }

    #orb-container {
        justify-content: center;
        height: 40px;
        margin-bottom: 10px;
    }

    .orb {
        width: 35px;
        height: 35px;
    }

    .hero-box {
        width: 90%;
        max-width: 300px;
    }

    #ability-description {
        order: 3;
        width: 100%;
        font-size: 12px;
        min-height: 40px;
        padding: 5px;
        border: none;
        background: none;
        transform: none;
    }

    #abilities {
        order: 4;
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        width: 100%;
        padding: 10px 0;
        background: rgba(0, 0, 0, 0.3);
    }

    .ability {
        width: 50px !important;
        height: 50px !important;
    }

    .side-title,
    .name,
    .key,
    .combo,
    .sub-header {
        display: none !important;
    }

    .seo-section {
        margin-top: 20px;
    }

    * {
        box-sizing: border-box;
    }
}