/* style.css */
body, html {
    height: 100%;
    margin: 0;
    font-family: Arial, sans-serif;
}

.container {
    display: flex;
    height: 99%;
}

.horizonCenter {
    display: flex;
    align-items: center;
}

.userListHeadIcon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin:0 5px 0 0;
}
.userListHeadIconBig {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 5px 0 0;
}
.userMsgHeadIcon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin: 0 5px 0 0;
}
.main-area {
    flex-grow: 1;
    display: flex;
    background-color: azure;
    flex-direction: column;
}

.chat-area {
    display: flex;
    flex-direction: column;
}

.input-area {
    display: flex;
}

    .input-area input {
        flex-grow: 1;
        height: 30px;
        border-radius: 5px;
        margin: 5px 0px 0px 0px;
    }

    .input-area button {
        width: 50px;
        height: 30px;
    }


.msg-area {
    background-color: lightgray;
    height: 200px; /* 固定高度 */
    overflow-y: auto;
}

.quiz-area {
    flex-grow: 1;
    overflow-y: auto;
}

.userPanel {
    border: pink solid;
    border-radius: 8px;
    padding: 3px;
}

.users-list {
    flex-grow: 1;
    background-color: lightgoldenrodyellow;
    margin-bottom: 20px;
    padding: 5px;
}

    .users-list div {
        background-color: lightcyan;
    }

.room-area {
    display: flex;
    background-color: bisque;
    flex-direction: column;
    min-width: 250px;
    max-width: 250px;
    margin: 10px 10px 10px 20px;
    padding: 7px;
    border-radius: 10px;
}

.coinIcon{
    width:20px;
    height:20px;
}

.room-info {
    background-color: aqua;
}

.room-list {
    background-color: #f2f2f2;
    box-sizing: border-box;
}

    .room-list select {
        width: 150px;
    }

.userPanel {
    margin-bottom: 5px;
}

.userInfo {
    display: flex;
}

.scorePanel {
    display: flex;
    justify-content: flex-end;
}

.userScore {
    display: flex;
    justify-content: flex-end;
    font-weight: bolder;
    font-size: 18px;
}

.userAddScore {
    display: flex;
    justify-content: flex-end;
    color: green;
    font-size: 14px;
}

.fillwidth {
    flex-grow: 1;
}

.color-box {
    width: 15px;
    height: 15px;
    display: inline-block;
    cursor: pointer;
    margin: 1px;
    border: 1px solid #000;
}


.center-link {
    display: block;
    text-align: center;
    margin: 10px 0; /* 可選，添加一些上下間距 */
}

.radio-inline {
    display: inline-block;
    margin-right: 10px;
}

@keyframes reveal {
    0% {
        clip-path: circle(0% at var(--random-x) var(--random-y));
    }

    100% {
        clip-path: circle(150% at var(--random-x) var(--random-y));
    }
}

.reveal-animation {
    animation: reveal 10s ease-in-out;
    max-width: 800px;
}

.quiz-image {
    max-width: 100%;
    max-height: 400px;
    min-height: 400px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

.floatingMessageBox {
    pointer-events: none;
    display: flex;
    align-items: center;
    position: fixed;
    top: 80%;
    animation: floatUp 3s ease-out;
    right: 1%;
    background: rgba(248, 215, 218, 0.7); /* 半透明背景 */
    color: #721c24;
    padding: 10px;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    font-weight: bold;
    z-index: 1000;
}


.button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

    .button-grid button {
        padding: 15px 8px 15px 8px;
        margin-top: 8px;
        background-color: #4CAF50; /* 綠色背景 */
        margin-left: 20px;
        margin-right: 20px;
        font-size: 18px;
        color: white; /* 白色文字 */
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s, transform 0.3s;
    }

        .button-grid button:hover {
            background-color: #45a049; /* 懸停時的綠色背景 */
            transform: scale(1.05); /* 懸停時放大 */
        }

        .button-grid button:active {
            background-color: #3e8e41; /* 點擊時的綠色背景 */
            transform: scale(0.9); /* 點擊時縮小 */
        }

.progress-bar {
    width: 100%;
    background-color: #f3f3f3;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar-inner {
    height: 25px;
    width: 100%;
    background-color: aqua;
    transition: width 1s linear;
}

.selected-button {
    background-color: #FF5733 !important; /* 橙色背景 */
    border: double;
    border-color: red;
    border-width: 3px;
    cursor: not-allowed;
    pointer-events: none;
}

.disabled-button {
    cursor: not-allowed;
    pointer-events: none;
    background-color: gray !important; /* 橙色背景 */
}


.placeStand {
    width: 100px;
    margin: 0 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}

.playerBasicPlaceHeadIcon {
    width: 50px;
    border-radius: 50%;
    position: absolute;
    top: -110px
}

.playerBasicPlace {
    top: -65px;
    position: absolute;
    padding: 5px;
    border: 1px solid #cd7f32;
    border-radius: 5px;
}

.playerPlace {
    font-weight: bold;
    color: red;
}



#quizImageArea {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    text-align: center;
    min-height: 200px;
}

.score-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(51, 51, 51, 0.8); /* 半透明背景 */
    color: white;
    padding: 10px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
    font-size: 36px;
    z-index: 1000;
}

    .score-popup.show {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }


.reward-float {
    display: flex;
    align-items: center;
    pointer-events: none;
    position: fixed;
    animation: floatUp 5s ease-out;
    font-weight: bolder;
    color: goldenrod;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    z-index: 1000;
}

/* 新增浮動得分的樣式 */
.score-float {
    display: flex;
    align-items:center;
    pointer-events: none;
    position: fixed;
    animation: floatUp 2.5s ease-out;
    font-weight: bolder;
    color: lightgreen;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    z-index: 1000;
}

.score-float-100 {
    display: flex;
    align-items: center;
    pointer-events: none;
    position: fixed;
    animation: floatUp 4.5s ease-out;
    font-weight: bolder;
    color: darkred;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 1100;
}

h3 {
    margin-block-start: 0.2em;
    margin-block-end: 0.2em;
}

.lockIcon {
    position: absolute;
    top: 35px;
    right: 0px;
    font-size: 18px;
    color: red;
    background-color: rgba(0, 0, 0, 0.5);
    box-shadow: rgba(0, 0, 0, 0.2) 0px 4px 8px;
    border-radius: 50%;
    pointer-events: none;
}
.headIconShowBig {
    width: 120px;
    height: 120px;
    cursor: pointer;
    position: relative;
    border-radius: 50%;
}
.headIconShow {
    width: 60px;
    height: 60px;
    cursor: pointer;
    position: relative;
    border-radius: 50%;
}
.headIconShowSmall {
    width: 32px;
    height: 32px;
    cursor: pointer;
    position: relative;
    border-radius: 50%;
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    25% {
        transform: translate(-1px, -1px) rotate(-1deg);
    }

    50% {
        transform: translate(-2px, 0px) rotate(1deg);
    }

    75% {
        transform: translate(2px, 1px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -1px) rotate(-1deg);
    }
}

.shake {
    animation: shake 0.2s;
}

@keyframes scaleDown {
    0% {
        transform: scale(100); /* 超大字體 */
    }

    100% {
        transform: scale(1); /* 目標大小 */
    }
}

.scale-down {
    animation: scaleDown 0.2s ease-out forwards;
}

.redName {
    color: red;
    font-weight: bold;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0.3;
        transform: translateY(-80px);
    }
}

.room-card {
    border: 1px solid #ccc;
    padding: 10px;
    margin: 5px;
    width: 225px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: #f9f9f9;
    border-radius: 8px;
}

    .room-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        background-color: lightcyan;
    }

.start-button {
    padding: 10px 14px;
    margin: 4px 4px 20px 4px;
    background-color: #ff3b00;
    height: 50px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .start-button:hover {
        background-color: #0056b3;
    }

.join-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 5px 10px;
    min-width: 80px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .join-button:hover {
        background-color: #0056b3;
    }


#quizTitle {
    height: 40px;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 10px;
    align-items: flex-end; /* 將 align-items 設為 flex-end 以貼齊下方 */
}

.quizAnswerTitle {
    font-size: 24px;
    color: red;
    font-weight: bold;
    margin: 0px 10px;
}

#quizAnswer {
    margin-bottom: 20px;
}

.tagIconButton {
    padding: 6px 16px;
    font-size: 15pt;
    margin: 8px;
    background-color: #cfcfcf;
    color: #000000;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}


.createroom-button {
    padding: 10px 14px;
    margin-top: 8px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .createroom-button:hover {
        background-color: #0056b3;
    }

h4 {
    margin-block-start: 0.8em;
    margin-block-end: 0.8em;
}

p {
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
}

.leaveroom-button {
    padding: 10px 14px;
    margin: 4px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin: -5px 0px 10px 0px;
}

    .leaveroom-button:hover {
        background-color: #0056b3;
    }

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.dailog-shadow {
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

.roomTitleName {
    font-size: 20px;
    font-weight: bold;
    margin: 10px;
}

.roomTitleIcon {
    font-size: 28px;
    font-weight: bold;
    margin: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#logoImage {
    display: block;
}

#logoText {
    display: none;
    font-size: 18px;
    text-align: center;
}

#roomsDialog {
    margin: 10px;
    overflow-y: auto;
    border-radius: 8px;
    background: white;
    padding: 20px;
    border: 1px solid black;
}

#sendMessageButton {
    padding: 5px 5px;
    min-width: 60px;
    background-color: #007bff;
    color: white;
    border: none;
    margin: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

@media (max-width: 768px) {

    .container {
        flex-direction: column;
        height: auto;
    }

    .room-area {
        display: flex;
        background-color: bisque;
        flex-direction: column;
        min-width: 250px;
        max-width: 100%;
        margin: 10px;
    }

    .button-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

        .button-grid button {
            margin-left: 20px;
            margin-right: 20px;
            font-size: 16px;
        }

            .button-grid button:hover {
                background-color: #45a049; /* 懸停時的綠色背景 */
                transform: scale(1.05); /* 懸停時放大 */
            }

            .button-grid button:active {
                background-color: #3e8e41; /* 點擊時的綠色背景 */
                transform: scale(0.9); /* 點擊時縮小 */
            }

    .msg-area {
        height: 100px; /* 調整高度以適應小螢幕 */
    }

    .quiz-area {
        padding: 10px; /* 增加內邊距以適應小螢幕 */
    }

    .start-button, .createroom-button, .leaveroom-button {
        box-sizing: border-box; /* 包含內邊距和邊框 */
    }

    .join-button {
        width: 100%; /* 按鈕寬度調整為 100% */
        position: static; /* 取消絕對定位 */
        margin-top: 10px; /* 增加上邊距 */
    }

    #quizTitle {
        font-size: 16px; /* 調整字體大小 */
    }

    .quizAnswerTitle {
        font-size: 20px; /* 調整字體大小 */
    }

    #logoImage {
        display: none;
    }

    #logoText {
        display: block;
        font-size: 18px;
        text-align: center;
    }

    .quiz-image {
        max-width: 100%;
        max-height: 400px;
        min-height: 200px;
        width: auto;
        height: auto;
        display: block;
        margin: 0 auto;
    }
}
