body {
    font-family: "Segoe UI", sans-serif;
    margin: 0;
    overflow: hidden;
    text-align: center;
    background: url("../songnuoc.png") repeat center center;
    background-size: cover; /* Hoặc auto tùy kích thước ảnh */
    animation: scrollWateX 300s linear infinite, scrollWaterY 3s linear infinite;
}
@keyframes scrollWateX {
    0% {
        background-position-x: 0;
    }
    100% {
        background-position-x: 2000%;
    }
}
@keyframes scrollWaterY {
    0% {
        background-position-y: 0;
    }
    50% {
        background-position-y: 10px;
    }
    100% {
        background-position-y: 0;
    }
}
h1 { color: white; text-shadow:2px 2px 5px #000; margin-top:10px; }
#controls { position: fixed; top: 0px; right: 0px; margin:0px; z-index: 900; }
#pond-container { overflow:hidden; width:100vw; height:100vh; border-top:6px solid white; border-bottom:6px solid #004080; position:relative; }
#pond { position: absolute; top: 200px; left: 0; width: 13000px; height: calc(100% - 200px); transition: transform 0.1s linear; z-index: 11; }
.duck { position:absolute; left:0; width:170px; height:170px; z-index: 1 }
.duck img { width:170px; height:170px; transform: scaleX(1)}
.duck .index {
    position: absolute;
    bottom: 53px;
    right: 61px;
    z-index: 1;
    text-align: center;
    display: block;
    width: 39px;
    color: #000;
    font-weight: bold;
    font-size: 14px;
}
.name {
    color: black;
    font-weight: bold;
    font-size: 14px;
    position: absolute;
    top: 40px;
    right: 40px;
    background: #fff;
    padding: 4px 8px;
    text-align: center;
    border-radius: 6px;
    transform: translate(-45px, 5px);
}
.name::after {
    content: '';
    position: absolute;
    display: block;
    width: 0;
    z-index: 1;
    border-style: solid;
    border-color: #ffffff transparent;
    border-width: 10px 10px 0;
    bottom: -8px;
    right: 2px;
    margin-left: -14px;
}

#countdown { font-size:160px; color:white; text-shadow:2px 2px 5px black; position:absolute; top:50%; width:100%; display:none; z-index:4; }
#raceTimer { position: fixed; top:210px; right:10px; font-size:60px; color:black; text-shadow:1px 1px 3px black; z-index:5; background: url("../thoigian.png") no-repeat; background-size: 100% 100%; padding: 16px; }
#result { position: absolute; top: 90px; left: 50%; transform: translate(-50%, -50%); font-size: 60px; color: black; text-shadow: 1px 1px 3px black; margin-top: 10px; z-index: 12; text-align: center; pointer-events: none; background: gold; background: url("../bangten.png") no-repeat; background-size: 100% 100%; padding: 6px 16px; max-width: 80vw; }
.bubble { position:absolute; width:10px; height:10px; background:rgba(255,255,255,0.7); border-radius:50%; animation:bubbleUp 2s linear forwards; z-index:1; }
.splash { position:absolute; width:15px; height:15px; border-radius:50%; background:rgba(255,255,255,0.8); animation:splashUp 0.6s ease-out forwards; }
.confetti { position:absolute; width:8px; height:8px; border-radius:2px; animation:confettiFall 1s linear forwards; }
.water-ring { position: absolute; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.6); border-radius: 50%; opacity: 1; animation: ringExpand 1.5s ease-out forwards; pointer-events: none; z-index: 1; }
@keyframes bubbleUp { 0% { transform:translateY(0); opacity:1; } 100% { transform:translateY(-80px); opacity:0; } }
@keyframes splashUp { 0%{ transform:scale(1) translateY(0); opacity:1; } 100%{ transform:scale(2) translateY(-40px); opacity:0; } }
@keyframes confettiFall { 0%{ opacity:1; transform:translateY(0) rotate(0deg);} 100%{opacity:0; transform:translateY(-80px) rotate(360deg);} }
@keyframes ringExpand { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(6); opacity: 0; } }
.winner-glow { box-shadow: 0 0 30px 10px gold; border-radius: 50%; animation: glowRotate 2s linear infinite; }
#bank { position: absolute; top: 0; left: -1000px; width: 13000px; height: 180px; background: url("../boco.jpg") repeat-x center bottom; z-index: 5; }
.tree { position: absolute; bottom: 0; background-repeat: no-repeat; background-position: center bottom; background-size: contain; pointer-events: none; z-index: 6; }
.bo { position: absolute; top: 160px; left: -1000px; width: 13000px; height: 50px; background: url("../bo.png") repeat-x center bottom; z-index: 8; }
.xuatphat { position: absolute; top: 50%; left: 50%; width: 600px; height: 400px; background: url("../xuatphat.png") no-repeat center center; background-size: contain; transform: translate(-50%, -50%); z-index: 10; transition: opacity 0.8s ease-out; }
.vedich { display: none !important;position: absolute; top: 50%; left: 50%; width: 600px; height: 400px; background: url("../vedich.png") no-repeat center center; background-size: contain; transform: translate(-50%, -50%); z-index: 10; transition: opacity 0.8s ease-out; }
.hidden { opacity: 0; pointer-events: none; }
.menu-container {
    background: url("../menu1.png") no-repeat;
    width: 992px;
    height: 488px;
    box-sizing: border-box;
    padding: 60px 88px 15px 95px;
    background-size: 100% 100%;
    flex-direction: row;
    display: flex;
    transition: transform 0.3s ease;
    z-index: 1000;
    text-align: left;
}

.menu-container * {
    box-sizing: border-box;
}
.menu-container .wrapper {
    width: 100%;
    height: calc(100% - 80px);
    overflow: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    box-shadow: 0px 4px 5px 0px rgba(0,0,0,0.1);
    padding: 0 15px 30px;
}

.menu-container .danhsach {
    padding: 0 15px;
    width: 50%;
}

.menu-container .setup {
    width: 50%;
    /*display: flex;*/
    padding: 0 15px;
}
.menu-container .setup .col {
    /*width: 33.3333%;*/
    /*padding: 0 15px;*/
}
.menu-container .btn-actions {
    position: absolute;
    bottom: 25px;
    right: 105px;
    justify-content: right;
    width: 350px;
    display: flex;
    gap: 15px;
}

.winner-menu { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: flex; justify-content: center; align-items: center; z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; z-index: 1000; }
.winner-menu.show { opacity: 1; pointer-events: all; }
.winner-menu.show .menu-container { transform: scale(1); }
.close-btn { margin-top: 10px; background: #ff4d4d; border: none; color: white; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.clear-btn { background: #ff9800; border: none; color: white; padding: 6px 12px; border-radius: 8px; cursor: pointer; margin-right: 8px; }
.buton_dk{ position: fixed; bottom:10px; right: 10px; }
#winnerList { padding-right: 5px; }
.danhsach h3, .setup h3 {
    border-bottom: 2px solid #0078ff;
    padding-bottom: 6px;
    color: #0078ff;
    font-size: 20px;
    margin: 10px 0;
}
input{ font-size: 20px !important; width: 20px; height: 20px; accent-color: #0078ff; cursor: pointer; }
.question-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 200; }
.qbox { background: white; padding: 20px; border-radius: 12px; max-width: 500px; text-align: left; color: black; }
.qbox .highlight { color: #0077ff; font-weight: bold; }
#questionArea h3{ font-size: 28px !important; }
#questionArea button{ font-size: 28px !important; border-radius: 6px; margin: 0 10px; }
#questionArea{ z-index: 900; }
.traloicauhoi { display: flex; justify-content: center; align-items: center; position: absolute; top: 50%; right: 10px; z-index: 2000; }
.traloicauhoi span{ color: aliceblue!important; }
button#traloi { padding: 20px 40px; font-size: 24px; color: #fff; border: none; border-radius: 12px; box-shadow: 0 8px 15px rgba(0,0,0,0.3); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; display: none; }
button:hover { transform: scale(1.1); box-shadow: 0 12px 20px rgba(0,0,0,0.4); }
#questionCountdown{ font-size: 36px; font-weight: bold; }
.btn-overlay { position: relative; border: none; padding: 0px !important; background: none; background-size: contain; cursor: pointer; }
.btn-overlay img { width: 160px; height: 50px; }
.btn-overlay span {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    width: 100%;
}
.btn-overlay:hover span{ color: greenyellow; }
button {padding:6px; font-size:18px; background:#ffdd00; border:none; cursor:pointer; transition:0.3s; }
button:hover { background:#ffcc00; border-radius: 10px;}
.btn_boqua{ background-color: red; color: white !important; }
#closeMenu{

}
.menu { position: fixed; top: 0; right: 0; background:url("../button_menu.png") no-repeat center; color: white; display: flex; align-items: center; gap: 10px; padding:6px; background-size: 100% 100%; border-bottom-left-radius: 10px; z-index: 100; width: auto; max-width: 100vw; }
#lopname { font-size: 18px; font-weight: 600; margin: 0; white-space: nowrap; }

.start-line,
.finish-line {
    position: absolute;
    top: 180px;
    height: calc(100% - 180px);
    z-index: 1;
    width: 80px;
    background-color: white;
    /* Tạo họa tiết caro đen trắng */
    background-image:
            linear-gradient(45deg, #8b1419 25%, transparent 25%, transparent 75%, #8b1419 75%, #8b1419),
            linear-gradient(45deg, #8b1419 25%, transparent 25%, transparent 75%, #8b1419 75%, #8b1419);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.start-line {
    left: 100px;
}

.finish-line {
    left: -100%;
}



/*
    start welcome screen
*/
/* Màn hình chào m?ng */
#welcomeScreen {
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #74ebd5, #ACB6E5);
    font-family: "Poppins", sans-serif;
    text-align: center;
    color: #fff;
    transition: opacity 1s ease;
    z-index: 1000;
    overflow: hidden;
}

#lang_switch input {
    display: none;
}
#lang_switch input + svg {
    width: 50px;
    border: 1px solid #fff;
    cursor: pointer;
    height: auto;
}

/* Logo góc trên ph?i */
#welcomeScreen .logo {
    position: absolute;
    top: 15px;
    right: 25px;
    flex-direction: column; /* thêm dòng này d? xu?ng dòng */
    align-items: flex-end;  /* can ph?i */
    align-items: center;
    gap: 10px;
    animation: slideInRight 1.2s ease;
}

#welcomeScreen .logo img {
    width: 50px;
    height: 50px;
}

#welcomeScreen .logo span {
    font-size: 1.4em;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Tiêu d? */
#welcomeScreen .title {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 30px;
    animation: slideDown 1.2s ease;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.4);
}

/* Nút b?t d?u */
#welcomeScreen button {
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    background: #ff9800;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    animation: fadeIn 2s ease;
}

#welcomeScreen button:hover {
    background: #ffb84d;
    transform: scale(1.05);
    box-shadow: 0 8px 18px rgba(0,0,0,0.4);
}

/* Hi?u ?ng khi bi?n m?t */
#welcomeScreen.fadeOut {
    opacity: 0;
    pointer-events: none;
}

/* Keyframes */
@keyframes slideDown {
    from {transform: translateY(-100px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}

@keyframes slideInRight {
    from {transform: translateX(100px); opacity: 0;}
    to {transform: translateX(0); opacity: 1;}
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}
/* Gradient d?ng cho welcome screen */
#welcomeScreen {
    background: linear-gradient(135deg, #74ebd5, #ACB6E5, #fbc2eb, #a6c1ee);
    background-size: 400% 400%;
    animation: gradientMove 10s ease infinite;
}

/* Hi?u ?ng gradient ch?y */
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Tiêu d? ánh sáng ch?y qua */
#welcomeScreen .title {
    position: relative;
    overflow: hidden;
}
#welcomeScreen .title::after {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: shine 3s infinite;
}
@keyframes shine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Nút Start rung nh? */
#welcomeScreen button {
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
    60% { transform: translateY(-3px); }
}

/* Khi bi?n m?t: zoom out + fade */
#welcomeScreen.fadeOut {
    opacity: 0;
    transform: scale(1.2);
    transition: opacity 1s ease, transform 1s ease;
}
/*
    end welcome screen
*/

#closeSetting {
    position: absolute;
    top: 15px;
    right: 85px;
}