/* SoloMarathon Game Styles */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #0a1628 0%, #1a2332 50%, #0f1b2d 100%);
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    display: none !important;
    background: transparent !important;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    display: none !important;
    background: transparent !important;
}

.game-container {
    height: 100vh;
    display: flex;
    padding-top: 56px;
    box-sizing: border-box;
}

main.container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.side-panel {
    width: 320px;
    overflow: hidden;
    flex-shrink: 0;
}

div.side-panel.bg-dark {
    background: transparent !important;
    border: none !important;
}

.side-panel .p-3 {
    max-height: calc(100vh - 120px);
    overflow-y: hidden !important;
    overflow-x: hidden !important;
    display: flex;
    flex-direction: column;
}

/* Скрытие скроллбара для логов */
.logs-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

.logs-container::-webkit-scrollbar-track {
    display: none !important;
    background: transparent !important;
}

.logs-container::-webkit-scrollbar-thumb {
    display: none !important;
    background: transparent !important;
}

.logs-container::-webkit-scrollbar-corner {
    display: none !important;
}

.logs-container {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    overflow-y: auto !important;
    flex: 1;
}

.side-panel .p-3::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

.side-panel .p-3::-webkit-scrollbar-track {
    display: none !important;
    background: transparent !important;
}

.side-panel .p-3::-webkit-scrollbar-thumb {
    display: none !important;
    background: transparent !important;
}

.side-panel .p-3::-webkit-scrollbar-corner {
    display: none !important;
}

.side-panel .p-3 {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.log-item {
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    background: rgba(74, 144, 226, 0.1);
    border-left: 3px solid transparent;
}

.log-item:hover {
    transform: translateX(2px);
    background: rgba(74, 144, 226, 0.15);
}

.log-item.dice_roll {
    background: rgba(251, 146, 60, 0.15);
    border-left-color: #fb923c;
}

.log-item.task_complete {
    background: rgba(25, 135, 84, 0.15);
    border-left-color: #198754;
}

.log-item.task_fail {
    background: rgba(220, 38, 38, 0.15);
    border-left-color: #dc2626;
}

.log-item.task_drop {
    background: rgba(255, 193, 7, 0.15);
    border-left-color: #ffc107;
}

.log-item.teleport {
    background: rgba(6, 182, 212, 0.15);
    border-left-color: #06b6d4;
}

.log-item.empty_cell {
    background: rgba(107, 114, 128, 0.15);
    border-left-color: #6b7280;
}

.log-item.randomizer {
    background: rgba(168, 85, 247, 0.15);
    border-left-color: #a855f7;
}

.log-item.pit {
    background: rgba(239, 68, 68, 0.15);
    border-left-color: #ef4444;
}

.log-item.trampoline {
    background: rgba(34, 197, 94, 0.15);
    border-left-color: #22c55e;
}

.log-item.game_complete {
    background: rgba(251, 191, 36, 0.15);
    border-left-color: #fbbf24;
}

.progress {
    background-color: rgba(255, 255, 255, 0.1);
}

div.center-panel.bg-dark {
    background: transparent !important;
    border: none !important;
}

.center-panel {
    flex: 1;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
}

.center-panel::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

.center-panel::-webkit-scrollbar-track {
    display: none !important;
    background: transparent !important;
}

.center-panel::-webkit-scrollbar-thumb {
    display: none !important;
    background: transparent !important;
}

.center-panel::-webkit-scrollbar-corner {
    display: none !important;
}

.center-panel {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    width: 100%;
    max-width: min(85vw, 85vh);
    margin: 10px auto;
    position: relative;
}

/* Змейка: каждый второй ряд идёт в обратном направлении */
.game-cell {
    order: var(--order);
}

.game-cell {
    aspect-ratio: 1;
    background: #2d3142;
    border: 2px solid #4a5568;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    padding: 5px;
}

.game-cell:hover {
    border-color: #60a5fa;
    transform: scale(1.05);
}

.game-cell.current {
    border-color: #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
    animation: pulse 2s infinite;
}

.game-cell.completed {
    background: #374151;
    opacity: 0.7;
}

.game-cell.locked {
    background: #1a1f2e;
    border-color: #2d3748;
    cursor: not-allowed;
    opacity: 0.5;
}

.game-cell.locked:hover {
    border-color: #2d3748;
    transform: none;
}

.game-cell.locked i {
    filter: grayscale(100%);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.6); }
    50% { box-shadow: 0 0 30px rgba(251, 191, 36, 0.8); }
}

.cell-number {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e5e7eb;
}

.game-cell i {
    font-size: 1rem;
}

.legend-item-vertical {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px 6px;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 6px;
    font-size: 0.6rem;
}

.legend-item-vertical i {
    font-size: 0.9rem;
}

/* Анимации для уведомлений */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ========================================
   Стили для модальных окон броска кубика
   ======================================== */

/* Основной контейнер модального окна */
.dice-modal-content {
    background: linear-gradient(145deg, rgba(20, 25, 35, 0.98) 0%, rgba(15, 18, 28, 0.98) 100%);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 24px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(74, 144, 226, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.dice-modal-content.dice-modal-drop {
    border-color: rgba(255, 193, 7, 0.3);
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(255, 193, 7, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Заголовок модального окна */
.dice-modal-header {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
    padding: 1.25rem 1.5rem;
    border-radius: 24px 24px 0 0;
}

.dice-modal-content.dice-modal-drop .dice-modal-header {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 158, 11, 0.1) 100%);
    border-bottom-color: rgba(255, 193, 7, 0.3);
}

/* Тело модального окна */
.dice-modal-body {
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

/* Подвал модального окна */
.dice-modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid rgba(74, 144, 226, 0.15);
    border-radius: 0 0 24px 24px;
    background: rgba(0, 0, 0, 0.2);
}

/* Обёртка для кубика с эффектом свечения */
.dice-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

/* Свечение вокруг кубика */
.dice-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: glow-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

.dice-glow-warning {
    background: radial-gradient(circle, rgba(255, 193, 7, 0.4) 0%, transparent 70%);
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* 3D кубик */
.dice-3d {
    font-size: 6rem;
    display: inline-block;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Анимация броска кубика */
.dice-3d.rolling {
    animation: dice-roll 0.6s ease-in-out infinite;
}

@keyframes dice-roll {
    0% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        transform: rotate(180deg) scale(1);
    }
    75% {
        transform: rotate(270deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* Заголовок под кубиком */
.dice-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Подзаголовок */
.dice-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    text-align: center;
    max-width: 280px;
    line-height: 1.5;
}

/* Кнопка броска кубика */
.btn-dice-roll {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 16px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(59, 130, 246, 0.4),
        0 0 30px rgba(59, 130, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-dice-roll::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-dice-roll:hover::before {
    left: 100%;
}

.btn-dice-roll:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(59, 130, 246, 0.5),
        0 0 40px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-dice-roll:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(59, 130, 246, 0.4),
        inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-dice-roll:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Жёлтая версия кнопки (для дропа) */
.btn-dice-roll-warning {
    background: linear-gradient(135deg, #ffc107 0%, #f59e0b 100%);
    box-shadow: 
        0 4px 15px rgba(255, 193, 7, 0.4),
        0 0 30px rgba(255, 193, 7, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-dice-roll-warning:hover {
    box-shadow: 
        0 8px 25px rgba(255, 193, 7, 0.5),
        0 0 40px rgba(255, 193, 7, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-dice-roll-warning:active {
    box-shadow: 
        0 2px 10px rgba(255, 193, 7, 0.4),
        inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Анимация результата */
.dice-result-pop {
    animation: result-pop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes result-pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    70% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Стили для спецклеток */
.special-cell-modal-content {
    background: linear-gradient(145deg, rgba(20, 25, 35, 0.98) 0%, rgba(15, 18, 28, 0.98) 100%);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 24px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(74, 144, 226, 0.1);
    backdrop-filter: blur(20px);
}

.special-cell-modal-header {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
    padding: 1.25rem 1.5rem;
    border-radius: 24px 24px 0 0;
}

.special-cell-modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid rgba(74, 144, 226, 0.15);
    border-radius: 0 0 24px 24px;
    background: rgba(0, 0, 0, 0.2);
}

.player-info-card {
    background: rgba(45, 49, 66, 0.6);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(74, 144, 226, 0.3);
}

.text-purple {
    color: #a855f7 !important;
}

@media (max-width: 992px) {
    .game-container {
        flex-direction: column;
    }
    
    .side-panel {
        width: 100%;
        max-height: 30vh;
    }
    
    .center-panel {
        flex: 1;
        padding: 10px;
    }
    
    .game-grid {
        gap: 4px;
    }
    
    .game-cell {
        min-height: 50px;
    }
    
    .game-cell i {
        font-size: 1rem;
    }
}
