/* Base styles */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background-color: var(--background-color);
    background-image: var(--background-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding-bottom: 60px; /* Adjust for footer */
}

.banner-container {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

.banner-image {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    margin: 0 auto;
    display: block;
}

.banner-text {
    margin-top: 10px;
    font-size: 1.2em;
    color: #333;
    padding: 0 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    color: #fff;
}

.game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0;
    margin: 0 auto;
    overflow-x: hidden;
    flex-direction: column;
    gap: 10px; /* Reduced gap between wheel and controls */
    /* Ensure proper centering */
    text-align: center;
}

.wheel-container {
    position: relative;
    width: 90vw;
    height: 90vw;
    max-width: 600px;
    max-height: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ensure proper centering on all devices */
    text-align: center;
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    display: block;
    margin: 0 auto;
    border: 2px solid var(--wheel-border-color);
    border-radius: 50%;
}

.spin-button-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    width: 15vw;
    height: 15vw;
    max-width: 120px;
    max-height: 120px;
    min-width: 60px;
    min-height: 60px;
}

.spin-btn {
    width: 100%;
    height: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: pulse 1.5s ease-in-out infinite;
    transform-origin: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    border-radius: 50%;
}

.spin-btn:hover {
    transform: scale(1.1);
    animation: none;
}

.spin-btn:active {
    transform: scale(0.95);
}

.spin-btn:disabled {
    cursor: not-allowed;
    animation: none;
    opacity: 0.7;
}

.spin-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin-right: 5px;
}

/* Footer Styles */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 8px 0;
    z-index: 1000;
}

.footer-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 5px;
    width: 25%;
}

.footer-icon {
    height: 48px;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.footer-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.footer-icon i {
    font-size: 24px;
    color: var(--footer-text-color);
}

.footer-item span {
    font-size: 18px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .footer-icon {
        height: 36px;
        width: 36px;
    }
    
    .footer-icon img {
        width: 36px;
        height: 36px;
    }
    
    .footer-icon i {
        font-size: 20px;
    }
    
    .footer-item span {
        font-size: 11px;
    }
}

/* Very small screen adjustments */
@media screen and (max-width: 320px) {
    .wheel-container {
        width: 95vw;
        height: 95vw;
        max-width: 300px;
        max-height: 300px;
        /* Ensure proper centering on very small screens */
        text-align: center;
    }

    .spin-button-container {
        width: 22vw;
        height: 22vw;
        max-width: 70px;
        max-height: 70px;
        min-width: 35px;
        min-height: 35px;
    }
}

/* Handle orientation changes on mobile */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .wheel-container {
        width: 70vh;
        height: 70vh;
        max-width: 400px;
        max-height: 400px;
        /* Ensure proper centering on landscape orientation */
        text-align: center;
    }
    
    .spin-button-container {
        width: 12vh;
        height: 12vh;
        max-width: 80px;
        max-height: 80px;
        min-width: 50px;
        min-height: 50px;
    }
}

/* Prize Notification Styles */
.prize-notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.prize-notification.show {
    top: 20px;
}

/* Animations */
@keyframes slideIn {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translate(-50%, 0); opacity: 1; }
    to { transform: translate(-50%, -100%); opacity: 0; }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Media Queries */
@media screen and (max-width: 768px) {
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .game-container {
        overflow-x: hidden;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 0;
        gap: 5px; /* Even smaller gap on mobile */
    }

    .wheel-container {
        position: relative;
        width: 85vw;
        height: 85vw;
        margin: 0 auto;
        max-width: 500px;
        max-height: 500px;
        /* Ensure proper centering on mobile */
        text-align: center;
    }

    #wheel-canvas {
        width: 100%;
        height: 100%;
        display: block;
        margin: 0 auto;
    }

    .spin-button-container {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 100;
        width: 18vw;
        height: 18vw;
        max-width: 100px;
        max-height: 100px;
        min-width: 50px;
        min-height: 50px;
    }

    .spin-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .winners-container,
    .history-container {
        position: static;
        margin: 20px auto;
        width: 90%;
    }

    .winners-container {
        max-width: 280px;
    }

    .history-container {
        max-width: 320px;
    }

    .game-controls {
        width: 90%;
        max-width: 400px;
        padding: 8px;
        margin-top: 0;
    }
}

@media screen and (max-width: 480px) {
    .wheel-container {
        width: 90vw;
        height: 90vw;
        max-width: 400px;
        max-height: 400px;
        /* Ensure proper centering on small screens */
        text-align: center;
    }

    .spin-button-container {
        width: 20vw;
        height: 20vw;
        max-width: 80px;
        max-height: 80px;
        min-width: 40px;
        min-height: 40px;
    }
}

/* Removed duplicate game-container styles - using responsive styles above */

/* Removed duplicate wheel-container styles - using responsive styles above */

.spin-button-container {
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

#spin-button:hover {
    transform: scale(1.1);
    /*box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);*/
}

#spin-button:active {
    transform: scale(0.95);
}

#spin-button:disabled {
    /*background-color: #cccccc;*/
    cursor: not-allowed;
    animation: none;
}

/* iOS-style notification banner */
.prize-notification {
    position: fixed;
    top: -100px; /* Start off-screen */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.prize-notification.show {
    top: 20px;
}

/* Add padding to main content to prevent footer overlap */
main {
    padding-bottom: 70px; /* Adjust based on footer height */
}

/* iOS Modal Styles */
.ios-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 1000;
}

.ios-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    max-width: 90%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    z-index: 1001;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.ios-modal-content {
    padding: 24px;
}

.ios-modal h2 {
    margin: 0 0 20px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #000;
}

.ios-input-group {
    margin-bottom: 24px;
}

.ios-input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
    background: rgba(242, 242, 242, 0.95);
    outline: none;
    box-sizing: border-box;
}

.ios-input-group input:focus {
    border-color: #007AFF;
}

.ios-button-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.ios-button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Canvas styles */
#canvas {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    position: relative;
}

/* Media queries for responsive design */
@media screen and (max-width: 768px) {
    .wheel-container {
        padding: 20px;
        /*min-height: calc(100vh - 40px); /* Account for padding */
    }
    
    #canvas {
        width: 90%; /* Slightly smaller to prevent edge cutting */
        max-width: 380px; /* Adjusted to prevent edge cutting */
        margin: 20px auto;
    }
    
    /* Center the power controls */
    .power-controls {
        text-align: center;
        width: 100%;
        margin: 10px auto;
    }
}

@media screen and (max-width: 480px) {
    .wheel-container {
        padding: 15px;
    }
    
    #canvas {
        width: 85%; /* Even smaller width ratio for mobile */
        max-width: 280px; /* Smaller size for mobile phones */
        margin: 15px auto;
    }
}

/* Ensure the wheel doesn't overflow */
canvas {
    max-width: 100%;
    height: auto !important; /* Force aspect ratio */
    border-radius: 50%; /* Optional: if you want to ensure perfect circle */
}

/* Add these helper classes */
.center-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.full-width {
    width: 100%;
}

.filter-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-section .form-label {
    font-weight: 500;
    color: #495057;
}

.filter-section .btn {
    padding: 8px 16px;
    margin-right: 8px;
}

@media (max-width: 768px) {
    .filter-section .col-md-4 {
        margin-bottom: 15px;
    }
    
    .filter-section .btn {
        width: 100%;
        margin-bottom: 8px;
    }
}

.filter-section input::placeholder {
    color: #adb5bd;
    font-size: 0.9em;
}

.filter-section .col-md-3 {
    padding: 0 10px;
}

@media (max-width: 768px) {
    .filter-section .col-md-3 {
        padding: 0 15px;
        margin-bottom: 15px;
    }
}

/* Removed conflicting wheel styles - using responsive styles above */

.winners-container,
.history-container {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 10px;
    color: white;
    z-index: 1000;
}

.winners-container {
    right: 20px;
    top: 20px;
    width: 280px;
}

.history-container {
    left: 20px;
    top: 20px;
    width: 320px;
}

.winners-header {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 10px;
}

.winners-list {
    height: 90px; /* Show 3 items */
    overflow: hidden;
    position: relative;
}

.winners-scroll {
    animation: scrollUp 15s linear infinite;
}

.winner-item {
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    font-size: 14px;
}

.winner-id {
    color: #ffd700;
}

.winner-amount {
    color: #00ff00;
}

@keyframes scrollUp {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100%);
    }
}

.history-header {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 10px;
}

.history-list {
    height: 90px; /* Show 3 items */
    overflow: hidden;
    position: relative;
}

.history-scroll {
    animation: scrollUp 15s linear infinite;
}

.history-item {
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    font-size: 14px;
}

.history-date {
    color: #87CEEB;
    min-width: 75px;
}

.history-time {
    color: #FFB6C1;
    min-width: 60px;
}

.history-amount {
    color: #00ff00;
    min-width: 70px;
    text-align: right;
}

@media (max-width: 767px) {
    body {
        background-image: var(--mobile-background-image);
    }
}

.site-header {
    width: 100%;
    text-align: center;
    padding: 20px 0;
}

.site-header h1 {
    color: var(--header-title-color);
    margin: 0;
    text-align: center;
    width: 100%;
}

.section-title {
    text-align: center;
    width: 100%;
    margin: 0px 0;
    color: var(--header-title-color) !important;
}

@media (max-width: 768px) {
    .site-header {
        padding: 15px 0;
    }
    
    .site-header h1 {
        font-size: 1.5em;
    }
}

.banner-text {
    color: var(--banner-text-color);
}

.wheel-container canvas {
    border: 2px solid var(--wheel-border-color);
    border-radius: 50%;
}

.ios-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 13px;
    width: 270px;
    z-index: 9999;
    display: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ios-alert-title {
    padding: 18px;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.ios-alert-message {
    padding: 16px;
    font-size: 13px;
    text-align: center;
    color: #666;
}

.ios-alert-button {
    padding: 16px;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: #007AFF;
    cursor: pointer;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.ios-alert-button:hover {
    background: rgba(0, 0, 0, 0.03);
}

.ios-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    display: none;
}

.ios-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
    max-width: 90%;
    text-align: center;
    pointer-events: none;
}

.ios-notification.error {
    background: rgba(255, 59, 48, 0.9);
}

.field-manual_status {
    font-weight: bold;
}

/* Game Controls */
.game-controls {
    position: relative; /* Changed from absolute to relative */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; /* Reduced gap between elements in controls */
    width: 90%;
    max-width: 500px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    z-index: 5;
    margin-top: 0; /* Remove top margin */
}

.spins-display {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: clamp(1.1em, 4vw, 1.3em);
    font-weight: bold;
    width: 100%;
    text-align: center;
    white-space: nowrap;
}

#spin-count {
    color: #4CAF50;
    font-weight: bold;
    margin-left: 5px;
}

/* Spin Wheel Notice Popup Styles */
#noticePopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

#noticePopup .notice-content {
    position: relative;
    width: 50%;
    max-height: 80vh;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#noticePopup .notice-content img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

#closeNotice {
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
    background-color: white !important;
    border-radius: 50%;
    z-index: 10000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    opacity: 1 !important;
    border: none;
    transform: translate(50%, -50%);
}

#closeNotice i {
    font-size: 16px;
    color: #000;
}

@media (max-width: 768px) {
    #noticePopup .notice-content {
        width: 90%;
    }
    
    #closeNotice {
        transform: translate(0, -50%);
    }
}

.multi-spin-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
}

.multi-spin-btn {
    background: linear-gradient(145deg, #5CBF60, #3E8B42);
    color: white;
    padding: clamp(8px, 2vw, 12px) clamp(16px, 4vw, 24px);
    border: none;
    border-radius: 25px;
    font-weight: bold;
    font-size: clamp(0.9em, 3vw, 1.1em);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    min-width: 80px;
    max-width: 150px;
    box-shadow: 
        0 8px 16px rgba(0,0,0,0.3),
        0 4px 8px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.2),
        inset 0 -1px 0 rgba(0,0,0,0.1);
    white-space: nowrap;
    position: relative;
    transform-style: preserve-3d;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.multi-spin-btn:disabled {
    background: linear-gradient(145deg, #B0B0B0, #999999);
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: 
        0 4px 8px rgba(0,0,0,0.2),
        0 2px 4px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.1),
        inset 0 -1px 0 rgba(0,0,0,0.1);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.multi-spin-btn:not(:disabled):hover {
    background: linear-gradient(145deg, #66D16A, #4CAF50);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 24px rgba(0,0,0,0.4),
        0 6px 12px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -1px 0 rgba(0,0,0,0.15);
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.multi-spin-btn:not(:disabled):active {
    transform: translateY(-1px) scale(0.98);
    background: linear-gradient(145deg, #3E8B42, #2E6B32);
    box-shadow: 
        0 4px 8px rgba(0,0,0,0.3),
        0 2px 4px rgba(0,0,0,0.2),
        inset 0 2px 4px rgba(0,0,0,0.2),
        inset 0 -1px 0 rgba(255,255,255,0.1);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Update media queries for game controls */
@media screen and (max-width: 768px) {
    .game-controls {
        bottom: 10px;
        padding: 10px;
    }

    .spins-display {
        font-size: 1.1em;
        padding: 10px 20px;
    }

    .multi-spin-buttons {
        gap: 8px;
    }

    .multi-spin-btn {
        padding: 8px 12px;
        font-size: 0.9em;
        box-shadow: 
            0 6px 12px rgba(0,0,0,0.25),
            0 3px 6px rgba(0,0,0,0.15),
            inset 0 1px 0 rgba(255,255,255,0.15),
            inset 0 -1px 0 rgba(0,0,0,0.1);
    }
}

@media screen and (max-height: 800px) {
    .game-controls {
        position: relative;
        bottom: auto;
        margin-top: 20px;
    }
}

/* Update mobile styles for winners and history containers */
@media screen and (max-width: 768px) {
    .winners-container,
    .history-container {
        position: static;
        margin: 20px auto;
        width: 90%;
        max-width: 400px;
    }

    .winners-container {
        margin-top: 30px;
    }

    .history-container {
        margin-top: 20px;
    }

    .game-container {
        flex-direction: column;
    }

    .game-controls {
        position: relative;
        bottom: auto;
        margin-top: 20px;
        width: 90%;
        max-width: 400px;
    }

    .winners-list,
    .history-list {
        height: 120px; /* Increased height for better visibility on mobile */
    }

    .winners-header,
    .history-header {
        font-size: 16px;
    }

    .winner-item,
    .history-item {
        font-size: 13px;
    }
}
