html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #222;
}
body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}
#gameWrapper {
    position: absolute;
    left: 0;
    top: 0;
    width: 1280px;
    height: 700px;
    transform-origin: top left;
}
canvas {
    display: block;
    width: 1280px;
    height: 700px;
    border: 1px solid white;
    touch-action: none;
}
#fullscreenBtn {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 8px 14px;
    font-size: 18px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: 1px solid white;
    border-radius: 8px;
    z-index: 9999;
}
#restartBtn {
    position: fixed;
    left: 50%;
    top: 62%;
    transform: translate(-50%, -50%);
    padding: 14px 35px;
    font-size: 24px;
    font-weight: bold;
    color: white;
    background: #00aaff;
    border: 3px solid white;
    border-radius: 12px;
    cursor: pointer;
    z-index: 9999;
}
#restartBtn:active {
    transform: translate(-50%, -50%) scale(0.95);
}
#topBar {
    width: 100%;
    height: 55px;
    display: flex;
    align-items: center;
    background: #111;
    border-bottom: 1px solid #444;
    color: white;
    box-sizing: border-box;
    padding: 0 18px;
    gap: 20px;
}
.topLogo{
    display:flex;
    align-items:center;
    height:100px;
    overflow:hidden;
    flex-shrink:0;
}

.topLogo img{
    height:100px;
    width:auto;
    display:block;
    transform: translateY(5px);
}
.topMenu button,
.topAccount button,
#searchBtn {
    background: #222;
    color: white;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 7px 10px;
    cursor: pointer;
}
.topSearch {
    flex: 1;

    display: flex;
    justify-content: center;
}
#searchInput {
    width: 100%;
    max-width: 400px;
    background: #222;
    color: white;
    border: 1px solid #555;
    border-radius: 6px 0 0 6px;
    padding: 8px 12px;
    outline: none;
}
#searchBtn {
    border-radius: 0 6px 6px 0;
}
.topAccount {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}
#topPlayerName {
    color: #ffd700;
    font-weight: bold;
}
@media (max-width: 600px) {
    #topBar {
        height: 55px;
        padding: 0 8px;
        gap: 8px;
        width: 100%;
        flex-shrink: 0;
    }
    .topLogo img {
        height: 80px;
        width: auto;
    }
    .topMenu button {
        padding: 6px 8px;
        font-size: 14px;
    }
    .topSearch {
        flex: 0;
    }
    #searchInput {
        display: none;
    }
    #searchBtn {
        border-radius: 6px;
        padding: 7px 9px;
    }
    .topAccount {
        margin-left: auto;
        min-width: 0;
    }
    #topPlayerName {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 14px;
    }
    #accountBtn {
        padding: 5px;
    }
}
#mainContent {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#gameInfo {
    position: absolute;
    box-sizing: border-box;
    padding: 18px;

    color: #aaa;
    font-family: Arial, sans-serif;

    overflow: hidden;
}

#gameInfo h1 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #ddd;
}

#gameInfo p {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.5;
}

#gameInfo a {
    color: #ffd700;
    text-decoration: none;
}

#gameInfo a:hover {
    text-decoration: underline;
}
.topMenu {
    position: relative;
}

#menuDropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 230px;
    padding: 6px 0;
    background: #222;
    border: 1px solid #555;
    border-radius: 6px;
    z-index: 9999;
}

#menuDropdown.show {
    display: block;
}

#menuDropdown a {
    display: block;
    padding: 12px 15px;
    color: white;
    text-decoration: none;
    font-size: 15px;
    white-space: nowrap;
}

#menuDropdown a:hover {
    background: #444;
}

@media (max-width: 600px) {
    #menuDropdown {
        width: 210px;
    }
}

@media (max-width: 600px) and (orientation: portrait) {
    #googleLoginArea {
        transform-origin: right center;
        width: 125px;
        margin-left: auto;
        margin-right: -3px;
        flex-shrink: 0;
    }
    #topBar {
        gap: 5px;
    }
    .topLogo {
        font-size: 19px;
        flex-shrink: 0;
    }
    .topMenu button {
        padding: 7px 8px;
        font-size: 13px;
    }
    .topSearch {
        flex: 0 0 auto;
    }
}
#loggedInAccount {
    position: relative;
    align-items: center;
    gap: 6px;
}

#accountDropdown{
    display:none;
    position:absolute;
    top:calc(100% + 8px);
    right:0;
    width:180px;      /* hoặc 200px */
    min-width:180px;
    background:#111;
    border:1px solid #555;
    border-radius:8px;
    padding:6px;
    z-index:99999;
}
#accountDropdown.show {
    display: block;
}

#accountDropdown button{
    width:100%;
    display:block;
    box-sizing:border-box;
    text-align:left;

    padding:10px 12px;
    margin:2px 0;

    background:transparent;
    border:0;
    color:#fff;
    cursor:pointer;
}

#accountDropdown button:hover {
    background: #333;
}
/* ===== Chat Input Modal ===== */

#chatInputModal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

#chatInputBox {
    width: min(90vw, 500px);
    background: #1b1b1b;
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 18px;
    box-sizing: border-box;
    box-shadow: 0 0 25px rgba(255,215,0,.25);
}

#chatInputTitle {
    color: #ffd700;
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
}

#chatInputText {
    width: 100%;
    height: 130px;
    resize: none;
    box-sizing: border-box;
    padding: 10px;
    background: #111;
    color: white;
    border: 1px solid #666;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
}

#chatInputText:focus {
    border-color: #ffd700;
}

#chatInputCount {
    color: #aaa;
    text-align: right;
    margin-top: 6px;
    margin-bottom: 14px;
    font-size: 13px;
}

#chatInputActions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#chatInputActions button {
    min-width: 90px;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
}

#chatCancelBtn {
    background: #555;
    color: white;
}

#chatSendBtn {
    background: #ffd700;
    color: black;
}

#chatSendBtn:hover {
    background: #ffe75b;
}

#chatCancelBtn:hover {
    background: #777;
}



