* {
    box-sizing: border-box;
}

:root {
    --bg:
        #0d1117;

    --panel:
        #161b22;

    --panel-light:
        #1f2630;

    --border:
        #30363d;

    --border-light:
        #4a5562;

    --text:
        #f0f6fc;

    --muted:
        #8b949e;

    --accent:
        #2f81f7;

    --accent-hover:
        #58a6ff;

    --danger:
        #da3633;

    --danger-hover:
        #f85149;

    --success:
        #238636;

    --shadow:
        rgba(0,
            0,
            0,
            0.35);
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;

    background:
        var(--bg);

    color:
        var(--text);

    font-family:
        Arial,
        Helvetica,
        sans-serif;
}

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

button {
    border:
        1px solid var(--border-light);

    border-radius:
        6px;

    padding:
        10px 14px;

    background:
        var(--accent);

    color:
        white;

    cursor:
        pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

button:hover {
    background:
        var(--accent-hover);
}

button:active {
    transform:
        translateY(1px);
}

button:disabled {
    opacity:
        0.5;

    cursor:
        not-allowed;
}

input,
select,
textarea {
    width:
        100%;

    padding:
        10px;

    border:
        1px solid var(--border);

    border-radius:
        6px;

    background:
        #0d1117;

    color:
        var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline:
        none;

    border-color:
        var(--accent);

    box-shadow:
        0 0 0 2px rgba(47,
            129,
            247,
            0.25);
}

textarea {
    resize:
        vertical;
}

h1,
h2,
h3 {
    margin-top:
        0;
}

h1 {
    margin:
        0;

    padding:
        18px 20px;

    text-align:
        center;

    background:
        #010409;

    border-bottom:
        1px solid var(--border);

    font-size:
        clamp(1.5rem,
            3vw,
            2.4rem);
}

hr {
    border:
        0;

    border-top:
        1px solid var(--border);

    margin:
        18px 0;
}

/*==================================================
    Lobby
==================================================*/

#login {
    width:
        min(1400px,
            calc(100% - 30px));

    margin:
        20px auto 50px;

    display:
        grid;

    grid-template-columns:
        repeat(auto-fit,
            minmax(280px,
                1fr));

    gap:
        16px;

    align-items:
        start;
}

.panel {
    background:
        var(--panel);

    border:
        1px solid var(--border);

    border-radius:
        10px;

    padding:
        18px;

    box-shadow:
        0 6px 20px var(--shadow);
}

.panel h2 {
    margin-bottom:
        14px;

    font-size:
        1.2rem;
}

.panel label {
    display:
        block;

    margin-bottom:
        14px;

    color:
        var(--muted);

    font-size:
        0.9rem;
}

.panel label input,
.panel label select,
.panel label textarea {
    margin-top:
        6px;

    color:
        var(--text);
}

.panel>input {
    margin-bottom:
        10px;
}

.panel>button {
    width:
        100%;

    margin-top:
        6px;
}

.row {
    display:
        flex;

    gap:
        8px;
}

.row input {
    flex:
        1;
}

.row button {
    flex:
        0 0 auto;
}

.disabled-field {
    opacity:
        0.5;
}

/*==================================================
    Lobby Game List
==================================================*/

#gameList,
#activeGameList {
    list-style:
        none;

    padding:
        0;

    margin:
        12px 0 0;
}

.game-list-item,
.active-game-item {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        8px;

    padding:
        8px 10px;

    margin-bottom:
        6px;

    background:
        var(--panel-light);

    border:
        1px solid var(--border);

    border-radius:
        6px;
}

.game-list-item span,
.active-game-item span {
    min-width:
        0;

    overflow-wrap:
        anywhere;
}

.empty-list-message,
.empty-room-list {
    color:
        var(--muted);

    font-style:
        italic;

    padding:
        8px 0;
}

/*==================================================
    Buttons
==================================================*/

.small-button {
    padding:
        6px 9px;

    font-size:
        0.78rem;
}

.danger-button {
    background:
        var(--danger);

    border-color:
        var(--danger);
}

.danger-button:hover {
    background:
        var(--danger-hover);
}

/*==================================================
    Open Room Browser
==================================================*/

#roomList {
    display:
        flex;

    flex-direction:
        column;

    gap:
        10px;

    max-height:
        500px;

    overflow-y:
        auto;
}

.room-card {
    padding:
        12px;

    border:
        1px solid var(--border);

    border-radius:
        8px;

    background:
        var(--panel-light);

    display:
        grid;

    gap:
        8px;
}

.room-card-header {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        10px;
}

.room-code {
    font-size:
        1.2rem;

    font-weight:
        bold;

    letter-spacing:
        0.08em;
}

.room-lock {
    font-size:
        1rem;
}

.room-info {
    color:
        var(--muted);

    font-size:
        0.9rem;
}

.room-games {
    color:
        #c9d1d9;

    font-size:
        0.85rem;

    overflow-wrap:
        anywhere;
}

.room-join-button {
    justify-self:
        start;
}

/*==================================================
    Game Layout
==================================================*/

#game {
    width:
        100%;
}

#gameLayout {
    width:
        100%;

    display:
        grid;

    grid-template-columns:
        280px minmax(0,
            1fr) 320px;

    gap:
        12px;

    align-items:
        start;

    padding:
        12px;
}

/*==================================================
    Sidebars
==================================================*/

#leftSidebar,
#rightSidebar {
    position:
        sticky;

    top:
        12px;

    height:
        calc(100vh - 24px);

    overflow-y:
        auto;

    background:
        var(--panel);

    border:
        1px solid var(--border);

    border-radius:
        10px;

    padding:
        14px;

    box-shadow:
        0 6px 20px var(--shadow);
}

#leftSidebar h2,
#rightSidebar h2 {
    margin-bottom:
        10px;

    font-size:
        1rem;

    text-transform:
        uppercase;

    letter-spacing:
        0.06em;

    color:
        #c9d1d9;
}

#backButton {
    width:
        100%;

    margin-bottom:
        18px;

    background:
        #21262d;
}

#backButton:hover {
    background:
        #30363d;
}

#roomDisplay {
    font-weight:
        bold;

    overflow-wrap:
        anywhere;

    color:
        var(--accent-hover);
}

/*==================================================
    Horizontal Player List
==================================================*/

#players {
    display:
        flex;

    flex-wrap:
        wrap;

    gap:
        8px;
}

.player-card {
    min-width:
        0;

    flex:
        1 1 115px;

    display:
        grid;

    grid-template-columns:
        12px 1fr;

    grid-template-rows:
        auto auto;

    column-gap:
        8px;

    row-gap:
        3px;

    align-items:
        center;

    padding:
        8px;

    border:
        1px solid var(--border);

    border-radius:
        7px;

    background:
        var(--panel-light);
}

.player-card.current-player {
    border-color:
        var(--accent);

    box-shadow:
        inset 0 0 0 1px rgba(47,
            129,
            247,
            0.4);
}

.player-card.offline {
    opacity:
        0.55;
}

.player-color {
    width:
        12px;

    height:
        100%;

    min-height:
        32px;

    grid-row:
        1 / 3;

    border-radius:
        4px;
}

.player-name {
    min-width:
        0;

    font-size:
        0.9rem;

    font-weight:
        bold;

    overflow-wrap:
        anywhere;
}

.player-details {
    color:
        var(--muted);

    font-size:
        0.72rem;

    overflow-wrap:
        anywhere;
}

.offline-label {
    display:
        inline-block;

    margin-left:
        5px;

    color:
        var(--muted);

    font-size:
        0.65rem;

    font-weight:
        normal;
}

/*==================================================
    Color Picker
==================================================*/

#colorPicker {
    cursor:
        pointer;
}

/*==================================================
    Active Game Controls
==================================================*/

.active-game-controls {
    display:
        flex;

    gap:
        6px;

    margin-bottom:
        10px;
}

.active-game-controls input {
    min-width:
        0;

    flex:
        1;
}

.active-game-controls button {
    flex:
        0 0 auto;
}

/*==================================================
    Center Board Area
==================================================*/

#centerPanel {
    min-width:
        0;

    width:
        100%;
}

#boardControls {
    position:
        sticky;

    top:
        0;

    z-index:
        20;

    display:
        flex;

    flex-wrap:
        wrap;

    gap:
        8px 20px;

    align-items:
        center;

    padding:
        10px 14px;

    margin-bottom:
        10px;

    background:
        rgba(13,
            17,
            23,
            0.96);

    border:
        1px solid var(--border);

    border-radius:
        8px;

    backdrop-filter:
        blur(8px);

    color:
        var(--muted);

    font-size:
        0.85rem;
}

#boardControls b {
    color:
        var(--text);
}

/*==================================================
    Bingo Board
==================================================*/

#board {
    display:
        grid;

    gap:
        5px;

    width:
        100%;

    margin:
        0 auto 40px;

    align-items:
        stretch;
}

.square {
    position:
        relative;

    min-width:
        0;

    aspect-ratio:
        1 / 1;

    display:
        flex;

    flex-direction:
        column;

    align-items:
        center;

    justify-content:
        center;

    padding:
        clamp(4px,
            0.7vw,
            10px);

    background:
        var(--panel);

    border:
        1px solid var(--border-light);

    border-radius:
        4px;

    cursor:
        pointer;

    user-select:
        none;

    overflow:
        hidden;

    text-align:
        center;

    transition:
        transform 0.1s ease,
        box-shadow 0.1s ease,
        border-color 0.1s ease;
}

.square:hover {
    z-index:
        5;

    transform:
        scale(1.035);

    box-shadow:
        0 0 12px rgba(255,
            255,
            255,
            0.18);

    border-color:
        #8b949e;
}

.square.marked {
    color:
        #080808;

    font-weight:
        bold;
}

.square.targeted {
    border-width:
        3px;

    border-style:
        dashed;
}

.square-text {
    width:
        100%;

    min-width:
        0;

    font-size:
        clamp(8px,
            1vw,
            15px);

    line-height:
        1.15;

    overflow-wrap:
        anywhere;

    word-break:
        break-word;

    padding-bottom: 34px;
}

/*==================================================
    Square Game Assignment
==================================================*/

.square-game-area {
    position: absolute;
    left: 5px;
    right: 5px;
    bottom: 5px;
    z-index: 8;
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: stretch;
}

.square-game-label {
    max-width: 100%;
    color: rgba(201,209,217,0.82);
    font-size: clamp(7px,0.7vw,11px);
    font-style: italic;
    font-weight: normal;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.square-game-input {
    width: 100%;
    min-width: 0;
    padding: 3px 5px;
    border: 1px solid rgba(139,148,158,0.35);
    border-radius: 4px;
    background: rgba(13,17,23,0.72);
    color: #c9d1d9;
    font-size: clamp(6px,0.65vw,10px);
    font-style: italic;
    line-height: 1.1;
    cursor: text;
    user-select: text;
}

.square-game-input::placeholder {
    color: rgba(139,148,158,0.65);
}

.square-game-input:hover {
    border-color: rgba(139,148,158,0.75);
}

.square-game-input:focus {
    border-color: var(--accent);
    background: rgba(13,17,23,0.95);
    box-shadow: 0 0 0 1px rgba(47,129,247,0.25);
}

.square-owner,
.square-target-owner {
    position: absolute;
    left: 3px;
    right: 3px;
    bottom: 38px;
    padding:
        2px 3px;
    border-radius:
        3px;

    font-size:
        clamp(6px,
            0.6vw,
            9px);

    line-height:
        1.1;

    overflow:
        hidden;

    text-overflow:
        ellipsis;

    white-space:
        nowrap;
}

.square-owner {
    background:
        rgba(0,
            0,
            0,
            0.55);

    color:
        white;
}

.square-target-owner {
    background:
        rgba(0,
            0,
            0,
            0.7);

    color:
        white;
}

/*==================================================
    Activity Log
==================================================*/

#activityLog {
    height:
        38vh;

    min-height:
        220px;

    overflow-y:
        auto;

    border:
        1px solid var(--border);

    border-radius:
        7px;

    background:
        #0d1117;
}

.activity-entry {
    display:
        grid;

    grid-template-columns:
        auto minmax(0,
            1fr);

    gap:
        7px;

    padding:
        7px 8px;

    border-bottom:
        1px solid rgba(48,
            54,
            61,
            0.7);

    font-size:
        0.78rem;
}

.activity-entry:last-child {
    border-bottom:
        0;
}

.activity-time {
    color:
        var(--muted);

    font-size:
        0.68rem;

    white-space:
        nowrap;
}

.activity-body {
    min-width:
        0;

    overflow-wrap:
        anywhere;
}

.activity-player {
    font-weight:
        bold;
}

.activity-system {
    color:
        var(--muted);
}

.activity-claim {
    border-left:
        3px solid var(--success);
}

.activity-unclaim {
    border-left:
        3px solid var(--danger);
}

.activity-target {
    border-left:
        3px solid #d29922;
}

.activity-team {
    border-left:
        3px solid #a371f7;
}

/*==================================================
    Chat
==================================================*/

#chatLog {
    height:
        28vh;

    min-height:
        180px;

    overflow-y:
        auto;

    border:
        1px solid var(--border);

    border-radius:
        7px;

    background:
        #0d1117;
}

.chat-entry {
    padding:
        8px;

    border-bottom:
        1px solid rgba(48,
            54,
            61,
            0.7);
}

.chat-entry:last-child {
    border-bottom:
        0;
}

.chat-header {
    display:
        flex;

    align-items:
        baseline;

    justify-content:
        space-between;

    gap:
        8px;

    margin-bottom:
        3px;
}

.chat-player {
    font-weight:
        bold;

    font-size:
        0.82rem;
}

.chat-time {
    color:
        var(--muted);

    font-size:
        0.65rem;

    white-space:
        nowrap;
}

.chat-message {
    color:
        #c9d1d9;

    font-size:
        0.8rem;

    line-height:
        1.35;

    overflow-wrap:
        anywhere;
}

#chatControls {
    display:
        flex;

    gap:
        6px;

    margin-top:
        8px;
}

#chatControls input {
    min-width:
        0;

    flex:
        1;
}

#chatControls button {
    flex:
        0 0 auto;
}

/*==================================================
    Scrollbars
==================================================*/

#leftSidebar,
#rightSidebar,
#roomList,
#activityLog,
#chatLog {
    scrollbar-width:
        thin;

    scrollbar-color:
        #484f58 #161b22;
}

#leftSidebar::-webkit-scrollbar,
#rightSidebar::-webkit-scrollbar,
#roomList::-webkit-scrollbar,
#activityLog::-webkit-scrollbar,
#chatLog::-webkit-scrollbar {
    width:
        8px;
}

#leftSidebar::-webkit-scrollbar-thumb,
#rightSidebar::-webkit-scrollbar-thumb,
#roomList::-webkit-scrollbar-thumb,
#activityLog::-webkit-scrollbar-thumb,
#chatLog::-webkit-scrollbar-thumb {
    background:
        #484f58;

    border-radius:
        5px;
}

/*==================================================
    Team Picker Overlay
==================================================*/

.team-picker-overlay {
    position:
        fixed;

    inset:
        0;

    z-index:
        1000;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    padding:
        20px;

    background:
        rgba(0,
            0,
            0,
            0.82);

    backdrop-filter:
        blur(5px);
}

.team-picker-panel {
    width:
        min(600px,
            100%);

    max-height:
        90vh;

    overflow-y:
        auto;

    padding:
        24px;

    background:
        var(--panel);

    border:
        1px solid var(--border-light);

    border-radius:
        12px;

    box-shadow:
        0 20px 50px rgba(0,
            0,
            0,
            0.6);

    text-align:
        center;
}

.team-picker-panel p {
    color:
        var(--muted);

    margin-bottom:
        20px;
}

.team-choice-grid {
    display:
        grid;

    grid-template-columns:
        repeat(auto-fit,
            minmax(180px,
                1fr));

    gap:
        10px;
}

.team-choice-button {
    display:
        grid;

    grid-template-columns:
        18px 1fr;

    grid-template-rows:
        auto auto;

    gap:
        2px 8px;

    align-items:
        center;

    padding:
        12px;

    background:
        var(--panel-light);

    border-width:
        2px;

    text-align:
        left;
}

.team-choice-button:hover {
    background:
        #30363d;
}

.team-color-swatch {
    width:
        18px;

    height:
        36px;

    grid-row:
        1 / 3;

    border-radius:
        4px;
}

.team-member-count {
    color:
        var(--muted);

    font-size:
        0.75rem;
}

/*==================================================
    Responsive Layout
==================================================*/

@media (max-width: 1200px) {

    #gameLayout {
        grid-template-columns:
            230px minmax(0,
                1fr) 270px;
    }

}

@media (max-width: 900px) {

    #gameLayout {
        grid-template-columns:
            1fr;

        padding:
            8px;
    }

    #leftSidebar,
    #rightSidebar {
        position:
            static;

        height:
            auto;

        max-height:
            none;
    }

    #leftSidebar {
        order:
            1;
    }

    #centerPanel {
        order:
            2;
    }

    #rightSidebar {
        order:
            3;
    }

    #activityLog,
    #chatLog {
        height:
            250px;
    }

    #players {
        display:
            grid;

        grid-template-columns:
            repeat(auto-fit,
                minmax(130px,
                    1fr));
    }

}

@media (max-width: 600px) {

    h1 {
        padding:
            12px;
    }

    #login {
        width:
            calc(100% - 16px);

        margin-top:
            8px;

        grid-template-columns:
            1fr;
    }

    .panel {
        padding:
            14px;
    }

    .row {
        flex-direction:
            column;
    }

    .row button {
        width:
            100%;
    }

    #board {
        gap:
            3px;
    }

    .square {
        padding:
            3px;
    }

    .square-text {
        font-size:
            clamp(6px,
                2vw,
                11px);
    }

    .square-owner,
    .square-target-owner {
        display:
            none;
    }

    #boardControls {
        font-size:
            0.75rem;

        gap:
            6px 12px;
    }

}

/*==================================================
    Very Large Boards
==================================================*/

#board[style*="repeat(15"],
#board[style*="repeat(16"],
#board[style*="repeat(17"],
#board[style*="repeat(18"],
#board[style*="repeat(19"],
#board[style*="repeat(20"] {
    gap:
        2px;
}

#board[style*="repeat(15"] .square,
#board[style*="repeat(16"] .square,
#board[style*="repeat(17"] .square,
#board[style*="repeat(18"] .square,
#board[style*="repeat(19"] .square,
#board[style*="repeat(20"] .square {
    padding:
        2px;
}

#board[style*="repeat(15"] .square-text,
#board[style*="repeat(16"] .square-text,
#board[style*="repeat(17"] .square-text,
#board[style*="repeat(18"] .square-text,
#board[style*="repeat(19"] .square-text,
#board[style*="repeat(20"] .square-text {
    font-size:
        clamp(5px,
            0.65vw,
            9px);
}

#board[style*="repeat(15"] .square-owner,
#board[style*="repeat(16"] .square-owner,
#board[style*="repeat(17"] .square-owner,
#board[style*="repeat(18"] .square-owner,
#board[style*="repeat(19"] .square-owner,
#board[style*="repeat(20"] .square-owner,
#board[style*="repeat(15"] .square-target-owner,
#board[style*="repeat(16"] .square-target-owner,
#board[style*="repeat(17"] .square-target-owner,
#board[style*="repeat(18"] .square-target-owner,
#board[style*="repeat(19"] .square-target-owner,
#board[style*="repeat(20"] .square-target-owner {
    display:
        none;
}

#board[style*="repeat(15"] .square-game-input,
#board[style*="repeat(16"] .square-game-input,
#board[style*="repeat(17"] .square-game-input,
#board[style*="repeat(18"] .square-game-input,
#board[style*="repeat(19"] .square-game-input,
#board[style*="repeat(20"] .square-game-input {
    padding: 1px 2px;
    font-size: 5px;
}

#board[style*="repeat(15"] .square-game-label,
#board[style*="repeat(16"] .square-game-label,
#board[style*="repeat(17"] .square-game-label,
#board[style*="repeat(18"] .square-game-label,
#board[style*="repeat(19"] .square-game-label,
#board[style*="repeat(20"] .square-game-label {
    font-size: 5px;
}

#board[style*="repeat(15"] .square-game-area,
#board[style*="repeat(16"] .square-game-area,
#board[style*="repeat(17"] .square-game-area,
#board[style*="repeat(18"] .square-game-area,
#board[style*="repeat(19"] .square-game-area,
#board[style*="repeat(20"] .square-game-area {
    left: 2px;
    right: 2px;
    bottom: 2px;
    gap: 1px;
}

#board[style*="repeat(15"] .square-state-summary,
#board[style*="repeat(16"] .square-state-summary,
#board[style*="repeat(17"] .square-state-summary,
#board[style*="repeat(18"] .square-state-summary,
#board[style*="repeat(19"] .square-state-summary,
#board[style*="repeat(20"] .square-state-summary {
    display: none;
}

#teamColorNotice {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

#colorPicker:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.admin-help-text {
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

#resetBoardButton {
    width: 100%;
}

.active-game-controls {
    position: relative;
    flex-wrap: wrap;
}

.active-game-controls input {
    flex: 1 1 140px;
}

.game-suggestions {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 180px;
    overflow-y: auto;
}

.game-suggestion {
    width: 100%;
    padding: 6px 8px;
    background: var(--panel-light);
    border-color: var(--border);
    text-align: left;
    font-size: 0.78rem;
}

.game-suggestion:hover {
    background: #30363d;
}

.form-error-message {
    margin: 10px 0;
    padding: 9px 10px;
    background: rgba(218,54,51,0.15);
    border: 1px solid var(--danger);
    border-radius: 6px;
    color: #ff7b72;
    font-size: 0.85rem;
    line-height: 1.35;
}

/*==================================================
    Compact Create Room Form
==================================================*/

.create-room-grid {
    display: grid;
    gap: 10px;
}

.create-room-grid-two {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.create-room-grid-three {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

.create-room-grid label {
    min-width: 0;
}

.create-room-section-title {
    margin:
        4px 0 8px;

    padding-top:
        4px;

    color:
        #c9d1d9;

    font-size:
        0.78rem;

    font-weight:
        bold;

    letter-spacing:
        0.08em;

    text-transform:
        uppercase;

    border-top:
        1px solid var(--border);
}

.compact-fields select {
    text-align:
        center;
}

@media (max-width: 700px) {

    .create-room-grid-three {
        grid-template-columns:
            1fr;
    }

}

@media (max-width: 480px) {

    .create-room-grid-two {
        grid-template-columns:
            1fr;
    }

}

.game-search-input {
    width:
        100%;

    margin:
        0 0 8px;

    padding:
        7px 9px;

    font-size:
        0.8rem;

    background:
        #0d1117;

    border-color:
        var(--border);
}

.game-search-input::placeholder {
    color:
        var(--muted);
}

/*==================================================
    Multi-owner Square State
==================================================*/

.square.square-has-state {
    color: #fff;
}

.square.square-has-state .square-text {
    position: relative;
    z-index: 3;
    font-weight: bold;
    text-shadow:
        0 1px 2px rgba(0,0,0,0.95),
        0 0 4px rgba(0,0,0,0.8);
}

.square-state-summary {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 38px;
    z-index: 6;

    padding: 2px 4px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    border-radius: 3px;

    background:
        rgba(0,0,0,0.62);

    color:
        white;

    font-size:
        clamp(6px,0.6vw,9px);

    line-height:
        1.1;
}

.host-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 5px;
    border: 1px solid #d29922;
    border-radius: 4px;
    color: #f2cc60;
    background: rgba(210,153,34,0.12);
    font-size: 0.58rem;
    font-weight: bold;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

.square-reroll-button {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 12;

    width: 22px;
    height: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 50%;

    background: rgba(13,17,23,0.72);
    color: rgba(255,255,255,0.78);

    font-size: 15px;
    line-height: 1;
}

.square-reroll-button:hover {
    background: rgba(47,129,247,0.9);
    color: white;
}

#completedSquareCount {
    margin-left: auto;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--panel-light);
    color: var(--text);
    font-weight: bold;
    white-space: nowrap;
}

.kick-player-button {
    grid-column: 2;
    justify-self: start;
    margin-top: 4px;
    padding: 4px 7px;
    background: var(--danger);
    border-color: var(--danger);
    font-size: 0.65rem;
}

.kick-player-button:hover {
    background: var(--danger-hover);
}

.rule-group {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: rgba(31,38,48,0.45);
}

.rule-group-title {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rule-group .create-room-grid {
    margin-bottom: 0;
}

.rule-group label {
    margin-bottom: 0;
}

.hub-back-link {
    position: absolute;

    top: 18px;
    left: 20px;

    display: inline-flex;
    align-items: center;

    min-height: 36px;

    padding:
        0
        12px;

    border:
        1px solid
        rgba(47, 129, 247, 0.45);

    border-radius: 999px;

    background:
        rgba(13, 17, 23, 0.82);

    color: var(--accent-hover);

    text-decoration: none;

    font-size: 0.9rem;
    font-weight: bold;

    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        color 0.15s ease;
}

.hub-back-link:hover {
    border-color:
        var(--accent-hover);

    background:
        rgba(31, 38, 48, 0.92);

    color: white;
}
