/* ── CB PL Countdown widget — sticky corner tile ── */

@keyframes cbplc-slide-in {
    from { transform: translateX(calc(100% + 24px)); opacity: 0; }
    to   { transform: translateX(0);                 opacity: 1; }
}

@keyframes cbplc-slide-up {
    from { transform: translateY(calc(100% + 12px)); opacity: 0; }
    to   { transform: translateY(0);                 opacity: 1; }
}

#cbplc-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    width: 224px;
    animation: cbplc-slide-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) 1.2s both;
}

/* Mobile — capped width bar, slides up */
@media (max-width: 768px) {
    #cbplc-widget {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-width: 320px;
        animation: cbplc-slide-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) 1.2s both;
    }
}

/* ── Tile link ─────────────────────────────────────── */
#cbplc-widget a {
    display: flex;
    align-items: center;
    height: 60px;
    border-radius: 10px;
    border: 1px solid transparent;   /* no border until hover (1px kept to avoid shift) */
    /* per-league colours set inline via CSS vars (fallbacks = Premier League) */
    background: var(--cbplc-bg, #26202B);
    overflow: hidden;
    position: relative;
    text-decoration: none !important;
    transition: background 0.25s ease, border-color 0.18s ease;
    cursor: pointer;
}

/* Hover — tile warms + coloured border, both per-league (PL purple, LaLiga/Bundesliga red) */
#cbplc-widget a:hover {
    background: var(--cbplc-bg-hover, #352A44);
    border-color: var(--cbplc-border-hover, rgba(186, 141, 247, 0.85));
    text-decoration: none !important;
}

/* ── Per-league background artwork ──────────────────── */
/* background-image is set inline per league; the mode class picks the
   treatment. 'crest' = watermark hugging the left (PL SVG crest);
   'texture' = full-cover raster (LaLiga / Bundesliga), WC-style. */
.cbplc-glow {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.cbplc-mode-crest .cbplc-glow {
    background-position: left center;
    background-size: auto 100%;
    opacity: 0.4;
}
.cbplc-mode-crest a:hover .cbplc-glow { opacity: 0.5; }

/* The texture PNGs are already ~15% alpha baked in, so they render near
   full CSS opacity — the built-in alpha IS the watermark fade. */
.cbplc-mode-texture .cbplc-glow {
    background-position: center;
    background-size: cover;
    opacity: 0.9;
}
.cbplc-mode-texture a:hover .cbplc-glow { opacity: 1; }

/* ── Trophy / logo area ────────────────────────────── */
.cbplc-logo-wrap {
    width: 52px;
    flex-shrink: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    position: relative;
    z-index: 1;
}

.cbplc-trophy {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cbplc-logo-img {
    max-height: 38px;
    width: auto;
    pointer-events: none;
    display: block;
    transform-origin: bottom center;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.35s ease;
}

/* Hover — lift + slight scale + soft purple glow (matches the hover wash) */
#cbplc-widget a:hover .cbplc-logo-img {
    transform: translateY(-2px) scale(1.08);
    filter: drop-shadow(0 0 6px var(--cbplc-glow, rgba(158, 106, 232, 0.8)));
}

/* Gleam — a diagonal light band swept across the trophy shape only */
.cbplc-shine {
    position: absolute;
    inset: 0;
    pointer-events: none;
    -webkit-mask: url('../img/pl-trophy.svg') center / contain no-repeat;
            mask: url('../img/pl-trophy.svg') center / contain no-repeat;
    background: linear-gradient(115deg,
        transparent 38%,
        rgba(255, 255, 255, 0.9) 50%,
        transparent 62%);
    background-size: 250% 100%;
    background-position: 160% 0;
    opacity: 0;
}

#cbplc-widget a:hover .cbplc-shine {
    opacity: 1;
    animation: cbplc-gleam 0.75s ease-out;
}

@keyframes cbplc-gleam {
    0%   { background-position: 160% 0; }
    100% { background-position: -60% 0; }
}

/* ── Content area ──────────────────────────────────── */
.cbplc-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
    padding: 6px 4px 6px 2px;
    gap: 3px;
    position: relative;
    z-index: 1;
}

.cbplc-title {
    font-size: 13px;
    font-weight: 700;
    color: #E0E0E0;
    line-height: 1;
    white-space: nowrap;
}

.cbplc-sub {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #AEB0B4;
    line-height: 1;
    white-space: nowrap;
}

/* ── Countdown row ─────────────────────────────────── */
.cbplc-cd-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.cbplc-unit {
    display: flex;
    align-items: baseline;
    gap: 1px;
}

.cbplc-num {
    font-size: 14px;
    font-weight: 700;
    color: #EDEDED;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.cbplc-unit-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--cbplc-label, #9179B8);   /* per-league: PL purple, LaLiga/Bundesliga warm maroon */
    text-transform: uppercase;
}

/* ── Live state ────────────────────────────────────── */
.cbplc-live-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 400;
    color: #E0E0E0;
    line-height: 1;
}

@keyframes cbplc-pulse {
    0%, 100% { opacity: 1;    transform: scale(1);   }
    50%       { opacity: 0.4; transform: scale(0.82); }
}

.cbplc-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ED573;
    box-shadow: 0 0 6px rgba(46, 213, 115, 0.8);
    flex-shrink: 0;
    animation: cbplc-pulse 1.4s ease-in-out infinite;
    display: inline-block;
}

/* ── Chevron ───────────────────────────────────────── */
.cbplc-chev {
    display: flex;
    align-items: center;
    padding: 0 10px;
    flex-shrink: 0;
    font-size: 17px;
    color: #8F8F8F;
    position: relative;
    z-index: 1;
}
