/* oura: one compact Marvel Rivals-style match HUD (hero portrait in the ult ring, segmented bars, ring prop, ability slots) */
#oura-wrap {
    --cut: 14px;
    --hud-gold: #ffd54a;
    --hud-purple: #a79fe6;
    --hud-hp: #6ff0b0;
    --hud-en: #8f86ff;
    --hud-red: #c8102e;
    --hud-font: "Barlow Condensed", "Geist", sans-serif;
    color: white;
}
.oura-day { margin-left: 10px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: darkgray; }

/* what is an Oura ring */
.oura-brief {
    margin: 8px 0 10px;
    font-size: 12.5px;
    line-height: 1.5;
    color: darkgray;
}
.oura-brief > b { color: white; }
.brief-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; }
.brief-legend span { display: inline-flex; align-items: center; }
.lg {
    display: inline-block;
    min-width: 30px;
    margin-right: 5px;
    padding: 0 6px;
    text-align: center;
    font: italic 800 12px/16px var(--hud-font);
    letter-spacing: 0.08em;
    color: #0d0c1d;
    clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}
.lg.ult { background: var(--hud-gold); }
.lg.hp { background: var(--hud-hp); }
.lg.en { background: var(--hud-en); }

.oura-strip { transition: transform 0.45s ease, filter 0.35s ease; }
.oura-strip:hover { transform: translateY(-4px); filter: drop-shadow(0 16px 24px rgba(115, 108, 157, 0.45)); }

/* gradient frame doubles as the angled border */
.hud-frame,
.hud-panel {
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.hud-frame { padding: 1.5px; background: linear-gradient(135deg, var(--hud-purple), rgba(115, 108, 157, 0.15) 45%, var(--hud-purple)); }
.hud-panel {
    position: relative;
    padding: 10px 16px 14px;
    overflow: hidden;
    background:
        radial-gradient(rgba(167, 159, 230, 0.13) 1px, transparent 1.4px) 0 0 / 8px 8px,
        linear-gradient(160deg, rgba(115, 108, 157, 0.28), #0d0c1d 55%);
    background-color: #0d0c1d;
}
.hud-panel::after { content: ""; position: absolute; right: 0; bottom: 0; width: 64px; height: 4px; background: var(--hud-red); }

.hud-top {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 7px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(167, 159, 230, 0.25);
    font-family: var(--hud-font);
    font-style: italic;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.hud-tag {
    flex: none;
    padding: 2px 12px 2px 8px;
    font-size: 12px;
    color: #0d0c1d;
    background: var(--hud-gold);
    clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.hud-player { font-size: 15px; letter-spacing: 0.08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-player i { color: var(--hud-purple); margin: 0 2px; }
.hud-rank { margin-left: auto; flex: none; font-size: 14px; color: var(--hud-gold); text-shadow: 0 0 12px rgba(255, 213, 74, 0.55); }

.hud-main { position: relative; display: flex; align-items: center; gap: 14px; }

/* hero portrait inside the ultimate-charge ring */
.hero-ult { position: relative; flex: none; width: 124px; height: 124px; }
.hud-ult-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); z-index: 1; }
.hud-ult-ring circle { fill: none; stroke-width: 5; }
.ult-track { stroke: rgba(167, 159, 230, 0.2); stroke-dasharray: 2.4 1.2; }
.ult-fill {
    stroke: var(--hud-gold);
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    filter: drop-shadow(0 0 4px rgba(255, 213, 74, 0.8));
    transition: stroke-dashoffset 1.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hero-portrait {
    position: absolute;
    inset: 9px;
    overflow: hidden;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 70%, rgba(255, 213, 74, 0.4), transparent 65%),
        repeating-conic-gradient(from 0deg at 50% 70%, rgba(255, 213, 74, 0.12) 0 8deg, transparent 8deg 16deg),
        #15122e;
}
.hero-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud-ult-label {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: -7px;
    transform: translateX(-50%);
    display: flex;
    align-items: baseline;
    gap: 5px;
    padding: 1px 10px 1px 8px;
    font: italic 800 1em var(--hud-font);
    color: #0d0c1d;
    background: var(--hud-gold);
    clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.hud-ult-label b { font-size: 17px; line-height: 1.1; }
.hud-ult-label span { font-size: 11px; letter-spacing: 0.1em; }
.oura-strip.ult-ready .hud-ult-label { animation: hud-pulse 1.4s ease-in-out infinite; }

/* segmented HP / energy bars */
.hud-bars { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 11px; }
.hud-stat { --c: var(--hud-hp); }
.hud-stat.en { --c: var(--hud-en); }
.hud-bar-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--hud-font);
    font-style: italic;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 15px;
}
.hud-bar-head em { margin-left: 6px; font-size: 11px; font-weight: 700; color: darkgray; letter-spacing: 0.1em; }
.hud-bar-head b { font-size: 21px; color: var(--c); }
.hud-bar-track {
    height: 14px;
    margin-top: 2px;
    background: rgba(255, 255, 255, 0.07);
    clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
    -webkit-mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 11px);
            mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 11px);
}
.hud-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, color-mix(in srgb, var(--c) 55%, #0d0c1d), var(--c));
    box-shadow: 0 0 10px var(--c);
    transition: width 1.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hud-status { font: italic 700 13px var(--hud-font); text-transform: uppercase; letter-spacing: 0.12em; color: darkgray; }
.oura-strip.ult-ready .hud-status { color: var(--hud-gold); }

/* the actual Oura ring, as the featured prop */
.oura-ring-wrap { position: relative; flex: none; width: 92px; height: 92px; perspective: 500px; }
.oura-ring-wrap::before {
    content: "";
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 213, 74, 0.45), transparent 70%);
    filter: blur(10px);
    animation: oura-glow 4s ease-in-out infinite;
}
.oura-ring {
    position: relative;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5));
    animation: oura-float 5s ease-in-out infinite;
    transition: transform 0.2s ease-out;
}

/* ability slots */
.oura-chips { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.oura-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(167, 159, 230, 0.08);
    border-left: 3px solid var(--hud-purple);
    clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    opacity: 0;
    transform: translateY(8px);
    animation: oura-in 0.8s ease forwards;
    transition: background 0.25s, border-color 0.25s;
}
.oura-chip:nth-child(2) { animation-delay: 0.15s; }
.oura-chip:nth-child(3) { animation-delay: 0.3s; }
.oura-chip:hover { background: rgba(255, 213, 74, 0.12); border-left-color: var(--hud-gold); }
.oura-icon { position: relative; flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.oura-icon::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(125, 119, 158, 0.3);
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.oura-icon svg { position: relative; width: 22px; height: 22px; overflow: visible; }
.oura-icon.sleep { --ic: #8f8cff; }
.oura-icon.hr { --ic: #ff5a74; }
.oura-icon.steps { --ic: #3fd68f; }
.oura-icon::before { background: color-mix(in srgb, var(--ic) 24%, transparent); transition: background 0.3s; }
.oura-chip:hover .oura-icon::before { background: color-mix(in srgb, var(--ic) 40%, transparent); }

/* sleep: moon with twinkling stars */
.ic-moon { fill: #a9a6ff; filter: drop-shadow(0 0 3px rgba(143, 140, 255, 0.7)); transform-origin: 12px 12px; animation: ic-rock 5s ease-in-out infinite; }
.ic-star { fill: #ffe9a8; transform-box: fill-box; transform-origin: center; animation: ic-twinkle 2.6s ease-in-out infinite; }
.ic-star.s2 { animation-delay: 1.3s; }

/* heart rate: beating heart with an ECG trace */
.ic-heart { fill: #ff5a74; filter: drop-shadow(0 0 3px rgba(255, 90, 116, 0.7)); transform-box: fill-box; transform-origin: center; animation: ic-beat 1.2s ease-in-out infinite; }
.ic-ecg { fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: ic-ecg 1.2s ease-in-out infinite; }

/* steps: footprints taking turns */
.ic-foot ellipse, .ic-foot circle { fill: #3fd68f; }
.ic-foot { filter: drop-shadow(0 0 2.500px rgba(63, 214, 143, 0.6)); animation: ic-step 1.2s ease-in-out infinite; }
.ic-foot.f2 { animation-delay: 0.6s; }
.oura-body { min-width: 0; }
.oura-main { font: italic 800 20px/1.05 var(--hud-font); letter-spacing: 0.02em; white-space: nowrap; }
.oura-chip .descript-text { font-size: 10.5px; line-height: 1.25; }
.oura-sub { font-size: 10.5px; color: darkgray; max-height: 0; opacity: 0; overflow: hidden; transition: all 0.3s; }
.oura-chip:hover .oura-sub { max-height: 30px; opacity: 0.9; }

@keyframes oura-in { to { opacity: 1; transform: none; } }
@keyframes oura-float { 0%, 100% { translate: 0 0; rotate: -3deg; } 50% { translate: 0 -6px; rotate: 3deg; } }
@keyframes oura-glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes oura-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.3); } 30% { transform: scale(1); } 45% { transform: scale(1.18); } }
@keyframes oura-breathe { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes oura-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes ic-rock { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes ic-twinkle { 0%, 100% { transform: scale(0.5); opacity: 0.35; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes ic-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }
@keyframes ic-ecg { 0% { stroke-dashoffset: 1; opacity: 1; } 55% { stroke-dashoffset: 0; opacity: 1; } 85%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes ic-step { 0%, 100% { opacity: 0.3; transform: translateY(1.5px); } 30%, 55% { opacity: 1; transform: translateY(-1px); } }
@keyframes hud-pulse { 0%, 100% { filter: none; } 50% { filter: drop-shadow(0 0 8px rgba(255, 213, 74, 0.9)); } }

@media (prefers-reduced-motion: reduce) {
    .oura-ring, .oura-ring-wrap::before, .oura-icon svg *, .hud-ult-label { animation: none !important; }
    .oura-chip { animation-duration: 0.01s; }
    .ult-fill, .hud-bar-fill { transition: none; }
}

@media (max-width: 520px) {
    .hud-panel { padding: 10px 12px 14px; }
    .hud-top { flex-wrap: wrap; gap: 4px 10px; }
    .hud-main { flex-wrap: wrap; justify-content: center; }
    .hud-bars { flex: 1 1 100%; order: 3; }
    .oura-ring-wrap { width: 76px; height: 76px; }
    .oura-chips { grid-template-columns: 1fr; }
    .oura-main { font-size: 22px; }
}
