* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    background: #2C2C34;
}



canvas {
    display: block;
}

#game-ui {
    position: fixed;
    top: 1.2%;
    left: 1.2%;
    color: #DDDCC5;
    font-family: Arial, sans-serif;
    background: rgba(13, 13, 13, 0.9);
    padding: 1%;
    border-radius: 8px;
    z-index: 1000;
    width: 18%;
    min-width: 210px;
    max-width: 260px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(77, 87, 102, 0.6);
}

#game-ui h2 {
    margin: 0;
    color: #E94B3C;
    font-size: 1.05rem;
}

#game-ui p {
    margin: 3px 0;
    font-size: 0.95rem;
}

#game-ui strong {
    color: #AAAFBA;
}

#turn-info {
    background: rgba(61, 68, 81, 0.3);
    padding: 0.55em;
    border-radius: 5px;
    margin-bottom: 8px;
}

#action-info {
    background: rgba(164, 30, 52, 0.2);
    padding: 0.6em;
    border-radius: 5px;
    border-left: 3px solid #E94B3C;
}

#controls {
    margin-top: 10px;
    border-top: 1px solid #4D5766;
    padding-top: 0.6em;
}

#controls p {
    font-size: 0.92rem;
    margin: 3px 0;
    color: #C5C3D8;
}

#reserve-info {
    margin-top: 8px;
}

#current-player {
    color: #E94B3C;
    font-weight: bold;
}

#selected-piece {
    color: #C5C3D8;
}

button {
    font-family: 'Arial', sans-serif;
}

button:hover:not(:disabled) {
    filter: brightness(1.2);
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

.game-ui-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid #A41E34;
    padding-bottom: 7px;
    margin-bottom: 8px;
}

.game-user-badge {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #111219;
    border: 1px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #f2f2f4;
}

.game-user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-user-fallback {
    font-size: 0.9rem;
    line-height: 1;
}

.game-ui-section {
    margin-top: 8px;
    border-top: 1px solid #4D5766;
    padding-top: 7px;
}

.game-ui-hints {
    font-size: 0.85rem;
    color: #C5C3D8;
}

.game-ui-back-btn {
    margin-top: 10px;
    width: 100%;
    padding: 0.5em;
    background: #923A3A;
    border: 1px solid #E94B3C;
    color: #DDDCC5;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95rem;
}

@media (max-width: 900px) {
    #game-ui {
        width: 28%;
        max-width: none;
    }
}

@media (max-width: 640px) {
    #game-ui {
        width: calc(100% - 24px);
        max-width: none;
    }
}

/* Global responsive baseline */
html {
    font-size: clamp(14px, 0.24vw + 12.9px, 18px);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

@media (max-height: 820px) {
    #game-ui {
        max-height: calc(100dvh - 16px);
        overflow: auto;
    }
}

/* Global chat-style typography override */
:root {
    --global-chat-font: 'JetBrains Mono', monospace;
}

html,
body,
body * {
    font-family: var(--global-chat-font) !important;
}
