* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url("../image/header-bg.8800d61.png") no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 900px;
    text-align: center;
}

.header {
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5em;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
}

.wheel-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-direction: column;
}

.wheel-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.wheel-container {
    position: relative;
    width: min(80vw, 460px);
    height: min(80vw, 460px);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 7px solid #FFA500;
    box-shadow: 0 0 20px rgba(11, 31, 75, 0.8);
    animation: wheel-glow 2s ease-in-out infinite;
    background: #c0b49f;
}

canvas {
    filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.35));
    border-radius: 50%;
    cursor: pointer;
    width: 100%;
    height: 100%;
    max-width: 460px;
    max-height: 460px;
}

.pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #ffd54f;
    z-index: 10;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.3));
    pointer-events: none;
}

.light-ring {
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border-radius: 50%;
    animation: rotate 5s linear infinite;
}

.light-ring span {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 10px;
    height: 100%;
    transform-origin: center center;
}

.light-ring span:before {
    content: '';
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.light-ring span:nth-of-type(even):before {
    background: #fff;
    animation: white-to-yellow 1s linear infinite;
}

.light-ring span:nth-of-type(odd):before {
    background: #d7a945;
    animation: white-to-yellow 1s linear reverse infinite;
}

.info-section {
    margin-top: 10px;
}

.button-group {
    display: none;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.info-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 16px 20px;
    text-align: left;
}

.result-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 300px;
}

.result-box.show {
    display: flex !important;
}

.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.result-overlay.show {
    display: block;
}

.result-box h3 {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.prize-name {
    font-size: 2.5em;
    font-weight: bold;
    color: white;
    margin: 20px 0;
}

.prize-desc {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 20px;
}

.records-section {
    display: none;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.records-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.records-table th {
    padding: 15px;
    text-align: left;
    font-weight: bold;
}

.records-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

.records-table tbody tr:hover {
    background: #f9f9f9;
}

.records-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #628192;
}

.empty-state svg {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    opacity: 0.3;
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll;
        background-position: center top;
    }

    .content {
        flex-direction: column;
    }

    .wheel-container {
        width: min(90vw, 380px);
        height: min(90vw, 380px);
    }

    canvas {
        width: 100% !important;
        height: 100% !important;
    }

    .header h1 {
        font-size: 2em;
    }

    .container {
        padding: 20px;
    }

    .records-section {
        overflow-x: auto;
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes white-to-yellow {
    0% {
        background: #fff;
    }

    100% {
        background: #d7a945;
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes wheel-glow {
    0% {
        box-shadow: 0 0 12px rgba(11, 31, 75, 0.6);
    }

    50% {
        box-shadow: 0 0 28px rgba(11, 31, 75, 1);
    }

    100% {
        box-shadow: 0 0 12px rgba(11, 31, 75, 0.6);
    }
}

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 998;
    display: none;
}

.dialog-overlay.show {
    display: block;
}

.dialog-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 24px 26px;
    border-radius: 14px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    z-index: 999;
    display: none;
}

.dialog-box.show {
    display: block;
}

.dialog-title {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 12px;
    color: #333;
}

.dialog-message {
    font-size: 0.95em;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.dialog-input-group {
    margin-bottom: 12px;
    text-align: left;
}

.dialog-input-group label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 6px;
    color: #444;
}

.dialog-input-group input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 0.95em;
}
