@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

:root {
    --neon: #0f0; --bg: #050a05; --red: #ff003c;
    --rare: #4b69ff; --epic: #8847ff; --legendary: #eb4b4b;
}

* { box-sizing: border-box; }
body {
    font-family: 'Share Tech Mono', monospace; background: var(--bg); color: var(--neon);
    margin: 0; padding: 10px; display: flex; flex-direction: column; align-items: center;
}

header { width: 100%; max-width: 900px; text-align: center; border-bottom: 2px solid var(--neon); margin-bottom: 10px; }
#topBar { display: flex; justify-content: space-between; padding: 5px; color: #fff; width: 100%; max-width: 900px; }

.menu-container { display: flex; flex-direction: column; gap: 15px; width: 100%; max-width: 400px; margin-top: 50px; }

button {
    font-family: 'Share Tech Mono'; background: rgba(0, 255, 0, 0.1); color: var(--neon);
    border: 2px solid var(--neon); padding: 15px; cursor: pointer; text-transform: uppercase;
}
button:hover { background: var(--neon); color: #000; box-shadow: 0 0 20px var(--neon); }
.btn-yellow { border-color: #ff0; color: #ff0; }
.btn-green { border-color: #0f0; color: #0f0; }
.btn-small { padding: 5px 10px; font-size: 0.8rem; margin-top: 10px; }

.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); z-index: 100; justify-content: center; align-items: center;
}
.modal-content { background: #000; border: 2px solid var(--neon); padding: 20px; width: 95%; max-width: 650px; text-align: center; }

/* МАГАЗИН И СЮЖЕТ */
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 20px 0; max-height: 350px; overflow-y: auto; }
.chapter-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 20px 0; }
.chapter-card { padding: 15px 5px; font-size: 0.7rem; background: #111; border: 1px solid var(--neon); }
.chapter-card.locked { opacity: 0.3; filter: grayscale(1); cursor: not-allowed; border-color: #555; }
.chapter-card.done { background: rgba(0, 255, 0, 0.2); border-color: gold; }

.skin-card { background: #111; padding: 10px; border-bottom: 4px solid #555; }
.rare { border-color: var(--rare); } .epic { border-color: var(--epic); } .legendary { border-color: var(--legendary); }
.chances-box { background: rgba(255,255,255,0.05); padding: 10px; margin: 10px 0; text-align: left; border: 1px solid #333; }

/* КЕЙС РУЛЕТКА */
.case-viewport { width: 100%; height: 130px; border: 2px solid #444; position: relative; overflow: hidden; margin: 20px 0; }
.case-runner { display: flex; position: absolute; left: 0; }
.case-item { min-width: 120px; height: 120px; margin: 5px; display: flex; align-items: center; justify-content: center; background: #111; }
.case-pointer { position: absolute; left: 50%; top: 0; width: 4px; height: 100%; background: #ff0; z-index: 10; transform: translateX(-50%); box-shadow: 0 0 10px #ff0; }

#gameContainer { position: relative; width: 100%; max-width: 900px; aspect-ratio: 16 / 9; border: 2px solid var(--neon); overflow: hidden; }
#levelGoalUI {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 1rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    padding: 10px;
    border: 1px solid var(--neon);
    border-radius: 5px;
    pointer-events: none;
}
.leader-list { list-style: none; padding: 0; text-align: left; }
.leader-list li { display: flex; justify-content: space-between; border-bottom: 1px dashed #333; padding: 5px 0; }

/* Центрируем блок победы над канвасом */
#partyTime {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    text-align: center;
    width: 100%;
    pointer-events: none; /* Чтобы не мешал кликам */
}

/* Анимация пульсации */
@keyframes victoryPulse {
    0% { transform: scale(1); text-shadow: 0 0 10px var(--neon); }
    50% { transform: scale(1.3) rotate(-3deg); text-shadow: 0 0 30px var(--neon), 0 0 50px gold; }
    100% { transform: scale(1); text-shadow: 0 0 10px var(--neon); }
}

.victory-anim {
    font-size: 3rem;
    font-weight: bold;
    animation: victoryPulse 0.8s ease-in-out infinite;
    text-transform: uppercase;
}