@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,700&display=swap');

@font-face {
    font-family: 'Orbitron';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/orbitron/v34/yMJRMIlzdpvBhQQL_Qq7dy0.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== CSS VARIABLEN ===== */
:root {
    --color-primary: #1f1f23;
    --color-light: #fff;
    --font-family: 'Tahoma', 'Arial', sans-serif;
    /* Angepasster Farbverlauf in Orangetönen */
    --gradient: linear-gradient(
        90deg,
        #FFDAB9 0%, /* Hellstes Orange (Pfirsichfarben) */
        #FFB74D 25%, /* Mittleres, wärmeres Orange */
        #ff8000 50%, /* Deine Hauptfarbe */
        #E66C00 75%, /* Etwas dunkleres Orange */
        #CC5500 100% /* Dunkleres, rötlicheres Orange */
    );
    /* Gesamtdauer eines kompletten Animationszyklus: 20 Minuten = 1200 Sekunden */
    --animation-duration: 1200s;
}

/* ===== KEYFRAME ANIMATIONEN ===== */
@keyframes bounce {
    0% {
        transform: translateY(calc(100vh - 100px));
    }
    50% {
        transform: translateY(calc(100vh - 180px));
    }
    70% {
        transform: translateY(calc(100vh - 120px));
    }
    100% {
        transform: translateY(calc(100vh - 100px));
    }
}

@keyframes scroll-left {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(-100%);
    }
}

@keyframes fade-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fade-out {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
    }
    80% {
        transform: translateY(calc(100vh - 100px)) rotate(15deg);
    }
    90% {
        transform: translateY(calc(100vh - 120px)) rotate(-15deg);
    }
    100% {
        transform: translateY(calc(100vh - 100px)) rotate(0deg);
    }
}

@keyframes scrollText {
    from {
        transform: translateX(15%);
    }
    to {
        transform: translateX(-100%);
    }
}

/* NewsBox Einfliegen */
@keyframes newsBoxIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* NewsBox Ausfliegen */
@keyframes newsBoxOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* NEUE GOAL-WIDGET ANIMATION */
@keyframes opacity-toggle {
    0% {
        opacity: 0;
    }
    0.083% {
        opacity: 1;
    }
    25% {
        opacity: 1;
    }
    25.083% {
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

/* ===== BODY & GRUNDLEGENDES STYLING ===== */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
    margin: 0;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 100%;
    position: relative;
    max-width: 100%;
    background-color: var(--color-primary);
    color: var(--color-light);
}

img,
video,
audio {
    pointer-events: none;
    z-index: 6;
}

video {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

p {
    height: fit-content;
}

/* ===== NEWS BOX ===== */
.newsBox {
    background-color: red;
    z-index: 1;
    bottom: 18px;
    position: absolute;
    height: 45px;
    opacity: 0;
}

.newsText {
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 2.5em;
    margin-top: 0;
    white-space: nowrap;
    animation-delay: 0s;
    overflow: hidden;
    width: fit-content;
    animation: scrollText 90s linear infinite;
}

.newsBoxIn {
    animation: fade-in 7s ease-out 2s forwards;
}

.newsBoxOut {
    animation: fade-out 5s ease-in forwards;
}

/* ===== TRACK INFO WIDGET ===== */
.topRow {
    grid-area: 1 / 2 / 2 / 3;
    font-family: 'DM Sans', Arial, sans-serif;
    font-size: 0.8em;
    overflow: hidden;
    white-space: nowrap;
    color: white;
    width: 200px;
    margin-top: 3px;
    z-index: 4;
}

.bottomRowText {
    margin-top: 0px;
    width: 200px;
}

.scrolling {
    white-space: nowrap;
    display: inline-block;
    animation: scrollText 20s linear infinite;
}

.bottomRow {
    grid-area: 2 / 2 / 3 / 3;
    overflow: hidden;
    white-space: nowrap;
    color: darkgray;
    font-family: 'DM Sans', Arial, sans-serif;
    font-size: 0.7em;
    font-weight: bold;
    width: fit-content;
    align-self: end;
    padding-bottom: 6px;
    z-index: 3;
}

.track-info {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 310px;
    height: 70px;
    background-color: black;
    border-radius: 15px;
    display: grid;
    grid-template-columns: 70px 1fr;
    grid-template-rows: repeat(2, 1fr);
    grid-column-gap: 0px;
    grid-row-gap: 0px;
    overflow: hidden;
    z-index: 2;
}

.trackCover {
    grid-area: 1 / 1 / 3 / 2;
    width: 60px;
    height: 60px;
    margin: 5px;
    border-radius: 10px;
    background-image: url('/../spotify/info/current_image.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 6;
}

/* ===== FALLING EMOJI ===== */
.falling-emoji {
    animation: fall var(--fall-duration, 8s) ease-in forwards,
        bounce 4s ease-out var(--fall-duration, 8s);
}

/* ===== TEXT SCROLLING ===== */
#topRow p,
#bottomRow p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#topRow p.scrolling,
#bottomRow p.scrolling {
    animation: scroll-left 10s linear infinite;
}

/* ===== OVERLAY ===== */
.overlay {
    width: 150em;
    height: 57em;
    z-index: 10;
    margin: auto;
}

/* ===== CHAT WINDOW ===== */
.chat-window {
    width: 400px;
    background: #ece9d8;
    border: 1px solid #0054e3;
    box-shadow:
        0 0 0 1px #316AC5,
        0 0 0 2px #5D9CEC,
        2px 2px 5px rgba(0, 0, 0, 0.4);
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    position: absolute;
    animation: slideIn 0.5s ease-out;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.chat-window.hidden {
    opacity: 0;
    transform: translateY(20px);
}

.title-bar {
    height: 20px;
    background: linear-gradient(90deg, #104a8b 0%, #1E90FF 100%);
    border-bottom: 1px solid #316AC5;
    display: flex;
    align-items: center;
    padding: 2px 4px;
    position: relative;
    overflow: hidden;
}

.title-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.7);
}

.title-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.3);
}

.title-content {
    display: flex;
    align-items: center;
    color: white;
    font-size: 18px;
    font-weight: 500;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
    flex-grow: 1;
    overflow: hidden;
}

.badges {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-right: 6px;
}

.badge {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.badge.mod {
    background: #00ad03;
    color: white;
}

.badge.vip {
    background: #e005b9;
    color: white;
}

.badge.sub {
    background: #6441a5;
    color: white;
}

.badge.bits {
    background: #9146FF;
    color: white;
}

.badge.prime {
    background: #00D4FF;
    color: white;
}

.badge.founder {
    background: #FFD700;
    color: #333;
}

.username {
    font-weight: bold;
    white-space: nowrap;
}

.window-controls {
    display: flex;
    gap: 0;
    margin-left: auto;
}

.control-btn {
    width: 16px;
    height: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 50%, #d4d0c8 100%);
    border: 1px solid;
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: normal;
    font-family: 'Marlett', monospace;
    color: #000;
}

.minimize::before {
    content: '0';
}

.maximize::before {
    content: '1';
}

.close::before {
    content: 'r';
}

.window-content {
    padding: 8px;
    background: #ffffff;
    border-top: 1px solid #c0c0c0;
    min-height: 40px;
    font-size: 13px;
    line-height: 1.4;
    color: #000;
    word-wrap: normal;
    position: relative;
    border-radius: 0 0 8px 8px;
}

.window-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
}

.chat-message {
    margin: 0;
    padding: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.emote-1x {
    width: 28px;
    height: 28px;
    vertical-align: middle;
}

.emote-2x {
    width: 56px;
    height: 56px;
    vertical-align: middle;
}

/* ===== ALERT SYSTEM ===== */
.alert_outer-container {
    margin: auto;
    width: 600px;
    overflow-wrap: normal;
}

.alert_variable-username {
    color: #ff8000;
    font-weight: 600;
}

.alert_text {
    font-family: "Orbitron", sans-serif;
    font-weight: bolder;
    font-size: 4em;
    text-align: center;
    color: white;
    -webkit-text-stroke: 3px black;
    
    /* KORREKTE Text-Umbruch Eigenschaften */
    word-wrap: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    white-space: normal;
    
    /* Maximale Breite für den Text */
    max-width: 100%;
    
    /* Zusätzliche Sicherheit für sehr lange Wörter */
    min-width: 0;
}

.alert_image-container {
    text-align: center;
}

.alert_image {
    width: 400px;
}

.followerDiv {
    margin: auto;
    width: 600px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.followerDiv.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===== GOAL WIDGET SYSTEM ===== */
.goal_widget_overlay {
    /* Feste Breite und Höhe */
    width: 500px !important;
    height: 30px !important;
    
    /* Animation auf den Hauptcontainer anwenden */
    animation: opacity-toggle var(--animation-duration) infinite ease-in-out;
    
    /* Basis-Styling */
    background: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
}

/* Anpassung der verschachtelten Container */
.goal_widget_overlay .goal_widget_v2__container {
    width: 100% !important;
    height: 100% !important;
    min-width: unset !important;
    min-height: unset !important;
    font-family: "Orbitron" !important;
    position: relative;
}

.goal_widget_overlay .tw-root--theme-dark {
    width: 100% !important;
    height: 100% !important;
    background: var(--color-primary) !important;
    border-radius: 1rem !important;
    border: none !important;
    overflow: hidden;
}

/* Der innerste Container mit den Goal-Daten */
.goal_widget_overlay .tw-root--theme-dark .goal_widget_v2__container {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    position: relative;
    z-index: 2;
}

/* Goal-Titel Styling */
.goal_widget_overlay #goalTitle {
	position: absolute !important;
	top: 0em !important;
	left: 25% !important;
	transform: translateX(-50%) !important;
	color: var(--color-light) !important;
	font-size: 2vh !important;
	font-weight: bold !important;
	text-shadow: 2px 2px 0 black, 2px 2px 0 black, 2px 2px 0 black, 2px 2px 0 black !important;
	z-index: 20 !important;
	/* font-family: var(--font-family) !important; */
}

/* Goal-Zahlen Container */
.goal_widget_overlay .tw-root--theme-dark .goal_widget_v2__container > div > div:last-child {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1rem !important;
    z-index: 2 !important;
    position: relative !important;
}

/* Goal-Zahlen Styling */
.goal_widget_overlay #goalNumber, .goal_widget_overlay #goalText {
	font-size: 3vh !important;
	color: var(--color-light) !important;
	font-family: var(--font-family) !important;
	font-weight: bold !important;
	text-shadow: -3px -3px 0 black, 3px -3px 0 black, -3px 3px 0 black, 3px 3px 0 black !important;
	line-height: 1 !important;
	right: -25% !important;
	position: relative;
}

/* Progress Bar Container */
.goal_widget_overlay #goalProgressBar {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: var(--color-primary) !important;
    border-radius: 1rem !important;
    z-index: 0 !important;
}

/* Progress Bar Dots (verstecken) */
.goal_widget_overlay #goalProgressBar > div:not(:last-child) {
    display: none !important;
}

/* Progress Bar Fill */
.goal_widget_overlay #goalProgressFill {
    height: 100% !important;
    background: var(--gradient) !important;
    border-radius: 1rem !important;
    transition: width 0.5s ease-in-out !important;
}

/* Zusätzliche Sicherheits-Styles */
.goal_widget_overlay * {
    box-sizing: border-box;
}

h1 > .magic {
  display: inline-block;
  position: relative;
}

h1 > .magic > .magic-star {
  --size: clamp(20px, 1.5vw, 30px);
  
  width: var(--size);
  height: var(--size);
  position: absolute;
  left: var(--star-left);
  top: var(--star-top);
  
  animation: magic-star-scale 700ms ease forwards;
}

h1 > .magic > .magic-star > svg {
  display: block;
  opacity: 0.7;
  
  animation: magic-star-rotate 700ms linear infinite;
}

h1 > .magic > .magic-star > svg > path {
  fill: #ff8000;
}

h1 > .magic > .magic-text {
  background: linear-gradient(
    to right,
    orange,
    #ff8000,
    orange,
    #ff8000
  );
  background-size: 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  animatioN: magic-text-pan 1.5s ease-in-out infinite;
}

@keyframes magic-text-pan {
  from {
    background-position: 0% center;
  }
  
  to {
    background-position: -200% center;
  }
}

@keyframes magic-star-scale {
  from, to {
    scale: 0;
  }
  
  50% {
    scale: 1.5;
  }
}

@keyframes magic-star-rotate {
  from {
    rotate: 0deg;
  }
  
  to {
    rotate: 180deg;
  }
}

/* Responsive Anpassungen falls nötig */
@media (max-width: 650px) {
    .goal_widget_overlay {
        width: 500px !important;
        height: 150px !important;
    }
    
    .goal_widget_overlay #goalNumber,
    .goal_widget_overlay #goalText {
        font-size: 80px !important;
    }
    
    .goal_widget_overlay #goalTitle {
        font-size: 18px !important;
        top: 10px !important;
    }
}