/* style.css - Versi Mobile Friendly dengan Tema Merah-Hitam */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #fff;
    min-height: 100vh;
    padding: 10px;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #8b0000 0%, #1a0000 100%);
    border-radius: 12px;
    border: 2px solid #ff4444;
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.3);
}

.game-header h1 {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    color: #ff4444;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.subtitle {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    color: #ff9999;
}

.game-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Ticket Section */
.ticket-section {
    background: rgba(255, 68, 68, 0.1);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 68, 68, 0.3);
    backdrop-filter: blur(10px);
}

.ticket-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    .ticket-input-container {
        flex-direction: row;
    }
}

#ticketCode {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    border: 2px solid #ff4444;
    transition: all 0.3s;
}

#ticketCode:focus {
    outline: none;
    border-color: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

#ticketCode::placeholder {
    color: #ff9999;
}

.btn-check {
    padding: 14px 20px;
    background: linear-gradient(45deg, #ff0000, #cc0000);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
}

.btn-check:hover {
    background: linear-gradient(45deg, #cc0000, #990000);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.4);
}

.ticket-info {
    background: rgba(0, 255, 0, 0.1);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    text-align: center;
}

.ticket-info p {
    margin: 8px 0;
    font-size: 0.95rem;
}

/* Slot Machine */
.slot-machine {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    border: 3px solid #ff4444;
    position: relative;
    overflow: hidden;
}

.slot-machine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 68, 68, 0.1) 50%,
        transparent 70%
    );
    animation: shine 3s infinite linear;
}

@keyframes shine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.slot-container {
    margin-bottom: 25px;
    perspective: 1000px;
}

.slot-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.slot-reel {
    width: clamp(60px, 20vw, 90px);
    height: clamp(60px, 20vw, 90px);
    background: linear-gradient(145deg, #1a0000, #0a0000);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #8b0000;
    box-shadow: 
        inset 0 0 10px rgba(0, 0, 0, 0.8),
        0 5px 15px rgba(0, 0, 0, 0.6);
    transition: all 0.5s;
    position: relative;
    overflow: hidden;
}

.slot-reel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 0, 0, 0.1) 50%,
        transparent 60%
    );
    animation: reelShine 2s infinite;
}

@keyframes reelShine {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.slot-item {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: #ff4444;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.prize-text {
    font-weight: bold;
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    color: #ff9999;
}

/* Spin Control */
.spin-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.btn-spin {
    padding: clamp(15px, 4vw, 20px) clamp(30px, 8vw, 50px);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    background: linear-gradient(45deg, #ff0000, #8b0000);
    border: none;
    border-radius: 50px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(255, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    justify-content: center;
}

.btn-spin:hover:not(:disabled) {
    background: linear-gradient(45deg, #cc0000, #660000);
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(255, 0, 0, 0.5);
}

.btn-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(45deg, #666, #333);
}

.spin-count {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #ff4444;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Prizes Section */
.prizes-section {
    background: rgba(255, 68, 68, 0.1);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.prizes-section h3 {
    color: #ff4444;
    margin-bottom: 15px;
    text-align: center;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

@media (max-width: 480px) {
    .prizes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.prize-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    border: 1px solid rgba(255, 68, 68, 0.2);
}

.prize-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 68, 68, 0.15);
    border-color: #ff4444;
}

.prize-icon {
    font-size: 1.8rem;
    color: #ff4444;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prize-details h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: #fff;
}

.prize-amount {
    color: #ff9999;
    font-weight: bold;
    font-size: 0.85rem;
}

/* Result Section */
.result-section {
    background: rgba(255, 68, 68, 0.1);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 68, 68, 0.3);
    text-align: center;
}

.result-section h3 {
    color: #ff4444;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
}

.win-animation {
    animation: pulse 1s infinite;
    color: #ffd700;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.win-animation i {
    font-size: 3rem;
    filter: drop-shadow(0 0 10px #ffd700);
}

.win-animation h2 {
    font-size: 2rem;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.game-footer {
    text-align: center;
    margin-top: 25px;
    padding: 15px;
    color: #ff9999;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 68, 68, 0.3);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: linear-gradient(135deg, #1a0000 0%, #0a0000 100%);
    margin: 10% auto;
    padding: 25px;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    border: 2px solid #ff4444;
    position: relative;
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
    color: #ff4444;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-modal:hover {
    background: rgba(255, 68, 68, 0.2);
    transform: rotate(90deg);
}

.modal-content h3 {
    color: #ff4444;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.btn-confirm {
    padding: 14px 30px;
    background: linear-gradient(45deg, #ff0000, #8b0000);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
    font-size: 1rem;
    flex: 1;
    max-width: 200px;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.4);
}

.result-modal {
    text-align: center;
}

#resultModalContent {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    margin: 20px 0;
    color: #ffd700;
}

.btn-close-result {
    padding: 12px 30px;
    background: linear-gradient(45deg, #ff0000, #8b0000);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 20px;
    transition: all 0.3s;
}

.btn-close-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.4);
}

/* Efek tambahan untuk game */
.btn-spin.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 10px 20px rgba(255, 0, 0, 0.3); }
    50% { box-shadow: 0 10px 30px rgba(255, 0, 0, 0.6); }
    100% { box-shadow: 0 10px 20px rgba(255, 0, 0, 0.3); }
}

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

.ticket-modal-info {
    background: rgba(255, 68, 68, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.modal-message {
    padding: 15px 0;
}

.big-prize {
    text-align: center;
    padding: 20px;
}

.big-prize h2 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin: 10px 0;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Animasi untuk reel saat spin */
.slot-reel.spinning {
    animation: spinReel 0.5s linear infinite;
}

@keyframes spinReel {
    0% { transform: rotateX(0deg); }
    100% { transform: rotateX(360deg); }
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 5px;
    }
    
    .game-header {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .slot-machine {
        padding: 15px;
    }
    
    .slot-reel {
        width: 70px;
        height: 70px;
    }
    
    .slot-item {
        font-size: 1.4rem;
    }
    
    .prize-text {
        font-size: 0.8rem;
    }
    
    .btn-spin {
        min-width: 180px;
        padding: 16px 25px;
        font-size: 1.2rem;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.4rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .slot-reel {
        width: 60px;
        height: 60px;
    }
    
    .slot-item {
        font-size: 1.2rem;
    }
    
    .prizes-grid {
        gap: 8px;
    }
    
    .prize-item {
        padding: 10px;
    }
    
    .prize-icon {
        font-size: 1.5rem;
    }
    
    .prize-details h4 {
        font-size: 0.85rem;
    }
    
    .btn-spin {
        min-width: 160px;
        padding: 14px 20px;
        font-size: 1.1rem;
    }
    
    .modal-content {
        margin: 15% auto;
        padding: 15px;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    .game-header {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .slot-machine {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .slot-reel {
        width: 50px;
        height: 50px;
    }
    
    .prizes-section {
        padding: 10px;
    }
    
    .result-section {
        padding: 10px;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 15px;
    }
}

/* Dark scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #ff4444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff0000;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Success/Error messages */
.success-message {
    background: rgba(0, 255, 0, 0.1);
    color: #4CAF50;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.error-message {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

/* Responsive font sizes for better mobile experience */
html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
}

/* Touch-friendly tap targets */
button, 
input[type="submit"], 
.btn-check, 
.btn-spin, 
.btn-confirm, 
.btn-close-result {
    min-height: 44px;
    min-width: 44px;
}

/* Prevent text selection on buttons */
button {
    user-select: none;
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, 
                border-color 0.3s ease, 
                transform 0.3s ease, 
                opacity 0.3s ease;
}