* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: url('resources/Gifs/BackgroundCity.gif') no-repeat center center fixed;
    background-size: cover;
    color: #e0e0e0;
    overflow-x: hidden;
    min-height: 150vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 150vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeIn 2s ease-in-out forwards;
}

.title {
    font-size: 3.5rem;
    font-weight: 300;
    color: #00ffff;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    margin-bottom: 1rem;
    letter-spacing: 3px;
}

.subtitle {
    font-size: 1.2rem;
    color: #b0b0b0;
    font-weight: 300;
    letter-spacing: 2px;
}

.content {
    position: relative;
    min-height: 80vh;
    margin-top: 2rem;
}

.card {
    position: absolute;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(3px);
    border: 3px solid rgba(0, 255, 255, 0.4);
    border-radius: 0;
    padding: 1.2rem;
    transition: all 0.3s ease;
    opacity: 0;
    animation: cardFloat 8s ease-in-out infinite;
    animation-delay: 0.5s;
    max-width: 260px;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.2),
        inset 0 0 10px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    top: 10%;
    left: 5%;
    transform: none;
}

.sleepy-cat {
    position: absolute;
    top: -55px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 80px;
    z-index: 5;
    animation: catFloat 8s ease-in-out infinite;
    animation-delay: 0.5s;
    filter: brightness(0.4) contrast(1.3) saturate(0.7);
}

.cat-glow {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 30px;
    background: radial-gradient(ellipse, rgba(0, 255, 255, 0.4) 0%, rgba(0, 255, 255, 0.1) 50%, transparent 100%);
    border-radius: 50%;
    animation: glowFloat 8s ease-in-out infinite;
    animation-delay: 0.5s;
    z-index: 6;
}

@keyframes catFloat {
    0%, 100% {
        transform: translateX(-50%) translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateX(-50%) translateY(-3px) rotate(0.2deg);
    }
    50% {
        transform: translateX(-50%) translateY(-1px) rotate(-0.2deg);
    }
    75% {
        transform: translateX(-50%) translateY(-5px) rotate(0.4deg);
    }
}

@keyframes glowFloat {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.6;
    }
    25% {
        transform: translateX(-50%) scale(1.1);
        opacity: 0.8;
    }
    50% {
        transform: translateX(-50%) scale(0.9);
        opacity: 0.5;
    }
    75% {
        transform: translateX(-50%) scale(1.2);
        opacity: 0.9;
    }
}

.credits-box {
    position: absolute;
    bottom: 5%;
    right: 2%;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(3px);
    border: 3px solid rgba(0, 255, 255, 0.4);
    border-radius: 0;
    padding: 1rem;
    transition: all 0.5s ease;
    opacity: 0;
    animation: cardFloat 8s ease-in-out infinite;
    animation-delay: 1s;
    max-width: 200px;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.2),
        inset 0 0 10px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    cursor: pointer;
    z-index: 15;
}

.credits-box:hover {
    transform: scale(1.05);
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.credits-box.expanded {
    max-width: 400px;
    max-height: 300px;
    overflow-y: auto;
}

.credits-title {
    color: #00ffff;
    font-size: 1.1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
    image-rendering: pixelated;
    margin-bottom: 0.5rem;
}

.credits-content {
    color: #d0d0d0;
    line-height: 1.4;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
    image-rendering: pixelated;
    white-space: pre-line;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.5s ease;
}

.credits-box.expanded .credits-content {
    max-height: 250px;
    opacity: 1;
    margin-top: 0.5rem;
}

.radio-box {
    position: absolute;
    top: 35%;
    right: 2%;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(3px);
    border: 3px solid rgba(0, 255, 255, 0.4);
    border-radius: 0;
    padding: 1rem;
    transition: all 0.5s ease;
    opacity: 0;
    animation: cardFloat 8s ease-in-out infinite;
    animation-delay: 1.5s;
    max-width: 200px;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.2),
        inset 0 0 10px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    cursor: pointer;
    z-index: 15;
}

.radio-box:hover {
    transform: scale(1.05);
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.radio-title {
    color: #00ffff;
    font-size: 1.1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
    image-rendering: pixelated;
    margin-bottom: 0.5rem;
}

.song-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.current-song {
    color: #d0d0d0;
    line-height: 1.4;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
    image-rendering: pixelated;
    white-space: pre-line;
    flex: 1;
}

.radio-controls {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.radio-btn {
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid rgba(0, 255, 255, 0.4);
    color: #00ffff;
    padding: 0.3rem 0.6rem;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.radio-btn:hover {
    background: rgba(0, 255, 255, 0.3);
    border-color: rgba(0, 255, 255, 0.6);
    transform: scale(1.05);
}

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

.radio-waveform {
    display: flex;
    gap: 2px;
    height: 16px;
    align-items: flex-end;
    flex-shrink: 0;
}

.waveform-line {
    width: 2px;
    background: #00ffff;
    border-radius: 1px;
    animation: waveform 1.5s ease-in-out infinite;
    box-shadow: 0 0 3px rgba(0, 255, 255, 0.6);
}

.radio-waveform.paused .waveform-line {
    animation: none;
    height: 2px;
    opacity: 0.4;
}

.waveform-line:nth-child(1) {
    animation-delay: 0s;
}

.waveform-line:nth-child(2) {
    animation-delay: 0.2s;
}

.waveform-line:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes waveform {
    0%, 100% {
        height: 4px;
        opacity: 0.6;
    }
    25% {
        height: 12px;
        opacity: 1;
    }
    50% {
        height: 8px;
        opacity: 0.8;
    }
    75% {
        height: 16px;
        opacity: 1;
    }
}

.card:hover {
    transform: scale(1.05) rotate(1deg);
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    z-index: 10;
}

.card h3 {
    color: #00ffff;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
    image-rendering: pixelated;
}

.card p {
    color: #d0d0d0;
    line-height: 1.4;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
    image-rendering: pixelated;
}

.scrolling-text {
    height: 200px;
    overflow: hidden;
    position: relative;
    margin-top: 1rem;
}

.scrolling-content {
    color: #d0d0d0;
    line-height: 1.4;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
    image-rendering: pixelated;
    animation: scrollText 180s linear infinite;
    white-space: pre-line;
}

@keyframes scrollText {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100%);
    }
}

.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-element {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(0, 255, 255, 0.6);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(1) { left: 10%; animation-delay: 0s; }
.floating-element:nth-child(2) { left: 20%; animation-delay: 1s; }
.floating-element:nth-child(3) { left: 30%; animation-delay: 2s; }
.floating-element:nth-child(4) { left: 40%; animation-delay: 3s; }
.floating-element:nth-child(5) { left: 50%; animation-delay: 4s; }
.floating-element:nth-child(6) { left: 60%; animation-delay: 5s; }
.floating-element:nth-child(7) { left: 70%; animation-delay: 0.5s; }
.floating-element:nth-child(8) { left: 80%; animation-delay: 1.5s; }
.floating-element:nth-child(9) { left: 90%; animation-delay: 2.5s; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0px);
        opacity: 0.9;
    }
    25% {
        transform: translateY(-3px);
        opacity: 1;
    }
    50% {
        transform: translateY(-1px);
        opacity: 0.95;
    }
    75% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

.footer {
    text-align: center;
    margin-top: 3rem;
    opacity: 0;
    animation: fadeIn 2s ease-in-out forwards;
    animation-delay: 1.5s;
}

.footer p {
    color: #808080;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    body {
        min-height: 180vh; /* Increase minimum height for more scrolling */
    }
    
    .container {
        padding: 1rem;
        min-height: 180vh; /* Match body height */
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .content {
        grid-template-columns: 1fr;
    }
    
    /* Mobile layout adjustments - better spacing */
    .card {
        top: 8%;
        left: 5%;
        max-width: 200px;
        z-index: 10;
    }
    
    .radio-box {
        top: 8%;
        right: 5%;
        max-width: 150px;
        z-index: 20;
    }
    
    .credits-box {
        bottom: 8%;
        right: 5%;
        max-width: 150px;
        z-index: 12;
    }
    
    .quietroom-box {
        right: 5%;
        top: 120%;
        max-width: 100px;
        max-height: 100px;
        z-index: 13;
    }
    
    .lowkeyroom-box {
        left: 5%;
        top: 120%;
        max-width: 100px;
        max-height: 100px;
        z-index: 13;
    }
    
    /* Adjust song info layout for smaller screens */
    .song-info {
        flex-direction: column;
        gap: 0.3rem;
        align-items: flex-start;
    }
    
    .radio-waveform {
        align-self: center;
    }
    
    /* Reduce font sizes for mobile */
    .current-song {
        font-size: 0.65rem;
    }
    
    .radio-title, .credits-title {
        font-size: 1rem;
    }
    
    .credits-content {
        font-size: 0.65rem;
    }
    
    .radio-btn {
        font-size: 0.6rem;
        padding: 0.25rem 0.5rem;
    }
    
    .news-box {
        left: 50%;
        top: 70%;
        width: 450px;
        max-height: 100px;
        z-index: 17;
        transform: translateX(-50%);
    }
    
    .news-scroll-container {
        height: 50px;
    }
    
    .news-scroll-content {
        font-size: 2rem;
    }
    
    .news-title {
        font-size: 1rem;
    }
    
    /* Ensure proper spacing */
    .header {
        margin-bottom: 2rem;
    }
    
    .content {
        margin-top: 1rem;
    }
}

/* Mobile landscape specific adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        min-height: 400vh; /* Significantly increase minimum height for more scrolling */
    }
    
    .container {
        min-height: 400vh; /* Match body height */
        padding: 1rem 0.5rem;
    }
    
    /* Main card positioning - spread out across the increased height */
    .card {
        top: 5%;
        left: 5%;
        max-width: 180px;
        z-index: 10;
    }
    
    /* Radio box - position to avoid overlap */
    .radio-box {
        top: 5%;
        right: 5%;
        max-width: 140px;
        z-index: 20;
    }
    
    /* Credits box - position much further down */
    .credits-box {
        bottom: 5%;
        right: 5%;
        max-width: 120px;
        z-index: 21;
    }
    
    /* Quiet room box - spread out much more */
    .quietroom-box {
        left: 5%;
        top: 15%;
        max-width: 100px;
        max-height: 100px;
        z-index: 13;
    }
    
    /* Lowkey room box - spread out much more */
    .lowkeyroom-box {
        right: 5%;
        top: 15%;
        max-width: 100px;
        max-height: 100px;
        z-index: 13;
    }
    
    /* News box - position much further down */
    .news-box {
        left: 50%;
        top: 75%;
        transform: translateX(-50%);
        width: 350px;
        max-height: 70px;
        z-index: 18;
    }
    
    .news-scroll-container {
        height: 35px;
    }
    
    .news-scroll-content {
        font-size: 0.6rem;
    }
    
    /* Reduce font sizes for better fit */
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .card h3 {
        font-size: 1.1rem;
    }
    
    .card p {
        font-size: 0.75rem;
    }
    
    .radio-title, .credits-title {
        font-size: 0.9rem;
    }
    
    .current-song {
        font-size: 0.6rem;
    }
    
    .credits-content {
        font-size: 0.6rem;
    }
    
    .radio-btn {
        font-size: 0.55rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Ensure proper spacing between elements */
    .header {
        margin-bottom: 2rem;
    }
    
    .content {
        margin-top: 1rem;
    }
    
    /* Add more vertical spacing to the main content */
    .content {
        min-height: 350vh; /* Use most of the 400vh height */
        position: relative;
    }
    
    /* Spread out the floating elements more */
    .floating-elements {
        min-height: 400vh;
    }
    
    /* Adjust floating element positions for better distribution */
    .floating-element:nth-child(1) { left: 10%; top: 10%; animation-delay: 0s; }
    .floating-element:nth-child(2) { left: 20%; top: 30%; animation-delay: 1s; }
    .floating-element:nth-child(3) { left: 30%; top: 50%; animation-delay: 2s; }
    .floating-element:nth-child(4) { left: 40%; top: 70%; animation-delay: 3s; }
    .floating-element:nth-child(5) { left: 50%; top: 90%; animation-delay: 4s; }
    .floating-element:nth-child(6) { left: 60%; top: 110%; animation-delay: 5s; }
    .floating-element:nth-child(7) { left: 70%; top: 130%; animation-delay: 0.5s; }
    .floating-element:nth-child(8) { left: 80%; top: 150%; animation-delay: 1.5s; }
    .floating-element:nth-child(9) { left: 90%; top: 170%; animation-delay: 2.5s; }
}

.quietroom-box {
    position: absolute;
    right: 5%;
    top: 10%;
    transform: translateY(-50%);
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(3px);
    border: 3px solid rgba(0, 255, 255, 0.4);
    border-radius: 0;
    padding: 0.5rem;
    transition: all 0.5s ease;
    opacity: 0;
    animation: cardFloat 8s ease-in-out infinite;
    animation-delay: 2s;
    max-width: 210px;
    max-height: 210px;
    overflow: hidden;
    z-index: 14;
    margin: 10px; /* Add safety margin */
}

.quietroom-box:hover {
    transform: translateY(-50%) scale(1.05);
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.quietroom-gif {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: pixelated;
}

.lowkeyroom-box {
    position: absolute;
    left: 10%;
    top: 55%;
    transform: translateY(-50%);
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(3px);
    border: 3px solid rgba(0, 255, 255, 0.4);
    border-radius: 0;
    padding: 0.5rem;
    transition: all 0.5s ease;
    opacity: 0;
    animation: cardFloat 8s ease-in-out infinite;
    animation-delay: 2.5s;
    max-width: 400px;
    max-height: 400px;
    overflow: hidden;
    z-index: 15;
    margin: 10px; /* Add safety margin */
}

.lowkeyroom-box:hover {
    transform: translateY(-50%) scale(1.05);
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.lowkeyroom-gif {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: pixelated;
}

.news-box {
    position: absolute;
    left: 30%;
    top: 15%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(3px);
    border: 3px solid rgba(0, 255, 255, 0.4);
    border-radius: 0;
    padding: 1rem;
    transition: all 0.5s ease;
    opacity: 0;
    animation: cardFloat 8s ease-in-out infinite;
    animation-delay: 2.5s;
    width: 500px;
    max-height: 140px;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.2),
        inset 0 0 10px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    z-index: 16;
    margin: 10px; /* Add safety margin */
}

.news-box:hover {
    transform: translate(-50%, -50%) scale(1.05);
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.news-title {
    color: #FF3131;
    font-size: 2rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
    image-rendering: pixelated;
    margin-bottom: 0.5rem;
    text-align: center;
}

.news-scroll-container {
    height: 60px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.news-scroll-content {
    color: #d0d0d0;
    line-height: 1.4;
    font-size: 1.5rem;
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
    image-rendering: pixelated;
    white-space: nowrap;
    animation: scrollNews 500s linear infinite;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    width: max-content;
}

@keyframes scrollNews {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-33.33%);
    }
}

/* Phone Rotation Overlay */
.phone-rotation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: 'Courier New', monospace;
}

.phone-rotation-overlay.show {
    display: flex;
}

.rotation-content {
    text-align: center;
    color: #00ffff;
    padding: 2rem;
    max-width: 300px;
}

.rotation-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: rotate 2s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

.rotation-text {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    line-height: 1.5;
}

@keyframes rotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(90deg);
    }
    50% {
        transform: rotate(90deg);
    }
    75% {
        transform: rotate(90deg);
    }
}

/* Hide overlay on landscape orientation */
@media (orientation: landscape) {
    .phone-rotation-overlay {
        display: none !important;
    }
}

/* Only show overlay on mobile devices in portrait mode */
@media (max-width: 768px) and (orientation: portrait) {
    .phone-rotation-overlay {
        display: flex;
    }
}

/* Additional mobile improvements for better spacing */
@media (max-width: 768px) {
    /* Ensure elements don't get cut off */
    .card, .radio-box, .credits-box, .quietroom-box, .lowkeyroom-box, .news-box {
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }
    
    /* Prevent horizontal overflow */
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Ensure proper container width */
    .container {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
}
