@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Rubik:wght@500;700;800;900&display=swap');

* {
    box-sizing: border-box;
}

body {
    padding: 0;
    margin: 0;
    overflow: hidden;
    background: #f2fbff;
    font-family: 'Inter', 'Rubik', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    direction: ltr;
    user-select: none;
}

#canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #f2fbff;
}

#overlays {
    display: block;
    position: absolute;
    inset: 0;
    background: #ffffff url('../img/blobs_wallpaper_clean_hd.jpg') no-repeat center center;
    background-size: cover;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
    z-index: 200;
}

#connecting {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
}

#connecting > div {
    width: 320px;
    background: #ffffff !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    margin: 180px auto !important;
    border-radius: 16px !important;
    padding: 22px !important;
    color: #1e293b;
    text-align: center;
}

#connecting h2 {
    font-family: 'Rubik', sans-serif;
    font-weight: 800;
    font-size: 22px;
    margin: 0 0 8px 0;
    color: #0284c7;
}

/* Authentic Center Modal Dialog */
#helloDialog {
    width: 440px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px 20px 16px 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
    color: #1e293b;
    direction: ltr;
    font-family: 'Inter', 'Rubik', -apple-system, sans-serif;
    z-index: 210;
}

/* Original Hand-drawn Blobs Logo */
.blobs-main-logo {
    display: block;
    margin: 0 auto 14px auto;
    height: 66px;
    user-select: none;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.06));
}

/* Navigation Tabs (Modern Segmented Control) */
.blobs-tabs {
    display: flex;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 3.5px;
    gap: 3px;
    margin-bottom: 14px;
}

.b-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 7.5px 6px;
    font-size: 13.5px;
    font-weight: 800;
    color: #64748b;
    border-radius: 7px;
    cursor: pointer;
    text-align: center;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', 'Rubik', sans-serif;
}

.b-tab:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.b-tab.active {
    background: #ffffff;
    color: #0284c7;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

/* Tab Panes Smooth Transition (Item 5) */
.b-tab-pane {
    animation: bTabFadeSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bTabFadeSlide {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Leaderboard Podium & Highlighting (Item 3) */
.lb-rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 12px;
    margin: 0 auto;
}

.lb-rank-1 {
    background: linear-gradient(135deg, #fef08a 0%, #eab308 100%);
    color: #854d0e;
    box-shadow: 0 2px 6px rgba(234, 179, 8, 0.35);
    border: 1.5px solid #fde047;
}

.lb-rank-2 {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    color: #334155;
    box-shadow: 0 2px 6px rgba(148, 163, 184, 0.3);
    border: 1.5px solid #e2e8f0;
}

.lb-rank-3 {
    background: linear-gradient(135deg, #fed7aa 0%, #f97316 100%);
    color: #7c2d12;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
    border: 1.5px solid #fdba74;
}

.lb-rank-other {
    background: #f1f5f9;
    color: #64748b;
    font-weight: 800;
}

.lb-row-self {
    background: #f0f9ff !important;
    border-right: 3px solid #0284c7 !important;
}

/* Modern Server Select Container (Item 1) */
.blobs-server-select-wrap {
    position: relative;
    margin-bottom: 14px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 2px 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.blobs-server-select-wrap:hover {
    border-color: #38bdf8;
    box-shadow: 0 3px 10px rgba(14, 165, 233, 0.12);
}

.blobs-server-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    margin-left: 8px;
    margin-right: 2px;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: serverPulse 2s infinite;
}

@keyframes serverPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.blobs-custom-server-select {
    width: 100%;
    border: none;
    background: transparent;
    padding: 9px 4px;
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    direction: ltr;
    outline: none;
    cursor: pointer;
    font-family: 'Inter', 'Rubik', sans-serif;
}

/* Action Buttons (Start Game & Spectate) */
.blobs-action-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.blobs-action-btn {
    flex: 1;
    background: #f8fafc;
    color: #334155;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    font-family: 'Inter', 'Rubik', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.blobs-action-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.blobs-action-btn.blobs-play-btn {
    background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%);
    color: #ffffff;
    border: 1px solid #0284c7;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28);
}

.blobs-action-btn.blobs-play-btn:hover {
    background: linear-gradient(180deg, #38bdf8 0%, #0369a1 100%);
    box-shadow: 0 5px 14px rgba(2, 132, 199, 0.35);
    transform: translateY(-1px);
}

.blobs-action-btn.blobs-play-btn:active,
.blobs-action-btn:active {
    transform: translateY(0);
}

/* Animated Loading Dots Wave */
.blobs-dots-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    height: 12px;
}

.b-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e2e8f0;
    display: inline-block;
    transition: all 0.3s ease;
    animation: blobsDotWave 1.8s infinite ease-in-out;
}

.b-dot:nth-child(1) { animation-delay: 0.0s; }
.b-dot:nth-child(2) { animation-delay: 0.15s; }
.b-dot:nth-child(3) { animation-delay: 0.30s; }
.b-dot:nth-child(4) { animation-delay: 0.45s; }
.b-dot:nth-child(5) { animation-delay: 0.60s; }
.b-dot:nth-child(6) { animation-delay: 0.75s; }
.b-dot:nth-child(7) { animation-delay: 0.90s; }
.b-dot:nth-child(8) { animation-delay: 1.05s; }
.b-dot:nth-child(9) { animation-delay: 1.20s; }
.b-dot:nth-child(10) { animation-delay: 1.35s; }

@keyframes blobsDotWave {
    0%, 100% {
        transform: scale(0.85);
        background: #e2e8f0;
        box-shadow: none;
        width: 7px;
        border-radius: 50%;
    }
    30% {
        transform: scale(1.15);
        background: #0284c7;
        box-shadow: 0 0 10px rgba(2, 132, 199, 0.65);
        width: 16px;
        border-radius: 6px;
    }
    50% {
        transform: scale(1.0);
        background: #38bdf8;
        box-shadow: 0 0 6px rgba(56, 189, 248, 0.45);
        width: 9px;
        border-radius: 50%;
    }
}

/* Authentic Tip Box */
.blobs-tip-box {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    padding: 11px 14px;
    margin-bottom: 12px;
    text-align: center;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* Volume Sliders */
.blobs-vol-row {
    display: flex;
    gap: 14px;
    margin-bottom: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
}

.blobs-vol-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.blobs-vol-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    font-weight: 800;
    color: #334155;
}

.blobs-badge-val {
    background: #e0f2fe;
    color: #0284c7;
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 11.5px;
    font-weight: 900;
    border: 1px solid #bae6fd;
}

/* 6 Toggle Settings Buttons Grid */
.blobs-toggle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.blobs-toggle-btn {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 9px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    transition: all 0.15s ease;
    user-select: none;
    font-family: 'Inter', 'Rubik', sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.blobs-toggle-btn.off {
    background: #ffffff;
    color: #475569;
    border-color: #e2e8f0;
}

.blobs-toggle-btn.off:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.blobs-toggle-btn.off .t-icon {
    color: #ef4444;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 4px;
}

.blobs-toggle-btn.on {
    background: #f0f9ff;
    border-color: #0284c7;
    color: #0284c7;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.18);
}

.blobs-toggle-btn.on .t-icon {
    color: #0284c7;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 4px;
}

/* Footer Social Icons */
.blobs-footer-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    padding-top: 2px;
}

.blobs-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.blobs-social-link:hover {
    transform: translateY(-2px);
    background: #ffffff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

/* Authentic Discord Left Widget */
#discord-widget {
    position: absolute;
    top: 15px;
    left: 10px;
    width: 185px;
    height: 320px;
    background: rgba(32, 34, 37, 0.96);
    border-radius: 5px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 210;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    direction: ltr;
}

.discord-header {
    background: #5865f2;
    padding: 7px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.2);
}

.discord-body {
    flex: 1;
    overflow-y: auto;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dc-chan {
    font-size: 11px;
    font-weight: 700;
    color: #b9bbbe;
    padding: 3.5px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dc-chan:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.discord-footer {
    background: #292b2f;
    padding: 5px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.2);
}

.dc-connect-btn {
    background: #3ba55c;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 2.5px 9px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.dc-connect-btn:hover {
    background: #2d7d46;
}

.account-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.account-mode-btn:hover {
    background: #f1f5f9;
}

.account-mode-btn.active {
    border-color: #0284c7;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

.input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

#nick {
    flex: 1;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    color: #0f172a;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 700;
    outline: none;
    direction: ltr;
    transition: all 0.2s ease;
}

#nick:focus {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

#gamemode {
    width: 140px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    color: #475569;
    padding: 12px;
    font-size: 13px;
    font-weight: 700;
    outline: none;
    direction: ltr;
}

/* Buttons */
.btn-group-custom {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

#play-btn {
    flex: 2;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-family: 'Rubik', sans-serif;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.5px;
    padding: 13px 0;
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
    transition: all 0.15s ease;
    cursor: pointer;
    text-align: center;
}

#play-btn:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(2, 132, 199, 0.45);
}

#play-btn:active {
    transform: scale(0.98);
}

#spectate-btn {
    flex: 1;
    margin-top: 0;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    color: #475569;
    font-weight: 700;
    font-size: 15px;
    padding: 12px 0;
    transition: all 0.15s ease;
    cursor: pointer;
}

#spectate-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Instructions card */
.instructions-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px 18px;
    font-size: 13px;
    color: #334155;
    line-height: 1.7;
    text-align: right;
}

.instructions-box b {
    color: #0284c7;
    background: #e0f2fe;
    padding: 2px 7px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
}

.instructions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    margin-top: 6px;
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 4px;
    margin-bottom: 18px;
    gap: 6px;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 14px;
    border-radius: 12px;
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.tab-btn.active {
    background: #ffffff;
    color: #0284c7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Tab Panes */
.tab-pane {
    display: none;
    animation: fadeInTab 0.2s ease forwards;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modern Settings Cards inside Tab 2 */
.settings-section-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.settings-section-title {
    font-size: 13px;
    font-weight: 800;
    color: #0284c7;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-grid-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
}

.setting-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.setting-check-item:hover {
    border-color: #0284c7;
    background: #f0f9ff;
    color: #0284c7;
}

.setting-check-item input[type="checkbox"] {
    accent-color: #0284c7;
    cursor: pointer;
    width: 15px;
    height: 15px;
    margin: 0;
}

/* In-game Chat Bar (Authentic Blobs.co.il) */
#blobz-chat-bar {
    position: relative;
    z-index: 50;
    display: flex;
    flex-direction: row;
    direction: ltr !important;
    align-items: center;
    border-radius: 0 4px 4px 0;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

#chat_textbox {
    display: block;
    height: 32px;
    width: 270px;
    background: rgba(180, 195, 210, 0.45);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0 4px 4px 0;
    padding: 0 10px;
    font-family: 'Rubik', 'Assistant', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    direction: ltr;
    outline: none;
    transition: width 0.2s ease, background 0.2s ease;
}

#chat_textbox::placeholder {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12.5px;
}

#chat_textbox:focus {
    width: 340px;
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    box-shadow: 0 0 0 2px rgba(0, 150, 230, 0.4);
}

#chat_textbox:focus::placeholder {
    color: #94a3b8;
}

/* Toast Notifications Container */
#blobs-toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    direction: ltr;
}

.blobs-toast {
    pointer-events: auto;
    min-width: 260px;
    max-width: 90vw;
    padding: 10px 18px;
    border-radius: 12px;
    font-family: 'Inter', 'Rubik', 'Rubik', sans-serif;
    font-size: 13.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.blobs-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.blobs-toast.hide {
    opacity: 0;
    transform: translateY(-15px) scale(0.95);
}

.blobs-toast-success {
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid #22c55e;
    color: #15803d;
}

.blobs-toast-error {
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid #ef4444;
    color: #b91c1c;
}

.blobs-toast-info {
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid #0ea5e9;
    color: #0284c7;
}

