.ach-toast {
    position: fixed;
    bottom: 100px;
    right: 16px;
    z-index: 9000;
    width: 280px;
    max-width: calc(100vw - 32px);
    background: linear-gradient(135deg, #1a1a2e, #0d0d1e);
    border: 2px solid var(--gold);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(240, 192, 64, 0.2);
    opacity: 0;
    transform: translateX(60px) scale(0.9);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    overflow: hidden;
}

.ach-toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), #ffd700, var(--gold));
    animation: achShine 1.5s ease infinite;
}

@keyframes achShine {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.ach-toast--visible {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.ach-toast-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.ach-toast-icon {
    font-size: 2rem;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.ach-toast-text {
    flex: 1;
    min-width: 0;
}

.ach-toast-title {
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2px;
}

.ach-toast-name {
    font-size: 0.95rem;
    font-weight: 900;
    color: white;
    word-break: break-word;
}

.ach-toast-desc {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
    word-break: break-word;
}

#achievements {
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.ach-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ach-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: bold;
}

.ach-progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.ach-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), #ffd700);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ach-category-title {
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 6px 0 4px;
    border-bottom: 2px solid var(--red);
    margin: 8px 0 6px;
}

.ach-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.ach-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: var(--radius);
    border: 2px solid;
    transition: transform var(--t), box-shadow var(--t);
    min-width: 0;
}

.ach-item.unlocked {
    background: linear-gradient(135deg, #fffde7, #fff8e1);
    border-color: var(--gold);
    box-shadow: 0 3px 0 var(--gold-dark);
}

.ach-item.unlocked:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(240, 192, 64, 0.3);
}

.ach-item.locked {
    background: #f5f5f5;
    border-color: #ddd;
    filter: grayscale(1);
    opacity: 0.55;
}

.ach-item-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.ach-item-info {
    flex: 1;
    min-width: 0;
}

.ach-item-name {
    font-size: 0.78rem;
    font-weight: 900;
    color: #333;
    word-break: break-word;
    overflow-wrap: break-word;
}

.ach-item.unlocked .ach-item-name {
    color: #7a6000;
}

.ach-item-desc {
    font-size: 0.62rem;
    color: #999;
    margin-top: 2px;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.ach-item.unlocked .ach-item-desc {
    color: #a07800;
}

body.inverse-mode .image-box {
    background: #000 !important;
}

body.inverse-mode #image,
body.inverse-mode #timerImage {
    filter: brightness(100) invert(1) !important;
}

body.inverse-mode .hint-box {
    background: #1a1a00;
    border-color: var(--gold);
    color: var(--gold);
}

body.inverse-mode #choices button,
body.inverse-mode #timerChoices button {
    background: #111;
    color: #fff;
    border-color: #444;
}

.crown-overlay {
    position: relative;
    display: inline-block;
}

.crown-animated {
    display: inline-block;
    animation: crownBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px #ffd700) drop-shadow(0 0 16px var(--gold));
    font-size: 2rem;
}

@keyframes crownBounce {

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

    25% {
        transform: rotate(8deg) scale(1.15);
    }

    50% {
        transform: rotate(-4deg) scale(1.05);
    }

    75% {
        transform: rotate(6deg) scale(1.12);
    }
}

.profile-name.golden-pseudo {
    background: linear-gradient(90deg, var(--gold), #ffd700, var(--gold-dark), #ffd700, var(--gold));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldenShimmer 2s linear infinite;
}

.pseudo-golden {
    background: linear-gradient(90deg, var(--gold), #ffd700, var(--gold-dark), #ffd700, var(--gold));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldenShimmer 2s linear infinite;
    font-weight: 900;
}

@keyframes goldenShimmer {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

#achievementsMenuBtn .sub {
    background: linear-gradient(135deg, #2a1a00, #3a2a00);
    border-color: var(--gold);
    color: var(--gold);
}

@media (max-width: 600px) {
    .ach-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 380px) {
    .ach-item {
        padding: 8px;
    }

    .ach-item-icon {
        font-size: 1.3rem;
    }

    .ach-item-name {
        font-size: 0.72rem;
    }

    .ach-toast {
        width: 240px;
        right: 8px;
        bottom: 80px;
    }
}