/* ========================================
   GATES OF OLYMPUS - MINECRAFT EDITION
   6x5 grid, pay anywhere
   ======================================== */

/* Minecraft Font */
@font-face {
    font-family: 'Minecraft';
    src: url('font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --slot-gold: #f5d472;
    --slot-gold-dark: #c2942b;
    --slot-blue: #0f2b38;
    --slot-accent: #e2892b;
    --scatter-color: #9b59b6;
    --multiplier-color: #f39c12;
    --minecraft-font: 'Minecraft', 'Segoe UI', monospace;
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(145deg, #0a1f2c, #041016) !important;
    font-family: var(--minecraft-font);
    min-height: 100vh;
    margin: 0;
}

/* Main Container */
.slot-card {
    background: radial-gradient(circle at 20% 40%, #23648a, #0e2d40);
    border: 4px solid var(--slot-gold);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 15px 0 #be9b45, 0 20px 40px rgba(0,0,0,0.5);
}

/* Title */
.slot-title {
    color: #ffde8a;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 4px 4px 0 #c2942b, 6px 6px 0 #624a1a;
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin-bottom: 20px;
}

/* Panels */
.slot-panel {
    background: var(--slot-blue) !important;
    border: 3px solid #edc55a !important;
    border-radius: 15px !important;
}

.slot-grid-panel {
    background: #143542 !important;
    border: 4px solid #e2b952 !important;
    border-radius: 20px !important;
    padding: 15px;
    overflow: hidden !important; /* Ukrywa kafelki wychodzące poza obszar */
}

/* Custom Inputs & Buttons */
.slot-input {
    background: #051a24 !important;
    border: 2px solid #ffcf5c !important;
    color: #ffde8a !important;
    border-radius: 10px !important;
}

.slot-input::placeholder {
    color: #8b7355 !important;
}

.slot-btn {
    background: #f09b2c !important;
    border: none !important;
    border-bottom: 4px solid #b06d1b !important;
    color: white !important;
    font-weight: bold !important;
    border-radius: 10px !important;
}

.slot-btn:active {
    transform: translateY(4px);
    border-bottom-width: 1px !important;
}

.slot-btn-sm {
    background: #c0392b !important;
    border: none !important;
    border-bottom: 3px solid #962d22 !important;
    color: white !important;
    font-weight: bold !important;
    border-radius: 8px !important;
    padding: 8px 20px !important;
}

.slot-btn-sm:active {
    transform: translateY(3px);
    border-bottom-width: 1px !important;
}

/* Round buttons for bet controls */
.slot-round-btn {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    font-size: 1.5rem !important;
    line-height: 1 !important;
    background: #f09b2c !important;
    border: none !important;
    border-bottom: 3px solid #b06d1b !important;
    color: white !important;
    font-weight: bold !important;
}

.slot-round-btn:active {
    transform: translateY(3px);
    border-bottom-width: 1px !important;
}

/* Spin Button */
.slot-spin-btn {
    background: linear-gradient(180deg, #e2892b, #c0392b) !important;
    border: none !important;
    border-bottom: 6px solid #7b521f !important;
    color: white !important;
    font-weight: 800 !important;
    font-size: 1.5rem !important;
    border-radius: 15px !important;
    text-shadow: 2px 2px 0 #6b4219;
    box-shadow: 0 8px 0 #7b521f, 0 10px 20px rgba(0,0,0,0.3);
}

.slot-spin-btn:active {
    transform: translateY(6px);
    box-shadow: 0 2px 0 #7b521f, 0 5px 10px rgba(0,0,0,0.3);
    border-bottom-width: 1px !important;
}

.slot-spin-btn:disabled {
    opacity: 0.6;
    transform: translateY(4px);
    box-shadow: 0 4px 0 #7b521f;
}

/* Stat boxes - bright text */
.slot-stat-box {
    background: #051a24;
    border: 2px solid #ffcf5c;
    border-radius: 12px;
    padding: 15px;
}

.slot-stat-box small {
    color: #ffde8a !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

/* =========================
   6x5 SLOT GRID (GATES OF OLYMPUS)
   ========================= */

/* Efekt eksplozji dla wygrywających symboli */
.cell.exploding {
    animation: symbol-explode 0.5s ease-out forwards;
}

@keyframes symbol-explode {
    0% { 
        transform: scale(1); 
        opacity: 1;
        filter: brightness(1);
    }
    30% { 
        transform: scale(1.3); 
        opacity: 1;
        filter: brightness(2) drop-shadow(0 0 20px gold);
    }
    60% { 
        transform: scale(1.5) rotate(15deg); 
        opacity: 0.8;
        filter: brightness(3) drop-shadow(0 0 30px orange);
    }
    100% { 
        transform: scale(0) rotate(45deg); 
        opacity: 0;
    }
}

/* Efekt 3D flip dla pojawiania się symbolu */
.cell.flipping {
    animation: card-flip 0.4s ease-out forwards;
}

@keyframes card-flip {
    0% { 
        transform: rotateY(90deg) scale(0.8); 
        opacity: 0;
    }
    50% { 
        transform: rotateY(45deg) scale(1.05); 
        opacity: 0.8;
    }
    100% { 
        transform: rotateY(0deg) scale(1); 
        opacity: 1;
    }
}

/* Perspektywa dla efektu 3D */
.slot-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: clamp(4px, 1vmin, 8px);
    width: 100%;
    aspect-ratio: 6 / 5;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    perspective: 1000px; /* Dla efektu 3D */
}

.cell {
    background: radial-gradient(circle at 45% 35%, #3580aa, #134b68);
    border-radius: clamp(6px, 1.5vmin, 12px);
    border: 2px solid #f5d174;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.2rem, 4vmin, 2rem);
    box-shadow: inset 0 -3px 0 #0a3647, 0 3px 0 #05212b;
    color: white;
    text-shadow: 2px 2px 3px black;
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    transition: transform 0.1s, box-shadow 0.2s;
    transform-style: preserve-3d; /* Dla efektu 3D */
    backface-visibility: hidden; /* Ukrywa tył podczas obrotu */
}

/* Scale entire game area for larger screens */
@media (min-width: 1400px) {
    .slot-card {
        transform: scale(1.5);
        transform-origin: center center;
    }
}

/* Minecraft Skin Characters - positioned outside game area in background */
.zeus-character {
    position: fixed;
    z-index: -1;
    width: 350px;
    height: 600px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.zeus-left {
    left: 0;
}

.zeus-right {
    right: 0;
}

.skin-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skin-animated {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    animation: skin-float 3s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5));
}

.skin-left-img {
    transform: none;
}

.skin-right-img {
    transform: scaleX(-1) !important;
}

/* Volume Control */
.volume-control {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(10, 31, 44, 0.9);
    padding: 10px 15px;
    border-radius: 10px;
    border: 2px solid var(--slot-gold);
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-control label {
    color: var(--slot-gold);
    font-size: 0.8rem;
    font-weight: bold;
}

.volume-control input[type="range"] {
    width: 100px;
    cursor: pointer;
}

/* Manual Button */
.manual-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, var(--slot-gold), var(--slot-gold-dark));
    color: #0a1f2c;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.manual-btn:hover {
    transform: scale(1.05);
}

/* Manual Modal */
.manual-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.manual-modal.active {
    display: flex;
}

.manual-content {
    background: linear-gradient(145deg, #0a1f2c, #041016);
    border: 3px solid var(--slot-gold);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    color: #fff;
}

.manual-content h2 {
    color: var(--slot-gold);
    text-align: center;
    margin-bottom: 20px;
}

.manual-content h3 {
    color: var(--slot-accent);
    margin-top: 20px;
    margin-bottom: 10px;
}

.manual-content ul {
    padding-left: 20px;
}

.manual-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.close-manual {
    display: block;
    margin: 20px auto 0;
    background: var(--slot-gold);
    color: #0a1f2c;
    border: none;
    padding: 10px 30px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
}

/* Free Spins Cost Display */
.free-spins-cost {
    font-size: 1.1rem;
    color: #1a1a1a;
    font-weight: bold;
    margin-top: 5px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

/* Game info message at bottom */
.game-info-bottom {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(10, 31, 44, 0.9);
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid var(--slot-gold);
    color: var(--slot-gold);
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

@keyframes skin-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.skin-right .skin-animated {
    animation: skin-float-right 3s ease-in-out infinite;
}

@keyframes skin-float-right {
    0%, 100% { transform: scaleX(-1) translateY(0); }
    50% { transform: scaleX(-1) translateY(-15px); }
}

/* Hide on smaller screens */
@media (max-width: 1400px) {
    .zeus-character {
        display: none !important;
    }
}

.symbol-img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.5));
    transition: transform 0.1s ease-out;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.cell:hover .symbol-img {
    transform: scale(1.15);
}

.cell:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* Multiplier cell */
.cell.multiplier-cell {
    background: radial-gradient(circle at 45% 35%, #f39c12, #d68910) !important;
    border-color: #ffd700;
    color: #fff;
    font-weight: bold;
    font-size: clamp(0.9rem, 3vmin, 1.5rem);
    animation: multiplier-glow 1.5s ease-in-out infinite;
}

@keyframes multiplier-glow {
    0%, 100% { box-shadow: 0 0 10px #f39c12, 0 0 20px rgba(243, 156, 18, 0.5); }
    50% { box-shadow: 0 0 20px #f39c12, 0 0 40px rgba(243, 156, 18, 0.8); }
}

/* Scatter symbol */
.cell.scatter {
    background: radial-gradient(circle at 45% 35%, #9b59b6, #8e44ad) !important;
    border-color: #c978e0;
    animation: scatter-pulse 2s ease-in-out infinite;
}

@keyframes scatter-pulse {
    0%, 100% { box-shadow: 0 0 15px #9b59b6, 0 0 30px rgba(155, 89, 182, 0.5); transform: scale(1); }
    50% { box-shadow: 0 0 25px #9b59b6, 0 0 50px rgba(155, 89, 182, 0.8); transform: scale(1.05); }
}

/* Multiplier pulse animation */
.cell.multiplier-pulse {
    animation: multiplier-burst 0.5s ease-out;
}

@keyframes multiplier-burst {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); box-shadow: 0 0 30px gold; }
    100% { transform: scale(1); }
}

/* Winning symbol highlight */
.cell.winning {
    animation: win-highlight 0.5s ease-in-out;
    box-shadow: 0 0 20px gold, inset 0 0 20px rgba(255, 215, 0, 0.5);
}

@keyframes win-highlight {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* =========================
   ANIMACJE
   ========================= */

/* ZNIKANIE (TUMBLE) */
.cell.removing {
    animation: tumble-out 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes tumble-out {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

/* SPAWN (nowe symbole spadające) */
.cell.spawning {
    animation: tumble-in 0.4s cubic-bezier(.34,1.56,.64,1);
}

@keyframes tumble-in {
    0% { transform: translateY(-30px) scale(0.5); opacity: 0; }
    60% { transform: translateY(3px) scale(1.1); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Efekt wygranej */
.slot-card.win-flash {
    animation: win-flash-anim 0.5s ease;
}

@keyframes win-flash-anim {
    0%, 100% { box-shadow: 0 15px 0 #be9b45, 0 20px 40px black; border-color: #f5d472; }
    50% { box-shadow: 0 15px 0 #ffd966, 0 20px 40px gold, 0 0 40px gold; border-color: #fff; }
}

/* BIG WIN */
.slot-card.big-win {
    animation: big-win-pulse 2s ease infinite;
}

@keyframes big-win-pulse {
    0%, 100% { 
        box-shadow: 0 15px 0 #be9b45, 0 20px 40px black, 0 0 0 rgba(255,215,0,0); 
        border-color: #f5d472;
        transform: scale(1);
    }
    25% { 
        box-shadow: 0 15px 0 #ffd966, 0 20px 40px gold, 0 0 50px rgba(255,215,0,0.8); 
        border-color: #fff;
        transform: scale(1.005);
    }
    50% { 
        box-shadow: 0 15px 0 #ffec8b, 0 20px 40px #ffd700, 0 0 80px rgba(255,215,0,1); 
        border-color: #fff;
        transform: scale(1);
    }
    75% { 
        box-shadow: 0 15px 0 #ffd966, 0 20px 40px gold, 0 0 50px rgba(255,215,0,0.8); 
        border-color: #fff;
        transform: scale(1.003);
    }
}

/* =========================
   RESPONSYWNOŚĆ
   ========================= */

/* Telefon pionowo */
@media (max-width: 768px) {
    .slot-card {
        padding: 12px;
        border-radius: 15px;
    }
    
    .slot-title {
        font-size: 1.3rem;
    }
    
    .slot-grid {
        gap: 3px;
        max-width: 100%;
    }
    
    .cell {
        font-size: clamp(0.9rem, 5vmin, 1.5rem);
        border-radius: 6px;
        border-width: 1px;
    }
    
    .cell.multiplier-cell {
        font-size: clamp(0.7rem, 4vmin, 1.1rem);
    }
    
    .slot-stat-box {
        padding: 8px;
    }
    
    .slot-round-btn {
        width: 35px !important;
        height: 35px !important;
        font-size: 1.2rem !important;
    }
}

/* Małe telefony */
@media (max-width: 380px) {
    .cell {
        font-size: clamp(0.8rem, 4.5vmin, 1.2rem);
    }
    
    .slot-grid {
        gap: 2px;
    }
}

/* 4K i duże skale */
@media (min-width: 2560px) {
    .slot-grid {
        max-width: 800px;
        gap: 8px;
    }
    
    .cell {
        font-size: 2rem;
        border-radius: 12px;
    }
}

/* Landscape na telefonie */
@media (max-height: 500px) and (orientation: landscape) {
    .slot-grid {
        max-width: 400px;
    }
    
    .cell {
        font-size: 1rem;
    }
}
