/* =========================================================
   Sauna Icecast Player – Full-width Inline Bar
   Default theme: Nordic Blue (matches saunamaraton.com)
   ========================================================= */

/* --- Reset --- */
.sip-player,
.sip-player *,
.sip-mini-player,
.sip-mini-player * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.sip-hidden {
    display: none !important;
}

.sip-player-anchor {
    width: 100%;
    height: 1px;
}

/* =========================================================
   INLINE BAR
   ========================================================= */
.sip-player {
    width: 100vw;
    max-width: 100vw;
    position: relative;
    left: auto;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    font-family: 'PT Sans Narrow', 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    overflow: hidden;
}

.sip-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    background:
        linear-gradient(135deg, var(--sip-bg), var(--sip-secondary)),
        radial-gradient(circle at 15% 50%, rgba(255,255,255,0.08), transparent 38%);
    color: var(--sip-text);
    padding: 14px 24px;
    border-radius: var(--sip-radius);
    border: 1px solid rgba(255,255,255,0.08);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.sip-player.sip-playing .sip-bar {
    box-shadow: 0 10px 30px rgba(0,0,0,0.25), inset 0 0 40px rgba(255,107,53,0.08);
    border-color: rgba(255,255,255,0.16);
}

/* =========================================================
   FIRE BORDER – animated ember glow
   ========================================================= */
.sip-player.sip-fire-border .sip-bar {
    position: relative;
    border-color: transparent;
}

.sip-player.sip-fire-border .sip-bar::before,
.sip-player.sip-fire-border .sip-bar::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

/* Animated fire gradient border */
.sip-player.sip-fire-border .sip-bar::before {
    background: linear-gradient(
        90deg,
        #ff4500 0%,
        #ff8c00 15%,
        #ffd700 30%,
        #ff6347 45%,
        #ff4500 55%,
        #ff8c00 70%,
        #ffd700 85%,
        #ff4500 100%
    );
    background-size: 300% 100%;
    animation: sipFireBorderFlow 3s linear infinite;
    opacity: 0.85;
}

/* Inner mask to cut out the gradient (shows only at edges) */
.sip-player.sip-fire-border .sip-bar::after {
    inset: 2px;
    background:
        linear-gradient(135deg, var(--sip-bg), var(--sip-secondary));
    z-index: 1;
}

/* Fire glow shadow */
.sip-player.sip-fire-border .sip-bar {
    box-shadow:
        0 0 8px rgba(255,69,0,0.4),
        0 0 20px rgba(255,140,0,0.2),
        0 0 40px rgba(255,69,0,0.1);
    animation: sipFireGlow 2s ease-in-out infinite alternate;
}

.sip-player.sip-fire-border.sip-playing .sip-bar {
    box-shadow:
        0 0 12px rgba(255,69,0,0.6),
        0 0 30px rgba(255,140,0,0.35),
        0 0 60px rgba(255,69,0,0.15),
        inset 0 0 40px rgba(255,107,53,0.08);
    animation: sipFireGlowPlaying 1.5s ease-in-out infinite alternate;
}

@keyframes sipFireBorderFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

@keyframes sipFireGlow {
    0% {
        box-shadow:
            0 0 6px rgba(255,69,0,0.3),
            0 0 16px rgba(255,140,0,0.15),
            0 0 30px rgba(255,69,0,0.08);
    }
    100% {
        box-shadow:
            0 0 10px rgba(255,69,0,0.5),
            0 0 24px rgba(255,140,0,0.25),
            0 0 45px rgba(255,69,0,0.12);
    }
}

@keyframes sipFireGlowPlaying {
    0% {
        box-shadow:
            0 0 10px rgba(255,69,0,0.5),
            0 0 25px rgba(255,140,0,0.3),
            0 0 50px rgba(255,69,0,0.12),
            inset 0 0 40px rgba(255,107,53,0.08);
    }
    100% {
        box-shadow:
            0 0 16px rgba(255,69,0,0.7),
            0 0 35px rgba(255,140,0,0.4),
            0 0 70px rgba(255,69,0,0.18),
            inset 0 0 40px rgba(255,107,53,0.12);
    }
}

/* All bar children must be above the fire border pseudo-elements */
.sip-player.sip-fire-border .sip-bar > * {
    position: relative;
    z-index: 2;
}

/* Builder compatibility (Elementor + Divi) */
.elementor-widget-shortcode .sip-player,
.et_pb_module .sip-player {
    width: 100vw !important;
    max-width: 100vw !important;
    left: auto !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

/* Full section fit for Elementor/Divi containers */
.sip-player.sip-fill-section {
    display: flex;
    align-items: stretch;
    min-height: var(--sip-section-h, 240px);
    background:
        linear-gradient(135deg, var(--sip-bg), var(--sip-secondary)),
        radial-gradient(circle at 15% 50%, rgba(255,255,255,0.08), transparent 38%);
}

.sip-player.sip-fill-section .sip-bar {
    width: 100%;
    min-height: var(--sip-section-h, 240px);
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding-top: clamp(18px, 3.2vh, 36px);
    padding-bottom: clamp(18px, 3.2vh, 36px);
}

/* Size presets (set in admin) */
.sip-player.sip-size-compact .sip-bar {
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 12px;
}

.sip-player.sip-size-compact .sip-play-btn {
    width: 40px;
    height: 40px;
}

.sip-player.sip-size-compact .sip-title {
    font-size: 16px;
}

.sip-player.sip-size-compact .sip-status-text {
    font-size: 12px;
}

.sip-player.sip-size-compact .sip-thermo-track {
    width: 96px;
}

.sip-player.sip-size-large .sip-bar {
    padding-top: 18px;
    padding-bottom: 18px;
    gap: 20px;
}

.sip-player.sip-size-large .sip-play-btn {
    width: 56px;
    height: 56px;
}

.sip-player.sip-size-large .sip-title {
    font-size: 24px;
}

.sip-player.sip-size-large .sip-status-text {
    font-size: 16px;
}

.sip-player.sip-size-large .sip-thermo-track {
    width: 132px;
}

/* =========================================================
   KIUAS (sauna heater) – water & steam animation
   ========================================================= */
.sip-kiuas {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 45px;
    color: var(--sip-text);
    transition: opacity 0.3s;
}

.sip-kiuas-svg {
    display: block;
    overflow: visible;
}

/* --- Stones subtle pulse when playing --- */
.sip-player.sip-playing .sip-stone {
    animation: sipStonePulse 4s ease-in-out infinite;
}

.sip-player.sip-playing .sip-stone:nth-child(2) { animation-delay: 0.3s; }
.sip-player.sip-playing .sip-stone:nth-child(3) { animation-delay: 0.6s; }
.sip-player.sip-playing .sip-stone:nth-child(4) { animation-delay: 0.9s; }
.sip-player.sip-playing .sip-stone:nth-child(5) { animation-delay: 1.2s; }
.sip-player.sip-playing .sip-stone:nth-child(6) { animation-delay: 1.5s; }

@keyframes sipStonePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

/* --- Hot glow between stones --- */
.sip-stone-glow {
    opacity: 0;
    transition: opacity 0.6s;
}

.sip-player.sip-playing .sip-stone-glow {
    opacity: 1;
    animation: sipGlowPulse 3s ease-in-out infinite;
}

@keyframes sipGlowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* --- Ladle animation (tips to pour when playing) --- */
.sip-ladle {
    transform-origin: 24px 23px;
    transition: transform 0.6s ease;
}

.sip-player.sip-playing .sip-ladle {
    animation: sipLadlePour 3s ease-in-out infinite;
}

@keyframes sipLadlePour {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-20deg); }
    30% { transform: rotate(-25deg); }
    50% { transform: rotate(-20deg); }
    70% { transform: rotate(0deg); }
}

/* --- Water drops falling onto stones --- */
.sip-drop {
    opacity: 0;
}

.sip-player.sip-playing .sip-drop-1 {
    animation: sipDropFall 3s ease-in 0.3s infinite;
}
.sip-player.sip-playing .sip-drop-2 {
    animation: sipDropFall 3s ease-in 0.5s infinite;
}
.sip-player.sip-playing .sip-drop-3 {
    animation: sipDropFall 3s ease-in 0.7s infinite;
}

@keyframes sipDropFall {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }
    15% {
        opacity: 0.9;
        transform: translateY(0);
    }
    25% {
        opacity: 0.9;
        transform: translateY(6px);
    }
    35% {
        opacity: 0;
        transform: translateY(10px) scale(1.5);
    }
    100% {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* --- Steam rising from stones (SVG circles) --- */
.sip-steam {
    opacity: 0;
}

.sip-player.sip-playing .sip-steam-1 {
    animation: sipSteamRise 2.5s ease-out 0.6s infinite;
}
.sip-player.sip-playing .sip-steam-2 {
    animation: sipSteamRise 2.8s ease-out 0.9s infinite;
}
.sip-player.sip-playing .sip-steam-3 {
    animation: sipSteamRise 2.5s ease-out 1.2s infinite;
}
.sip-player.sip-playing .sip-steam-4 {
    animation: sipSteamRise 3s ease-out 1.0s infinite;
}
.sip-player.sip-playing .sip-steam-5 {
    animation: sipSteamRise 2.8s ease-out 1.4s infinite;
}

@keyframes sipSteamRise {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.4);
    }
    20% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: translateY(-22px) scale(1.8);
    }
}

/* --- JS-generated steam particles --- */
.sip-particles {
    position: absolute;
    top: -8px;
    left: 10px;
    width: 36px;
    height: 20px;
    pointer-events: none;
}

.sip-steam-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: var(--sip-text);
    border-radius: 50%;
    opacity: 0;
    animation: sipParticleRise 2.2s ease-out forwards;
    pointer-events: none;
}

@keyframes sipParticleRise {
    0% {
        opacity: 0.45;
        transform: translateY(0) scale(0.4);
    }
    100% {
        opacity: 0;
        transform: translateY(-28px) translateX(var(--sip-drift, 4px)) scale(1.6);
    }
}

/* =========================================================
   PLAY BUTTON
   ========================================================= */
.sip-play-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--sip-accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.35);
    position: relative;
}

.sip-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(255, 107, 53, 0.5);
}

.sip-play-btn:active {
    transform: scale(0.95);
}

.sip-play-btn:focus-visible {
    outline: 2px solid var(--sip-text);
    outline-offset: 2px;
}

/* =========================================================
   STATION INFO
   ========================================================= */
.sip-info {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sip-title {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.sip-status-text {
    font-size: 14px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================================
   HEADLINE TEXT (center call-to-action)
   ========================================================= */
.sip-headline {
    flex: 0 1 auto;
    font-weight: 700;
    font-size: clamp(20px, 3vw, 32px);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--sip-text);
    background: linear-gradient(
        135deg,
        #ffd700 0%,
        #ff8c00 35%,
        #fff 50%,
        #ff8c00 65%,
        #ffd700 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: sipHeadlineShimmer 4s ease-in-out infinite;
    text-shadow: none;
    position: relative;
    z-index: 2;
    padding: 0 8px;
}

/* Fallback glow for browsers that don't support background-clip: text */
@supports not (background-clip: text) {
    .sip-headline {
        background: none;
        -webkit-text-fill-color: unset;
        color: #ffd700;
        text-shadow: 0 0 10px rgba(255,140,0,0.6), 0 0 20px rgba(255,69,0,0.3);
    }
}

@keyframes sipHeadlineShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 200% 50%; }
}

/* Size variants */
.sip-player.sip-size-compact .sip-headline {
    font-size: clamp(14px, 2.2vw, 20px);
    letter-spacing: 0.04em;
}

.sip-player.sip-size-large .sip-headline {
    font-size: clamp(24px, 3.5vw, 40px);
    letter-spacing: 0.08em;
}

/* Headline content column (headline + frequency stacked) */
.sip-headline-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

/* =========================================================
   STEAMING FREQUENCY TEXT (107.5 MHz)
   ========================================================= */
.sip-freq {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    font-weight: 700;
    font-size: clamp(16px, 2.2vw, 24px);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sip-text);
    padding: 0 8px;
    z-index: 2;
    line-height: 1.2;
}

/* Individual characters – each wavers with staggered delay */
.sip-freq-char {
    display: inline-block;
    opacity: 0.85;
    text-shadow:
        0 0 6px rgba(255,255,255,0.6),
        0 0 12px rgba(255,200,150,0.4),
        0 0 20px rgba(255,140,0,0.2);
    animation: sipSteamChar 3s ease-in-out infinite;
    animation-delay: var(--sip-steam-d, 0s);
}

.sip-freq-space {
    width: 0.3em;
}

@keyframes sipSteamChar {
    0%, 100% {
        opacity: 0.75;
        transform: translateY(0);
        filter: blur(0px);
        text-shadow:
            0 0 6px rgba(255,255,255,0.5),
            0 0 12px rgba(255,200,150,0.3),
            0 0 20px rgba(255,140,0,0.15);
    }
    30% {
        opacity: 0.95;
        transform: translateY(-1px);
        filter: blur(0.3px);
        text-shadow:
            0 0 8px rgba(255,255,255,0.7),
            0 0 16px rgba(255,200,150,0.5),
            0 0 28px rgba(255,140,0,0.25);
    }
    60% {
        opacity: 0.7;
        transform: translateY(1px);
        filter: blur(0.5px);
        text-shadow:
            0 0 4px rgba(255,255,255,0.4),
            0 0 10px rgba(255,200,150,0.25),
            0 0 18px rgba(255,140,0,0.1);
    }
}

/* Steam wisps rising from the frequency text */
.sip-freq-steam {
    position: absolute;
    top: -4px;
    left: 8px;
    right: 8px;
    height: 24px;
    pointer-events: none;
}

.sip-freq-wisp {
    position: absolute;
    bottom: 0;
    width: 6px;
    height: 6px;
    background: var(--sip-text);
    border-radius: 50%;
    opacity: 0;
}

.sip-freq-wisp-1 { left: 8%;  animation: sipFreqWisp 2.8s ease-out 0s infinite; }
.sip-freq-wisp-2 { left: 28%; width: 5px; height: 5px; animation: sipFreqWisp 3.2s ease-out 0.6s infinite; }
.sip-freq-wisp-3 { left: 50%; animation: sipFreqWisp 2.6s ease-out 1.2s infinite; }
.sip-freq-wisp-4 { left: 70%; width: 4px; height: 4px; animation: sipFreqWisp 3s ease-out 0.3s infinite; }
.sip-freq-wisp-5 { left: 88%; width: 5px; height: 5px; animation: sipFreqWisp 2.9s ease-out 0.9s infinite; }

@keyframes sipFreqWisp {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.4);
        filter: blur(0px);
    }
    15% {
        opacity: 0.4;
        transform: translateY(-4px) scale(0.6);
        filter: blur(0.5px);
    }
    50% {
        opacity: 0.25;
        transform: translateY(-14px) translateX(3px) scale(1);
        filter: blur(1px);
    }
    100% {
        opacity: 0;
        transform: translateY(-26px) translateX(6px) scale(1.4);
        filter: blur(2px);
    }
}

/* Size variants */
.sip-player.sip-size-compact .sip-freq {
    font-size: clamp(12px, 1.8vw, 16px);
    letter-spacing: 0.08em;
}

.sip-player.sip-size-large .sip-freq {
    font-size: clamp(20px, 2.8vw, 30px);
    letter-spacing: 0.14em;
}

/* =========================================================
   LÖYLY MAN – throws steam at the headline
   ========================================================= */
.sip-headline-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 1 auto;
    position: relative;
    z-index: 2;
}

.sip-loyly-man {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 54px;
}

.sip-loyly-svg {
    display: block;
    overflow: visible;
}

/* Arm throwing animation */
.sip-loyly-arm {
    transform-origin: 26px 22px;
    animation: sipLoylyThrow 3.5s ease-in-out infinite;
}

@keyframes sipLoylyThrow {
    0%, 10%  { transform: rotate(0deg); }
    20%      { transform: rotate(15deg); }
    30%      { transform: rotate(-30deg); }
    45%      { transform: rotate(-25deg); }
    65%      { transform: rotate(0deg); }
    100%     { transform: rotate(0deg); }
}

/* Water drops flying toward headline */
.sip-loyly-drops {
    position: absolute;
    top: 0;
    left: 36px;
    width: 60px;
    height: 30px;
    pointer-events: none;
}

.sip-loyly-drop {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #7CB9E8;
    border-radius: 50%;
    opacity: 0;
    top: 6px;
    left: 0;
}

.sip-loyly-drop-1 { animation: sipDropArc1 3.5s ease-out infinite; }
.sip-loyly-drop-2 { animation: sipDropArc2 3.5s ease-out 0.08s infinite; width: 3px; height: 3px; }
.sip-loyly-drop-3 { animation: sipDropArc3 3.5s ease-out 0.15s infinite; }

@keyframes sipDropArc1 {
    0%, 25% { opacity: 0; transform: translate(0, 0); }
    30%     { opacity: 0.9; transform: translate(8px, -6px); }
    40%     { opacity: 0.8; transform: translate(28px, -12px); }
    50%     { opacity: 0.5; transform: translate(50px, -4px); }
    55%     { opacity: 0; transform: translate(60px, 4px); }
    100%    { opacity: 0; }
}

@keyframes sipDropArc2 {
    0%, 25% { opacity: 0; transform: translate(0, 0); }
    30%     { opacity: 0.85; transform: translate(6px, -10px); }
    40%     { opacity: 0.75; transform: translate(24px, -16px); }
    50%     { opacity: 0.4; transform: translate(46px, -8px); }
    55%     { opacity: 0; transform: translate(58px, 2px); }
    100%    { opacity: 0; }
}

@keyframes sipDropArc3 {
    0%, 25% { opacity: 0; transform: translate(0, 0); }
    31%     { opacity: 0.9; transform: translate(10px, -4px); }
    41%     { opacity: 0.7; transform: translate(32px, -8px); }
    51%     { opacity: 0.35; transform: translate(54px, 0px); }
    56%     { opacity: 0; transform: translate(62px, 8px); }
    100%    { opacity: 0; }
}

/* Steam puffs near headline */
.sip-loyly-steam {
    position: absolute;
    top: -10px;
    right: -50px;
    width: 40px;
    height: 30px;
    pointer-events: none;
}

.sip-loyly-puff {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--sip-text);
    border-radius: 50%;
    opacity: 0;
    bottom: 0;
}

.sip-loyly-puff-1 { left: 6px;  animation: sipPuffRise 3.5s ease-out 0.1s infinite; }
.sip-loyly-puff-2 { left: 18px; width: 10px; height: 10px; animation: sipPuffRise 3.5s ease-out 0.2s infinite; }
.sip-loyly-puff-3 { left: 30px; width: 7px;  height: 7px;  animation: sipPuffRise 3.5s ease-out 0.35s infinite; }

@keyframes sipPuffRise {
    0%, 48% { opacity: 0; transform: translateY(0) scale(0.3); }
    55%     { opacity: 0.45; transform: translateY(-4px) scale(0.6); }
    70%     { opacity: 0.3; transform: translateY(-16px) scale(1.2); }
    85%     { opacity: 0; transform: translateY(-28px) scale(1.6); }
    100%    { opacity: 0; }
}

/* Gentle body sway */
.sip-loyly-svg {
    animation: sipLoylyBodySway 3.5s ease-in-out infinite;
    transform-origin: 20px 60px;
}

@keyframes sipLoylyBodySway {
    0%, 10%  { transform: rotate(0deg); }
    20%      { transform: rotate(2deg); }
    30%      { transform: rotate(-3deg); }
    50%      { transform: rotate(-1deg); }
    70%, 100% { transform: rotate(0deg); }
}

/* Löyly man size variants */
.sip-player.sip-size-compact .sip-loyly-man { width: 36px; height: 40px; }
.sip-player.sip-size-compact .sip-loyly-svg { width: 36px; height: 40px; }
.sip-player.sip-size-large .sip-loyly-man   { width: 56px; height: 63px; }
.sip-player.sip-size-large .sip-loyly-svg   { width: 56px; height: 63px; }

/* =========================================================
   RUNNING SAUNA HOUSE – runs across player periodically
   ========================================================= */
.sip-run-mascot {
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 50px;
    height: 60px;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    animation: sipRunAcross 25s linear infinite;
    animation-delay: 8s;
}

.sip-run-mascot .sip-run-svg {
    display: block;
    width: 50px;
    height: 60px;
    overflow: visible;
    animation: sipRunBounce 0.35s ease-in-out infinite alternate;
}

@keyframes sipRunBounce {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-3px); }
}

/* The mascot runs from offscreen-left to offscreen-right */
@keyframes sipRunAcross {
    0%   { transform: translateX(-80px); opacity: 0; }
    2%   { transform: translateX(-80px); opacity: 0.85; }
    18%  { transform: translateX(100vw); opacity: 0.85; }
    20%  { transform: translateX(calc(100vw + 20px)); opacity: 0; }
    100% { transform: translateX(calc(100vw + 20px)); opacity: 0; }
}

/* Running legs */
.sip-run-leg-back {
    transform-origin: 38px 82px;
    animation: sipLegBack 0.35s ease-in-out infinite alternate;
}

.sip-run-leg-front {
    transform-origin: 62px 82px;
    animation: sipLegFront 0.35s ease-in-out infinite alternate;
}

@keyframes sipLegBack {
    0%   { transform: rotate(-12deg); }
    100% { transform: rotate(22deg); }
}

@keyframes sipLegFront {
    0%   { transform: rotate(12deg); }
    100% { transform: rotate(-22deg); }
}

/* Chimney smoke trail */
.sip-run-smoke {
    stroke-dasharray: 8 6;
    animation: sipSmokeFlow 1s linear infinite;
}

@keyframes sipSmokeFlow {
    0%   { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -28; }
}

/* Size variants */
.sip-player.sip-size-compact .sip-run-mascot { width: 38px; height: 46px; bottom: 2px; }
.sip-player.sip-size-compact .sip-run-svg    { width: 38px; height: 46px; }
.sip-player.sip-size-large .sip-run-mascot   { width: 60px; height: 72px; bottom: 6px; }
.sip-player.sip-size-large .sip-run-svg      { width: 60px; height: 72px; }

/* =========================================================
   LIVE INDICATOR
   ========================================================= */
.sip-live-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sip-text);
    flex-shrink: 0;
}

.sip-dot-pulse {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    display: inline-block;
    animation: sipPulse 1.5s ease-in-out infinite;
}

@keyframes sipPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* =========================================================
   TEMPERATURE GAUGE VOLUME
   ========================================================= */
.sip-thermo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sip-mute-btn {
    background: none;
    border: none;
    color: var(--sip-text);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    opacity: 0.85;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.sip-mute-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Horizontal thermometer track */
.sip-thermo-track {
    position: relative;
    width: 120px;
    height: 22px;
    display: flex;
    align-items: center;
}

/* The visual bar underneath the range slider */
.sip-thermo-bar {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
    overflow: hidden;
    pointer-events: none;
}

.sip-thermo-level {
    height: 100%;
    width: var(--sip-vol-pct, 80%);
    border-radius: 4px;
    background: linear-gradient(to right,
        #5B9BD5 0%,
        var(--sip-accent) 50%,
        #E8432A 100%
    );
    transition: width 0.15s ease;
    position: relative;
}

/* Glow effect at the hot end */
.sip-thermo-level::after {
    content: '';
    position: absolute;
    right: -2px;
    top: -2px;
    bottom: -2px;
    width: 8px;
    background: radial-gradient(circle, var(--sip-accent) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0.6;
}

/* The actual range input (transparent, sits on top) */
.sip-thermo-track .sip-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    z-index: 2;
    width: 100%;
    height: 20px;
    background: transparent;
    outline: none;
    cursor: pointer;
}

.sip-thermo-track .sip-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.sip-thermo-track .sip-volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* =========================================================
   BRANDING
   ========================================================= */
.sip-branding {
    flex-shrink: 0;
    font-size: 10px;
    color: var(--sip-text);
    text-decoration: none;
    opacity: 0.4;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.sip-branding:hover {
    opacity: 0.75;
}

.sip-branding-subtle {
    opacity: 0.25;
}

/* =========================================================
   ERROR STATE
   ========================================================= */
.sip-player.sip-error .sip-play-btn {
    background: #999;
    box-shadow: none;
}

.sip-player.sip-error .sip-status-text {
    color: #ff6b6b;
    opacity: 1;
}

/* =========================================================
   MINIMIZED PLAYER (fixed position)
   ========================================================= */
.sip-mini-player {
    position: fixed;
    z-index: 2147483000;
    font-family: 'PT Sans Narrow', 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, var(--sip-bg), var(--sip-secondary));
    color: var(--sip-text);
    border-radius: 24px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    transition: transform 0.3s, box-shadow 0.3s;
}

.sip-mini-player:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0,0,0,0.3);
}

.sip-pos-bottom-left {
    bottom: var(--sip-mini-bottom, 16px);
    left: 16px;
}

.sip-pos-bottom-center {
    bottom: var(--sip-mini-bottom, 16px);
    left: 50%;
    transform: translateX(-50%);
}

.sip-pos-bottom-center:hover {
    transform: translateX(-50%) translateY(-2px);
}

.sip-pos-bottom-right {
    bottom: var(--sip-mini-bottom, 16px);
    right: 16px;
}

.sip-mini-kiuas {
    flex-shrink: 0;
    display: flex;
    opacity: 0.8;
}

.sip-mini-kiuas-svg {
    overflow: visible;
}

.sip-mini-player.sip-playing .sip-mini-kiuas svg {
    animation: sipMiniKiuasPulse 2.2s ease-in-out infinite;
    transform-origin: 50% 85%;
}

.sip-mini-player.sip-playing .sip-mini-stone {
    animation: sipMiniStonePulse 3.5s ease-in-out infinite;
}

.sip-mini-player.sip-playing .sip-mini-stone:nth-of-type(2) { animation-delay: 0.2s; }
.sip-mini-player.sip-playing .sip-mini-stone:nth-of-type(3) { animation-delay: 0.45s; }
.sip-mini-player.sip-playing .sip-mini-stone:nth-of-type(4) { animation-delay: 0.65s; }

.sip-mini-player.sip-playing .sip-mini-stone-glow {
    opacity: 1;
    animation: sipMiniGlowPulse 2.2s ease-in-out infinite;
}

.sip-mini-ladle {
    transform-origin: 22px 22px;
}

.sip-mini-player.sip-playing .sip-mini-ladle {
    animation: sipMiniLadlePour 2.8s ease-in-out infinite;
}

.sip-mini-player.sip-playing .sip-mini-drop-1 {
    animation: sipMiniDropFall 2.6s ease-in 0.25s infinite;
}

.sip-mini-player.sip-playing .sip-mini-drop-2 {
    animation: sipMiniDropFall 2.6s ease-in 0.45s infinite;
}

.sip-mini-player.sip-playing .sip-mini-drop-3 {
    animation: sipMiniDropFall 2.6s ease-in 0.65s infinite;
}

.sip-mini-player.sip-playing .sip-mini-steam-1 {
    animation: sipMiniSteamRise 2s ease-out 0.2s infinite;
}

.sip-mini-player.sip-playing .sip-mini-steam-2 {
    animation: sipMiniSteamRise 2.2s ease-out 0.4s infinite;
}

.sip-mini-player.sip-playing .sip-mini-steam-3 {
    animation: sipMiniSteamRise 2s ease-out 0.6s infinite;
}

.sip-mini-player.sip-playing .sip-mini-steam-4 {
    animation: sipMiniSteamRise 2.4s ease-out 0.5s infinite;
}

.sip-mini-player.sip-playing .sip-mini-play-btn {
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.5);
    animation: sipMiniPlayPulse 1.8s ease-out infinite;
}

@keyframes sipMiniKiuasPulse {
    0%, 100% { transform: scale(1); opacity: 0.75; }
    50% { transform: scale(1.08); opacity: 1; }
}

@keyframes sipMiniStonePulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.6; }
}

@keyframes sipMiniGlowPulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.95; }
}

@keyframes sipMiniLadlePour {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-18deg); }
    40% { transform: rotate(-22deg); }
    70% { transform: rotate(0deg); }
}

@keyframes sipMiniDropFall {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }
    16% {
        opacity: 0.85;
        transform: translateY(0);
    }
    28% {
        opacity: 0.85;
        transform: translateY(5px);
    }
    40% {
        opacity: 0;
        transform: translateY(8px) scale(1.35);
    }
    100% {
        opacity: 0;
        transform: translateY(8px);
    }
}

@keyframes sipMiniSteamRise {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.45);
    }
    20% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: translateY(-14px) scale(1.5);
    }
}

@keyframes sipMiniPlayPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.45); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0); }
}

.sip-mini-play-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--sip-accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.sip-mini-play-btn:hover {
    transform: scale(1.1);
}

.sip-mini-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.sip-mini-live {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.sip-mini-volume {
    -webkit-appearance: none;
    appearance: none;
    width: 60px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(
        to right,
        var(--sip-accent) 0%,
        var(--sip-accent) var(--sip-vol-pct, 80%),
        rgba(255,255,255,0.2) var(--sip-vol-pct, 80%)
    );
    outline: none;
    cursor: pointer;
}

.sip-mini-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.sip-mini-volume::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
}

.sip-expand-btn {
    background: none;
    border: none;
    color: var(--sip-text);
    cursor: pointer;
    opacity: 0.7;
    padding: 4px;
    display: flex;
    transition: opacity 0.2s;
}

.sip-expand-btn:hover {
    opacity: 1;
}

/* =========================================================
   FLOATING EMBERS – sauna fire sparks
   ========================================================= */
.sip-embers {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.sip-ember {
    position: absolute;
    bottom: -6px;
    left: var(--e-x, 50%);
    width: var(--e-size, 3px);
    height: var(--e-size, 3px);
    border-radius: 50%;
    opacity: 0;
    background: radial-gradient(circle,
        #ffd700 0%,
        #ff8c00 40%,
        #ff4500 80%,
        transparent 100%
    );
    box-shadow:
        0 0 calc(var(--e-size, 3px) * 1.5) rgba(255,140,0, var(--e-bright, 0.8)),
        0 0 calc(var(--e-size, 3px) * 3) rgba(255,69,0, calc(var(--e-bright, 0.8) * 0.4));
    animation:
        sipEmberRise var(--e-dur, 5s) ease-out var(--e-delay, 0s) infinite,
        sipEmberFlicker 0.15s ease-in-out infinite alternate;
}

/* Main rise: bottom to top with horizontal drift */
@keyframes sipEmberRise {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(1);
    }
    5% {
        opacity: 1;
    }
    30% {
        opacity: 0.9;
        transform: translateY(-30px) translateX(calc(var(--e-drift, 10px) * 0.4)) scale(0.9);
    }
    60% {
        opacity: 0.5;
        transform: translateY(-65px) translateX(calc(var(--e-drift, 10px) * 0.8)) scale(0.65);
    }
    100% {
        opacity: 0;
        transform: translateY(-110px) translateX(calc(var(--e-drift, 10px) * 1.2)) scale(0.2);
    }
}

/* Rapid twinkle/flicker */
@keyframes sipEmberFlicker {
    0%   { filter: brightness(1); }
    100% { filter: brightness(0.5); }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
/* --- Tablet (< 900px) --- */
@media (max-width: 900px) {
    .sip-title {
        font-size: 17px;
    }

    .sip-status-text {
        font-size: 13px;
    }

    .sip-headline {
        font-size: clamp(16px, 2.5vw, 24px);
    }

    .sip-freq {
        font-size: clamp(13px, 1.8vw, 18px);
    }

    .sip-thermo-track {
        width: 92px;
    }
}

/* --- Phone (< 680px) --- */
@media (max-width: 680px) {
    .sip-bar {
        gap: 0;
        padding: 0;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
    }

    /* === Row 1: Headline hero block (full width, centered) === */
    .sip-headline-wrap {
        flex: 1 1 100%;
        order: 1;
        justify-content: center;
        padding: 14px 12px 8px;
        gap: 8px;
    }

    .sip-headline-content {
        align-items: center;
    }

    .sip-headline {
        font-size: clamp(17px, 5vw, 24px);
        letter-spacing: 0.04em;
        white-space: nowrap;
        text-align: center;
        padding: 0 4px;
    }

    .sip-freq {
        font-size: clamp(13px, 3.5vw, 18px);
        letter-spacing: 0.08em;
        padding: 0 4px;
    }

    .sip-loyly-man {
        width: 36px;
        height: 40px;
    }

    .sip-loyly-svg {
        width: 36px;
        height: 40px;
    }

    /* Scale down loyly drops & steam to match smaller man */
    .sip-loyly-drops {
        left: 28px;
        width: 44px;
    }

    .sip-loyly-steam {
        right: -34px;
    }

    /* === Row 2: Controls row (kiuas + play + info + live) === */
    .sip-kiuas {
        order: 2;
        width: 32px;
        height: 26px;
        margin-left: 12px;
    }

    .sip-kiuas-svg {
        width: 32px;
        height: 26px;
    }

    .sip-play-btn {
        order: 3;
        width: 42px;
        height: 42px;
        margin-left: 8px;
    }

    .sip-info {
        order: 4;
        min-width: 0;
        flex: 1 1 80px;
        margin-left: 8px;
    }

    .sip-title {
        font-size: 14px;
        white-space: nowrap;
        line-height: 1.2;
    }

    .sip-status-text {
        font-size: 11px;
        white-space: nowrap;
        line-height: 1.2;
    }

    .sip-live-dot {
        order: 5;
        margin-left: auto;
        margin-right: 12px;
        font-size: 10px;
    }

    /* === Row 3: Volume (full width) === */
    .sip-thermo {
        order: 10;
        width: 100%;
        justify-content: center;
        padding: 6px 12px 10px;
        gap: 8px;
    }

    .sip-thermo-track {
        width: min(60vw, 220px);
    }

    .sip-branding {
        display: none;
    }

    /* Running mascot */
    .sip-run-mascot {
        width: 30px;
        height: 36px;
        bottom: 2px;
    }

    .sip-run-mascot .sip-run-svg {
        width: 30px;
        height: 36px;
    }

    /* Mini player */
    .sip-mini-title {
        max-width: 100px;
    }

    .sip-mini-volume {
        width: 40px;
    }
}

/* --- Small phone (< 420px) --- */
@media (max-width: 420px) {
    .sip-headline {
        font-size: clamp(15px, 4.5vw, 20px);
    }

    .sip-freq {
        font-size: clamp(12px, 3vw, 15px);
    }

    /* Hide kiuas on very small screens - play button is enough */
    .sip-kiuas {
        display: none;
    }

    .sip-live-dot {
        display: none;
    }

    .sip-play-btn {
        margin-left: 12px;
    }

    .sip-thermo-track {
        width: min(55vw, 180px);
    }

    /* Smaller löyly man but keep him visible */
    .sip-loyly-man {
        width: 28px;
        height: 32px;
    }

    .sip-loyly-svg {
        width: 28px;
        height: 32px;
    }

    .sip-loyly-drops {
        left: 22px;
        width: 36px;
    }

    .sip-loyly-steam {
        right: -28px;
    }

    .sip-loyly-drop {
        width: 3px;
        height: 3px;
    }
}

/* Touch-friendly */
@media (hover: none) {
    .sip-play-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .sip-mini-play-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .sip-mute-btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    .sip-steam,
    .sip-steam-particle,
    .sip-drop,
    .sip-ladle,
    .sip-stone,
    .sip-stone-glow,
    .sip-dot-pulse,
    .sip-mini-kiuas svg,
    .sip-mini-stone,
    .sip-mini-stone-glow,
    .sip-mini-ladle,
    .sip-mini-drop,
    .sip-mini-steam,
    .sip-mini-play-btn,
    .sip-thermo-level,
    .sip-headline,
    .sip-freq-char,
    .sip-freq-wisp,
    .sip-loyly-arm,
    .sip-loyly-svg,
    .sip-loyly-drop,
    .sip-loyly-puff,
    .sip-ember,
    .sip-run-mascot,
    .sip-run-svg,
    .sip-run-leg-back,
    .sip-run-leg-front,
    .sip-run-smoke,
    .sip-player.sip-fire-border .sip-bar,
    .sip-player.sip-fire-border .sip-bar::before {
        animation: none !important;
        transition: none !important;
    }

    .sip-player.sip-playing .sip-stone-glow {
        opacity: 0.6;
    }

    .sip-player.sip-playing .sip-steam {
        opacity: 0.3;
    }

    .sip-player.sip-fire-border .sip-bar::before {
        background-position: 0% 50%;
    }

    .sip-headline {
        background-position: 0% 50%;
    }
}
