@font-face {
    font-family: 'CustomFont';
    src: url('font/font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'slkscrb';
    src: url('font/slkscrb.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Combo text styles */
.combo-text {
    font-family: 'slkscrb', Arial, sans-serif;
    position: absolute;
    font-size: 48px;
    font-weight: bold;
    color: #ff69b4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 10000;
    text-align: center;
}

/* Combo text colors by difficulty */
.combo-text.difficulty-1 {
    color: #cd7f32; /* Bronze */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(205, 127, 50, 0.5);
}

.combo-text.difficulty-2 {
    color: #c0c0c0; /* Silver */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(192, 192, 192, 0.5);
}

.combo-text.difficulty-3 {
    color: #ffd700; /* Gold */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 215, 0, 0.5);
}

.combo-text.difficulty-4 {
    color: #5bcffa; /* White-blue */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 15px rgba(91, 207, 250, 0.8);
    animation: comboFlicker 3s ease-in-out infinite;
}

@keyframes comboFlicker {
    0%, 100% {
        color: #5bcffa;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 15px rgba(91, 207, 250, 0.8);
    }
    50% {
        color: #ffffff;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 255, 1);
    }
}

/* Combo count on page buttons */
.page-btn.combo-display {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff8fab !important;
    font-family: 'slkscrb', Arial, sans-serif;
    font-size: 32px;
    font-weight: bold;
    text-shadow: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    image-rendering: crisp-edges;
    transition: color 0.1s ease;
}

/* Combo flashing animation - only affects the text */
.page-btn.combo-flashing .combo-text-inner {
    animation: comboFlash 1s infinite;
}

@keyframes comboFlash {
    0%, 100% {
        opacity: 1;
        color: #000000;
    }
    50% {
        opacity: 0;
        color: #000000;
    }
}

body {
    font-family: 'CustomFont', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #ffffff;
}

header {
    background: #333;
    color: #fff;
    padding: 1em;
    text-align: center;
}

/* Footer Styles - Appears at bottom of content */
.site-footer {
    background: linear-gradient(135deg, #ffb3c2 0%, #ff8fab 100%);
    color: #fff;
    padding: 1.5em 1em;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    margin-top: 6em;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.footer-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.wechat-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.wechat-qr {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wechat-text {
    font-size: 12px;
}

.wechat-text.en {
    display: none;
}

.footer-logo img {
    height: 40px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.footer-info p {
    margin: 0;
    font-size: 14px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.footer-link {
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.footer-link:hover {
    opacity: 0.8;
    border-bottom-color: #fff;
}

main {
    padding: 2em;
}

.top-images-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-top: 6em;
    position: relative;
    height: 250px;
    /* Adjust as needed */
}

.left-images {
    display: flex;
    flex-direction: column;
    position: relative;
    margin-right: 30px;
}

.bun-img {
    width: 180px;
    /* Adjust as needed */
    height: auto;
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.bun-img.shrink {
    transform: scale(0.7);
}

.left-bottom-img {
    width: 180px;
    /* Adjust as needed */
    height: auto;
    margin-top: 0;
}

.sis-img {
    width: 320px;
    /* Adjust as needed */
    height: auto;
    align-self: flex-start;
}

.pinyin-image {
    display: flex;
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中（如果需要） */
    width: 100%;
    /* 确保容器占满宽度 */
    margin-top: -1em;
    margin-bottom: 3em;
}

.game-image {
    display: flex;
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中（如果需要） */
    width: 100%;
    /* 确保容器占满宽度 */
    margin-top: 3em;
    margin-bottom: 3em;
}

@keyframes flicker {
    0% {
        color: #ffb3c2;
        /* 几乎透明 */
    }

    50% {
        color: rgba(0, 0, 0, 1);
        /* 纯黑色 */
    }

    100% {
        color: #ffb3c2;
        /* 几乎透明 */
    }
}

.flicker-text {
    animation: flicker 3s infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 3em;
    margin-bottom: 3em;
    -webkit-animation: flicker 3s infinite;
}

button {
    padding: 0.5em 1em;
    font-size: 1em;
    font-family: 'CustomFont', Arial, sans-serif;
    align-items: center;
    background-color: #dddddd;
    /* Button background color */
    color: #000000;
    /* Text color */
    border: none;
    /* Remove default border */
    border-radius: 5px;
    /* Rounded corners */
    cursor: pointer;
    /* Pointer cursor on hover */
    transition: background-color 0.3s;
    /* Smooth transition for hover effect */
}

button:hover:not(:disabled) {
    background-color: #ffb3c2;
    /* Darker background on hover */
    color: #000000;
    /* Text color */
}

/* Confirm button animation */
#confirmBtn.active:not(:disabled):not(:hover) {
    animation: buttonBounce 1s infinite alternate;
    -webkit-animation: buttonBounce 1s infinite alternate;
}

/* Restart buttons animation */
#restartBtn.active:not(:disabled):not(:hover),
#restartBtnFloat.active:not(:disabled):not(:hover) {
    animation: buttonBounce 1s infinite alternate;
    -webkit-animation: buttonBounce 1s infinite alternate;
}

#startBtn {
    border-radius: 50px;
    -webkit-border-radius: 50px;
    -moz-border-radius: 50px;
    -ms-border-radius: 50px;
    -o-border-radius: 50px;
}

/* Sticker 容器 - fixed全屏层，在page2激活时显示 */
.sticker-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* 不影响点击 */
    z-index: 998; /* 在most内容之上，浮动控件(999)之下 */
    overflow: visible; /* 不裁剪 */
    display: none; /* 默认隐藏 */
}

/* page2激活时显示sticker */
body.page2-active .sticker-container {
    display: block;
}

/* Sticker wrapper - 处理定位和旋转 */
.sticker-item {
    position: absolute;
    pointer-events: none;
    will-change: opacity;
}

/* Sticker img - 呼吸动画由JS驱动 */
.sticker-item img {
    display: block;
    width: 100%;
    height: auto;
    transform-origin: center center;
}




@keyframes buttonBounce {
    0% {
        background-color: #dddddd;
    }
    100% {
        background-color: #ffb3c2;
    }
}

button:disabled {
    color: #808080;
    /* Grey text color when disabled */
    cursor: not-allowed;
    /* Not-allowed cursor when disabled */
}

canvas {
    width: 100%;
    max-width: 1344px;
    height: auto;
    display: block;
    margin: 0 auto;
    border: 2px solid #333;
    justify-content: center;
    align-items: center;
}

.jigsaw-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    justify-content: center;
    align-items: center;
    gap: 2em;
    margin: 2em auto;
    min-height: calc(100vh - 8em);
    box-sizing: border-box;
}

.jigsaw {
    width: 100%;
    max-width: 70vw;
    height: auto;
    border: 2px solid #333;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1em;
    margin-top: 2em;
}

#floatingTimer {
    font-size: 1.5em;
    font-family: monospace;
}

.ranking-block {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 1em 2em;
    max-width: 800px;
    margin: 0 auto;
}

.ranking-block>div {
    width: 320px;
}

.ranking-block h3 {
    margin-bottom: 0.5em;
    font-size: 1.1em;
}

/* 分页容器样式 - 固定定位在右侧 */
.page-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    /* 初始隐藏，按下任意键后显示 */
    flex-direction: column;
    gap: 20px;
    z-index: 1000;
}

/* 分页按钮样式 - 小图 */
.page-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    background-color: #ffffff;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* 选中状态 - 放大 */
.page-btn.active {
    transform: scale(1.2);
    border-color: #ffb3c2;
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.4);
    z-index: 1001;
}

/* Display image when active or has been active */
.page-nav .page-btn:first-child.active,
.page-nav .page-btn:first-child.has-been-active {
    background: url('images/b1.png') no-repeat center center;
    background-size: 110%;
    color: transparent;
}

.page-nav .page-btn:nth-child(2).active,
.page-nav .page-btn:nth-child(2).has-been-active {
    background: url('images/b2.png') no-repeat center center;
    background-size: 110%;
    color: transparent;
}

.page-nav .page-btn:nth-child(3).active,
.page-nav .page-btn:nth-child(3).has-been-active {
    background: url('images/b3.png') no-repeat center center;
    background-size: 110%;
    color: transparent;
}

.page-nav .page-btn:nth-child(4).active,
.page-nav .page-btn:nth-child(4).has-been-active {
    background: url('images/b4.png') no-repeat center center;
    background-size: 110%;
    color: transparent;
}

.page-nav .page-btn:nth-child(5).active,
.page-nav .page-btn:nth-child(5).has-been-active {
    background: url('images/b5.png') no-repeat center center;
    background-size: 110%;
    color: transparent;
}

.page-nav .page-btn:nth-child(6).active,
.page-nav .page-btn:nth-child(6).has-been-active {
    background: url('images/b6.png') no-repeat center center;
    background-size: 110%;
    color: transparent;
}

/* 分页内容区域 */
.page {
    position: relative; /* ← 添加这行！为 sticker 容器提供定位上下文 */
    min-height: 100vh;
    /* 每个分页占满视口高度 */
    width: 100%;
    opacity: 1;
    transition: opacity 0.1s ease;
    scroll-margin-top: 0;
}


/* 平滑滚动到分页 */
html {
    scroll-behavior: smooth;
}

/* 禁用鼠标滚轮滚动 */
body {
    overflow-y: hidden;
    /* 隐藏滚动条，但保留滚动功能 */
    min-height: 100vh;
    position: relative;
}

.pages-container {
    height: 100vh;
    overflow-y: scroll;
    /* 保留滚动功能但隐藏滚动条 */
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    /* IE和Edge隐藏滚动条 */
    scrollbar-width: none;
    /* Firefox隐藏滚动条 */
}

.pages-container::-webkit-scrollbar {
    display: none;
    /* Chrome、Safari和Opera隐藏滚动条 */
}

/* 浮动控制块样式（拼图页显示） */
.floating-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.hover-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    pointer-events: none;
}

.hover-preview-overlay.visible {
    display: flex;
}

/* 关键：用相对定位的包装器 */
.hover-preview-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0; /* 消除 inline-block 底部间隙 */
}

.hover-preview-image {
    max-width: 60vw;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
    display: block; /* 消除图片底部间隙 */
}

/* Canvas 精确覆盖图片，不拦截鼠标 */
.hover-preview-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    border-radius: 16px;
}




@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Floating Music Button Styles */
.floating-music-container {
    position: fixed;
    bottom: 55%;
    left: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.floating-music-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s ease;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
    -webkit-transition: transform 0.3s ease;
    -moz-transition: transform 0.3s ease;
    -ms-transition: transform 0.3s ease;
    -o-transition: transform 0.3s ease;
}

.floating-music-btn:hover {
    transform: scale(1.1);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
    -o-transform: scale(1.1);
}

.floating-music-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.floating-music-btn.playing img {
    animation: breatheRotate 1.5s ease-in-out infinite;
    -webkit-animation: breatheRotate 1.5s ease-in-out infinite;
}

@keyframes breatheRotate {
    0% {
        transform: scale(1) rotate(0deg);
        -webkit-transform: scale(1) rotate(0deg);
        -moz-transform: scale(1) rotate(0deg);
        -ms-transform: scale(1) rotate(0deg);
        -o-transform: scale(1) rotate(0deg);
}

    50% {
        transform: scale(3) rotate(180deg);
        -webkit-transform: scale(3) rotate(180deg);
        -moz-transform: scale(3) rotate(180deg);
        -ms-transform: scale(3) rotate(180deg);
        -o-transform: scale(3) rotate(180deg);
    }

    100% {
        transform: scale(1) rotate(360deg);
    }
}

@keyframes attention {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.floating-music-btn.attention {
    animation: attention 1s ease-in-out;
}

/* Music Text Styles */
.music-text-container {
    width: 60px;
    height: 20px;
    margin-top: 5px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.music-text {
    color: #666;
    /*Greycolor*/
    font-size: 12px;
    white-space: nowrap;
    position: absolute;
    left: 0;
    transition: transform 0.5s ease;
    /*Fadeeffectonbothends*/
    /* mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent); */
}

/* Animation for scrolling text */
.music-text-container.scrolling .music-text {
    animation: scrollText 12s linear infinite;
    -webkit-animation: scrollText 12s linear infinite;
}

/* Floating Door Button Styles */
.floating-door-container {
    position: fixed;
    bottom: 25%;
    left: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.floating-door-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.floating-door-btn:hover {
    transform: scale(1.1);
}

.floating-door-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Floating Language Button Styles */
.floating-lang-container {
    position: fixed;
    bottom: 45%;
    left: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.floating-lang-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffb3c2 0%, #ff8fab 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s ease, background 0.3s ease;
    font-family: 'CustomFont', Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
    -webkit-transition: transform 0.3s ease, background 0.3s ease;
    -moz-transition: transform 0.3s ease, background 0.3s ease;
    -ms-transition: transform 0.3s ease, background 0.3s ease;
    -o-transition: transform 0.3s ease, background 0.3s ease;
}

.floating-lang-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #ff8fab 0%, #ff6b8a 100%);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
    -o-transform: scale(1.1);
}

/* Floating Kid Mode Button Styles */
.floating-kid-container {
    position: fixed;
    bottom: 35%;
    left: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.floating-kid-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(90deg, #ff8fab 0%, #8fabff 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s ease, background 0.3s ease;
    font-family: 'CustomFont', Arial, sans-serif;
    font-size: 13px;
    font-weight: bold;
    color: #ffffff;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
    -webkit-transition: transform 0.3s ease, background 0.3s ease;
    -moz-transition: transform 0.3s ease, background 0.3s ease;
    -ms-transition: transform 0.3s ease, background 0.3s ease;
    -o-transition: transform 0.3s ease, background 0.3s ease;
}

.floating-kid-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(90deg, #8fabff 0%, #5bcffa 100%);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
    -o-transform: scale(1.1);
}

/* Floating Options Button Styles */
.floating-options-container {
    position: fixed;
    bottom: 15%;
    left: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.floating-options-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s ease, background 0.3s ease;
}

.floating-options-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #d0d0d0 0%, #b0b0b0 100%);
}

.floating-options-btn img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

/* Options Hint Bubble Styles */
.options-hint-bubble {
    position: absolute;
    left: 75px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #ff8fab 0%, #ff6b8a 100%);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(255, 107, 138, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    animation: hintPulse 2s ease-in-out infinite;
}

.options-hint-bubble.hidden {
    display: none;
}

.options-hint-text {
    color: #ffffff;
}

.options-hint-arrow {
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid #ff8fab;
}

@keyframes hintPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(255, 107, 138, 0.4);
        transform: translateY(-50%) scale(1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 107, 138, 0.7);
        transform: translateY(-50%) scale(1.03);
    }
}

/* Options Window Styles */
.options-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
}

.options-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    width: 90%;
    max-width: 400px;
    display: none;
    overflow: hidden;
}

.options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ffb3c2 0%, #ff8fab 100%);
    color: white;
}

.options-title {
    font-size: 20px;
    font-weight: bold;
}

.close-options-btn {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.2s ease;
}

.close-options-btn:hover {
    transform: scale(1.2);
}

.options-content {
    padding: 20px;
}

.volume-control {
    margin-bottom: 24px;
}

.volume-control:last-child {
    margin-bottom: 0;
}

.checkbox-control {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-control input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #ff8fab;
}

/* Guide Button Styles */
.guide-btn {
    background: linear-gradient(135deg, #ffb3c2 0%, #ff8fab 100%);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.guide-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #ff8fab 0%, #ff6b8a 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 138, 0.4);
}

/* Floating Achievements Button Styles */
.floating-achieve-container {
    position: fixed;
    bottom: 68%;
    left: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.floating-achieve-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s ease, background 0.3s ease;
    -webkit-transition: transform 0.3s ease, background 0.3s ease;
    -moz-transition: transform 0.3s ease, background 0.3s ease;
    -ms-transition: transform 0.3s ease, background 0.3s ease;
    -o-transition: transform 0.3s ease, background 0.3s ease;
}

.floating-achieve-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #ffe033 0%, #ffc700 100%);
}

.floating-achieve-btn img {
    width: 120%;
    height: 120%;
    object-fit: contain;
}

/* Achievement Badge (red dot with uncollected count) */
.achieve-badge {
    position: absolute;
    right: -8px;
    bottom: -8px;
    min-width: 18px;
    height: 18px;
    background: #ff3b30;
    color: #ffffff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.5);
    z-index: 1000;
    line-height: 1;
    border: 2px solid #ffffff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.achieve-badge.badge-hidden {
    display: none;
}

/* Achievements Window Styles */
.achieve-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
}

.achieve-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    width: 90%;
    max-width: 1200px;
    max-height: 85vh;
    display: none;
    overflow: hidden;
}

.achieve-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #333;
    position: relative;
}

.achieve-title {
    font-size: 20px;
    font-weight: bold;
}

.achieve-header-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    right: 20px;
}

.close-achieve-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.2s ease;
}

.close-achieve-btn:hover {
    transform: scale(1.2);
}

.reset-achieve-btn {
    background: none;
    border: 2px solid #333;
    color: #333;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 4px;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.reset-achieve-btn:hover {
    transform: scale(1.1);
    background-color: #333;
    color: #ffd700;
}

.achieve-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(85vh - 60px);
}

.achieve-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding-bottom: 40px;
}

.achieve-item {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe4e1 100%);
    border-radius: 12px;
    padding: 12px;
    border: 2px solid #ffb3c2;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.achieve-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 179, 194, 0.4);
}

.achieve-item.locked {
    opacity: 0.5;
    background: #f5f5f5;
    border-color: #ddd;
}

.achieve-item.unlocked {
    background: linear-gradient(180deg, #f5f5f5 0%, #d4d4d4 100%);
    border-color: #2e2e2e;
}

.achieve-item.highlight {
    background: #ffb3c2 !important;
    border-color: #ff8fa3 !important;
    box-shadow: 0 0 16px rgba(255, 179, 194, 0.8) !important;
    transform: scale(1.05) !important;
}

.achieve-item.highlight {
    background: #ffb3c2 !important;
    border-color: #ff8fa3 !important;
    box-shadow: 0 0 16px rgba(255, 179, 194, 0.8) !important;
    transform: scale(1.05) !important;
}

.achieve-title-text {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    text-align: center;
}

.achieve-desc {
    font-size: 12px;
    color: #666;
    text-align: center;
    line-height: 1.3;
}

.achieve-item.unlocked .achieve-title-text,
.achieve-item.unlocked .achieve-desc {
    color: #2e2e2e;
}

.achieve-bun-counter {
    position: absolute;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bun-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    transition: transform 0.05s ease;
}

.bun-count {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    transition: transform 0.05s ease;
}

.bun-count.pulse {
    transform: scale(1.5);
}

.bun-icon.pulse {
    transform: scale(1.4);
}

.shop-btn {
    background: linear-gradient(135deg, #ff8fab 0%, #ff6b8a 100%);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shop-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 138, 0.4);
}

.shop-btn img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.achieve-item .item-bun-counter {
    position: absolute;
    top: 6px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.achieve-item .item-bun-icon {
    width: 15px;
    height: 15px;
    object-fit: contain;
}

.achieve-item .item-bun-count {
    font-size: 11px;
    font-weight: bold;
    color: #666;
}

.achieve-unlock-badge {
    display: none;
    width: 20px;
    height: 20px;
    background: #66bb6a;
    border-radius: 50%;
    position: absolute;
    top: -5px;
    right: -5px;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

.achieve-item.unlocked .achieve-unlock-badge {
    display: flex;
}


.checkbox-control label {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    cursor: pointer;
}

.volume-control label {
    display: block;
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.volume-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: calc(100% - 60px);
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    vertical-align: middle;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffb3c2;
    cursor: pointer;
    border: 2px solid #ff8fab;
    margin-top: 0px;
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffb3c2;
    cursor: pointer;
    border: 2px solid #ff8fab;
}

.volume-value {
    display: inline-block;
    width: 50px;
    text-align: right;
    font-size: 14px;
    color: #666;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes scrollText {
    0% {
        transform: translateX(100%);
        -webkit-transform: translateX(100%);
        -moz-transform: translateX(100%);
        -ms-transform: translateX(100%);
        -o-transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
        -webkit-transform: translateX(-100%);
        -moz-transform: translateX(-100%);
        -ms-transform: translateX(-100%);
        -o-transform: translateX(-100%);
    }
}

/* Sliding banner - visible after confirmBtn click */
.sliding-banner {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 28px;
    overflow: hidden;
    background: transparent;
    display: none; /* Hidden by default */
}

.sliding-banner.visible {
    display: block;
}

.sliding-track {
    display: inline-flex;
    position: absolute;
    left: 0;
    top: 0;
}

.sliding-text {
    white-space: nowrap;
    font-weight: bold;
    color: #000000;
    font-size: 16px;
    margin-right: 20px;
    line-height: 28px;
}

.sliding-text::after {
    content: attr(data-text);
    display: inline-block;
    margin-left: 20px;
}

/* 首页特定样式 */
.flicker-text {
    font-size: 32px;
    letter-spacing: 4px;
    transition: opacity 0.3s ease;
}

.flicker-text.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 第二页样式调整 */
.second-page .game-image {
    margin-top: 2em;
}


.new_button {
    background-color: #606060;
    border: none;
    color: white;
    padding: 8px 12px;
    font-size: 14px;
    font-family: 'CustomFont', Arial, sans-serif;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 4px;
}

.new_button:hover {
    background-color: #808080;
}


/* Tank Volume Slider Styles */
#tankVolumeSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 8px;
  border-radius: 4px;
  background: #ddd;
  outline: none;
}

/* WebKit browsers (Chrome, Safari, Edge) */
#tankVolumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffb3c2;
  cursor: pointer;
  border: 2px solid #ff8fab;
  margin-top: -5px; /* Center thumb vertically */
}

/* Mozilla Firefox */
#tankVolumeSlider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffb3c2;
  cursor: pointer;
  border: 2px solid #ff8fab;
}

/* WebKit track styling for filled portion */
#tankVolumeSlider::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #ffb3c2 0%, #ffb3c2 var(--value), #ddd var(--value), #ddd 100%);
}

/* Firefox track styling */
#tankVolumeSlider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: #ddd;
}