* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-image: url('bulank3.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 10px;
    overflow: hidden;
}

.undian-section {
    padding: 5px 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.undian-section .container {
    width: 100%;
    max-width: 1200px;
}

.heading-section {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: 3px;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.4);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.sub-heading {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 500;
    font-style: italic;
    color: #fff;
    opacity: 0.95;
    margin-bottom: -50px;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.undian-section .row.mb-5 {
    margin-bottom: 10px !important;
}

.undian-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    width: 100%;
    max-height: 95vh;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.dice-container {
    margin: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.dice-box {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, #ff7300 0%, #ff7300 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    border: 5px solid #fff;
}

.dice-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.dice-box.rolling {
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    25% {
        transform: translateX(-10px) rotate(-5deg);
    }
    75% {
        transform: translateX(10px) rotate(5deg);
    }
}

.dice-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    z-index: 10;
    position: relative;
    transition: all 0.3s ease;
}

.dice-number.rolling {
    animation: numberRoll 0.1s infinite;
}

@keyframes numberRoll {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
}

.dice-number.final {
    animation: bounceIn 0.6s ease;
    font-size: 4rem;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.button-container {
    margin: 8px 0;
    flex-shrink: 0;
}

.roll-button {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.roll-button:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.roll-button:active:not(:disabled) {
    transform: translateY(-2px);
}

.roll-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.memo-container {
    margin: 8px auto 0 auto;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.memo-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
}

.memo-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.btn-reset {
    padding: 4px 12px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn-reset:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.memo-list {
    overflow: visible;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    width: 100%;
    max-width: 100%;
}

.memo-empty {
    text-align: center;
    color: #6c757d;
    padding: 10px;
    font-style: italic;
    font-size: 0.8rem;
}

.memo-item {
    background: #fff;
    padding: 6px 10px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    animation: slideIn 0.3s ease;
    border-top: 3px solid #667eea;
    width: 100%;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.memo-item-info {
    width: 100%;
    text-align: center;
}

.memo-item-nomor {
    font-size: 0.8rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 3px;
    text-align: center;
}

.memo-item-nama {
    font-size: 0.65rem;
    color: #6c757d;
    text-align: center;
    margin-bottom: 2px;
}

.memo-item-time {
    font-size: 0.55rem;
    color: #adb5bd;
    text-align: center;
    white-space: nowrap;
}

.result-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.result-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    color: #fff;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.result-title {
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.result-nomor {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    letter-spacing: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.result-pemenang {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-close-result {
    padding: 15px 40px;
    background: #fff;
    color: #667eea;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-close-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .heading-section {
        font-size: 2rem;
        letter-spacing: 2px;
    }
    
    .sub-heading {
        font-size: 1.1rem;
    }
    
    .dice-box {
        width: 250px;
        height: 250px;
    }
    
    .dice-number {
        font-size: 4rem;
    }
    
    .dice-number.final {
        font-size: 5rem;
    }
    
    .roll-button {
        padding: 15px 40px;
        font-size: 1.2rem;
    }
    
    .result-box {
        padding: 30px;
    }
    
    .result-title {
        font-size: 2rem;
    }
    
    .result-nomor {
        font-size: 3rem;
        padding: 20px;
    }
}

/* Result Hadiah dan Karyawan Container */
.result-hadiah-container,
.result-karyawan-container {
    margin-top: 15px;
    animation: fadeIn 0.3s ease;
}

.result-hadiah-box,
.result-karyawan-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.result-hadiah-box h5,
.result-karyawan-box h5 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.result-hadiah-nama,
.result-karyawan-nama {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.result-hadiah-kode,
.result-karyawan-nomor {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 600;
}

/* Styling untuk 2 roll container */
.undian-container.mb-4 {
    margin-bottom: 30px !important;
    margin-top: 0 !important;
}

.undian-container h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Styling untuk dice label */
.dice-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Styling untuk 2 dice bersampingan */
.row .col-md-6 .dice-container {
    margin-bottom: 15px;
}

/* Responsive untuk mobile */
@media (max-width: 768px) {
    .row .col-md-6 {
        margin-bottom: 20px;
    }
    
    .result-hadiah-box,
    .result-karyawan-box {
        padding: 15px;
    }
    
    .result-hadiah-nama,
    .result-karyawan-nama {
        font-size: 1.2rem;
    }
    
    .memo-list {
        grid-template-columns: repeat(5, 1fr);
    }
}