@font-face {
    font-family: 'CustomFont';
    src: url('font/font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
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;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.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;
    opacity: 0.9;
}

.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;
}

.footer-divider {
    opacity: 0.5;
}

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;
}

#startBtn {
    border-radius: 50px;
    -webkit-border-radius: 50px;
    -moz-border-radius: 50px;
    -ms-border-radius: 50px;
    -o-border-radius: 50px;
}



@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: 600px;
    margin: 0 auto;
}

.ranking-block>div {
    width: 220px;
}

.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-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 {
    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);
}

/* 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: transparent;
    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: transparent;
    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 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;
}

.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;
}