:root {
    --em-bg: #05071a;
    --em-bg-2: #090f2f;
    --em-surface: rgba(10, 16, 42, 0.84);
    --em-surface-solid: #101733;
    --em-panel: #ffffff;
    --em-panel-soft: #f7f9ff;
    --em-text: #f8fbff;
    --em-muted: #9fb0d0;
    --em-ink: #172033;
    --em-blue: #0bb7ff;
    --em-cyan: #2be7ff;
    --em-purple: #7c3cff;
    --em-pink: #ff33d1;
    --em-gold: #ffc857;
    --em-danger: #ff477e;
    --em-success: #25d486;
    --em-border: rgba(255, 255, 255, 0.14);
    --em-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    --em-sticky-nav-offset: 84px;
    --bs-primary: #6f4cff;
    --bs-primary-rgb: 111, 76, 255;
    --bs-link-color: #0b8dff;
    --bs-link-hover-color: #7c3cff;
    color-scheme: dark light;
}

* {
    letter-spacing: 0;
}

body.euromusis-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--em-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 18% 12%, rgba(20, 183, 255, 0.28), transparent 28rem),
        radial-gradient(circle at 86% 20%, rgba(255, 51, 209, 0.22), transparent 24rem),
        radial-gradient(circle at 78% 88%, rgba(255, 200, 87, 0.16), transparent 20rem),
        linear-gradient(145deg, #030513 0%, #071032 48%, #05071a 100%);
    background-attachment: fixed;
}

.auth-body {
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
    color: var(--em-text);
    background:
        radial-gradient(circle at 16% 20%, rgba(11, 183, 255, 0.28), transparent 24rem),
        radial-gradient(circle at 86% 18%, rgba(255, 51, 209, 0.24), transparent 24rem),
        radial-gradient(circle at 50% 90%, rgba(124, 60, 255, 0.18), transparent 26rem),
        linear-gradient(145deg, #030513 0%, #071032 48%, #05071a 100%);
}

.auth-body::before {
    content: "";
    position: fixed;
    inset: 10vh -8vw auto;
    height: 42vh;
    pointer-events: none;
    opacity: 0.38;
    background:
        radial-gradient(circle, rgba(43, 231, 255, 0.85) 1px, transparent 1.7px),
        radial-gradient(circle, rgba(255, 51, 209, 0.72) 1px, transparent 1.7px);
    background-size: 22px 16px, 26px 18px;
    transform: skewY(-5deg);
    filter: drop-shadow(0 0 12px rgba(43, 231, 255, 0.26));
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent), linear-gradient(0deg, transparent, #000 28%, #000 72%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent), linear-gradient(0deg, transparent, #000 28%, #000 72%, transparent);
    mask-composite: intersect;
    -webkit-mask-composite: source-in;
}

.auth-body::after {
    content: "";
    position: fixed;
    inset: auto 0 0;
    height: 34vh;
    pointer-events: none;
    background: linear-gradient(0deg, rgba(3, 5, 19, 0.92), transparent);
}

.app-shell {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

.app-main {
    display: flex;
    flex: 1 0 auto;
    padding-block: 1.5rem 3rem;
}

.app-container {
    width: min(1180px, calc(100vw - 2rem));
    margin-inline: auto;
}

.glass-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: 84px;
    padding: 0 56px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    background: rgba(5, 7, 30, .72) !important;
    backdrop-filter: blur(14px);
    box-shadow: none;
}

.glass-nav .app-container {
    width: 100%;
    max-width: none;
    padding: 0;
}

.navbar-brand.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: #fff;
    font-weight: 900;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 28px rgba(130, 65, 255, .65);
}

.brand-text {
    display: grid;
    line-height: 1.05;
}

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

.brand-year {
    color: #c8d3ff;
    font-size: 14px;
    font-weight: 800;
}

.glass-nav .navbar-nav {
    gap: 24px;
    align-items: center;
    font-weight: 800;
}

.glass-nav .nav-link {
    color: #f4f4ff !important;
    font-weight: 800;
    opacity: 1;
}

.glass-nav .nav-link:hover,
.glass-nav .nav-link:focus {
    color: #fff;
}

.glass-nav .nav-link.is-active::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 10px;
    border-radius: 50%;
    background: #ff4acb;
    box-shadow: 0 0 14px #ff4acb;
}

.glass-nav .nav-link.is-active {
    color: #fff !important;
}

.profile-nav-link {
    display: grid;
    justify-items: center;
    gap: 0.24rem;
    min-width: 62px;
    padding-top: 0.25rem;
    padding-bottom: 0.2rem;
}

.profile-nav-link.dropdown-toggle::after {
    display: none;
}

.profile-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #8235ff, #ff3ac8);
    box-shadow: 0 0 25px rgba(255, 60, 205, .65);
    font-size: 0.82rem;
    font-weight: 950;
    text-transform: uppercase;
}

.profile-nav-name {
    max-width: 92px;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-menu {
    border: 1px solid rgba(255, 51, 209, 0.22);
    border-radius: 10px;
    background: rgba(5, 9, 32, 0.96);
    box-shadow: 0 18px 42px rgba(5, 7, 26, 0.34), 0 0 24px rgba(255, 51, 209, 0.12);
    backdrop-filter: blur(16px);
}

.dropdown-item {
    color: #eef4ff;
    font-weight: 750;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: #fff;
    background: rgba(255, 51, 209, 0.16);
}

.page-card,
.admin-section,
.results-panel,
.status-card,
.score-card,
.table-responsive,
.alert-light.border {
    border: 1px solid rgba(17, 31, 74, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 44px rgba(2, 8, 30, 0.12);
}

.page-card {
    padding: clamp(1.1rem, 2vw, 1.6rem);
}

.app-main h1,
.app-main h2,
.app-main h3,
.app-main h4,
.app-main h5 {
    color: var(--em-ink);
    font-weight: 900;
}

.vote-shell h2,
.vote-shell h5,
.admin-shell > h1,
.admin-results-shell > h2 {
    color: #fff;
    text-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.vote-shell .lead,
.vote-shell .stage-helper,
.admin-results-shell .stage-tabs {
    color: var(--em-muted);
}

.vote-shell form .lead {
    color: #fff;
}

.vote-shell > p,
.admin-results-shell > p,
.app-main > p,
.update-timestamp {
    color: var(--em-muted);
}

.page-card p,
.page-card h1,
.page-card h2,
.page-card h3,
.page-card h4,
.page-card h5,
.admin-section p,
.results-panel p,
.list-group-item,
.card,
.table,
.modal-content {
    color: var(--em-ink);
}

.page-card .text-muted,
.admin-section .text-muted,
.results-panel .text-muted,
.list-group-item .text-muted {
    color: #64748b !important;
}

.list-group-item {
    border-color: #dbe2ec;
    background: #fff;
}

.selection-meter,
.ranking-row,
.country-card,
.results-panel,
.admin-section {
    box-shadow: 0 16px 44px rgba(2, 8, 30, 0.12);
}

.btn {
    border-radius: 8px;
    font-weight: 850;
}

.btn-primary,
.btn-success {
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, var(--em-blue), var(--em-purple) 52%, var(--em-pink));
    box-shadow: 0 12px 26px rgba(111, 76, 255, 0.24);
}

.btn-primary:hover,
.btn-success:hover {
    filter: brightness(1.08);
    box-shadow: 0 16px 34px rgba(111, 76, 255, 0.3);
}

.btn-outline-primary {
    border-color: rgba(111, 76, 255, 0.42);
    color: #4230ba;
    background: rgba(111, 76, 255, 0.04);
}

.btn-outline-primary:hover {
    border-color: transparent;
    background: linear-gradient(135deg, var(--em-blue), var(--em-purple));
    color: #fff;
}

.btn-secondary,
.btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.page-card .btn-secondary,
.page-card .btn-outline-secondary,
.admin-section .btn-secondary,
.admin-section .btn-outline-secondary,
.results-panel .btn-secondary,
.results-panel .btn-outline-secondary {
    border-color: #cbd5e1;
    color: #26364f;
    background: #f8fafc;
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, #46546f, #172033);
}

.form-control,
.form-select {
    border-color: #d9e2f3;
    border-radius: 8px;
    background-color: #fff;
    color: var(--em-ink);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--em-purple);
    box-shadow: 0 0 0 0.2rem rgba(111, 76, 255, 0.16);
}

.auth-card {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    padding: clamp(1.15rem, 4vw, 2rem);
    border: 1px solid rgba(43, 231, 255, 0.28);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 51, 209, 0.12), rgba(11, 183, 255, 0.08)), rgba(7, 10, 40, 0.78);
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.38),
        0 0 0 1px rgba(255, 51, 209, 0.18),
        inset 0 0 48px rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(20px);
}

.auth-card-wide {
    width: min(560px, 100%);
}

.auth-logo {
    display: block;
    width: min(230px, 66vw);
    margin: 0 auto 1rem;
    border-radius: 50%;
    filter:
        drop-shadow(0 0 24px rgba(43, 231, 255, 0.34))
        drop-shadow(0 0 34px rgba(255, 51, 209, 0.22));
}

.auth-title {
    margin-bottom: 0.25rem;
    color: #fff;
    text-align: center;
    font-size: clamp(1.45rem, 6vw, 2rem);
    font-weight: 950;
}

.auth-subtitle {
    margin-bottom: 1.25rem;
    color: #aeb9df;
    text-align: center;
}

.auth-card .form-label {
    color: #eef4ff;
    font-weight: 800;
}

.auth-card .form-control {
    min-height: 48px;
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(5, 10, 34, 0.72);
    color: #fff;
    box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.025);
}

.auth-card .form-control:focus {
    border-color: rgba(255, 51, 209, 0.75);
    background: rgba(7, 12, 40, 0.92);
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(255, 51, 209, 0.12), 0 0 24px rgba(43, 231, 255, 0.12);
}

.auth-card .form-control::placeholder {
    color: rgba(224, 232, 255, 0.48);
}

.auth-card .btn-primary {
    min-height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(11, 183, 255, 0.96), rgba(124, 60, 255, 0.96) 52%, rgba(255, 51, 209, 0.94));
    box-shadow: 0 16px 36px rgba(111, 76, 255, 0.28), 0 0 28px rgba(255, 51, 209, 0.18);
    font-weight: 950;
}

.auth-card .alert {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    background: rgba(7, 10, 40, 0.7);
    backdrop-filter: blur(12px);
}

.auth-card .alert-danger {
    border-color: rgba(255, 71, 126, 0.42);
    box-shadow: inset 0 0 0 1px rgba(255, 71, 126, 0.08);
}

.auth-card .alert-success {
    border-color: rgba(37, 212, 134, 0.42);
    box-shadow: inset 0 0 0 1px rgba(37, 212, 134, 0.08);
}

.auth-link {
    color: #fff;
    text-align: center;
}

.auth-link a {
    color: var(--em-cyan);
    font-weight: 900;
    text-decoration: none;
}

.auth-link a:hover {
    color: var(--em-gold);
}

.auth-info-link {
    margin-top: 0.85rem;
    text-align: center;
}

.auth-info-link a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    color: #9feaff;
    font-weight: 900;
    text-decoration: none;
    text-shadow: 0 0 12px rgba(43, 231, 255, 0.42), 0 0 18px rgba(255, 51, 209, 0.22);
}

.auth-info-link a:hover {
    color: #ff8fe7;
}

.auth-info-icon {
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border: 1px solid rgba(43, 231, 255, 0.38);
    border-radius: 50%;
    color: #fff;
    background: rgba(7, 10, 40, 0.55);
    box-shadow: 0 0 16px rgba(43, 231, 255, 0.28), 0 0 14px rgba(255, 51, 209, 0.18);
    font-size: 0.82rem;
    font-weight: 950;
}

.public-info-body .app-main {
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.public-info-body .app-container {
    width: min(820px, 100%);
}

.info-page-card {
    position: relative;
    overflow: hidden;
    padding: clamp(1.25rem, 4vw, 2.4rem);
    border: 1px solid rgba(43, 231, 255, 0.24);
    border-radius: 16px;
    color: #f8fbff;
    background:
        radial-gradient(circle at 14% 12%, rgba(43, 231, 255, 0.18), transparent 32%),
        radial-gradient(circle at 86% 12%, rgba(255, 51, 209, 0.18), transparent 34%),
        linear-gradient(135deg, rgba(255, 51, 209, 0.10), rgba(11, 183, 255, 0.08)),
        rgba(7, 10, 40, 0.82);
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.38),
        0 0 0 1px rgba(255, 51, 209, 0.14),
        inset 0 0 54px rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    text-align: center;
}

.info-page-logo {
    width: min(180px, 46vw);
    margin-bottom: 0.85rem;
    border-radius: 50%;
    filter: drop-shadow(0 0 26px rgba(43, 231, 255, 0.28)) drop-shadow(0 0 32px rgba(255, 51, 209, 0.18));
}

.info-page-kicker {
    color: #7ddfff;
    font-size: 0.82rem;
    font-weight: 950;
    text-transform: uppercase;
}

.info-page-card h1 {
    margin: 0.25rem 0 1rem;
    color: #fff;
    font-size: clamp(1.75rem, 6vw, 3.1rem);
    font-weight: 950;
    text-shadow: 0 0 24px rgba(255,255,255,.22);
}

.info-page-content {
    display: block;
    color: #dce5ff;
    font-size: clamp(1rem, 2vw, 1.12rem);
    line-height: 1.65;
    text-align: left;
}

.info-page-content p {
    margin: 0 0 0.8rem;
}

.info-page-content h2,
.info-page-content h3,
.info-page-content h4 {
    margin: 0.35rem 0 0;
    color: #ffffff;
    font-weight: 950;
    text-shadow: 0 0 18px rgba(255, 55, 210, 0.24), 0 0 20px rgba(43, 231, 255, 0.14);
}

.info-page-content h2 {
    font-size: clamp(1.45rem, 4vw, 2rem);
}

.info-page-content h3 {
    font-size: clamp(1.25rem, 3vw, 1.55rem);
}

.info-page-content h4 {
    font-size: clamp(1.08rem, 2.4vw, 1.28rem);
}

.info-page-content ul,
.info-page-content ol {
    margin: 0 0 0.85rem;
    padding-left: 1.35rem;
}

.info-page-content li {
    margin: 0.28rem 0;
    padding-left: 0.25rem;
    color: inherit;
}

.info-page-content li p {
    margin: 0;
}

.info-page-content li::marker {
    color: #ff4ed8;
}

.info-page-content blockquote {
    margin: 0 0 0.85rem 1.9rem;
    padding: 0;
    border-left: 0;
    border-radius: 0;
    background: transparent;
}

.info-page-content blockquote blockquote {
    margin-left: 1.9rem;
}

.info-page-content blockquote p {
    margin: 0 0 0.7rem;
}

.info-page-content blockquote ul,
.info-page-content blockquote ol {
    margin-top: 0;
    margin-bottom: 0.7rem;
}

.info-page-content ul li::marker,
.info-page-content ol li::marker {
    color: #ff4ed8;
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(230px, 0.7fr) minmax(280px, 1fr);
    gap: clamp(1rem, 4vw, 2.5rem);
    align-items: center;
    min-height: calc(100vh - 130px);
    padding: clamp(1rem, 4vw, 2rem);
    border: 1px solid rgba(43, 231, 255, 0.24);
    border-radius: 16px;
    color: #fff;
    background:
        radial-gradient(circle at 16% 18%, rgba(43, 231, 255, 0.18), transparent 28%),
        radial-gradient(circle at 84% 20%, rgba(255, 51, 209, 0.16), transparent 30%),
        linear-gradient(135deg, rgba(255, 51, 209, 0.10), rgba(11, 183, 255, 0.08)),
        rgba(7, 10, 40, 0.68);
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 51, 209, 0.12),
        inset 0 0 54px rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(18px);
}

.home-hero h1 {
    color: #fff;
    font-size: clamp(2rem, 7vw, 4.6rem);
    line-height: 0.95;
    text-shadow: 0 0 28px rgba(255, 255, 255, 0.24);
}

.home-hero p {
    color: #b8c4e5;
    font-size: 1.05rem;
}

.home-logo {
    width: min(360px, 82vw);
    border-radius: 50%;
    filter:
        drop-shadow(0 0 30px rgba(43, 231, 255, 0.34))
        drop-shadow(0 0 44px rgba(255, 51, 209, 0.18));
}

.home-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 0.8rem;
    max-width: 620px;
    margin-top: 1.4rem;
}

.home-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding-inline: 1rem;
    border-radius: 10px;
    white-space: normal;
    text-align: center;
    font-weight: 950;
}

.home-actions .btn-outline-primary {
    border-color: rgba(255, 51, 209, 0.48);
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 14px 34px rgba(2, 8, 30, 0.2);
    backdrop-filter: blur(14px);
}

.home-actions .btn-outline-primary:hover {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, rgba(11, 183, 255, 0.92), rgba(255, 51, 209, 0.88));
}

.table {
    vertical-align: middle;
}

.table thead th {
    color: #40506f;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.alert {
    border-radius: 8px;
}

.floating-tv-button {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 46px;
    border: 1px solid rgba(43, 231, 255, 0.34);
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, rgba(11, 183, 255, 0.92), rgba(124, 60, 255, 0.92), rgba(255, 51, 209, 0.88));
    box-shadow: 0 14px 34px rgba(2, 8, 30, 0.32), 0 0 28px rgba(255, 51, 209, 0.2);
    font-weight: 950;
    text-decoration: none;
    backdrop-filter: blur(14px);
}

.floating-tv-button:hover {
    color: #fff;
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.tv-shell-embedded .floating-tv-button {
    display: none;
}

.tv-shell-embedded body .floating-tv-button {
    display: none;
}

.site-credit {
    margin-top: auto;
    margin-bottom: 7px;
    padding-top: 1.2rem;
    pointer-events: none;
    color: rgba(248, 251, 255, 0.26);
    font-size: 0.68rem;
    font-weight: 800;
    text-align: center;
    text-shadow:
        0 0 10px rgba(43, 231, 255, 0.58),
        0 0 18px rgba(255, 51, 209, 0.18);
    white-space: nowrap;
}

@media (max-width: 560px) {
    .floating-tv-button {
        right: 12px;
        bottom: 12px;
        min-width: 54px;
        height: 42px;
    }

    .tv-shell-embedded body {
        padding-bottom: var(--tv-dock-space, 0px);
    }

    .tv-shell-embedded .app-main {
        padding-bottom: calc(var(--tv-dock-space, 0px) + 1rem);
    }

    .tv-shell-embedded .site-credit {
        display: none;
    }
}

@media (max-width: 820px) {
    :root {
        --em-sticky-nav-offset: 84px;
    }

    .glass-nav {
        min-height: auto;
        padding: 18px;
    }
    .glass-nav .navbar-nav {
        align-items: stretch;
        gap: 0.35rem;
        padding-top: 0.75rem;
    }
    .profile-nav-link {
        justify-items: start;
        grid-template-columns: 38px minmax(0, 1fr);
        align-items: center;
    }

    .app-main {
        padding-block: 1rem 2rem;
    }

    .home-hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-block: 1.5rem 2.5rem;
        text-align: center;
    }

    .home-logo {
        margin-inline: auto;
    }

    .home-actions {
        margin-inline: auto;
    }

    .brand-year {
        display: none;
    }
}

@media (max-width: 560px) {
    :root {
        --em-sticky-nav-offset: 84px;
    }

    .auth-body {
        align-items: start;
        padding-top: 1rem;
    }

    .auth-card {
        padding: 1rem;
    }

    .auth-logo {
        width: min(220px, 72vw);
    }

    .home-actions {
        grid-template-columns: 1fr;
        width: 100%;
    }
}
