/* ────────────────────────────────────────────────────────────────────
   7Play Sports — Demo launcher styles
   ──────────────────────────────────────────────────────────────────── */

:root {
    --bg: #08090c;
    --chrome: #0e1116;
    --chrome-2: #14181f;
    --chrome-3: #1a2029;
    --hairline: rgba(255, 255, 255, 0.08);
    --hairline-strong: rgba(255, 255, 255, 0.14);

    --text: #e9edf3;
    --text-soft: #aab3c2;
    --text-dim: #6d7789;

    --accent: #00c853;
    --accent-soft: rgba(0, 200, 83, 0.14);
    --accent-ring: rgba(0, 200, 83, 0.35);
    --danger: #ff5d5d;

    --radius: 10px;
    --radius-lg: 14px;
    --toolbar-h: 60px;

    --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html,
body {
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

img {
    display: block;
    max-width: 100%;
}

button,
select {
    font-family: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ── App shell ─────────────────────────────────────────────────────── */

.app {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* z-index: 0 traps every widget-internal stacking context (the sportsbook
   uses high z-indexes for sticky headers and popups) below the toolbar,
   so launcher popovers always render on top. */
.stage {
    position: relative;
    z-index: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.sport-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* ── Toolbar ───────────────────────────────────────────────────────── */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: var(--toolbar-h);
    padding: 10px 16px;
    background: linear-gradient(180deg, var(--chrome-2), var(--chrome));
    border-bottom: 1px solid var(--hairline);
    position: relative;
    z-index: 100;
}

/* Brand */

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.brand-name {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--text);
    white-space: nowrap;
}

.brand-name span {
    font-weight: 500;
    color: var(--text-soft);
}

.brand-chip {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(0, 200, 83, 0.25);
    padding: 2px 7px;
    border-radius: 999px;
    transform: translateY(-1px);
}

/* Controls cluster */

.toolbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Segmented layout switch */

.segmented {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: 9px;
    padding: 3px;
    isolation: isolate;
}

.segmented-thumb {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    background: var(--chrome-3);
    border: 1px solid var(--hairline-strong);
    border-radius: 7px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s var(--ease);
    z-index: -1;
}

.segmented[data-active="european"] .segmented-thumb {
    transform: translateX(100%);
}

.segmented-btn {
    position: relative;
    appearance: none;
    border: none;
    background: none;
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 7px;
    transition: color 0.2s var(--ease);
    white-space: nowrap;
}

.segmented-btn:hover {
    color: var(--text-soft);
}

.segmented-btn[aria-selected="true"] {
    color: var(--text);
}

.segmented-btn[aria-selected="true"]::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 1px;
    width: 16px;
    height: 2px;
    transform: translateX(-50%);
    border-radius: 2px;
    background: var(--accent);
}

/* Template picker */

.template-picker {
    position: relative;
}

.picker-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: 9px;
    padding: 8px 12px;
    cursor: pointer;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.picker-btn:hover {
    border-color: var(--hairline-strong);
    background: var(--chrome);
}

.picker-btn[aria-expanded="true"] {
    border-color: var(--accent-ring);
}

.picker-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    white-space: nowrap;
}

.chevron {
    color: var(--text-dim);
    flex-shrink: 0;
}

.swatch {
    display: flex;
    align-items: center;
}

.swatch i,
.menu-option-swatch i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.swatch i + i,
.menu-option-swatch i + i {
    margin-left: -4px;
}

/* Flags */

.flag,
.menu-option-flag {
    width: 20px;
    height: 15px;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.flag svg,
.menu-option-flag svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Template dropdown */

.picker-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 224px;
    max-height: min(384px, calc(100vh - 96px));
    overflow-y: auto;
    background: var(--chrome-2);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    padding: 6px;
    z-index: 200;
    animation: menu-in 0.16s var(--ease);
}

.picker-menu[hidden] {
    display: none;
}

@keyframes menu-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    border-radius: 9px;
    padding: 9px 10px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s var(--ease);
}

.menu-option:hover {
    background: var(--chrome-3);
}

.menu-option-swatch {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.menu-option-flag {
    display: inline-flex;
    flex-shrink: 0;
}

.menu-option-label {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
}

.menu-option.active .menu-option-label {
    color: var(--text);
}

.menu-option-check {
    color: var(--accent);
    opacity: 0;
    display: flex;
}

.menu-option.active .menu-option-check {
    opacity: 1;
}

/* Language picker */

.language-picker {
    position: relative;
}

.picker-btn-compact {
    padding: 8px 10px;
    gap: 7px;
}

.picker-label-short {
    letter-spacing: 0.05em;
}

/* ── Overlays ──────────────────────────────────────────────────────── */

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    z-index: 20;
    padding: 24px;
}

.overlay[hidden] {
    display: none;
}

/* Loader */

.loader {
    transition: opacity 0.35s var(--ease);
}

.loader.is-done {
    opacity: 0;
    pointer-events: none;
}

.loader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.loader-mark {
    position: relative;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.loader-mark img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    z-index: 1;
}

.loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--hairline);
    border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.loader-sub {
    font-size: 13px;
    color: var(--text-dim);
}

.loader-bar {
    margin-top: 18px;
    width: 168px;
    height: 3px;
    border-radius: 3px;
    background: var(--chrome-3);
    overflow: hidden;
    position: relative;
}

.loader-bar::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    border-radius: 3px;
    background: var(--accent);
    animation: bar-slide 1.1s var(--ease) infinite;
}

@keyframes bar-slide {
    from {
        left: -40%;
    }
    to {
        left: 100%;
    }
}

/* Error */

.error-card {
    max-width: 420px;
    text-align: center;
    background: var(--chrome-2);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: var(--danger);
    background: rgba(255, 93, 93, 0.12);
    margin-bottom: 16px;
}

.error-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

.error-message {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-soft);
    margin-bottom: 22px;
}

.retry-btn {
    appearance: none;
    border: none;
    background: var(--accent);
    color: #04140a;
    font-size: 13.5px;
    font-weight: 700;
    padding: 10px 26px;
    border-radius: 9px;
    cursor: pointer;
    transition: filter 0.15s var(--ease), transform 0.15s var(--ease);
}

.retry-btn:hover {
    filter: brightness(1.08);
}

.retry-btn:active {
    transform: scale(0.97);
}

/* No script */

.noscript {
    position: fixed;
    inset: auto 16px 16px;
    background: var(--chrome-2);
    border: 1px solid var(--hairline);
    color: var(--text-soft);
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    text-align: center;
    z-index: 100;
}

/* ── Responsive ───────────────────────────────────────────────────── */

/* The widget renders its mobile layout at <=800px (its own breakpoint)
   and relies on page-level scrolling there, so the container must scroll
   instead of clipping. */
@media (max-width: 800px) {
    .sport-container {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #sport-container > div {
        height: auto !important;
        min-height: 100%;
    }
}

@media (max-width: 900px) {
    .template-picker .picker-label {
        display: none;
    }

    .picker-btn {
        padding: 8px 10px;
    }
}

@media (max-width: 680px) {
    .toolbar {
        flex-wrap: wrap;
        row-gap: 8px;
        padding: 10px 12px;
    }

    .toolbar-controls {
        width: 100%;
        justify-content: space-between;
    }

    .segmented-btn {
        padding: 6px 12px;
        font-size: 12.5px;
    }

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

    .brand-chip {
        display: none;
    }

    .language-select {
        font-size: 12.5px;
    }
}

@media (max-width: 420px) {
    .picker-menu {
        position: fixed;
        top: auto;
        bottom: 16px;
        left: 16px;
        right: 16px;
        min-width: 0;
    }
}
