@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    background: radial-gradient(circle at center, #1e2941 0%, #101b35 55%, #16223d 100%);
    color: white;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0px;
    box-sizing: border-box;
}

#layout {
    display: flex;
    width: 100%;
    max-width: 1200px;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    min-height: 30vh;
}


.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;
    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;
}

#timer-container {
    margin-bottom: 6px;
}

#center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 14px;
    max-width: 600px;
    width: 100%;
}

#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;
    align-items: center;
    justify-content: center;
}

.orb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(255, 204, 0, 0.6);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.25), inset 0 0 12px rgba(255, 204, 0, 0.08);
    background: rgba(255, 204, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    color: #ffcc00;
    overflow: hidden;
    flex-shrink: 0;
}

.hero-box {
    position: relative;
    width: 80%;
    aspect-ratio: 480 / 270;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #333;
    margin-top: 0px;
    background: rgba(0, 0, 0, 0.25);
}

.gif {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

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

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

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

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

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

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

.result-image {
    backface-visibility: hidden;
}

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

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


.play-btn {
    padding: 18px 0;
    width: 300px;
    font-size: 22px;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    letter-spacing: 5px;
    background: linear-gradient(135deg, #ffcc00 0%, #ff9900 50%, #ffcc00 100%);
    background-size: 200% 200%;
    color: #0a0a14;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 30px rgba(255, 170, 0, 0.6),
        0 0 60px rgba(255, 170, 0, 0.3),
        0 6px 20px rgba(0, 0, 0, 0.5);
    animation: playPulse 2s ease-in-out infinite, gradientShift 3s ease infinite;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

#restart-btn {
    padding: 18px 0;
    width: 300px;
    font-size: 22px;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    letter-spacing: 5px;
    background: linear-gradient(135deg, #b8920a 0%, #8a6500 100%);
    color: #1a1000;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 10px rgba(200, 145, 0, 0.18),
        0 3px 10px rgba(0, 0, 0, 0.5);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: restartBreath 3s ease-in-out infinite;
}

#restart-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 35%;
    height: 200%;
    background: rgba(255, 255, 255, 0.12);
    transform: skewX(-20deg);
    animation: restartShine 4s ease-in-out infinite;
}

@keyframes restartBreath {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(200, 145, 0, 0.15), 0 3px 10px rgba(0, 0, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 18px rgba(200, 145, 0, 0.32), 0 4px 14px rgba(0, 0, 0, 0.5);
    }
}

@keyframes restartShine {
    0% {
        left: -60%;
        opacity: 0;
    }

    25% {
        opacity: 1;
    }

    55% {
        left: 120%;
        opacity: 0;
    }

    100% {
        left: 120%;
        opacity: 0;
    }
}

#restart-btn:hover {
    background: linear-gradient(135deg, #d4a812 0%, #a07800 100%);
    box-shadow: 0 0 22px rgba(210, 155, 0, 0.38), 0 5px 16px rgba(0, 0, 0, 0.5);
    transform: scale(1.03) translateY(-1px);
    transition: all 0.15s ease;
    animation: none;
}

#restart-btn:active {
    background: linear-gradient(135deg, #8a6800 0%, #624a00 100%);
    box-shadow: 0 0 5px rgba(180, 130, 0, 0.1), 0 2px 5px rgba(0, 0, 0, 0.4);
    transform: scale(0.97) translateY(1px);
    transition: all 0.08s ease;
    animation: none;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: rgba(255, 255, 255, 0.25);
    transform: skewX(-20deg);
    animation: playShine 2.5s ease-in-out infinite;
}

.play-btn::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

@keyframes playPulse {

    0%,
    100% {
        box-shadow:
            0 0 25px rgba(255, 170, 0, 0.55),
            0 0 50px rgba(255, 170, 0, 0.25),
            0 6px 20px rgba(0, 0, 0, 0.5);
        transform: scale(1);
    }

    50% {
        box-shadow:
            0 0 45px rgba(255, 170, 0, 0.85),
            0 0 90px rgba(255, 170, 0, 0.45),
            0 8px 30px rgba(0, 0, 0, 0.5);
        transform: scale(1.035);
    }
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes playShine {
    0% {
        left: -60%;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    50% {
        left: 120%;
        opacity: 0;
    }

    100% {
        left: 120%;
        opacity: 0;
    }
}

.play-btn:hover {
    animation: none;
    background: linear-gradient(135deg, #ffe033 0%, #ffaa00 100%);
    box-shadow:
        0 0 50px rgba(255, 180, 0, 0.8),
        0 0 80px rgba(255, 180, 0, 0.4),
        0 8px 25px rgba(0, 0, 0, 0.6);
    transform: scale(1.04) translateY(-2px);
    transition: all 0.15s ease;
}

.play-btn:active {
    animation: none;
    background: linear-gradient(135deg, #e6b800 0%, #cc8800 100%);
    box-shadow:
        0 0 10px rgba(255, 170, 0, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.5);
    transform: scale(0.97) translateY(1px);
    transition: all 0.08s ease;
}

.play-hint {
    display: block;
    font-size: 11px;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    margin-top: -10px;
    font-family: 'Lora', serif;
    transition: opacity 0.3s ease;
}

.play-hint.hidden {
    display: none;
}

.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 {
    display: block;
    width: 80px;
    margin: 10px auto;
    opacity: 0;
    backface-visibility: hidden;
}

.result-image {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.result-image.show {
    opacity: 1;
    transform: scale(1);
}

@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;
}

@media (max-width: 768px) {
    body::after {
        display: 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;
}

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


.seo-section {
    margin-top: 40px;
    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-section-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;
}


#layout {
    min-height: 70vh;
}

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


    #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;
    }

    .play-btn {
        animation: gradientShift 3s ease infinite;
        box-shadow:
            0 0 20px rgba(255, 170, 0, 0.45),
            0 4px 14px rgba(0, 0, 0, 0.5);
    }

    .play-btn::before,
    #restart-btn::before {
        display: none;
    }

    #restart-btn {
        animation: none;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    }

    #abilities,
    #skills,
    #binds-menu,
    .auth-dropdown,
    #top-banner-overlay,
    #underlayout,
    .top-controls {
        backdrop-filter: none;
    }

    #abilities,
    #skills {
        background: rgba(15, 15, 25, 0.92);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    }

    #binds-menu,
    .auth-dropdown {
        background: rgba(12, 12, 20, 0.98);
    }

    #top-banner-overlay {
        background: rgba(0, 0, 0, 0.85);
    }

    #underlayout {
        background: rgba(12, 12, 22, 0.92);
        box-shadow: none;
    }

    .top-controls {
        background: rgba(10, 10, 15, 0.95);
        top: 12px;
        right: 8px;
        padding: 5px;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 4px;
    }

    .top-controls .auth-menu,
    .top-controls .user-panel {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 4px;
        max-width: 100%;
    }

    .top-controls .top-btn {
        padding: 6px 8px;
        font-size: 10px;
        letter-spacing: 0.5px;
    }

    .top-controls .top-btn .btn-icon {
        width: 12px;
        height: 12px;
    }

    #auth-toggle {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }

    html {
        scroll-behavior: auto;
    }

    .fade {
        opacity: 0;
        filter: none;
        transform: scale(1.05);
    }

    .main-header h1,
    #timer-container,
    .panel-title,
    .lb-title,
    #top-banner-title,
    .seo-item h3,
    .seo-block h2 {
        text-shadow: none;
    }
}



.seo-block {
    margin-bottom: 40px;

}

.seo-block h2 {
    font-family: 'Cinzel', serif;
    color: #ffcc00;
    font-size: 1.3rem;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

.seo-block h3 {
    font-size: 1rem;
    margin-top: 15px;
    margin-bottom: 5px;
    color: #ffffff;
}

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


.spell-list {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.spell-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    color: rgba(240, 230, 210, 0.8);
}

.spell-list li strong {
    color: #ffffff;
}


#faq h3 {
    border-left: 2px solid #ffcc00;
    padding-left: 10px;
}


html {
    scroll-behavior: smooth;
}


.faq-item {
    margin-bottom: 20px;
}

.faq-item h3 {
    border-left: 2px solid #ffcc00;
    padding-left: 10px;
    margin-bottom: 5px;
}

.seo-block:first-of-type {
    margin-top: 20px;
}

.seo-block p {
    max-width: 700px;
}

.seo-block:first-of-type p {
    font-size: 1rem;
}

.seo-block {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 25px;
}


#settings-panel {
    margin-top: 10px;
    text-align: center;
}

#settings-btn {
    padding: 10px 18px;
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: bold;
    color: #ffcc00;
    background: rgba(15, 15, 25, 0.8);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s ease;
    text-transform: uppercase;
}

#settings-btn:hover {
    background: #ffcc00;
    color: #0f0f19;
    transform: scale(1.05);
}

#binds-menu {
    margin-top: 12px;
    padding: 15px;
    width: 220px;
    margin-left: auto;
    margin-right: auto;
    background: rgba(15, 15, 25, 0.95);
    border: 1px solid rgba(255, 204, 0, 0.15);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#binds-menu div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
}

#binds-menu input {
    width: 40px;
    padding: 6px;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 204, 0, 0.2);
    border-radius: 6px;
    color: #ffcc00;
    font-weight: bold;
    text-transform: uppercase;
    outline: none;
    transition: 0.2s ease;
}

#binds-menu input:focus {
    border-color: #ffcc00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

.bind-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
}

.bind-actions button {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-transform: uppercase;
    border: 1px solid rgba(255, 204, 0, 0.5);
}

#save-binds {
    background: linear-gradient(180deg, #ffcc00 0%, #b38f00 100%);
    color: #000;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#save-binds:hover {
    background: linear-gradient(180deg, #ffe066 0%, #cca300 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 204, 0, 0.2);
}

#reset-binds {
    background: rgba(255, 204, 0, 0.05);
    color: #ffcc00;
}

#reset-binds:hover {
    background: rgba(255, 204, 0, 0.15);
    border-color: #ffcc00;
}

#reset-binds:active,
#save-binds:active {
    transform: translateY(1px);
}

.top-controls {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px;
    border-radius: 999px;
    background: rgba(10, 10, 15, 0.9);
    border: 1px solid rgba(255, 204, 0, 0.22);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    z-index: 100;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100%;
}

.top-btn {
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    font-family: 'Cinzel', 'Georgia', serif;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: rgb(255, 204, 0);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.2s ease;
}

.top-btn .btn-icon {
    flex-shrink: 0;
}

.top-btn:hover {
    background: rgba(255, 204, 0, 0.08);
    color: #fff;
    transform: translateY(-1px);
}

.top-btn.active {
    color: #ffcc00;
    background: transparent;
    border: 1px solid transparent;
}

.top-btn.active:hover {
    background: rgba(255, 204, 0, 0.08);
    color: #fff;
}

.login-btn {
    border: 1px solid transparent;
    background: transparent;
    color: rgb(255, 204, 0);
    box-shadow: none;
}

.login-btn:hover {
    border-color: transparent;
    background: rgba(255, 204, 0, 0.08);
    box-shadow: none;
    color: #fff;
}

.login-btn.signed-in {
    animation: none;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: #ffcc00;
}

.login-btn.signed-in:hover {
    background: rgba(255, 204, 0, 0.08);
    border-color: transparent;
    color: #fff;
}

.icon-user {
    display: none;
}

.login-btn.signed-in .icon-login {
    display: none;
}

.login-btn.signed-in .icon-user {
    display: inline-flex;
}

.icon-edit-hint {
    display: none;
    opacity: 0.55;
    margin-left: -1px;
    transition: opacity 0.2s ease;
}

.login-btn.signed-in .icon-edit-hint {
    display: inline-flex;
}

.login-btn.signed-in:hover .icon-edit-hint {
    opacity: 1;
}

.lb-title {
    font-family: 'Cinzel', serif;
    color: #ffcc00;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.4);
}

#leaderboard h3 {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    color: rgba(255, 204, 0, 0.6);
    margin: 15px 0 10px 5px;
    letter-spacing: 1px;
}

#leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lb-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

.lb-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-left: 2px solid #ffcc00;
}

.lb-item span:first-child {
    font-family: 'Cinzel', serif;
    font-weight: bold;
    color: rgba(255, 204, 0, 0.8);
    width: 30px;
}

.lb-item span:nth-child(2) {
    flex-grow: 1;
    color: #e0e0e0;
    font-size: 14px;
    margin: 0 10px;
    text-align: left;
}

.lb-item span:last-child {
    font-family: monospace;
    color: #ffcc00;
    font-weight: bold;
    font-size: 14px;
}

.lb-top-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.13) 0%, rgba(255, 215, 0, 0.04) 100%);
    border-left: 2px solid rgba(255, 215, 0, 0.7) !important;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.12), inset 0 0 12px rgba(255, 215, 0, 0.05);
}

.lb-top-1 span:last-child {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.lb-top-1 span:nth-child(2) {
    color: #fff;
    font-weight: 600;
}

.lb-top-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1) 0%, rgba(192, 192, 192, 0.03) 100%);
    border-left: 2px solid rgba(192, 192, 192, 0.5) !important;
    box-shadow: 0 0 14px rgba(192, 192, 192, 0.08), inset 0 0 10px rgba(192, 192, 192, 0.03);
}

.lb-top-2 span:last-child {
    color: #c8c8c8;
    text-shadow: 0 0 6px rgba(200, 200, 200, 0.4);
}

.lb-top-2 span:nth-child(2) {
    color: #eee;
    font-weight: 500;
}

.lb-top-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1) 0%, rgba(205, 127, 50, 0.03) 100%);
    border-left: 2px solid rgba(205, 127, 50, 0.5) !important;
    box-shadow: 0 0 12px rgba(205, 127, 50, 0.08), inset 0 0 8px rgba(205, 127, 50, 0.03);
}

.lb-top-3 span:last-child {
    color: #cd8c46;
    text-shadow: 0 0 6px rgba(205, 127, 50, 0.4);
}

.lb-top-3 span:nth-child(2) {
    color: #ddd;
}

.lb-medal {
    font-size: 16px;
    width: 30px;
    text-align: center;
    line-height: 1;
}

.lb-me {
    margin-top: 10px;
    padding-top: 5px;
    border-top: 1px solid rgba(255, 204, 0, 0.1);
    color: #fff;
    font-size: 14px;
}

.lb-item.me {
    background: rgba(255, 204, 0, 0.15);
    border: 1px solid rgba(255, 204, 0, 0.4);
    box-shadow: inset 0 0 10px rgba(255, 204, 0, 0.1);
}

.lb-item.me span:nth-child(2) {
    font-weight: bold;
    color: #fff;
}

.auth-menu {
    position: relative;
}

.auth-dropdown {
    position: absolute;
    top: 52px;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
    padding: 10px;
    background: rgba(15, 15, 25, 0.98);
    border: 1px solid rgba(255, 204, 0, 0.15);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    z-index: 999;
}

.auth-dropdown.show {
    display: flex;
}

.auth-dropdown button {
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: white;
    cursor: pointer;
    transition: 0.2s ease;
}

.auth-dropdown button:hover {
    background: rgba(255, 204, 0, 0.08);
}

.user-panel {
    position: relative;
    display: flex;
    gap:8px;
    align-items: center;
}

.user-panel > .top-btn:not(:first-child) {
    position: relative;
}

.user-panel > .top-btn:not(:first-child)::before {
    content: "";
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.14);
}


.nickname-popup {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: #0b0c10;
    border: 1px solid rgba(255, 204, 0, 0.25);
    border-radius: 10px;
    padding: 10px;
    z-index: 999;
}

#nickname-input {
    width: 100%;
    box-sizing: border-box;
    background: #0f1116;
    border: 1px solid #2a2a2a;
    color: #fff;
    padding: 8px;
    border-radius: 6px;
    outline: none;
}

#save-nickname {
    width: 100%;
    margin-top: 8px;
    background: #ffcc00;
    border: none;
    border-radius: 6px;
    padding: 8px;
    font-weight: bold;
    cursor: pointer;
}

.logout-btn {
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255, 154, 130, 0.85);
}

.logout-btn:hover {
    background: rgba(255, 70, 70, 0.1);
    border-color: transparent;
    color: #ffb19e;
}

.logout-btn .btn-icon {
    opacity: 0.9;
}

#underlayout {
    display: grid;
    grid-template-columns: 260px 1fr 260px;
    gap: 20px;
    width: 100%;
    max-width: 1060px;
    margin: 0 auto;
    padding: 36px 24px;
    position: relative;
    border: 1px solid rgba(255, 204, 0, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 0 40px rgba(255, 204, 0, 0.02);
    align-items: stretch;
}

#rank-panel,
#leaderboard-panel,
#profile-panel {
    background: rgba(255, 255, 255, 0.018);
    border: 1px solid rgba(255, 204, 0, 0.09);
    border-radius: 12px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
}

.panel-title {
    font-family: 'Cinzel', serif;
    color: #ffcc00;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 204, 0, 0.15);
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.35);
}

.rank-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    min-height: 0;
}

.rank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    cursor: default;
}

.rank-row:hover {
    background: rgba(255, 204, 0, 0.05);
    border-color: rgba(255, 204, 0, 0.18);
    transform: translateX(3px);
}

.rank-row.my-rank {
    background: rgba(255, 204, 0, 0.1);
    border-color: rgba(255, 204, 0, 0.4);
    box-shadow: 0 0 14px rgba(255, 204, 0, 0.1);
}

.rank-badge-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
    flex-shrink: 0;
}

.rank-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.rank-name {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    color: #e8dcc8;
    letter-spacing: 0.5px;
}

.rank-time {
    font-family: monospace;
    font-size: 12px;
    color: rgba(255, 204, 0, 0.7);
    letter-spacing: 1px;
}

.lb-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 4px;
}

.lb-tab {
    flex: 1;
    padding: 7px 4px;
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 204, 0, 0.5);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lb-tab:hover {
    color: rgba(255, 204, 0, 0.85);
    background: rgba(255, 204, 0, 0.06);
    transform: none;
}

.lb-tab.active {
    color: #ffcc00;
    background: rgba(255, 204, 0, 0.12);
    border: 1px solid rgba(255, 204, 0, 0.25);
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.4);
}

.lb-tab-content {
    display: none;
    flex-direction: column;
    gap: 3px;
}

.lb-tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-shrink: 0;
    padding: 12px;
    background: rgba(255, 204, 0, 0.04);
    border: 1px solid rgba(255, 204, 0, 0.1);
    border-radius: 10px;
}

.profile-rank-badge-wrap {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border: 1px solid rgba(255, 204, 0, 0.2);
    box-shadow: 0 0 16px rgba(255, 204, 0, 0.12);
}

.profile-rank-badge-wrap img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(255, 204, 0, 0.3));
    transition: transform 0.4s ease;
}

.profile-rank-badge-wrap img:hover {
    transform: scale(1.12) rotate(5deg);
}

.profile-name-wrap {
    flex: 1;
    min-width: 0;
}

.profile-nickname {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-rank-label {
    font-size: 11px;
    color: rgba(255, 204, 0, 0.7);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 3px;
    font-family: 'Cinzel', serif;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.stat-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 204, 0, 0.08);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
}

.stat-card:hover {
    border-color: rgba(255, 204, 0, 0.2);
    background: rgba(255, 204, 0, 0.04);
}

.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.4);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.profile-sessions-label {
    font-size: 10px;
    color: rgba(255, 204, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    font-family: 'Cinzel', serif;
    flex-shrink: 0;
}

.profile-sessions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 0;
}

#sessions-chart {
    width: 100%;
    height: 100%;
    min-height: 60px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 204, 0, 0.07);
    display: block;
}

.profile-sign-in-hint {
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    font-style: italic;
    font-family: 'Lora', serif;
    padding-top: 8px;
    letter-spacing: 0.5px;
}

.lb-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

.lb-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-left: 2px solid #ffcc00;
}

.lb-item span:first-child {
    font-family: 'Cinzel', serif;
    font-weight: bold;
    color: rgba(255, 204, 0, 0.8);
    width: 30px;
}

.lb-item span:nth-child(2) {
    flex-grow: 1;
    color: #e0e0e0;
    font-size: 14px;
    margin: 0 10px;
    text-align: left;
}

.lb-item span:last-child {
    font-family: monospace;
    color: #ffcc00;
    font-weight: bold;
    font-size: 14px;
}

.lb-top-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.13) 0%, rgba(255, 215, 0, 0.04) 100%);
    border-left: 2px solid rgba(255, 215, 0, 0.7) !important;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.12), inset 0 0 12px rgba(255, 215, 0, 0.05);
}

.lb-top-1 span:last-child {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.lb-top-1 span:nth-child(2) {
    color: #fff;
    font-weight: 600;
}

.lb-top-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1) 0%, rgba(192, 192, 192, 0.03) 100%);
    border-left: 2px solid rgba(192, 192, 192, 0.5) !important;
    box-shadow: 0 0 14px rgba(192, 192, 192, 0.08), inset 0 0 10px rgba(192, 192, 192, 0.03);
}

.lb-top-2 span:last-child {
    color: #c8c8c8;
    text-shadow: 0 0 6px rgba(200, 200, 200, 0.4);
}

.lb-top-2 span:nth-child(2) {
    color: #eee;
    font-weight: 500;
}

.lb-top-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1) 0%, rgba(205, 127, 50, 0.03) 100%);
    border-left: 2px solid rgba(205, 127, 50, 0.5) !important;
    box-shadow: 0 0 12px rgba(205, 127, 50, 0.08), inset 0 0 8px rgba(205, 127, 50, 0.03);
}

.lb-top-3 span:last-child {
    color: #cd8c46;
    text-shadow: 0 0 6px rgba(205, 127, 50, 0.4);
}

.lb-top-3 span:nth-child(2) {
    color: #ddd;
}

.lb-medal {
    font-size: 16px;
    width: 30px;
    text-align: center;
    line-height: 1;
}

.lb-item.me {
    background: rgba(255, 204, 0, 0.15);
    border: 1px solid rgba(255, 204, 0, 0.4);
    box-shadow: inset 0 0 10px rgba(255, 204, 0, 0.1);
}

.lb-item.me span:nth-child(2) {
    font-weight: bold;
    color: #fff;
}

@media (max-width: 900px) {
    #underlayout {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    #rank-panel {
        grid-column: 1;
        grid-row: 2;
    }

    #leaderboard-panel {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    #profile-panel {
        grid-column: 2;
        grid-row: 2;
    }
}

@media (max-width: 600px) {
    #underlayout {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px 12px;
    }

    #rank-panel,
    #leaderboard-panel,
    #profile-panel {
        grid-column: 1;
        grid-row: auto;
    }

    .profile-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}




#leaderboard {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 204, 0, 0.1);
    border-radius: 10px;
    padding: 12px;
}

.lb-title {
    color: #ffcc00;
    text-align: center;
    margin-bottom: 10px;
}

#rankings {
    flex: 1;
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 204, 0, 0.08);
    border-radius: 10px;
    padding: 12px;
}

#rankings h2 {
    color: #ffcc00;
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

#rankings div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    transition: background 0.2s ease;
}

#rankings div:last-child {
    border-bottom: none;
}

#rankings div:hover {
    background: rgba(255, 204, 0, 0.03);
}

#rankings div:hover strong {
    color: #ffffff;
}

#rankings strong {
    color: #e2e8f0;
    font-weight: 500;
    transition: color 0.2s ease;
}

#rankings span {
    color: rgba(255, 204, 0, 0.8);
    font-family: monospace;
}

#right-panel {
    flex: 1;
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 204, 0, 0.08);
    border-radius: 10px;
    padding: 12px;
}

#right-panel h2 {
    color: #ffcc00;
    text-align: center;
    margin-top: 0;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

#right-panel .patch-version {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

#right-panel div:not(.patch-version) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    transition: background 0.2s ease;
}

#right-panel div:not(.patch-version):last-child {
    border-bottom: none;
}

#right-panel div:not(.patch-version):hover {
    background: rgba(255, 204, 0, 0.04);
}

#right-panel strong {
    color: #ffcc00;
    font-weight: 600;
    font-size: 13px;
}

#right-panel span {
    color: #ffffff;
    font-size: 12px;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}


#top-banner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

#top-banner-overlay.show {
    opacity: 1;
}

#top-banner {
    background: linear-gradient(160deg, rgba(20, 21, 30, 0.98), rgba(10, 11, 18, 0.99));
    border: 1px solid rgba(255, 204, 0, 0.35);
    border-radius: 16px;
    padding: 32px 28px 24px;
    max-width: 420px;
    width: 100%;
    box-shadow:
        0 0 60px rgba(255, 204, 0, 0.12),
        0 20px 60px rgba(0, 0, 0, 0.8);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

#top-banner-overlay.show #top-banner {
    transform: translateY(0) scale(1);
}

#top-banner-title {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 700;
    color: #ffcc00;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
    margin-bottom: 14px;
}

#top-banner-body {
    font-family: 'Lora', serif;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(240, 230, 210, 0.8);
    margin-bottom: 24px;
}

#top-banner-body strong {
    color: #ffcc00;
    font-weight: 600;
}

#top-banner-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-banner-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: filter 0.2s ease, transform 0.15s ease;
    width: 100%;
}

.top-banner-oauth img {
    flex-shrink: 0;
}

#top-banner-google {
    background: #ffffff;
    color: #1a1a1a;
}

#top-banner-google:hover {
    filter: brightness(0.93);
    transform: scale(1.02);
}

.top-banner-discord-btn {
    background: #5865f2;
    color: #ffffff;
}

.top-banner-discord-btn:hover {
    filter: brightness(0.9);
    transform: scale(1.02);
}

#top-banner-dismiss {
    padding: 10px 20px;
    background: transparent;
    color: rgba(255, 255, 255, 0.35);
    font-size: 12px;
    border: none;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
    text-decoration: underline;
    text-underline-offset: 3px;
}

#top-banner-dismiss:hover {
    color: rgba(255, 255, 255, 0.65);
    transform: none;
}

@media (max-width: 480px) {
    #top-banner {
        padding: 24px 18px 20px;
    }

    #top-banner-title {
        font-size: 18px;
    }

    #top-banner-body {
        font-size: 14px;
    }
}

.orb-empty {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(255, 204, 0, 0.35);
    background: transparent;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.08), inset 0 0 8px rgba(255, 204, 0, 0.04);
}

.play-hint,
.restart-hint {
    display: block;
    font-size: 11px;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    margin-top: -10px;
    font-family: 'Lora', serif;
}

.play-hint.hidden {
    display: none;
}

#touch-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.touch-key {
  width: 70px;
  height: 70px;
  font-size: 22px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: #ffcc00;
  background: rgba(15, 15, 25, 0.8);
  border: 1px solid rgba(255, 204, 0, 0.4);
  border-radius: 10px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.touch-key-r {
  background: rgba(255, 204, 0, 0.15);
  border-color: rgba(255, 204, 0, 0.7);
}

.touch-key:active {
  background: rgba(255, 204, 0, 0.25);
  transform: scale(0.95);
}

.play-btn, #restart-btn {
  max-width: 300px;
  width: 90%;
}

@media (max-width: 768px) {
  #ability-description {
    height: auto !important;
    min-height: 40px;
  }
  
  #abilities:hover, #skills:hover {
    transform: none;
  }
  
  .ability:active, .skill:active {
    background: rgba(255, 204, 0, 0.1);
  }
  
  button {
    touch-action: manipulation;
  }
}

#streak-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    background: linear-gradient(160deg, rgba(20, 21, 30, 0.98), rgba(10, 11, 18, 0.99));
    border: 1px solid rgba(255, 154, 30, 0.4);
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow:
        0 0 30px rgba(255, 120, 30, 0.12),
        0 12px 30px rgba(0, 0, 0, 0.6);
    transform: translateY(16px) scale(0.94);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    pointer-events: none;
}

#streak-toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
    animation: streakGlowBreathe 2.6s ease-in-out 0.4s infinite;
}

#streak-toast.show::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 220, 160, 0.16) 48%, transparent 62%);
    transform: translateX(-130%);
    pointer-events: none;
    animation: streakShine 1.1s ease-out 0.2s 1;
}

@keyframes streakGlowBreathe {
    0%, 100% {
        box-shadow:
            0 0 28px rgba(255, 120, 30, 0.12),
            0 12px 30px rgba(0, 0, 0, 0.6);
        border-color: rgba(255, 154, 30, 0.4);
    }
    50% {
        box-shadow:
            0 0 42px rgba(255, 145, 40, 0.24),
            0 12px 30px rgba(0, 0, 0, 0.6);
        border-color: rgba(255, 184, 70, 0.6);
    }
}

@keyframes streakShine {
    to { transform: translateX(130%); }
}

#streak-toast .streak-icon {
    position: relative;
    width: 26px;
    height: 30px;
    flex-shrink: 0;
}

#streak-toast .streak-flame {
    width: 100%;
    height: 100%;
    display: block;
    transform-origin: 50% 96%;
    animation: flameGlowPulse 2.4s ease-in-out infinite;
}

#streak-toast .streak-flame .flame-outer {
    transform-origin: 50% 100%;
    animation: flameFlickerOuter 2.1s ease-in-out infinite;
}

#streak-toast .streak-flame .flame-inner {
    transform-origin: 50% 100%;
    animation: flameFlickerInner 1.5s ease-in-out infinite;
}

@keyframes flameGlowPulse {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(255, 110, 30, 0.55)); }
    50% { filter: drop-shadow(0 0 10px rgba(255, 150, 40, 0.85)); }
}

@keyframes flameFlickerOuter {
    0%, 100% { transform: scaleY(1) scaleX(1) translateY(0) rotate(0deg); }
    22% { transform: scaleY(1.06) scaleX(0.96) translateY(-0.5px) rotate(-1.5deg); }
    48% { transform: scaleY(0.95) scaleX(1.05) translateY(0.4px) rotate(1.5deg); }
    74% { transform: scaleY(1.04) scaleX(0.97) translateY(-0.3px) rotate(-1deg); }
}

@keyframes flameFlickerInner {
    0%, 100% { opacity: 0.9; transform: scaleY(1) translateY(0); }
    35% { opacity: 1; transform: scaleY(1.1) translateY(-0.5px); }
    65% { opacity: 0.82; transform: scaleY(0.92) translateY(0.3px); }
}

#streak-toast .streak-ember {
    position: absolute;
    left: 11px;
    bottom: 6px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #ffb347;
    box-shadow: 0 0 4px rgba(255, 160, 50, 0.9);
    opacity: 0;
    animation: emberRise 2.8s ease-in infinite;
}

#streak-toast .streak-ember:nth-child(2) {
    left: 6px;
    width: 2px;
    height: 2px;
    animation-delay: 0.9s;
}

#streak-toast .streak-ember:nth-child(3) {
    left: 16px;
    width: 2px;
    height: 2px;
    animation-delay: 1.8s;
}

@keyframes emberRise {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    12% { opacity: 1; }
    75% { opacity: 0.35; }
    100% { transform: translateY(-22px) scale(0.3); opacity: 0; }
}

#streak-toast .streak-text {
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}

#streak-toast .streak-count {
    font-family: monospace;
    font-size: 18px;
    font-weight: 700;
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.4);
}

#streak-toast .streak-label {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 700;
    color: #ffe9b0;
    letter-spacing: 0.5px;
}

#streak-toast .streak-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
    cursor: pointer;
    margin-left: 2px;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

#streak-toast .streak-close:hover {
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 480px) {
    #streak-toast {
        right: 12px;
        bottom: 12px;
        left: 12px;
        justify-content: center;
        padding: 12px 14px;
    }

    #streak-toast .streak-label {
        font-size: 12px;
        white-space: normal;
    }
}