html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #f6d365 100%);
}

.container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h1 {
    font-size: 3em;
    margin-bottom: 30px;
    animation: fadeIn 1s ease-in;
}

#gachaButton {
    padding: 15px 40px;
    font-size: 1.5em;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(45deg, #ff9a00, #ffcc00);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

#gachaButton:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.6);
}

#gachaButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#videoContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    background: black;
}

#videoContainer.show {
    display: flex;
}

#gachaVideo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 1001;
    background: black;
    display: none;
}

#resultContainer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/bg.jpg') center/cover no-repeat; /* 图片背景 + 遮罩 */
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 2000;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease-out;
}

#resultContainer.show {
    display: flex;
    opacity: 1;
    transform: scale(1);
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    0% { transform: scale(0.6); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

#foodImage {
    max-width: 70%;
    max-height: 70%;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    margin-bottom: 20px;
    border: 2px solid #fff;
    transition: max-width 0.3s ease, max-height 0.3s ease; /* 平滑过渡 */
}

/* 新增：放大 PNG 图片 */
#foodImage.enlarge-png {
    max-width: 80%; /* 比默认 60% 大 */
    max-height: 80%;
}

/* 响应式设计：小屏幕上限制放大尺寸 */
@media (max-width: 768px) {
    #foodImage {
        max-width: 80%;
        max-height: 80%;
    }
    #foodImage.enlarge-png {
        max-width: 85%; /* 小屏幕上稍微放大 */
        max-height: 85%;
    }
}

#foodName {
    font-size: 2.2em;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.star-3 { color: #4aa6ff; }
.star-4 { color: #c17aff; }
.star-5 { color: #ffd700; }

#closeButton {
    padding: 10px 30px;
    font-size: 1.2em;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(45deg, #ff4444, #ff6666);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.4);
    transition: transform 0.3s;
}

#closeButton:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    h1 { font-size: 2em; }
    #gachaButton { padding: 12px 30px; font-size: 1.2em; }
    #foodImage { max-width: 80%; }
    #foodName { font-size: 1.5em; }
}

/* 在 styles.css 末尾添加 */
#videoContainer::before {
    content: '加载中...';
    display: none;
    color: #fff;
    font-size: 1.5em;
    position: absolute;
    z-index: 1002;
    animation: pulse 1.5s infinite;
}
#videoContainer.loading::before {
    display: block;
}
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

#resultContainer img {
    transition: opacity 0.3s ease;
}
#resultContainer img:not([src=""]) {
    opacity: 1;
}
#resultContainer img[src=""] {
    opacity: 0;
}