

#somerCompetitionsPanel { position: fixed; inset: 0; z-index: 2147483600; display: none; direction: rtl; font-family: Tahoma, Arial, sans-serif; }
#somerCompetitionsPanel.is-open { display: block; }

#somerCompetitionsPanel .sb-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }


#somerCompetitionsPanel .sb-card-root {
    position: relative;
    width: min(420px, 96vw);
    max-width: 420px;
    max-height: calc(100vh - 24px);
    margin: 12px auto;
    background: #ffffff;
    border-radius: 12px;
    border: 2px solid #1976d2;
    border-top: 5px solid #0d47a1;
    box-shadow: 0 18px 50px rgba(0,0,0,0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}


#somerCompetitionsPanel .sb-head {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1976d2;
    color: #fff;
    padding: 6px 10px;
    position: relative;
}
#somerCompetitionsPanel .sb-head-icon {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(255,255,255,0.22);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.35);
    font-size: 14px;
    flex-shrink: 0;
}
#somerCompetitionsPanel .sb-head-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#somerCompetitionsPanel .sb-head-h1 { font-size: 13px; font-weight: 800; line-height: 1.1; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
#somerCompetitionsPanel .sb-status {
    padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 700;
    background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.2);
    display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
}
#somerCompetitionsPanel .sb-status .sb-dot { width: 6px; height: 6px; border-radius: 50%; background: #ff6b6b; box-shadow: 0 0 4px rgba(255,107,107,0.7); }
#somerCompetitionsPanel .sb-status-on .sb-dot { background: #2ecc71; box-shadow: 0 0 4px rgba(46,204,113,0.7); }
#somerCompetitionsPanel .sb-close {
    border: none; background: rgba(0,0,0,0.25); color: #fff;
    width: 24px; height: 24px; border-radius: 6px; font-size: 16px; line-height: 22px;
    cursor: pointer;
    flex-shrink: 0;
}

#somerCompetitionsPanel .sb-body {
    padding: 10px 12px;
    overflow-y: auto;
    background: #fafafa;
    flex: 1 1 auto;
}

/* Compact row layouts */
#somerCompetitionsPanel .sb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 5px; }
#somerCompetitionsPanel .sb-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
#somerCompetitionsPanel .sb-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#somerCompetitionsPanel .sb-field > span { font-size: 10px; font-weight: 700; color: #0d47a1; padding-right: 2px; }
#somerCompetitionsPanel .sb-inp, #somerCompetitionsPanel .sb-sel {
    width: 100%; padding: 6px 8px; border: 1.5px solid #e1e1e1; border-radius: 7px;
    font-size: 12px; background: #fff; color: #2c2c4a; box-sizing: border-box;
    height: 30px;
}
#somerCompetitionsPanel .sb-num { text-align: center; font-weight: 800; color: #0d47a1; font-size: 13px; }
#somerCompetitionsPanel .sb-color { flex: 1; display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: #fff; border: 1.5px solid #e1e1e1; border-radius: 8px; min-width: 0; }
#somerCompetitionsPanel .sb-color > span { font-size: 10px; font-weight: 700; color: #444; flex: 1; }
#somerCompetitionsPanel .sb-color input[type="color"] { width: 30px; height: 24px; border: 2px solid #fff; border-radius: 6px; padding: 0; cursor: pointer; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.12); }

/* Thumbnails */
#somerCompetitionsPanel .sb-thumb-wrap { position: relative; display: none; }
#somerCompetitionsPanel .sb-thumb-pic { height: 28px; width: 28px; object-fit: cover; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px #0d47a1; }
#somerCompetitionsPanel .sb-thumb-bnr { height: 26px; max-width: 100px; object-fit: contain; border: 2px solid #0d47a1; border-radius: 5px; background: #fff; padding: 1px; }
#somerCompetitionsPanel .sb-thumb-x { position: absolute; top: -6px; right: -6px; background: #e74c3c; color: #fff; width: 16px; height: 16px; border-radius: 50%; font-size: 11px; line-height: 16px; text-align: center; cursor: pointer; border: 2px solid #fff; }


#somerCompetitionsPanel .sb-game-select { position: relative; }
#somerCompetitionsPanel .sb-game-select-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    width: 100%; padding: 6px 8px;
    border: 1.5px solid #e1e1e1; border-radius: 7px;
    background: #fff; color: #2c2c4a;
    font-size: 12px; font-weight: 600;
    height: 30px;
    cursor: pointer;
    text-align: right;
}
#somerCompetitionsPanel .sb-game-select-toggle:hover { border-color: #1976d2; }
#somerCompetitionsPanel .sb-game-select.is-open .sb-game-select-toggle { border-color: #0d47a1; box-shadow: 0 0 0 2px rgba(13,71,161,0.12); }
#somerCompetitionsPanel .sb-game-select .sb-selected-game { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
#somerCompetitionsPanel .sb-game-select .sb-chev { font-size: 11px; color: #555; transition: transform 0.15s; }
#somerCompetitionsPanel .sb-game-select.is-open .sb-chev { transform: rotate(180deg); color: #0d47a1; }

#somerCompetitionsPanel .sb-game-select-menu {
    list-style: none; margin: 4px 0 0; padding: 0;
    position: absolute;
    top: 100%; right: 0; left: 0;
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1.5px solid #0d47a1; border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
    z-index: 5;
    display: none;
}
#somerCompetitionsPanel .sb-game-select.is-open .sb-game-select-menu { display: block; }
#somerCompetitionsPanel .sb-game-group {
    padding: 4px 10px;
    background: #f3f6fa;
    color: #0d47a1;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e1e1e1;
    text-transform: uppercase;
    text-align: right;
    direction: rtl;
}
#somerCompetitionsPanel .sb-game-item {
    display: flex; align-items: center; gap: 8px;
    height: 32px;
    padding: 0 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    background: #fff;
    color: #1f2937;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.12s, color 0.12s;
    direction: rtl;
}
#somerCompetitionsPanel .sb-game-item:last-child { border-bottom: 0; }
#somerCompetitionsPanel .sb-game-item:hover { background: #f3f6fa; }
#somerCompetitionsPanel .sb-game-item:focus { outline: none; background: #f3f6fa; }
#somerCompetitionsPanel .sb-game-item .sb-game-emoji { flex: 0 0 18px; width: 18px; text-align: center; font-size: 14px; line-height: 1; }
#somerCompetitionsPanel .sb-game-item .sb-game-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#somerCompetitionsPanel .sb-game-item .sb-game-check { flex: 0 0 14px; font-size: 11px; color: transparent; transition: color 0.12s; }
#somerCompetitionsPanel .sb-game-item.active { background: #e3edf7; color: #0d47a1; font-weight: 800; }
#somerCompetitionsPanel .sb-game-item.active .sb-game-check { color: #1b7d2f; }

/* Action row */
#somerCompetitionsPanel .sb-actions { display: flex; gap: 8px; margin: 6px 0 8px; }
#somerCompetitionsPanel .sb-btn-big {
    flex: 1; padding: 9px; font-size: 12px; font-weight: 800; border: none; border-radius: 8px;
    cursor: pointer; color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    letter-spacing: 0.4px; height: 36px;
}
#somerCompetitionsPanel .sb-btn-start { background: #28a745; box-shadow: 0 4px 10px rgba(40,167,69,0.25); }
#somerCompetitionsPanel .sb-btn-start:hover { filter: brightness(1.05); }
#somerCompetitionsPanel .sb-btn-stop { background: linear-gradient(135deg, #ff4757, #a71d2a); box-shadow: 0 4px 10px rgba(220,53,69,0.3); }
#somerCompetitionsPanel .sb-btn-stop:hover { filter: brightness(1.05); }
#somerCompetitionsPanel .sb-btn { border: none; padding: 6px 9px; border-radius: 7px; font-size: 11px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
#somerCompetitionsPanel .sb-btn-pri { background: #6c63ff; color: #fff; }
#somerCompetitionsPanel .sb-btn-save { background: #0d47a1; color: #fff; }
#somerCompetitionsPanel .sb-btn-danger { background: #e74c3c; color: #fff; padding: 3px 7px; font-size: 10px; }


#somerCompetitionsPanel .sb-banner-section { margin-top: 6px; }
#somerCompetitionsPanel .sb-banner-label { font-size: 10px; font-weight: 700; color: #0d47a1; margin-bottom: 5px; }
#somerCompetitionsPanel .sb-banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 5px;
    max-height: 160px;
    overflow-y: auto;
    padding: 5px;
    background: #fff;
    border: 1.5px solid #e1e1e1;
    border-radius: 8px;
}
#somerCompetitionsPanel .sb-banner-thumb {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    height: 32px;
    padding: 1px;
    border: 1.5px solid transparent;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
}
#somerCompetitionsPanel .sb-banner-thumb:hover { border-color: #1976d2; box-shadow: 0 2px 6px rgba(25,118,210,0.18); }
#somerCompetitionsPanel .sb-banner-thumb.is-selected { border-color: #0d47a1; box-shadow: 0 0 0 2px rgba(13,71,161,0.18); background: #e3edf7; }
#somerCompetitionsPanel .sb-banner-thumb img { max-width: 100%; max-height: 28px; object-fit: contain; }
#somerCompetitionsPanel .sb-banner-none { color: #888; font-size: 10px; font-weight: 700; gap: 4px; }
#somerCompetitionsPanel .sb-banner-none-label { font-size: 9px; }
#somerCompetitionsPanel .sb-banner-none .fa { font-size: 12px; }


#somerCompetitionsPanel .sb-collapse {
    background: #fff; border: 1px solid #e1e1e1; border-radius: 9px;
    margin-bottom: 8px;
    overflow: hidden;
}
#somerCompetitionsPanel .sb-collapse[open] { border-color: #0d47a1; box-shadow: 0 4px 10px rgba(13,71,161,0.08); }
#somerCompetitionsPanel .sb-collapse-head {
    cursor: pointer;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 800;
    color: #0d47a1;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}
#somerCompetitionsPanel .sb-collapse-head::-webkit-details-marker { display: none; }
#somerCompetitionsPanel .sb-collapse-head::before {
    content: '\f0da';   /* fa-caret-right — points down when [open] flips RTL */
    font-family: 'FontAwesome';
    font-size: 11px;
    color: #555;
    transition: transform 0.15s;
}
#somerCompetitionsPanel .sb-collapse[open] .sb-collapse-head::before { transform: rotate(-90deg); }
#somerCompetitionsPanel .sb-collapse-body {
    padding: 8px 10px;
    border-top: 1px solid #eee;
    background: #fafafa;
}
#somerCompetitionsPanel .sb-winners-clear { margin-right: auto; }


#somerCompetitionsPanel .sb-winners-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}
#somerCompetitionsPanel .sb-w { position: relative; display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px; background: linear-gradient(135deg, #fff9e6, #fff3d0); border: 1.5px solid #f2d680; border-radius: 8px; }
#somerCompetitionsPanel .sb-w-rank { position: absolute; top: 2px; left: 2px; background: linear-gradient(135deg, #f9a825, #e65100); color: #fff; font-size: 9px; font-weight: 800; width: 14px; height: 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
#somerCompetitionsPanel .sb-w-pic { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 0 0 2px #f9a825; }
#somerCompetitionsPanel .sb-w-pic-empty { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid #f9a825; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
#somerCompetitionsPanel .sb-w-info { flex: 1; min-width: 0; }
#somerCompetitionsPanel .sb-w-name { font-size: 11px; font-weight: 800; color: #5d4000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#somerCompetitionsPanel .sb-w-meta { font-size: 9px; color: #8b6914; font-weight: 600; }
#somerCompetitionsPanel .sb-winners-empty { text-align: center; font-size: 11px; color: #999; padding: 10px; grid-column: 1 / -1; }


.somer-bot-entry {
    background-color: #6a1b9a !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 2px 6px rgba(106,27,154,0.25);
}
.somer-bot-entry:hover { background-color: #7b1fa2 !important; color: #ffffff !important; }
.somer-bot-entry:active { background-color: #4a148c !important; color: #ffffff !important; }
.somer-bot-entry .fa { color: #ffffff !important; }

@media (max-width: 560px) {
    #somerCompetitionsPanel .sb-card-root { margin: 6px auto; border-radius: 10px; max-height: calc(100vh - 12px); }
    #somerCompetitionsPanel .sb-head-h1 { font-size: 12px; }
    #somerCompetitionsPanel .sb-row-2 { grid-template-columns: 1fr 1fr; gap: 6px; }
    #somerCompetitionsPanel .sb-btn-big { padding: 9px; font-size: 11px; }
    #somerCompetitionsPanel .sb-game-select-menu { max-height: 220px; }
}
