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

body {
    font-family: 'Arial', 'Microsoft JhengHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    position: relative;
}

.lottery-container {
    text-align: center;
}

.title {
    color: white;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    animation: fadeIn 1s ease-in;
}

.title-zh {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.title-en {
    display: block;
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 抽籤圖片容器 */
.lottery-image-wrapper {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    cursor: pointer;
    animation: floatBounce 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.lottery-image-wrapper:hover {
    transform: scale(1.05);
}

.lottery-image-wrapper:active {
    transform: scale(0.95);
}

.lottery-image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    border: 5px solid rgba(255,255,255,0.3);
}

.lottery-image-wrapper.shaking {
    animation: shakeImage 0.5s ease-in-out;
}

/* 提示文字 */
.hint {
    color: white;
    margin-top: 30px;
    animation: bounce 2s ease-in-out infinite;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.hint-zh {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.hint-en {
    display: block;
    font-size: 1rem;
    opacity: 0.9;
}

/* 結果對話框覆蓋層 */
.result-overlay {
    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-out;
    overflow-y: auto;
    padding: 20px;
}

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

/* 結果對話框 */
.result-dialog {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    padding: 40px 30px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    color: white;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    position: relative;
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.result-title {
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease-out;
}

.result-title .title-zh {
    font-size: 2rem;
}

.result-title .title-en {
    font-size: 1.2rem;
}

.result-number {
    font-size: 4rem;
    font-weight: bold;
    color: #ffd93d;
    margin-bottom: 30px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    animation: scaleIn 0.8s ease-out 0.3s both;
}

.result-image-wrapper {
    margin: 30px auto;
    max-width: 100%;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.result-image {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 5px solid white;
}

.result-image.zoom-in {
    animation: zoomInImage 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.retry-button {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 30px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: fadeIn 1s ease-out 0.9s both;
}

.btn-zh {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 3px;
}

.btn-en {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

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

/* 動畫 */
@keyframes floatBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-15px) scale(1.02);
    }
    50% {
        transform: translateY(0) scale(1);
    }
    75% {
        transform: translateY(-8px) scale(1.01);
    }
}

@keyframes shakeImage {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: rotate(-5deg);
    }
    20%, 40%, 60%, 80% {
        transform: rotate(5deg);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes zoomInImage {
    0% {
        opacity: 0;
        transform: scale(0.1);
    }
    60% {
        transform: scale(1.15);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}


/* 響應式設計 */
@media (max-width: 480px) {
    .title-zh {
        font-size: 1.5rem;
    }
    
    .title-en {
        font-size: 1rem;
    }
    
    .lottery-image-wrapper {
        max-width: 280px;
    }
    
    .hint-zh {
        font-size: 1rem;
    }
    
    .hint-en {
        font-size: 0.85rem;
    }
    
    .result-dialog {
        padding: 30px 20px;
        border-radius: 20px;
    }
    
    .result-number {
        font-size: 3rem;
    }
    
    .btn-zh {
        font-size: 1rem;
    }
    
    .btn-en {
        font-size: 0.8rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 600px;
    }
    
    .lottery-image-wrapper {
        max-width: 400px;
    }
    
    .title-zh {
        font-size: 2.5rem;
    }
    
    .title-en {
        font-size: 1.5rem;
    }
}

