/* ========================================= */
/*  ГЛАВНОЕ МЕНЮ — FNF + RED + ПЕПЕЛ         */
/* ========================================= */
/* === КОНТЕЙНЕР === */
.menu-container {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    background: linear-gradient(160deg, #1a0f30 0%, #644b26 40%, #7c1f20 100%);
    font-family: var(--font-pixel);
    overflow: hidden;
    z-index: 1000;
}

.menu-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
    z-index: 0;
}

.menu-container::after { display: none; }
.menu-container.hidden { opacity: 0; visibility: hidden; }

/* === ПЕПЕЛ === */
.ash-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.ash {
    position: absolute;
    top: -10px;
    width: 3px;
    height: 3px;
    background: #aaa;
    border-radius: 50%;
    opacity: 0;
    animation: ashFall linear infinite;
}

.ash.small { width: 2px; height: 2px; background: #888; }
.ash.big { width: 5px; height: 3px; background: #bbb; border-radius: 1px; }
.ash.glow {
    width: 2px;
    height: 2px;
    background: #ff6633;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 102, 51, 0.8), 0 0 12px rgba(255, 60, 20, 0.4);
}

@keyframes ashFall {
    0%   { opacity: 0; transform: translateX(0) rotate(0deg); }
    8%   { opacity: 0.8; }
    40%  { opacity: 0.5; }
    100% { opacity: 0; transform: translateX(var(--ash-drift, 30px)) rotate(var(--ash-rotate, 180deg)); top: 105%; }
}

.ash:nth-child(1)  { left: 5%;  animation-duration: 7s;   animation-delay: 0s;   --ash-drift: 25px;  --ash-rotate: 120deg; }
.ash:nth-child(2)  { left: 12%; animation-duration: 9s;   animation-delay: 1.2s; --ash-drift: -20px; --ash-rotate: 200deg; }
.ash:nth-child(3)  { left: 20%; animation-duration: 8s;   animation-delay: 0.5s; --ash-drift: 40px;  --ash-rotate: 150deg; }
.ash:nth-child(4)  { left: 28%; animation-duration: 6s;   animation-delay: 2s;   --ash-drift: -15px; --ash-rotate: 260deg; }
.ash:nth-child(5)  { left: 35%; animation-duration: 7.5s; animation-delay: 0.3s; --ash-drift: 30px;  --ash-rotate: 90deg; }
.ash:nth-child(6)  { left: 42%; animation-duration: 8.5s; animation-delay: 1.5s; --ash-drift: -35px; --ash-rotate: 180deg; }
.ash:nth-child(7)  { left: 50%; animation-duration: 9.5s; animation-delay: 0.8s; --ash-drift: 20px;  --ash-rotate: 300deg; }
.ash:nth-child(8)  { left: 58%; animation-duration: 7s;   animation-delay: 2.5s; --ash-drift: -25px; --ash-rotate: 140deg; }
.ash:nth-child(9)  { left: 65%; animation-duration: 8s;   animation-delay: 0.2s; --ash-drift: 35px;  --ash-rotate: 220deg; }
.ash:nth-child(10) { left: 72%; animation-duration: 10s;  animation-delay: 1.8s; --ash-drift: -40px; --ash-rotate: 170deg; }
.ash:nth-child(11) { left: 80%; animation-duration: 7.8s; animation-delay: 0.6s; --ash-drift: 15px;  --ash-rotate: 280deg; }
.ash:nth-child(12) { left: 88%; animation-duration: 9s;   animation-delay: 3s;   --ash-drift: -30px; --ash-rotate: 110deg; }
.ash:nth-child(13) { left: 95%; animation-duration: 8.2s; animation-delay: 1.2s; --ash-drift: 20px;  --ash-rotate: 200deg; }
.ash:nth-child(14) { left: 8%;  animation-duration: 11s;  animation-delay: 2.2s; --ash-drift: -10px; --ash-rotate: 340deg; }
.ash:nth-child(15) { left: 33%; animation-duration: 6.5s; animation-delay: 0.9s; --ash-drift: 45px;  --ash-rotate: 160deg; }
.ash:nth-child(16) { left: 48%; animation-duration: 9.2s; animation-delay: 3.5s; --ash-drift: -20px; --ash-rotate: 240deg; }
.ash:nth-child(17) { left: 55%; animation-duration: 7.3s; animation-delay: 1.7s; --ash-drift: 28px;  --ash-rotate: 130deg; }
.ash:nth-child(18) { left: 75%; animation-duration: 10s;  animation-delay: 0.4s; --ash-drift: -35px; --ash-rotate: 290deg; }
.ash:nth-child(19) { left: 85%; animation-duration: 8.8s; animation-delay: 2.8s; --ash-drift: 18px;  --ash-rotate: 185deg; }
.ash:nth-child(20) { left: 15%; animation-duration: 7.7s; animation-delay: 1.3s; --ash-drift: -22px; --ash-rotate: 250deg; }

/* === ЗАГОЛОВОК === */
.graffiti-sloppy-style,
.graffiti-real-style {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 7vw, 4rem);
    text-transform: uppercase;
    color: #fff;
    position: relative;
    z-index: 2;
    text-align: center;
    text-shadow:
        0 0 10px var(--color-red-glow),
        0 0 30px var(--color-red-glow),
        0 0 60px rgba(255, 34, 68, 0.3),
        4px 4px 0 #000;
    animation: titlePulse 2.5s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 10px var(--color-red-glow), 0 0 30px var(--color-red-glow), 0 0 60px rgba(255, 34, 68, 0.3), 4px 4px 0 #000;
    }
    50% {
        transform: scale(1.02);
        text-shadow: 0 0 20px var(--color-red-glow), 0 0 50px var(--color-red-glow), 0 0 90px rgba(255, 34, 68, 0.5), 4px 4px 0 #000;
    }
}

/* === ВАЛЮТА === */
.currency-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    max-width: 280px;
    width: 100%;
    z-index: 2;
    backdrop-filter: blur(8px);
}

.currency-card::before { display: none; }

.currency-item {
    font-family: var(--font-pixel);
    font-size: 0.9rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
    animation: none;
}

.currency-item.interactive {
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
    animation: none;
}

.currency-item.interactive:hover { background: rgba(255, 255, 255, 0.1); }
.currency-item .coin-icon img { width: 20px; height: 20px; vertical-align: middle; }

/* === КНОПКИ — сплошная заливка === */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    max-width: 300px;
    width: 100%;
    z-index: 2;
}

.menu-btn {
    font-family: var(--font-pixel);
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    border: 4px solid #000;
    padding: 1rem 1.2rem;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
    transition: all 0.12s ease;
    position: relative;
    overflow: hidden;
    animation: btnAppear 0.5s ease-out forwards;
    opacity: 0;

    /* По умолчанию — голубая */
    background: #00ddff;
    color: #0a0a1a;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.2);
}

.menu-btn::before,
.menu-btn::after { display: none; }

.menu-btn:nth-child(1) { animation-delay: 0.05s; }
.menu-btn:nth-child(2) { animation-delay: 0.15s; }
.menu-btn:nth-child(3) { animation-delay: 0.25s; }
.menu-btn:nth-child(4) { animation-delay: 0.35s; }
.menu-btn:nth-child(5) { animation-delay: 0.45s; }

@keyframes btnAppear {
    0%  { opacity: 0; transform: translateY(20px) scale(0.95); }
    70% { transform: translateY(-3px) scale(1.01); }
    100%{ opacity: 1; transform: translateY(0) scale(1); }
}

/* Голубая hover/active */
.menu-btn:hover {
    background: #33e5ff;
    transform: translateY(-3px);
    box-shadow: 5px 7px 0 #000, 0 0 25px rgba(0, 221, 255, 0.4);
}

.menu-btn:active {
    background: #00b8d4;
    transform: translate(3px, 3px);
    box-shadow: 1px 1px 0 #000;
}

/* КРАСНАЯ — "Начать игру" */
.menu-btn.primary {
    background: #ff2244;
    color: #fff;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
    box-shadow: 4px 4px 0 #000, 0 0 20px rgba(255, 34, 68, 0.4);
    font-size: 0.95rem;
}

.menu-btn.primary:hover {
    background: #ff4466;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 5px 7px 0 #000, 0 0 35px rgba(255, 34, 68, 0.5);
}

.menu-btn.primary:active {
    background: #cc1133;
    transform: translate(3px, 3px);
    box-shadow: 1px 1px 0 #000;
}

/* ЗОЛОТАЯ — "Экипировка" */
.menu-btn.secondary {
    background: #ffcc00;
    color: #1a1a1a;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.3);
    box-shadow: 4px 4px 0 #000, 0 0 12px rgba(255, 204, 0, 0.3);
}

.menu-btn.secondary:hover {
    background: #ffdd44;
    transform: translateY(-3px);
    box-shadow: 5px 7px 0 #000, 0 0 25px rgba(255, 204, 0, 0.4);
}

.menu-btn.secondary:active {
    background: #e6b800;
    transform: translate(3px, 3px);
    box-shadow: 1px 1px 0 #000;
}

/* FOCUS */
.menu-btn:focus {
    outline: none;
    box-shadow: 4px 4px 0 #000, 0 0 0 3px #fff;
}

/* === МОДАЛКА === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.25s;
    z-index: 1500; /* модалка меню */
}

.modal-overlay::before { display: none; }
.modal-overlay:not(.hidden) { opacity: 1; }

.modal-content {
    background: var(--bg-surface, #2d1b4e);
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 350px;
    width: 90%;
    font-family: var(--font-pixel);
    color: #fff;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.5);
    position: relative;
    animation: modalAppear 0.3s ease-out;
}

.modal-content::before,
.modal-content::after { display: none; }

@keyframes modalAppear {
    0%  { opacity: 0; transform: scale(0.9) translateY(20px); }
    100%{ opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #a090c0;
    transition: color 0.2s;
    animation: none;
    font-family: var(--font-pixel);
}

.modal-close-btn:hover { color: var(--color-red); }

.exchange-feedback {
    margin-top: 15px;
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    color: var(--color-gold);
    animation: none;
}

/* === МОБИЛА === */
@media (max-width: 480px) {
    .graffiti-sloppy-style,
    .graffiti-real-style { font-size: clamp(1.5rem, 7vw, 2.5rem); }
    .menu-buttons { max-width: 260px; }
    .menu-btn { padding: 0.85rem 1rem; font-size: 0.75rem; }
    .menu-btn.primary { font-size: 0.8rem; }
    .currency-card { max-width: 240px; padding: 0.6rem 1rem; gap: 1.5rem; }
    .currency-item { font-size: 0.8rem; }
}

@media (max-width: 360px) {
    .menu-buttons { max-width: 230px; gap: 0.7rem; }
    .menu-btn { padding: 0.75rem 0.8rem; font-size: 0.7rem; border-width: 3px; box-shadow: 3px 3px 0 #000; }
}
