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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('background.png') no-repeat center center ;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden; /* avoid inner scrollbar so parent handles scrolling */
}

/* Email Modal Overlay */
.email-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.email-overlay.hidden {
    display: none;
}

.email-modal {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.4s ease;
}

.email-modal h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.email-modal p {
    color: #666;
    margin-bottom: 25px;
    font-size: 16px;
}

.email-modal input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.email-modal input:focus {
    outline: none;
    border-color: #667eea;
}

.email-modal button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.email-modal button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.email-modal button:active {
    transform: translateY(0);
}

.email-modal button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Layout: sidebar + main */
.layout {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 0 auto;
    min-height: 100vh; /* Full screen height */
}

/* Main Container */
.container {
    text-align: center;
    width: 100%;
    max-width: 880px;
    min-height: 100vh; /* Full screen height */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

/* Game Wrapper - encapsulates the wheel and button */
.game-wrapper {
    background: url('background.png') no-repeat center center;
    /* Stretch image to fill wrapper width and height exactly (may distort aspect ratio) */
    background-size: cover;
    background-repeat: no-repeat;
    /*background-size: 100% 100%; */
    background-position: center center;
    border: 4px solid transparent;
    border-radius: 20px;
    padding: 40px 30px;
    width: 100%;
    max-width: 600px;
    min-width: 540px; /* Ensure consistent width (460px wheel + 80px padding) */
    min-height: 100vh; /* Full screen height */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto; /* Center horizontally */
}

.game-wrapper::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 20px;
    z-index: -1;
    opacity: 0.8;
}

h1 {
    color: white;
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 20px;
    margin-bottom: 40px;
}

/* Wheel Container */
.wheel-container {
    position: relative;
    width: 360px;
    height: 360px;
    margin: 0 auto 40px;
}

.wheel-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.wheel.spinning {
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* Indefinite spinning while waiting for server result (JS-driven for precise control) */

/* Wheel Pointer */
.pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #ff6b6b;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    z-index: 10;
}

/* Center Pin */
.center-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #667eea;
    font-size: 24px;
}

/* Wheel Segments */
.segment {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-left: 20px;
    overflow: hidden;
}

.segment-text {
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: rotate(-22.5deg);
    white-space: nowrap;
}

.wheel-text {
    color: white;
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    max-width: 38%;
    text-align: center;
    transform-origin: center center;
}

/* Play Button for starting screen */
.play-button {
    width: 300px;
    padding: 24px 20px;
    font-size: 28px;
    font-weight: bold;
    background: #FFD700;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.play-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.6);
}

.play-button:active {
    transform: translateY(0);
}

/* Bottom buttons */
.bottom-buttons {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    margin-top: 30px;
}

.bottom-button {
    flex: 1;
    padding: 20px 20px;
    margin: 0 10px;
    font-size: 18px;
    font-weight: bold;
    background: #FFD700;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bottom-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.4);
}

.bottom-button:active {
    transform: translateY(0);
}

/* Guide button - positioned top right of game wrapper */
.guide-button {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: bold;
    background: #FFD700;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10;
}

.guide-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.4);
}

.guide-button:active {
    transform: translateY(0);
}

/* Info overlays */
.info-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.info-overlay.hidden {
    display: none;
}

.info-modal {
    background: white;
    width: 100%;
    max-width: 600px;
    min-width: 540px;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 40px 20px;
    box-sizing: border-box;
    margin: 0 auto;
    overflow: hidden;
}

.info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    overflow-y: auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.info-content p {
    font-size: 18px;
    color: #333;
    line-height: 1.6;
    margin: 15px 0;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.info-content h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.info-content ul {
    margin: 15px 0;
    padding-left: 20px;
    width: 100%;
    text-align: left;
}

.info-content li {
    font-size: 18px;
    color: #333;
    line-height: 1.6;
    margin: 8px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.info-content strong {
    color: #667eea;
}

.close-info-btn {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 30px;
}

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

/* Logo styling */
.logo {
    max-width: 336px;
    max-height: 120px;
    width: auto;
    height: auto;
    margin-bottom: 30px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Game title styling */
.game-title {
    text-align: center;
    margin-bottom: 20px;
}

.title-line {
    color: white;
    font-size: 32px;
    font-weight: bold;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.title-line:first-child {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-line:last-child {
    background: linear-gradient(135deg, #FF69B4 0%, #FF1493 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Spin Button */
.spin-button {
    padding: 20px 60px;
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(135deg, #FFD54F 0%, #FFC107 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 20px;
    margin-left: 36px;
}

.spin-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 193, 7, 0.55);
}

.spin-button:active {
    transform: translateY(0);
}

.spin-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: translateY(0);
}

/* Result Modal */
.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.result-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.result-modal {
    background: white;
    padding: 60px 40px;
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.result-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.result-modal h2 {
    font-size: 36px;
    margin-bottom: 15px;
    color: #333;
}

.result-modal .prize {
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.result-modal p {
    color: #666;
    font-size: 18px;
    margin-bottom: 30px;
}

.result-modal button {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s;
}

.result-modal button:hover {
    transform: scale(1.05);
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1500;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 900px) {
    h1 {
        font-size: 32px;
    }
    .layout { flex-direction: column; align-items: center }
    .sidebar { width: 100%; order: 2 }
    .container { order: 1; padding: 0 10px; }
    .wheel-container { width: 320px; height: 320px }
    .spin-button { padding: 15px 40px; font-size: 20px; margin-left: 56px; }
    .play-button { width: 300px; padding: 24px 15px; font-size: 24px; }
    .title-line { font-size: 28px; }
    .bottom-button { padding: 16px 15px; font-size: 16px; margin: 0 5px; }
    .info-modal {
        width: calc(100vw - 20px);
        max-width: 400px;
        min-width: unset;
        padding: 30px 15px;
        justify-content: flex-start;
    }
    .info-content {
        padding: 0 5px;
    }
    .info-content p {
        font-size: 16px;
        margin: 12px 0;
    }
    .info-content h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    .info-content li {
        font-size: 16px;
        margin: 6px 0;
    }
    .game-wrapper {
        padding: 30px 20px;
        margin: 0 auto;
        width: calc(100vw - 20px);
        max-width: 400px;
        min-width: unset; /* Remove min-width constraint on mobile */
        min-height: 100vh; /* Full screen height on mobile too */
    }
}

@media (max-width: 540px) {
    .container { padding: 0 5px; }
    .game-wrapper {
        padding: 20px 15px;
        width: calc(100vw - 10px);
        max-width: none;
        border-radius: 15px;
    }
    .play-button { width: 300px; padding: 20px 12px; font-size: 20px; }
    .title-line { font-size: 24px; }
    .bottom-button { padding: 14px 12px; font-size: 14px; margin: 0 3px; }
    .info-modal {
        width: calc(100vw - 10px);
        max-width: none;
        padding: 20px 10px;
        justify-content: flex-start;
    }
    .info-content {
        padding: 0 5px;
    }
    .info-content p {
        font-size: 14px;
        margin: 10px 0;
    }
    .info-content h1 {
        font-size: 20px;
        margin-bottom: 12px;
    }
    .info-content li {
        font-size: 14px;
        margin: 5px 0;
    }
    .spin-button { padding: 12px 32px; font-size: 18px; margin-left: 66px; }
}
.wheel.no-transition {
    transition: none !important;
}

.hidden {
    display: none !important;
}

/* Back button shown inside game UI */
.back-button {
    position: absolute;
    top: 18px;
    left: 18px;
    background: linear-gradient(90deg, #FFD54F 0%, #FFC107 100%);
    color: #222;
    border: none;
    padding: 5px 5px;
    font-weight: 700;
    border-radius: 11px; /* rounded ends */
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 1001;
}
.back-button:hover { transform: translateY(-2px); }
.back-button:active { transform: translateY(0); }

/* Game Containers */
.game-container {
    display: none;
}

.game-container:not(.hidden) {
    display: block;
}

/* Check-in Game Styles */
.checkin-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.checkin-title {
    color: #FFD54F;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.checkin-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 400px; /* target width for list */
    max-width: 100%;
    margin: 0 auto;
}

.checkin-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 213, 79, 0.28);
    min-height: 88px;
    gap: 40px; /* spacing between left and right */
    box-sizing: border-box;
}

.checkin-item-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0; /* allow text to wrap */
}

.checkin-item-right {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 85px; /* fixed width for claim button */
}

.day-label {
    font-size: 16px;
    font-weight: 700;
    color: #444;
}

.reward-text {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    word-break: break-word;
}

.claim-button {
    background: linear-gradient(45deg, #4CAF50, #45A049);
    color: white;
    border: none;
    width: 85px;
    height: 32px;
    padding: 0;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.claim-button:hover {
    background: linear-gradient(45deg, #45A049, #3D8B40);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.claim-button.claimed {
    background: #4CAF50 !important;
    color: white !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.claim-button.claimed:hover {
    background: #4CAF50 !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3) !important;
}

.claim-button:disabled,
.claim-button.disabled {
    background: linear-gradient(45deg, #4CAF50, #45A049) !important;
    color: white !important;
    cursor: not-allowed !important;
    opacity: 0.4;
    pointer-events: none;
}

.claim-button:disabled:hover,
.claim-button.disabled:hover {
    background: linear-gradient(45deg, #4CAF50, #45A049) !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3) !important;
}

.progress-container {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-label {
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.progress-count {
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.progress-bar-background {
    background: rgba(255, 255, 255, 0.3);
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    background: linear-gradient(90deg, #FFD700 0%, #FFC700 100%);
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.checkin-list-item:not(.claimed):not(.claimable) {
    border: 3px solid #4CAF50;
}

.checkin-list-item.claimed {
    opacity: 0.8;
    border: 1px solid rgba(255, 213, 79, 0.28);
}

.claimed-text {
    color: #4CAF50;
    font-weight: bold;
    font-size: 14px;
}

.checkin-list-item.claimable {
    border: 3px solid #FFD700;
    box-shadow: 0 4px 15px rgba(255, 213, 79, 0.3);
}

.no-prizes {
    text-align: center;
    color: #666;
    font-size: 18px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}