body {
    font-family: 'Georgia', serif;
    background-color: #1a171b;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column; /* Add this line to stack elements vertically */
    align-items: center;
    min-height: 100vh;
    color: #333;
}
.container-nav {
    width: 100%;
    max-width: 1600px;
    text-align: center;
}
.container {
    width: 100%;
    max-width: 1000px;
    text-align: left;
}

#horror-text-container {
    color:'ffff00!important';
}

.poetry-display {
    background-color: #1a171b;
    padding-top: 3rem;
    padding-bottom: 3rem;
    padding-left: 3rem;
    padding-right: 3rem;            
    border:0;
    /*border-radius: 8px;*/
    /*box-shadow: 0 4px 20px rgba(100, 100, 100, 0.25);*/
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* FIXED: was "left" which is invalid */
    align-items: flex-start; /* ADD this to ensure left alignment */
    position: relative;
    overflow: visible;
    text-align: left; /* ADD this to force left alignment */
}

.poem {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* FIXED: was "left" which is invalid */
    align-items: flex-start; /* ADD this to ensure left alignment */
    padding: 2rem;
    transition: all 1s ease-in-out;
    text-align: left; /* ADD this to force left alignment */
}

.poem.active {
    opacity: 1;
    z-index: 10 !important; /* Ensure active poem is on top */
}

/* Transition variations */
.transition-fade {
    transition: opacity 1s ease-in-out;
}

.transition-slide-up {
    transform: translateY(50px);
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

.transition-slide-up.active {
    transform: translateY(0);
}

.transition-slide-down {
    transform: translateY(-50px);
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

.transition-slide-down.active {
    transform: translateY(0);
}

.transition-zoom {
    transform: scale(0.9);
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

.transition-zoom.active {
    transform: scale(1);
}

.transition-rotate {
    transform: rotate(2deg);
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

.transition-rotate.active {
    transform: rotate(0);
}

/* ADD these rules to maintain alignment during transitions */
.poem.transition-fade,
.poem.transition-slide-up,
.poem.transition-slide-down,
.poem.transition-zoom,
.poem.transition-rotate {
    text-align: left !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
}

.poem.transition-fade .poem-content,
.poem.transition-slide-up .poem-content,
.poem.transition-slide-down .poem-content,
.poem.transition-zoom .poem-content,
.poem.transition-rotate .poem-content {
    text-align: left !important;
}

/* ADDED: Keep rating stars left-aligned during transitions */
.poem.transition-fade .rating-container,
.poem.transition-slide-up .rating-container,
.poem.transition-slide-down .rating-container,
.poem.transition-zoom .rating-container,
.poem.transition-rotate .rating-container {
    align-items: flex-start !important;
}

.poem.transition-fade .stars,
.poem.transition-slide-up .stars,
.poem.transition-slide-down .stars,
.poem.transition-zoom .stars,
.poem.transition-rotate .stars {
    align-self: flex-start !important;
}

.poem-content {
    /*font-family: Arial;*/
    font-size: 2.5rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    color: #e4f400;
    text-align: left !important; /* ADD this to explicitly force left alignment */
    width: 100%; /* ADD this to ensure full width */
}

.poem-author a {
    color:#7d47bf;
    text-decoration: none;
}
.poem-stats {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-count {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.view-count i {
    font-size: 0.9rem;
    color: #aaa;
}

/* Styles for disabled stars */
.stars.disabled {
    opacity: 0.5; /* Make stars appear greyed out */
    position: relative; /* For tooltip positioning */
    cursor: not-allowed; /* Show "forbidden" cursor */
    display: inline-block; /* Contains the tooltip */
}

/* Style for disabled stars that show average rating */
.stars.disabled .star-avg {
    color: #ccc; /* Light grey for all stars by default */
    position: relative;
    display: inline-block;
    margin: 0 2px;
}

/* Fill stars based on average rating */
.stars.disabled .star-avg.filled {
    color: #888; /* Darker grey for filled stars to indicate average */
}

/* Tooltip container */
.stars.disabled .tooltip-text {
    visibility: hidden;
    width: 140px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -70px;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Tooltip arrow */
.stars.disabled .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

/* Show tooltip on hover */
.stars.disabled:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Message below the stars */
.stars.disabled + .star-rating-text {
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}

/* Enhanced loading message with clock animation */
.loading-message {
    width:100%;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 0;
    color:#ffff00;
}

.loading-message.active {
    opacity: 1;
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* Enhanced clock icon animation */
.clock-icon {
    font-size: 7.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: rotate 3s linear infinite;
    position: relative;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.clock-icon i {
    animation: pulse-glow 2s alternate infinite;
}

@keyframes pulse-glow {
    0% {
        text-shadow: 0 0 5px rgba(228, 244, 0, 0.3);
        color: #e4f400;
    }
    100% {
        text-shadow: 0 0 20px rgba(228, 244, 0, 0.8), 0 0 30px rgba(228, 244, 0, 0.6);
        color: #ffff33;
    }
}

/* Loading dots animation */
#loading-dots {
    display: inline-block;
    min-width: 24px;
    text-align: left;
}

.controls {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    background-color: #4a4a4a;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
}

.btn:hover {
    background-color: #333;
}

.user-info {
    position: absolute;
    top: 0rem;
    left: 1rem;
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info a {
    color: #4a4a4a;
    text-decoration: none;
}

.user-info a:hover {
    text-decoration: underline;
}

/* Super aggressive star rating CSS - FIXED Z-INDEX ISSUES */
.rating-container {
    margin-top: 1rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important; /* FIXED: Changed from center to flex-start */
    position: relative !important;
    width: 100% !important; /* Ensure full width */
    z-index: 1010 !important; /* INCREASED: Higher than trophy icon (1000) */
}

/* Star Rating */
.stars {
    direction: rtl !important; /* Right to left for easier hover effect */
    display: inline-flex !important;
    margin-bottom: 0.5rem !important;
    z-index: 1011 !important; /* INCREASED: Higher than trophy icon */
    position: relative !important;
    align-self: flex-start !important; /* ADDED: Ensure stars align to the left */
}

/* Hide the actual radio inputs */
.stars input[type="radio"] {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Style for the star labels */
.stars label {
    color: #ddd !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    padding: 0 0.1rem !important;
    transition: color 0.2s ease !important;
    display: inline-block !important;
    z-index: 1012 !important; /* INCREASED: Highest z-index for clickability */
    position: relative !important;
}

/* This is the key part: when hovering a label, color it and all previous ones gold */
.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label {
    color: gold !important;
}

.star-rating-text {
    font-size: 0.8rem !important;
    color: #666 !important;
    margin-top: 0.5rem !important;
    height: 1.2em !important;
    z-index: 1011 !important; /* INCREASED */
    position: relative !important;
}

.thank-you-message {
    color: #4a9e4a !important;
    font-weight: bold !important;
    font-size: 0.9rem !important;
    margin-top: 0.5rem !important;
    opacity: 0 !important;
    transition: opacity 0.5s ease !important;
    height: 1.2em !important;
    z-index: 1011 !important; /* INCREASED */
    position: relative !important;
    display: block !important;
    visibility: visible !important;
}

.thank-you-message.visible {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}

.rating-info {
    font-size: 0.75rem !important;
    color: #888 !important;
    margin-top: 0.5rem !important;
    z-index: 1011 !important; /* INCREASED */
    position: relative !important;
}

/* Make sure everything in the active poem is visible */
.poem.active .rating-container,
.poem.active .stars,
.poem.active .star-rating-text,
.poem.active .thank-you-message,
.poem.active .rating-info {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}

.poem.active .thank-you-message {
    opacity: 0 !important; /* But keep this hidden until needed */
}

.poem.active .thank-you-message.visible {
    opacity: 1 !important;
}

/* Filter Controls */
.filter-controls {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.filter-label {
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
}

.filter-select {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: white;
    cursor: pointer;
    min-width: 180px;
}

/* Status indicator for filters */
.filter-status {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    height: 1.2em;
}

/* Login prompt */
.login-prompt {
    margin: 1rem 0;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.login-prompt a {
    color: #4a4a4a;
    font-weight: bold;
    text-decoration: none;
}

.login-prompt a:hover {
    text-decoration: underline;
}

.scoreboard-header {
    font-family: 'Cinzel', serif;
    text-align: center;
    margin-bottom: 2rem;
    color: #d1c4e9;
    position: relative;
    padding-bottom: 1.5rem;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}
.scoreboard-header:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: linear-gradient(90deg, #1A171B, #ffff00, #1A171B);
}

/* FIXED: Trophy icon with reduced z-index and pointer-events disabled */
.trophy-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #ce93d8;
    text-shadow: 0 0 10px rgba(206, 147, 216, 0.5);
    z-index: 2050 !important; /* REDUCED: Lower than rating stars */
}

@media screen and (max-width: 948px) {
        .trophy-icon {
            display: none;
        }
}

/* Desktop - FIXED: Trophy icon with reduced z-index and pointer-events disabled */
@media screen and (min-width: 1024px) {
        .trophy-icon {
            font-size: 2.5rem;
            margin-bottom: 1rem;
            color: #ce93d8;
            text-shadow: 0 0 10px rgba(206, 147, 216, 0.5);
        }
}

.user-info {
    
}
.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #4a148c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #d1c4e9;
    border: 2px solid #8e24aa;
    box-shadow: 0 0 10px rgba(142, 36, 170, 0.3);
}

.user-avatar-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding:2px;
    border: 2px solid #8e24aa;
    box-shadow: 0 0 10px rgba(142, 36, 170, 0.3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #4a148c; /* Fallback background color */
}

.user-avatar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
} 

a.username_profile_link {
    text-decoration: none;
    color: #999;
    font-weight: 800;
}

a.username_profile_link:hover {
    color:#ffff00;
}




.filter-controls {
   display: flex;
   justify-content: center;
   gap: 20px;
   margin-bottom: 30px;
   flex-wrap: wrap;
}

.filter-group {
   display: flex;
   align-items: center;
   min-width: 200px;
}

.limit-select {
   background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
   border: 2px solid #ffff00;
   border-radius: 12px;
   color: #888888;
   padding: 8px 18px;
   font-weight: 600;
   font-size: 1em;
   cursor: pointer;
   transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
   position: relative;
   box-shadow: 
       0 4px 15px rgba(255, 255, 0, 0.2),
       inset 0 1px 3px rgba(255, 255, 255, 0.1);
   min-width: 180px;
   text-align: center;
   line-height: 1.2;
}

.limit-select:hover {
   background: linear-gradient(135deg, #3d3d3d 0%, #2a2a2a 100%);
   border-color: #ffd700;
   color: #ffd700;
   box-shadow: 
       0 0 25px rgba(255, 215, 0, 0.4),
       0 0 50px rgba(255, 215, 0, 0.2),
       inset 0 1px 3px rgba(255, 255, 255, 0.2);
   transform: translateY(-2px) scale(1.02);
}

.limit-select:focus {
   outline: none;
   border-color: #ffd700;
   color: #ffd700;
   box-shadow: 
       0 0 30px rgba(255, 215, 0, 0.6),
       0 0 60px rgba(255, 215, 0, 0.3),
       0 0 90px rgba(255, 215, 0, 0.1),
       inset 0 1px 3px rgba(255, 255, 255, 0.3);
   transform: translateY(-2px) scale(1.02);
   animation: golden-pulse 2s infinite;
}

.limit-select:active {
   transform: translateY(0) scale(1.01);
   box-shadow: 
       0 0 20px rgba(255, 215, 0, 0.5),
       inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.limit-select option {
   background: #1a1a1a;
   color: #c9aa71;
   padding: 6px 12px;
   border: none;
   font-weight: 500;
   line-height: 1.3;
}

.limit-select option:hover {
   background: #2d2d2d;
   color: #ffd700;
}

.limit-select option:checked {
   background: linear-gradient(135deg, #c9aa71 0%, #ffd700 100%);
   color: #1a1a1a;
   font-weight: 700;
}

/* Custom tooltip styling */
.limit-select[title]:hover::after {
   content: attr(title);
   position: absolute;
   bottom: 120%;
   left: 50%;
   transform: translateX(-50%);
   background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
   color: #ffd700;
   padding: 8px 12px;
   border-radius: 6px;
   font-size: 0.9em;
   white-space: nowrap;
   border: 1px solid #ffd700;
   box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
   z-index: 1000;
   opacity: 0;
   animation: tooltip-fade-in 0.3s ease forwards;
   pointer-events: none;
}

.limit-select[title]:hover::before {
   content: '';
   position: absolute;
   bottom: 110%;
   left: 50%;
   transform: translateX(-50%);
   border: 6px solid transparent;
   border-top-color: #ffd700;
   z-index: 1001;
   opacity: 0;
   animation: tooltip-fade-in 0.3s ease forwards;
}

@keyframes tooltip-fade-in {
   from {
       opacity: 0;
       transform: translateX(-50%) translateY(10px);
   }
   to {
       opacity: 1;
       transform: translateX(-50%) translateY(0);
   }
}

@keyframes golden-pulse {
   0% {
       box-shadow: 
           0 0 25px rgba(255, 215, 0, 0.4),
           0 0 50px rgba(255, 215, 0, 0.2);
   }
   50% {
       box-shadow: 
           0 0 35px rgba(255, 215, 0, 0.6),
           0 0 70px rgba(255, 215, 0, 0.3);
   }
   100% {
       box-shadow: 
           0 0 25px rgba(255, 215, 0, 0.4),
           0 0 50px rgba(255, 215, 0, 0.2);
   }
}

.filter-status {
   text-align: center;
   margin-top: 15px;
   color: #c9aa71;
   font-style: italic;
   text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

@media (max-width: 768px) {
   .filter-controls {
       flex-direction: row;
       justify-content: space-between;
       align-items: flex-start;
       gap: 10px;
       padding: 0 10px;
   }
   
   .filter-group {
       min-width: auto;
       flex: 1;
   }
   
   .limit-select {
       min-width: auto;
       width: 100%;
       padding: 6px 12px;
       font-size: 0.9em;
   }
   
   /* Adjust tooltip for mobile */
   .limit-select[title]:hover::after {
       font-size: 0.8em;
       padding: 6px 10px;
       bottom: 110%;
   }
}

@media (max-width: 480px) {
   .limit-select {
       padding: 4px 10px;
       font-size: 0.85em;
   }
   
   .limit-select option {
       padding: 4px 8px;
   }
}



        /* Audio control styles */
        .audio-controls-container {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 1000;
            transition: all 0.3s ease;
        }

        .audio-control {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: rgba(74, 20, 140, 0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: #d1c4e9;
            box-shadow: 0 0 10px rgba(142, 36, 170, 0.5);
            transition: all 0.3s ease;
            opacity: 0.6;
            margin-left: auto;
        }
        
        .audio-control:hover {
            opacity: 1;
            transform: scale(1.1);
        }
        
        .audio-control.audio-off {
            background-color: rgba(70, 70, 70, 0.7);
            animation: none;
        }
        
        /* Pulse animation for audio button */
        @keyframes pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(142, 36, 170, 0.7);
                transform: scale(1);
            }
            70% {
                box-shadow: 0 0 0 10px rgba(142, 36, 170, 0);
                transform: scale(1.05);
            }
            100% {
                box-shadow: 0 0 0 0 rgba(142, 36, 170, 0);
                transform: scale(1);
            }
        }
        
        .pulse-animation {
            animation: pulse 2s infinite;
        }

        /* Expandable controls */
        .audio-controls-expanded {
            background: rgba(26, 23, 27, 0.95);
            border-radius: 25px;
            padding: 8px;
            border: 1px solid rgba(142, 36, 170, 0.3);
            backdrop-filter: blur(10px);
            display: flex;
            align-items: center;
            gap: 8px;
            opacity: 0;
            transform: translateX(50px) scale(0.8);
            pointer-events: none;
            transition: all 0.3s ease;
            white-space: nowrap;
        }

        .audio-controls-container:hover .audio-controls-expanded {
            opacity: 1;
            transform: translateX(0) scale(1);
            pointer-events: all;
        }

        .source-select, .category-select {
            background: rgba(74, 20, 140, 0.3);
            border: 1px solid rgba(142, 36, 170, 0.5);
            color: #d1c4e9;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 11px;
            outline: none;
            cursor: pointer;
        }

        .source-select {
            min-width: 60px;
        }

        .category-select {
            min-width: 100px;
        }

        .source-select option, .category-select option {
            background: #1a171b;
            color: #d1c4e9;
        }

        .skip-btn {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background-color: rgba(74, 20, 140, 0.5);
            border: 1px solid rgba(142, 36, 170, 0.5);
            color: #d1c4e9;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            transition: all 0.2s ease;
        }

        .skip-btn:hover {
            background-color: rgba(74, 20, 140, 0.8);
            transform: scale(1.1);
        }

        /* Track info display */
        .track-info {
            position: fixed;
            bottom: 20px;
            right: 70px;
            background: rgba(26, 23, 27, 0.9);
            padding: 8px 12px;
            border-radius: 20px;
            border: 1px solid rgba(142, 36, 170, 0.3);
            backdrop-filter: blur(10px);
            max-width: 300px;
            transition: all 0.3s ease;
            z-index: 999;
            opacity: 0;
            transform: translateX(20px);
        }

        .track-info.visible {
            opacity: 0.9;
            transform: translateX(0);
        }

        .track-info:hover {
            opacity: 1;
        }

        .track-name {
            color: #d1c4e9;
            font-size: 12px;
            font-weight: 500;
            margin-bottom: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .track-artist {
            color: #a29bfe;
            font-size: 10px;
            opacity: 0.8;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .audio-element {
            display: none;
        }

        /* Mobile responsive */
        @media (max-width: 768px) {
            .track-info {
                right: 10px;
                bottom: 70px;
                max-width: 200px;
            }
            
            .audio-controls-container {
                right: 10px;
                bottom: 10px;
            }

            .audio-controls-expanded {
                transform: translateX(30px) scale(0.8);
            }

            .audio-controls-container:hover .audio-controls-expanded {
                transform: translateX(0) scale(0.9);
            }

            .source-select {
                min-width: 50px;
                font-size: 10px;
            }

            .category-select {
                min-width: 80px;
                font-size: 10px;
            }
        }

        /* Enhanced poem content styling for dynamic sizing */
.poem-content {
    flex-grow: 1;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 200px;
    padding: 20px;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word;
    hyphens: auto;
    transition: font-size 0.3s ease-in-out;
    line-height: 1.4 !important;
    max-height: calc(100vh - 300px);
    overflow: hidden;
}

/* Ensure poem container takes full height */
.poem {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 100px);
    max-height: 100vh;
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-height: 600px) {
    .poem-content {
        min-height: 150px;
        padding: 15px;
    }
}

@media (max-height: 400px) {
    .poem-content {
        min-height: 100px;
        padding: 10px;
    }
}


/* Mobile responsive */
@media (max-width: 768px) {
   .poem-content {
        margin-top:40px!important;
    }

}

/* live stats */
        .stats-container {
            position: fixed !important;
            bottom: 0 !important;
            left: 0 !important;
            right: 0 !important;
            width: 100vw !important;
            display: flex;
            gap: 20px;
            align-items: center;
            flex-wrap: nowrap;
            justify-content: center;
            overflow-x: auto;
            z-index: 9999 !important;
            margin: 0 !important;
            transform: none !important;
        }
        
        .filter-controls {
            display: flex;
            gap: 15px;
            align-items: center;
        }
        
        .filter-group {
            display: flex;
            flex-direction: column;
            align-items: center;
            min-width: 120px;
        }
        
        .limit-select {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            border-radius: 8px;
            color: white;
            padding: 8px 12px;
            font-size: 0.85em;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            appearance: none;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 8px center;
            background-size: 16px;
            padding-right: 35px;
            min-width: 100px;
        }
        
        .limit-select:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
            background: linear-gradient(135deg, #7b8fea 0%, #8659b2 100%);
        }
        
        .limit-select:focus {
            outline: none;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
        }
        
        .limit-select option {
            background: #444;
            color: white;
            padding: 5px;
        }
        
        .stat-item {
            padding: 15px;
            /*background: linear-gradient(45deg, #f093fb 0%, #f5576c 50%, #4facfe 100%);*/
            border-radius: 15px;
            color: white;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            text-align: center;
            min-width: 120px;
            flex-shrink: 0;
        }
        
        .stat-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
        }
        
        .stat-label {
            font-size: 0.8em;
            font-weight: 500;
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        
        .stat-value {
            font-size: 1.3em;
            font-weight: bold;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            transition: all 0.5s ease;
        }
        
        .stat-value.updating {
            transform: scale(1.1);
            text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
        }
        
        .last-updated {
            color: #666;
            font-size: 0.8em;
            font-style: italic;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 15px;
            border-radius: 15px;
            min-width: 150px;
            text-align: center;
            flex-shrink: 0;
        }
        
        .status-indicator {
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin-right: 6px;
            transition: all 0.3s ease;
        }
        
        .status-online {
            background: #4CAF50;
            box-shadow: 0 0 8px #4CAF50;
        }
        
        .status-offline {
            background: #f44336;
            box-shadow: 0 0 8px #f44336;
        }
        
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.01); }
            100% { transform: scale(1); }
        }
        
        .updating {
            animation: pulse 0.5s ease-in-out;
        }
        
        /* Responsive design for smaller screens */
        @media (max-width: 768px) {
            .stats-container {
                gap: 6px;
                justify-content: flex-start;
                overflow-x: auto;
            }
            
            .filter-controls {
                gap: 5px;
            }
            
            .filter-group {
                min-width: 65px;
            }
            
            .limit-select {
                font-size: 0.65em;
                padding: 5px 6px;
                padding-right: 22px;
                min-width: 60px;
                background-size: 11px;
                background-position: right 5px center;
            }
            
            .stat-item {
                min-width: 50px;
                padding: 6px 3px;
            }
            
            .stat-label {
                font-size: 0.5em;
                margin-bottom: 3px;
            }
            
            .stat-value {
                font-size: 0.8em;
            }
            
            .last-updated {
                font-size: 0.55em;
                min-width: 75px;
                padding: 6px 3px;
            }
            
            .status-indicator {
                width: 7px;
                height: 7px;
                margin-right: 3px;
            }
        }
        
.hideonmobile {
    display: block!important;
}
.showonmobile {
    display: none!important;
}

.fa-question-circle {
    color:#aaa!important;
}

        /* Extra small screens */
        @media (max-width: 480px) {
            .showonmobile {
                display: block!important;
            }
            .hideonmobile {
                display: none!important;
            }
            .stats-container {
                gap: 3px;
            }
            
            .filter-controls {
                gap: 3px;
            }
            
            .filter-group {
                min-width: 50px;
            }
            
            .limit-select {
                font-size: 0.5em;
                padding: 3px 4px;
                padding-right: 15px;
                min-width: 45px;
                background-size: 8px;
                background-position: right 2px center;
            }
            
            .stat-item {
                min-width: 40px;
                padding: 4px 2px;
            }
            
            .stat-label {
                font-size: 0.4em;
                margin-bottom: 2px;
            }
            
            .stat-value {
                font-size: 0.65em;
            }
            
            .last-updated {
                font-size: 0.45em;
                min-width: 55px;
                padding: 4px 2px;
            }
        }
        
        /* iPhone specific - very aggressive sizing */
        @media (max-width: 390px) {
            .stats-container {
                gap: 2px;
            }
            
            .filter-controls {
                gap: 2px;
            }
            
            .filter-group {
                min-width: 42px;
            }
            
            .limit-select {
                font-size: 0.45em;
                padding: 2px 3px;
                padding-right: 13px;
                min-width: 38px;
                background-size: 7px;
                background-position: right 1px center;
            }
            
            .stat-item {
                min-width: 32px;
                padding: 3px 1px;
            }
            
            .stat-label {
                font-size: 0.35em;
                margin-bottom: 1px;
            }
            
            .stat-value {
                font-size: 0.55em;
            }
            
            .last-updated {
                font-size: 0.4em;
                min-width: 45px;
                padding: 3px 1px;
            }
        }




        /* Enhanced poem content styling for dynamic sizing */
        .poem-content {
            display: block !important; /* CHANGED: Remove flex centering */
            text-align: left !important; /* CHANGED: Always left aligned */
            padding: 20px;
            white-space: pre-wrap !important;
            word-wrap: break-word !important;
            overflow-wrap: break-word;
            hyphens: auto;
            transition: font-size 0.3s ease-in-out;
            line-height: 1.4 !important;
    overflow: visible !important; /* FIXED */
    max-height: none !important; /* ADDED */
    height: auto !important; /* ADDED */
    margin-bottom: 0;
        }

        /* UPDATED: Make poem container only as tall as needed */
        .poem {
            display: block; /* CHANGED: Remove flex that was forcing full height */
            padding: 20px;
            overflow: visible; /* CHANGED: Allow natural flow */
            /* REMOVED: min-height and max-height constraints */
        }

        /* UPDATED: Rating container sits directly below content */
        .rating-container {
            padding: 10px 0; /* REDUCED: Minimal spacing */
            margin: 0; /* REMOVED: All margins */
        }

        /* UPDATED: Metadata section with minimal spacing */
        .poem-metadata {
            margin: 5px 0; /* REDUCED: Very tight margins */
            overflow: hidden;
            display: flex;
            align-items: center;
            gap: 15px;
            margin: 10px 0;
            font-size: 16px; 
            color: #666; 
            flex-wrap: wrap;
        }

        /* Responsive adjustments */
        @media (max-height: 600px) {
            .poem-content {
                padding: 15px;
            }
            .rating-container {
                padding: 8px 0;
            }
            .poem-metadata {
                margin: 3px 0;
            }
        }

        @media (max-height: 400px) {
            .poem-content {
                padding: 10px;
            }
            .rating-container {
                padding: 5px 0;
            }
            .poem-metadata {
                margin: 2px 0;
            }
        }



@media (max-width: 768px) {
    .poem-content {
        zoom: 0.67; /* Actually changes layout space */
        padding: 15px !important;
    }
    
    .poem-metadata {
        zoom: 0.82;
        gap: 10px !important;
    }
}