* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Prompt', 'Kanit', sans-serif;
    image-rendering: pixelated;
}

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&family=Kanit:wght@300;400;500;600;700&display=swap');

body {
    background:#99ddff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;
}

/* กรณีมี 2 แบนเนอร์ (prize + countdown) */
body.has-double-banner .container,
.container.has-double-banner {
    margin-top: 200px !important;
}
@media (max-width: 768px) {
    body.has-double-banner .container,
    .container.has-double-banner {
        margin-top: 120px !important;
    }
}
@media (max-width: 480px) {
    body.has-double-banner .container,
    .container.has-double-banner {
        margin-top: 100px !important;
    }
}

/* ลบ margin-top เดิมของ .container */
.container {
    margin-top: 0 !important;
    display: flex;
    width: 1000px;
    gap: 20px;
}

.game-container {
    flex: 2;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
    height: auto;
    min-height: 580px;
    position: relative;
    border: 5px solid #4CABE8;
}

.scoreboard-container {
    flex: 1;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    padding: 20px;
    height: auto;
    min-height: auto;
    overflow-y: visible;
    border: 5px solid #4CABE8;
    display: flex;
    flex-direction: column;
}

h1, h2 {
    text-align: center;
    font-weight: 600;
    margin-bottom: 22px;
    color: #007BFF;
    font-size: 24px;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
    letter-spacing: 0.5px;
}

/* Login Screen */
#login-screen {
    min-height: 250px;
    position: relative;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 300px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    margin-bottom: 1px;
}

input {
    padding: 12px;
    border: 3px solid #4DC1F9;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Prompt', 'Kanit', sans-serif;
    background-color: #F0F9FF;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

button {
    padding: 12px 18px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    line-height: 1.3;
    box-shadow: 0 4px 0 #3D8B40;
    font-weight: 500;
    font-family: 'Prompt', 'Kanit', sans-serif;
}

button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #3D8B40;
}

/* Login Screen */
#login-btn {
    padding: 13px 18px;
    font-size: 17px;
    font-weight: 500;
    box-shadow: 0 5px 0 #3D8B40;
    transition: all 0.2s ease-in-out;
}

#login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 #3D8B40;
}

#login-btn:active {
    transform: translateY(2px);
    box-shadow: 0 3px 0 #3D8B40;
}

.error-message {
    color: #FF5252;
    font-size: 13px;
    text-align: center;
    background-color: rgba(255, 82, 82, 0.1);
    padding: 4px 6px;
    border-radius: 6px;
    border-right: 3px solid #FF5252;
    border-left: 3px solid #FF5252;
    display: block;
    transition: all 0.2s ease;
    max-height: 35px;
    margin-top: 2px;
    position: static;
    overflow: visible;
    background-color: #FFEBEE;
    font-weight: 500;
}

.error-message:empty {
    max-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 24px;
    color: #007BFF;
    position: relative;
    gap: 30px;
}

#game-area {
    position: relative;
    height: 350px;
    border-bottom: 4px solid #333;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    background: linear-gradient(180deg, #87CEEB 0%, #4DC1F9 100%);
}

/* Animation สำหรับเวลากลางวัน */
@keyframes day-sky {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}

/* Animation สำหรับเวลาเย็น */
@keyframes evening-sky {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}

/* Animation สำหรับเวลากลางคืน */
@keyframes night-sky {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}

/* พื้นหลังเวลากลางวัน (ค่าเริ่มต้น) */
#game-area.day-background {
    background: linear-gradient(180deg, #87CEEB 0%, #4DC1F9 100%) !important;
    transition: background 1.5s ease;
    position: relative;
    overflow: hidden;
}

.day-sun {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, #FFFF8F 10%, #FFD700 60%, #FFA500 100%);
    box-shadow: 0 0 30px 10px rgba(255, 215, 0, 0.4);
    top: 40px;
    left: 50px;
    z-index: 2;
}

/* พื้นหลังเวลาเย็น (สีส้ม) */
#game-area.evening-background {
    background: linear-gradient(180deg, #FF7F50 0%, #FFA07A 100%) !important;
    transition: background 1.5s ease;
    position: relative;
    overflow: hidden;
}

.sunset {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, #FF5F1F 20%, #FF4500 70%, #8B0000 100%);
    box-shadow: 0 0 30px 10px rgba(255, 69, 0, 0.25);
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.sunset-rays {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.4) 0%, rgba(255, 69, 0, 0.3) 30%, rgba(255, 140, 0, 0.2) 50%, rgba(255, 69, 0, 0.05) 70%, transparent 80%);
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    pointer-events: none;
}

/* พื้นหลังเวลากลางคืน (สีม่วงดำ) */
#game-area.night-background {
    background: linear-gradient(180deg, #191970 0%, #4B0082 100%) !important;
    transition: background 2s ease;
    position: relative;
    overflow: hidden;
}

.night-moon {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 15px 15px, #FFFAE6 60%, #FFEA94 100%);
    box-shadow: 0 0 20px 5px rgba(255, 234, 148, 0.3);
    top: 30px;
    right: 50px;
    z-index: 2;
}

.night-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(2px 2px at 20px 30px, #ffffff 100%, transparent), 
                       radial-gradient(2px 2px at 40px 70px, #ffffff 100%, transparent),
                       radial-gradient(1px 1px at 90px 40px, #ffffff 100%, transparent),
                       radial-gradient(1px 1px at 160px 20px, #ffffff 100%, transparent),
                       radial-gradient(2px 2px at 200px 50px, #ffffff 100%, transparent),
                       radial-gradient(1px 1px at 300px 30px, #ffffff 100%, transparent),
                       radial-gradient(2px 2px at 350px 70px, #ffffff 100%, transparent),
                       radial-gradient(1px 1px at 400px 40px, #ffffff 100%, transparent);
    background-repeat: repeat;
    background-size: 450px 200px;
    opacity: 0.6;
    animation: twinkle-stars 5s linear infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes twinkle-stars {
    0% { opacity: 0.4; }
    50% { opacity: 0.8; }
    100% { opacity: 0.4; }
}

/* ID ตรงๆ สำหรับการเปลี่ยนพื้นหลัง */
#day-sky {
    background: linear-gradient(180deg, #87CEEB 0%, #4DC1F9 100%);
}

#evening-sky {
    background: linear-gradient(180deg, #FF7F50 0%, #FFA07A 100%);
}

#night-sky {
    background: linear-gradient(180deg, #191970 0%, #4B0082 100%);
}

/* พื้นหลังนอกโลก (อวกาศ) */
.space-background {
    background: linear-gradient(180deg, #000033 0%, #3a1866 100%) !important;
    position: relative;
    overflow: hidden;
}

#stars-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/stars.svg');
    background-size: cover;
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
    animation: stars-twinkle 60s linear infinite;
}

@keyframes stars-twinkle {
    0% { opacity: 0.5; }
    50% { opacity: 0.7; }
    100% { opacity: 0.5; }
}

/* Space dust particles - reduced number and simplified animation */
.space-dust {
    position: absolute;
    background-color: #ffffff;
    border-radius: 50%;
    opacity: 0.3;
    pointer-events: none;
    z-index: 2;
    animation: space-dust-float linear infinite;
}

@keyframes space-dust-float {
    0% { transform: translateX(0); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% { transform: translateX(-100vw); opacity: 0; }
}

/* Galaxy swirl effects - reduced number and simplified */
.galaxy-swirl {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.15) 0%, rgba(75, 0, 130, 0.1) 50%, rgba(0, 0, 33, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.4;
    transform: rotate(0deg);
    animation: galaxy-rotate 90s linear infinite;
}

@keyframes galaxy-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Coin Character (Bird) */
#bird {
    position: absolute;
    width: 40px;
    height: 40px;
    background-image: url('../images/coin.svg');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 100;
    left: 20%;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.1s;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.3));
}

/* Obstacles - Pipes */
.pipe {
    position: absolute;
    width: 60px;
    background-color: #74BF2E;
    border: 4px solid #2F5D14;
    z-index: 50;
    display: block !important;
    box-shadow: 2px 0 8px rgba(0,0,0,0.2);
}

.pipe-top {
    top: 0;
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.pipe-bottom {
    bottom: 0;
    border-top: none;
    border-radius: 8px 8px 0 0;
}

.pipe-cap {
    position: absolute;
    width: 70px;
    height: 24px;
    background-color: #7AD532;
    border: 4px solid #2F5D14;
    left: -9px;
    z-index: 51;
    display: block !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.pipe-cap-top {
    bottom: -1px;
    border-radius: 8px 8px 12px 12px;
}

.pipe-cap-bottom {
    top: -1px;
    border-radius: 12px 12px 8px 8px;
}

#obstacles-container {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 50;
}

#ground {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 40px;
    background-color: #DED895;
    background-image: url('../images/ground.svg');
    background-repeat: repeat-x;
    z-index: 90;
    box-shadow: 0 -4px 8px rgba(0,0,0,0.2);
    border-top: 3px solid #C7B36E;
}

#clouds {
    display: none;
}

.cloud {
    display: none;
}

/* แยกแอนิเมชัน float แบบเดิมออกเพื่อไม่ให้ส่งผลต่อการเคลื่อนที่ทางแนวนอน */
@keyframes float-vertical {
    0% { margin-top: 0; }
    50% { margin-top: -10px; }
    100% { margin-top: 0; }
}

@keyframes slight-rotate {
    0% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
    100% { transform: rotate(-2deg); }
}

/* แก้ไขคลาสของเมฆให้ใช้ margin-top แทน transform เพื่อไม่ให้กระทบการเคลื่อนที่ทางแนวนอน */
.cloud-normal {
    display: none;
}

.cloud-fluffy {
    display: none;
}

.cloud-small {
    display: none;
}

.cloud:nth-child(2n) {
    display: none;
}

.cloud:nth-child(3n) {
    display: none;
}

.cloud-normal {
    display: none;
}

.cloud-fluffy {
    display: none;
}

.cloud-small {
    display: none;
}

.cloud:hover {
    display: none;
}

@keyframes float-cloud {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}

.game-controls {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.game-controls p {
    margin-bottom: 0;
    color: #0067B3;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.6);
    padding: 10px 18px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 500;
}

/* Scoreboard */
#scoreboard-list {
    max-height: none;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
    flex-grow: 0;
}

.scoreboard-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-gap: 10px;
    align-items: center;
    padding: 10px 15px;
    background-color: #E9F7FF;
    border-radius: 12px;
    font-size: 16px;
    border: 2px solid #78D3FF;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: all 0.2s;
    color: #0067B3;
    margin-bottom: 8px;
}

.scoreboard-item:hover {
    /* ปิดการทำงานของ hover effect */
    transform: none;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    background-color: #E9F7FF;
}

.scoreboard-item .rank {
    font-weight: 600;
    color: #0067B3;
    display: flex;
    align-items: center;
    min-width: 40px;
}

.scoreboard-item .phone {
    font-size: 16px;
    color: #0067B3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    justify-self: center;
    font-weight: 400;
}

.scoreboard-item .score {
    font-weight: 600;
    font-size: 16px;
    color: #0067B3;
    text-align: right;
    min-width: 40px;
    justify-self: end;
}

.scoreboard-item .prize {
    font-weight: 600;
    font-size: 16px;
    color: #0067B3;
    text-align: right;
    min-width: 65px;
    justify-self: end;
    padding-left: 8px;
    border-left: 1px solid rgba(0, 103, 179, 0.2);
}

.scoreboard-item:nth-child(1) .prize {
    color: #FFD700;
    text-shadow: 0 0 2px rgba(255, 215, 0, 0.5);
}

.scoreboard-item:nth-child(2) .prize {
    color: #C0C0C0;
    text-shadow: 0 0 2px rgba(192, 192, 192, 0.5);
}

.scoreboard-item:nth-child(3) .prize {
    color: #CD7F32;
    text-shadow: 0 0 2px rgba(205, 127, 50, 0.5);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Bird Animation */
@keyframes fly {
    0% { transform: translateY(-50%) rotate(0deg); }
    25% { transform: translateY(-50%) rotate(-5deg); }
    75% { transform: translateY(-50%) rotate(5deg); }
    100% { transform: translateY(-50%) rotate(0deg); }
}

#bird {
    animation: fly 0.6s infinite;
}

#bird.flying-up {
    transform: translateY(-50%) rotate(-20deg);
    animation: none;
}

#bird.falling {
    transform: translateY(-50%) rotate(20deg);
    animation: none;
}

/* Debug Outline */
.debug #bird, .debug .pipe {
    outline: 2px solid red;
}

/* Mobile Responsiveness - Enhanced */

/* Tablets and smaller laptops */
@media (max-width: 1024px) {
    .container {
        width: 100%;
        padding: 10px;
        flex-direction: column;
    }
    
    .game-container, .scoreboard-container {
        width: 100%;
        height: auto;
        max-width: 600px;
        margin: 20px auto;
    }
    
    .scoreboard-container {
        height: auto;
        min-height: auto;
        overflow-y: visible;
        padding: 15px;
    }
    
    #game-area {
        height: 50vh; /* Use viewport height */
        min-height: 300px;
        max-height: 450px;
    }
    
    .game-btn {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    /* Make touch targets larger */
    #logout-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    /* Adjust trophy size for smaller screens */
    .trophy {
        font-size: 1.5em;
    }
}

/* Medium sized phones/tablets - Portrait orientation */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 0;
    }
    
    .game-container, .scoreboard-container {
        height: auto;
        min-height: auto;
        padding: 15px;
    }
    
    .game-header {
        font-size: 20px;
        gap: 20px;
    }
    
    #game-area {
        height: 45vh;
        min-height: 280px;
    }
    
    h1, h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .game-btn {
        padding: 12px 22px;
        font-size: 15px;
    }
    
    .final-score {
        padding: 18px 25px;
        font-size: 16px;
    }
    
    .scoreboard-item .phone {
        font-size: 15px;
        text-align: center;
        flex: 1;
    }
}

/* Small phones */
@media (max-width: 480px) {
    body {
        font-size: 14px;
        padding: 5px;
    }
    
    .game-container, .scoreboard-container {
        height: auto;
        min-height: auto;
        padding: 12px;
    }
    
    #game-area {
        height: 40vh;
        min-height: 250px;
    }
    
    .game-header {
        gap: 20px;
        font-size: 18px;
    }
    
    /* Adjust logout button position for small screens */
    #logout-btn {
        display: block;
        margin: 8px auto 0;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    h1, h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .scoreboard-item {
        padding: 5px 6px;
        font-size: 12px;
        grid-gap: 5px;
    }
    
    .scoreboard-item .phone,
    .scoreboard-item .score,
    .scoreboard-item .prize {
        font-size: 13px;
    }
    
    .scoreboard-item .prize {
        min-width: 55px;
        padding-left: 5px;
    }
    
    /* Position game buttons lower on small screens to create more space */
    #game-buttons {
        top: 82%;
    }
    
    /* Make final score display smaller and higher on small screens */
    .final-score {
        top: 35%;
        padding: 15px 20px;
        font-size: 14px;
        min-width: 200px;
        border-width: 3px;
    }
    
    .final-score-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .final-score-value {
        font-size: 28px;
    }
    
    /* Make trophy smaller on very small screens */
    .trophy {
        font-size: 1.2em;
        margin-right: 5px;
    }
    
    /* Adjust login form for smaller screens */
    .login-form {
        width: 100%;
    }
    
    input, button {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    #game-buttons {
        gap: 10px;
    }
    
    .game-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* Extra Small phones */
@media (max-width: 360px) {
    .game-container, .scoreboard-container {
        height: auto;
        min-height: auto;
        padding: 10px;
    }
    
    .game-header {
        font-size: 16px;
        gap: 12px;
        margin-bottom: 10px;
    }
    
    #game-area {
        height: 35vh;
        min-height: 200px;
        border-radius: 10px;
    }
    
    h1, h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .scoreboard-item {
        padding: 4px 5px;
        font-size: 11px;
        grid-gap: 4px;
    }
    
    .scoreboard-item .phone,
    .scoreboard-item .score,
    .scoreboard-item .prize {
        font-size: 11px;
    }
    
    .scoreboard-item .prize {
        min-width: 45px;
        padding-left: 3px;
    }
    
    .game-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 90px;
    }
    
    .game-controls p {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    #logout-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    /* Move final score higher on the screen */
    .final-score {
        top: 30%;
        padding: 12px 15px;
        font-size: 12px;
        min-width: 180px;
        border-width: 2px;
    }
    
    .final-score-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .final-score-value {
        font-size: 24px;
    }
    
    /* Move game buttons lower on the screen */
    #game-buttons {
        top: 85%;
    }
    
    #game-buttons {
        gap: 8px;
    }
}

/* Tall narrow screens (like 360x740) */
@media (max-width: 360px) and (min-height: 700px) {
    #game-area {
        height: 50vh;
        min-height: 300px;
    }
    
    /* Create more space between elements */
    .final-score {
        top: 25%;
    }
    
    #game-buttons {
        top: 88%;
    }
}

/* Landscape mode on phones */
@media (max-height: 480px) and (orientation: landscape) {
    .container {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .game-container {
        flex: 1 1 65%;
        height: 80vh;
        max-height: none;
    }
    
    .scoreboard-container {
        flex: 1 1 30%;
        height: 80vh;
        max-height: none;
    }
    
    #game-area {
        height: 70%;
    }
    
    .game-header {
        margin-bottom: 10px;
    }
    
    h1, h2 {
        margin-bottom: 10px;
    }
    
    .game-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    #bird {
        width: 30px;
        height: 30px;
    }
    
    /* Adjust spacing around game area */
    .game-controls {
        margin-top: 10px;
        gap: 8px;
    }
}

/* Game Buttons */
#game-buttons {
    position: absolute;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    display: flex;
    flex-direction: row;
    gap: 15px;
    text-align: center;
}

.game-btn {
    padding: 14px 30px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 6px 0 #3D8B40;
    transition: all 0.2s;
}

.game-btn:hover {
    background-color: #45a049;
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 8px 0 #3D8B40;
}

.game-btn:active {
    transform: scale(1) translateY(3px);
    box-shadow: 0 3px 0 #3D8B40;
}

/* Game Over Score Display */
.final-score {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 20px 30px;
    border-radius: 15px;
    text-align: center;
    z-index: 199;
    font-size: 16px;
    border: 4px solid #45a049;
    min-width: 220px;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
}

/* Level Up Message */
.level-up-message {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 87, 34, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 22px;
    font-weight: bold;
    z-index: 200;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 87, 34, 0.6);
    animation: pulse 0.5s infinite alternate;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
}

.level-up-message span {
    display: inline-block;
    animation: bounce 0.5s infinite alternate;
    margin: 0 5px;
    font-size: 24px;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

@keyframes pulse {
    from { transform: translate(-50%, -50%) scale(1); }
    to { transform: translate(-50%, -50%) scale(1.1); }
}

.level-up-message.fade-out {
    opacity: 0;
    transition: opacity 0.5s;
}

.final-score-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #c62828;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.final-score-value {
    font-size: 30px;
    color: #FFD700;
    margin-top: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#logout-btn {
    background-color: #ff5252;
    box-shadow: 0 4px 0 #c62828;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

#logout-btn:hover {
    background-color: #ff6b6b;
    transform: translateY(-2px);
}

#logout-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #c62828;
}

/* Admin Footer Styles */
.game-footer {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
}

.admin-link {
    margin-top: 15px;
}

.admin-btn {
    display: inline-block;
    background-color: #333;
    color: #fff;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s;
}

.admin-btn:hover {
    background-color: #555;
}

.rules-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #0067B3;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rules-btn:hover {
    background-color: #0078d4;
    transform: scale(1.1);
}

.rules-button {
    background-color: #0067B3;
    color: white;
    box-shadow: 0 4px 0 #004e8c;
    margin-top: 8px;
    font-size: 14px;
    width: 100%;
    padding: 10px;
    transition: all 0.2s ease;
}

.rules-button:hover {
    background-color: #0078d4;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #004e8c;
}

.rules-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #004e8c;
}

.rules-link {
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
}

.rules-link a {
    color: #0067B3;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.rules-link a:hover {
    color: #004E8C;
    text-decoration: underline;
}

.you-label {
    position: absolute;
    left: -10px;
    top: -10px;
    background-color: #4CAF50;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1;
    min-width: 35px;
    text-align: center;
} 

.winners-button {
    background-color: #4CAF50;
    color: white;
    box-shadow: 0 4px 0 #3D8B40;
    margin-top: 8px;
    font-size: 14px;
    width: 100%;
    padding: 10px;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.winners-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #3D8B40;
}

.winners-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #3D8B40;
} 