:root {
    --bg: #070b14;
    --bg-soft: #0c1220;
    --panel: rgba(16, 24, 39, 0.82);
    --panel-solid: #101827;
    --border: rgba(148, 163, 184, 0.14);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-light: #cbd5e1;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --success: #22c55e;
    --danger: #ef4444;
    --radius: 18px;
    --max-width: 1180px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 10%, rgba(37, 99, 235, 0.13), transparent 30%),
        radial-gradient(circle at 85% 20%, rgba(59, 130, 246, 0.08), transparent 25%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.navbar {
    width: min(var(--max-width), calc(100% - 40px));
    margin: 0 auto;
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #1d4ed8);
    box-shadow: 0 10px 35px rgba(37, 99, 235, 0.28);
    font-size: 13px;
    letter-spacing: 0.04em;
}

.brand-name {
    font-size: 18px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a,
.footer-links a {
    color: var(--muted);
    font-size: 14px;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.footer-links a:hover {
    color: var(--text);
}

.nav-button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 650;
    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.nav-button,
.button-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.22);
}

.nav-button:hover,
.button-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.button-secondary {
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.5);
    color: var(--text);
}

.button-secondary:hover {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(30, 41, 59, 0.7);
    transform: translateY(-2px);
}

.hero {
    width: min(var(--max-width), calc(100% - 40px));
    min-height: calc(100vh - 82px);
    margin: 0 auto;
    padding: 90px 0 110px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
    align-items: center;
    gap: 90px;
}

.hero-content {
    max-width: 650px;
}

.eyebrow,
.section-kicker,
.card-label,
.dashboard-label {
    color: var(--accent-hover);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.eyebrow {
    margin-bottom: 20px;
}

.hero h1 {
    max-width: 680px;
    font-size: clamp(52px, 6vw, 82px);
    line-height: 0.98;
    letter-spacing: -0.065em;
    font-weight: 800;
}

.hero h1 span {
    color: var(--accent-hover);
}

.hero-text {
    max-width: 590px;
    margin-top: 28px;
    color: var(--muted-light);
    font-size: 18px;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.hero-status {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 25px;
    color: var(--muted);
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.8);
}

.hero-card,
.dashboard-preview,
.feature-card,
.community-card,
.docs-card {
    border: 1px solid var(--border);
    background: linear-gradient(
        145deg,
        rgba(20, 30, 48, 0.92),
        rgba(10, 16, 28, 0.88)
    );
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.hero-card {
    padding: 26px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    top: -150px;
    right: -100px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.18);
    filter: blur(30px);
}

.card-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.player-name {
    margin-top: 5px;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.server-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.12);
    color: #93c5fd;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.session-main-stat {
    margin: 46px 0 28px;
}

.stat-value {
    display: block;
    font-size: 56px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.055em;
}

.stat-label {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-box {
    padding: 17px;
    border: 1px solid rgba(148, 163, 184, 0.09);
    border-radius: 13px;
    background: rgba(15, 23, 42, 0.56);
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    color: #3b9cff;
}

.stat-icon svg {
    width: 34px;
    height: 34px;
}

.stat-box > span:last-child {
    min-width: 0;
}

.stat-number {
    display: block;
    font-size: 22px;
    font-weight: 750;
}

.session-timer {
    font-size: 20px;
    letter-spacing: -0.03em;
}

.stat-caption {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.battle-history {
    margin-top: 25px;
}

.history-label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.14em;
}

.history-items {
    display: flex;
    gap: 5px;
}

.battle {
    width: 21px;
    height: 21px;
    border-radius: 6px;
}

.battle.win {
    background: rgba(34, 197, 94, 0.78);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.12);
}

.battle.loss {
    background: rgba(239, 68, 68, 0.78);
}

.section {
    width: min(var(--max-width), calc(100% - 40px));
    margin: 0 auto;
    padding: 115px 0;
}

.section-heading {
    max-width: 720px;
    margin-bottom: 48px;
}

.section-kicker {
    margin-bottom: 12px;
}

.section-heading h2,
.session-copy h2,
.docs-card h2 {
    font-size: clamp(34px, 4vw, 54px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.section-heading p,
.session-copy p,
.docs-card p {
    margin-top: 17px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.75;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.feature-card {
    min-height: 245px;
    padding: 25px;
    border-radius: var(--radius);
}

.feature-icon {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    margin-bottom: 35px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    font-size: 18px;
}

.feature-card h3 {
    font-size: 19px;
    letter-spacing: -0.025em;
}

.feature-card p {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.session-section {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    align-items: center;
    gap: 90px;
}

.session-copy {
    max-width: 470px;
}

.session-copy .button {
    margin-top: 28px;
}

.session-flow {
    display: grid;
    grid-template-columns: 1fr auto 1.2fr auto 1fr;
    align-items: center;
    gap: 12px;
}

.flow-item {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(15, 23, 42, 0.6);
    text-align: center;
}

.flow-item strong,
.flow-item small {
    display: block;
}

.flow-item strong {
    margin-top: 10px;
    font-size: 14px;
}

.flow-item small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.flow-icon,
.flow-core {
    display: grid;
    place-items: center;
}

.flow-icon {
    width: 35px;
    height: 35px;
    margin: 0 auto;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    font-weight: 800;
}

.flow-core {
    min-width: 135px;
    min-height: 135px;
    border: 1px solid rgba(59, 130, 246, 0.28);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.75));
    text-align: center;
}

.flow-core span {
    color: var(--accent-hover);
    font-size: 22px;
    font-weight: 850;
}

.flow-core strong {
    margin-top: 4px;
    font-size: 11px;
}

.flow-line {
    height: 1px;
    min-width: 22px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.45), transparent);
}

.dashboard-preview {
    max-width: 900px;
    margin: 0 auto;
    padding: 28px;
    border-radius: 22px;
}

.dashboard-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-top h3 {
    margin-top: 5px;
    font-size: 23px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 28px;
}

.dashboard-stats > div {
    padding: 20px;
    border-radius: 13px;
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.08);
}

.dashboard-stats span,
.dashboard-stats strong {
    display: block;
}

.dashboard-stats span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.dashboard-stats strong {
    margin-top: 5px;
    font-size: 25px;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 20px;
}

.control-button {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.7);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.control-button.start {
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.control-button.danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.community-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 21px;
    border-radius: var(--radius);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.community-card:hover {
    transform: translateY(-3px);
    border-color: rgba(148, 163, 184, 0.28);
}

.community-icon {
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    font-weight: 800;
}

.community-card strong,
.community-card small {
    display: block;
}

.community-card strong {
    font-size: 15px;
}

.community-card small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.docs-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 35px;
    padding: 38px;
    border-radius: 22px;
}

.docs-card > div {
    max-width: 680px;
}

footer {
    width: min(var(--max-width), calc(100% - 40px));
    margin: 0 auto;
    padding: 35px 0 45px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 25px;
}

.footer-brand strong,
.footer-brand span {
    display: block;
}

.footer-brand strong {
    font-size: 15px;
}

.footer-brand span,
.footer-copy {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.footer-links {
    display: flex;
    gap: 22px;
}

.footer-copy {
    text-align: right;
}

@media (max-width: 1050px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 55px;
        padding-top: 65px;
    }

    .hero-content {
        max-width: 760px;
    }

    .hero-card {
        max-width: 650px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .session-section {
        grid-template-columns: 1fr;
        gap: 55px;
    }
}

@media (max-width: 780px) {
    .navbar {
        min-height: 70px;
    }

    .nav-links {
        display: none;
    }

    .nav-button {
        min-height: 40px;
        padding: 0 14px;
    }

    .hero {
        padding: 55px 0 75px;
    }

    .hero h1 {
        font-size: clamp(45px, 13vw, 68px);
    }

    .hero-text {
        font-size: 16px;
    }

    .section {
        padding: 80px 0;
    }

    .features-grid,
    .community-grid {
        grid-template-columns: 1fr;
    }

    .session-flow {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .flow-line {
        width: 1px;
        height: 20px;
        min-width: 0;
        margin: 0 auto;
        background: linear-gradient(180deg, transparent, rgba(59, 130, 246, 0.45), transparent);
    }

    .flow-core {
        margin: 5px auto;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .docs-card {
        align-items: flex-start;
        flex-direction: column;
    }

    footer {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-wrap: wrap;
    }

    .footer-copy {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .navbar,
    .hero,
    .section,
    footer {
        width: min(100% - 28px, var(--max-width));
    }

    .brand-name {
        display: none;
    }

    .hero-card {
        padding: 19px;
        border-radius: 18px;
    }

    .stat-value {
        font-size: 45px;
    }

    .stats-grid,
    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-preview {
        padding: 18px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .button {
        width: 100%;
    }

    .history-items {
        flex-wrap: wrap;
    }
}

/* PLAYER SEARCH */

.player-search-card {
    max-width: 900px;
    margin: 0 auto;
    padding: 28px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    background: rgba(255,255,255,0.025);
}

.search-form {
    display: flex;
    gap: 12px;
}

#player-search-input {
    flex: 1;
    min-width: 0;
    padding: 15px 18px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    background: rgba(0,0,0,0.20);
    color: inherit;
    font: inherit;
    outline: none;
}

#player-search-input:focus {
    border-color: rgba(255,255,255,0.25);
}

#player-search-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.search-status {
    min-height: 24px;
    margin-top: 16px;
    font-size: 14px;
    opacity: 0.7;
}

.player-results {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.player-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    background: rgba(255,255,255,0.025);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.player-result:hover,
.player-result.selected {
    border-color: rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.05);
}

.player-result > div {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.player-result strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-result span {
    padding: 5px 8px;
    border-radius: 7px;
    background: rgba(255,255,255,0.08);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.player-select {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .player-search-card {
        padding: 18px;
    }

    .search-form {
        flex-direction: column;
    }

    .player-result {
        align-items: flex-start;
        flex-direction: column;
    }

    .player-select {
        width: 100%;
    }
}

.session-wr-purple {
    color: #a855f7;
    text-shadow: 0 0 28px rgba(168, 85, 247, 0.28);
}

/* SESSION PREVIEW STATS */
.stats-grid .stat-box {
    display: flex;
    align-items: center;
    gap: 11px;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: rgba(59, 130, 246, 0.10);
    color: #60a5fa;
}

.stat-icon svg {
    width: 18px;
    height: 18px;
}

.stat-box > span:last-child {
    min-width: 0;
}

.session-timer {
    font-size: 20px;
    letter-spacing: -0.035em;
}

.language-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-radius: 10px;
    padding: 10px 34px 10px 12px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                      linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.language-select:hover {
    background-color: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
}

.language-select:focus {
    border-color: rgba(168, 85, 247, 0.6);
}

.language-select option {
    background: #111318;
    color: #ffffff;
}

@media (max-width: 900px) {
    .language-select {
        order: 3;
    }
}


/* Session preview stat icons and timer */
.session-wr-purple {
    color: #a855f7;
    text-shadow: 0 0 28px rgba(168, 85, 247, 0.28);
}

.stat-icon {
    color: #3b9cff;
}

.session-timer {
    color: var(--text);
    font-size: 20px;
}


.dashboard-stats > div {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    align-items: center;
}

.dashboard-stat-icon {
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: #60a5fa;
}

.dashboard-stat-icon svg {
    width: 19px;
    height: 19px;
}

.dashboard-wr-purple {
    color: #a855f7;
    text-shadow: 0 0 18px rgba(168, 85, 247, 0.22);
}

/* WEB ACCOUNT / OBS */
.web-dashboard-card{max-width:900px;margin:0 auto;padding:28px;border:1px solid var(--border);border-radius:22px;background:linear-gradient(145deg,rgba(20,30,48,.92),rgba(10,16,28,.88));}
.web-accounts{display:grid;gap:9px;margin-top:22px}
.web-account{display:flex;gap:8px;align-items:stretch}
.web-account-select{flex:1;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 16px;border:1px solid rgba(148,163,184,.10);border-radius:12px;background:rgba(15,23,42,.62);color:var(--text);font:inherit;text-align:left;cursor:pointer}
.web-account.active .web-account-select{border-color:rgba(59,130,246,.45);background:rgba(37,99,235,.10)}
.web-account-select span{display:flex;align-items:center;gap:12px;min-width:0}
.web-account-select strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.web-account-select small{color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.08em}
.web-account-select b{font-size:10px;color:#93c5fd;white-space:nowrap}
.web-account-delete{width:44px;border:1px solid rgba(239,68,68,.20);border-radius:10px;background:rgba(239,68,68,.06);color:#fca5a5;font-size:20px;cursor:pointer}
.web-account-empty{padding:18px;border:1px dashed var(--border);border-radius:12px;color:var(--muted);text-align:center}
.web-mode-select{min-height:42px;padding:0 14px;border:1px solid var(--border);border-radius:10px;background:rgba(15,23,42,.7);color:var(--text);font:inherit}
.obs-card{margin-top:20px;padding:18px;border:1px solid rgba(59,130,246,.20);border-radius:14px;background:rgba(37,99,235,.06)}
.obs-card>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:12px}
.obs-card strong{font-size:13px;color:#86efac}
.obs-url-row{display:flex;gap:9px;margin-top:12px}
#web-obs-url{flex:1;min-width:0;padding:11px 13px;border:1px solid var(--border);border-radius:9px;background:rgba(0,0,0,.2);color:var(--muted-light);font:12px monospace}
.web-search-card{margin-top:24px}
.error{color:#ff8792}
@media(max-width:640px){.obs-url-row{flex-direction:column}.obs-url-row .control-button{width:100%}.web-account-select{padding:12px}.web-account-select span{gap:8px}}


/* Web Dashboard */
.web-dashboard-section{scroll-margin-top:30px}
.web-dashboard-card{max-width:900px;margin:0 auto;padding:28px;border:1px solid var(--border);border-radius:22px;background:linear-gradient(145deg,rgba(20,30,48,.92),rgba(10,16,28,.88));}
.web-accounts{display:grid;gap:9px;margin-top:22px}
.web-account{display:flex;gap:8px;align-items:stretch}
.web-account-select{flex:1;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 16px;border:1px solid rgba(148,163,184,.10);border-radius:12px;background:rgba(15,23,42,.62);color:var(--text);font:inherit;text-align:left;cursor:pointer}
.web-account.active .web-account-select{border-color:rgba(59,130,246,.45);background:rgba(37,99,235,.10)}
.web-account-select span{display:flex;align-items:center;gap:12px;min-width:0}
.web-account-select strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.web-account-select small{color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.08em}
.web-account-select b{font-size:10px;color:#93c5fd;white-space:nowrap}
.web-account-delete{width:44px;border:1px solid rgba(239,68,68,.20);border-radius:10px;background:rgba(239,68,68,.06);color:#fca5a5;font-size:20px;cursor:pointer}
.web-account-empty{padding:18px;border:1px dashed var(--border);border-radius:12px;color:var(--muted);text-align:center}
.web-dashboard-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px}
.web-mode-select{min-height:42px;padding:0 14px;border:1px solid var(--border);border-radius:10px;background:rgba(15,23,42,.7);color:var(--text);font:inherit}
.web-live-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:20px}
.web-live-stats>div{padding:14px;border:1px solid rgba(148,163,184,.09);border-radius:12px;background:rgba(15,23,42,.56)}
.web-live-stats span{display:block;color:var(--muted);font-size:10px;font-weight:750;letter-spacing:.1em}
.web-live-stats strong{display:block;margin-top:5px;font-size:21px}
.web-obs-card{margin-top:20px;padding:18px;border:1px solid rgba(59,130,246,.20);border-radius:14px;background:rgba(37,99,235,.06)}
.web-obs-card>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:12px}
.web-obs-card strong{font-size:13px;color:#86efac}
.web-obs-url-row{display:flex;gap:9px;margin-top:12px}
#web-obs-url{flex:1;min-width:0;padding:11px 13px;border:1px solid var(--border);border-radius:9px;background:rgba(0,0,0,.2);color:var(--muted-light);font:12px monospace}
.web-add-account-card{max-width:900px;margin:24px auto 0}
.search-status.error{color:#ff8792}
@media(max-width:700px){.web-live-stats{grid-template-columns:repeat(2,1fr)}.web-obs-url-row{flex-direction:column}.web-obs-url-row .control-button{width:100%}}
@media(max-width:520px){.web-dashboard-actions{display:grid;grid-template-columns:1fr}.web-mode-select,.web-dashboard-actions .control-button{width:100%}}

/* Mobile Web Dashboard layout */
@media (max-width: 520px) {
    .web-dashboard-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        align-items: stretch;
    }

    .web-dashboard-actions .web-mode-select {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        min-height: 50px;
        box-sizing: border-box;
    }

    .web-dashboard-actions .control-button {
        width: 100%;
        min-width: 0;
        min-height: 56px;
        box-sizing: border-box;
        padding: 10px 12px;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
    }

    .web-add-account-card .search-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
    }

    .web-add-account-card .search-form input,
    .web-add-account-card .search-form .button {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        margin: 0;
    }

    .web-add-account-card .search-form input {
        min-height: 52px;
    }

    .web-add-account-card .search-form .button {
        min-height: 56px;
    }
}

/* Custom language switcher */
.language-switcher {
    position: relative;
    order: 3;
}

.language-switcher-button {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.language-switcher-button:hover,
.language-switcher.open .language-switcher-button {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
}

.language-switcher-arrow {
    opacity: .65;
    font-size: 11px;
    margin-left: 2px;
}

.language-switcher-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    display: none;
    min-width: 190px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: #111318;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .35);
}

.language-switcher.open .language-switcher-menu {
    display: grid;
    gap: 2px;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.language-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.language-flag {
    position: relative;
    display: inline-block;
    flex: 0 0 24px;
    width: 24px;
    height: 16px;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.12);
}

/* Ukraine */
.flag-uk {
    background: linear-gradient(
        to bottom,
        #0057b7 0 50%,
        #ffd700 50% 100%
    );
}

/* United Kingdom */
.flag-en {
    background:
        linear-gradient(90deg, transparent 43%, #fff 43% 57%, transparent 57%),
        linear-gradient(0deg, transparent 43%, #fff 43% 57%, transparent 57%),
        linear-gradient(90deg, transparent 47%, #c8102e 47% 53%, transparent 53%),
        linear-gradient(0deg, transparent 47%, #c8102e 47% 53%, transparent 53%),
        #012169;
}

/* Germany */
.flag-de {
    background: linear-gradient(
        to bottom,
        #000 0 33.33%,
        #dd0000 33.33% 66.66%,
        #ffce00 66.66% 100%
    );
}

/* France */
.flag-fr {
    background: linear-gradient(
        to right,
        #0055a4 0 33.33%,
        #fff 33.33% 66.66%,
        #ef4135 66.66% 100%
    );
}

/* Poland */
.flag-pl {
    background: linear-gradient(
        to bottom,
        #fff 0 50%,
        #dc143c 50% 100%
    );
}

/* Spain */
.flag-es {
    background: linear-gradient(
        to bottom,
        #aa151b 0 25%,
        #f1bf00 25% 75%,
        #aa151b 75% 100%
    );
}

/* Vietnam */
.flag-vi {
    background: #da251d;
}

.flag-vi::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 9px solid #ffcd00;
    transform: rotate(180deg);
}

/* Japan */
.flag-ja {
    background: #fff;
}

.flag-ja::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #bc002d;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* China */
.flag-zh {
    background: #de2910;
}

.flag-zh::after {
    content: "★";
    position: absolute;
    left: 3px;
    top: 0;
    color: #ffde00;
    font-size: 9px;
    line-height: 16px;
}

@media (max-width: 900px) {
    .language-switcher {
        order: 3;
    }

    .language-switcher-menu {
        right: 0;
        max-width: calc(100vw - 24px);
    }
}


/* Final mobile language switcher fix */
@media (max-width: 780px) {
    .navbar {
        gap: 10px;
    }

    .language-switcher {
        order: 2;
        margin-left: auto;
        flex-shrink: 0;
    }

    .nav-button {
        order: 3;
        flex-shrink: 0;
    }

    .language-switcher-button {
        min-height: 40px;
        padding: 7px 9px;
        gap: 6px;
        font-size: 12px;
        white-space: nowrap;
    }

    .language-switcher-menu {
        right: 0;
    }
}

@media (max-width: 480px) {
    .navbar {
        gap: 8px;
    }

    .language-switcher-button {
        min-width: 42px;
        padding: 7px 8px;
    }
}

/* Correct United Kingdom flag */
.flag-en {
    background:
        linear-gradient(28deg,
            transparent 43%,
            #fff 43% 48%,
            #c8102e 48% 52%,
            #fff 52% 57%,
            transparent 57%),
        linear-gradient(-28deg,
            transparent 43%,
            #fff 43% 48%,
            #c8102e 48% 52%,
            #fff 52% 57%,
            transparent 57%),
        linear-gradient(90deg,
            transparent 38%,
            #fff 38% 62%,
            transparent 62%),
        linear-gradient(0deg,
            transparent 35%,
            #fff 35% 65%,
            transparent 65%),
        linear-gradient(90deg,
            transparent 44%,
            #c8102e 44% 56%,
            transparent 56%),
        linear-gradient(0deg,
            transparent 40%,
            #c8102e 40% 60%,
            transparent 60%),
        #012169;
}


/* Accurate CSS Union Jack */
.flag-en {
    background:
        /* red vertical */
        linear-gradient(to right,
            transparent 0 43%,
            #c8102e 43% 57%,
            transparent 57% 100%),
        /* red horizontal */
        linear-gradient(to bottom,
            transparent 0 38%,
            #c8102e 38% 62%,
            transparent 62% 100%),
        /* white vertical */
        linear-gradient(to right,
            transparent 0 36%,
            #fff 36% 64%,
            transparent 64% 100%),
        /* white horizontal */
        linear-gradient(to bottom,
            transparent 0 31%,
            #fff 31% 69%,
            transparent 69% 100%),
        /* white diagonal */
        linear-gradient(45deg,
            transparent 0 39%,
            #fff 39% 47%,
            transparent 47% 53%,
            #fff 53% 61%,
            transparent 61%),
        /* white diagonal */
        linear-gradient(-45deg,
            transparent 0 39%,
            #fff 39% 47%,
            transparent 47% 53%,
            #fff 53% 61%,
            transparent 61%),
        #012169;
}


/* Real SVG Union Jack */
.flag-en {
    background: #012169 url("/flags/gb.svg") center / 100% 100% no-repeat !important;
}
