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

body {
    font-family: 'Arial', sans-serif;
    background-image: url('../img/bcbangjawa.jpg');
    background-size: cover;
    direction: ltr; /* Changed to LTR for English */
    color: #333;

}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #fff;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.header p {
    color: #f0f0f0;
    font-size: 1.1rem;
}

.game-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.right-column, .left-column {
    border-radius: 15px;
    padding: 30px;
}
.right-column {
    vertical-align: middle;
    display: grid;
    align-items: center;
    align-content: center;
}
.right-column h2, .left-column h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
    font-size: 1.5rem;
}

.code-input-section {
    margin-bottom: 20px;
}

.code-input-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.code-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1rem;
    text-align: center;
    transition: border-color 0.3s ease;
}

.code-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #f093fb, #f5576c);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.wheel-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

#wheelCanvas {
    border: 3px solid #333;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.message {
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Winners Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    color: #aaa;
    float: right; /* Changed from left to right for LTR */
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px; /* Changed from left to right for LTR */
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.winners-list {
    margin-top: 20px;
}

.winner-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(90deg, #f8f9fa, #e9ecef);
    margin-bottom: 5px;
    border-radius: 5px;
}

.winner-item:nth-child(odd) {
    background: linear-gradient(90deg, #e9ecef, #f8f9fa);
}

.winner-date {
    font-size: 0.9rem;
    color: #666;
}

.winner-prize {
    font-weight: bold;
    color: #333;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .right-column, .left-column {
        padding: 20px;
    }
    
    #wheelCanvas {
        width: 300px;
        height: 300px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Animation effects */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}


/* custom */ 
.wheel-container {
    margin: 0 auto;
    display: grid;
    place-items: center;
    grid-template-areas: "inner-div";
}
.wheel-img, #wheelCanvas{
    transform: scale(1);
    margin-bottom: 8px;
    margin-right: 0px;
    grid-area: inner-div;
}

.wheel-img {
      height: 43em;
    margin-top: 78px;
}

.logo {
    margin: 0 auto;
    width: 400px;
}
.logo-moblie {
    display:none;
}

    /* --- UI button styling --- */
    .audio-toggle {
      position: fixed;
      inset-inline-end: 16px; /* right in LTR, left in RTL */
      inset-block-start: 16px; /* top */
      z-index: 9999;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 14px;
      border: none;
      border-radius: 999px;
      background: rgba(0,0,0,0.7);
      color: #fff;
      font: 500 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
      cursor: pointer;
      backdrop-filter: blur(6px);
    }
    .audio-toggle[aria-pressed="false"] .dot {
      /* pulse gently to hint user to unmute on first load */
      animation: pulse 1.6s ease-in-out infinite;
      width: 8px; height: 8px; border-radius: 50%;
      background: #4ade80;
    }
    .audio-toggle[aria-pressed="true"] .dot {
      width: 8px; height: 8px; border-radius: 50%;
      background: #f87171;
      animation: none;
    }
    @keyframes pulse {
      0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.7); }
      70% { box-shadow: 0 0 0 10px rgba(74,222,128,0); }
      100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
    }
    .visually-hidden {
      position: absolute !important;
      width: 1px; height: 1px;
      margin: -1px; padding: 0; border: 0;
      clip: rect(0 0 0 0); overflow: hidden;
    }
    #resultModal{

        flex-direction: column;
        justify-content: center;
    }
    .modal-content {
        text-align: center;
        padding: 30px;;
    }
    .close-btn {
    position: absolute;
    left: 10px;
    top:10px;
    font-size: 25px;
    cursor: pointer;
    }
    .winner-index {
    color: #888;
    font-weight: bold;
    flex-basis: 10%; /* 10% for the index */
    text-align: left;
}

.winner-prize {
    color: #333;
    font-weight: 500;
    flex-basis: 40%; /* 40% for prize name */
    padding: 0 10px;
}

/* *** Add this new style for the code *** */
.winner-code {
    color: #007bff; /* Distinct color for the code */
    font-family: monospace;
    flex-basis: 25%; /* 25% for the code */
    padding: 0 10px;
}

.winner-date {
    color: #555;
    font-family: monospace;
    flex-basis: 25%; /* 25% for the date */
    text-align: right;
}
.group_btn {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.group_btn a{
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    width:46%;
    text-align: center;
    text-decoration: none;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.group_btn a:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/*  responsive design */
@media (max-width: 768px) {
    .wheel-img {
    height: 25em;
    margin-top: 35px;
}
.logo {
    display:none;
}
.logo-moblie {
    margin: 0 auto;
    width:300px;
    display:block;
}
.game-container{
    display: flex;
    flex-direction: column;
}
.group_btn {
    flex-direction: column;
}
.group_btn a{
    width:100%;   
}
}