* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #3c2415 0%, #2d1810 50%, #1a0e08 100%);
    min-height: 100vh;
    color: #f5f5dc;
}

.header {
    background: rgba(26, 14, 8, 0.8);
    backdrop-filter: blur(10px);
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #d2691e, #cd853f, #daa520);
    background-size: 300% 300%;
    animation: gradient 3s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.channel-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.channel-toggle {
    position: relative;
}

.channel-toggle input[type="checkbox"] {
    display: none;
}

.channel-toggle label {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(60, 36, 21, 0.6);
    border: 2px solid rgba(210, 105, 30, 0.5);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    color: #f5f5dc;
}

.channel-toggle label:hover {
    background: rgba(60, 36, 21, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    border-color: rgba(210, 105, 30, 0.8);
}

.channel-toggle input[type="checkbox"]:checked + label {
    background: linear-gradient(45deg, #8b4513, #a0522d);
    border-color: rgba(210, 105, 30, 1);
    color: #f5f5dc;
    font-weight: 700;
}

.play-all-btn, .toggle-maximized-btn {
    background: linear-gradient(45deg, #cd853f, #d2691e);
    border: 2px solid rgba(210, 105, 30, 0.5);
    color: #f5f5dc;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
}

.play-all-btn:hover, .toggle-maximized-btn:hover {
    background: linear-gradient(45deg, #b8860b, #cd853f);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.main-container {
    display: flex;
    height: calc(100vh - 170px);
    padding: 20px;
    gap: 20px;
}

.main-container.full-grid {
    justify-content: center;
}

.grid-container {
    background: rgba(26, 14, 8, 0.6);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.grid-container.with-maximized {
    flex: none;
    width: 24%;
}

.grid-container.full-width {
    width: 100%;
}

.streams-grid {
    display: grid;
    gap: 15px;
    height: 100%;
}

.streams-grid.grid-4x3 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.streams-grid.grid-3x4 {
    grid-template-columns: repeat(1, 1fr);
    grid-template-rows: repeat(4, 1fr);
}

.stream-slot {
    background: rgba(60, 36, 21, 0.4);
    border-radius: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(210, 105, 30, 0.5);
    transition: all 0.3s ease;
}

.stream-slot.active {
    border: 2px solid #cd853f;
    background: rgba(26, 14, 8, 0.8);
}

.stream-slot.empty {
    color: rgba(245, 245, 220, 0.6);
    font-size: 0.9rem;
    text-align: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.empty-slot-text {
    text-align: center;
    line-height: 1.4;
}

.stream-embed {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    position: relative;
}

.stream-embed iframe {
    width: 100%;
    height: calc(100% - 40px);
    border: none;
    border-radius: 8px;
}

.full-width .stream-embed iframe {
    height: 100%;
    object-fit: contain;
}

.stream-controls {
    position: absolute;
    bottom: 5px;
    left: 10px;
    right: 10px;
    z-index: 10;
}

.maximize-btn {
    background: linear-gradient(45deg, #8b4513, #a0522d);
    border: none;
    color: #f5f5dc;
    padding: 8px 16px;
    border-radius: 6px;
    display: block;
    width: 100%;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.maximize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.featured-container {
    flex: 1;
    background: rgba(26, 14, 8, 0.6) url(./peak.webp) center/cover no-repeat;
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: row;
    gap: 15px;
}

.featured-container.hidden {
    display: none;
}

.featured-stream {
    flex: 0.7;
    height: 100%;
    border-radius: 10px;
    display: none;
}

.featured-stream.active {
    display: block;
}

.featured-stream iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: 10px;
}

.featured-chat {
    flex: 0.3;
    height: 100%;
    border-radius: 10px;
    display: none;
}

.featured-chat.active {
    display: block;
}

.featured-chat iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 10px;
}

.no-featured {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(245, 245, 220, 0.7);
    font-size: 1.2rem;
}

.channel-name {
    position: absolute;
    top: 5px;
    left: 10px;
    background: rgba(26, 14, 8, 0.9);
    color: #f5f5dc;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 10;
}

.no-featured span{
    display: inline-block;
    padding: 10px 20px;
    background: rgba(0,0,0,.9);
}

@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
        height: auto;
    }
    
    .streams-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
        height: 400px;
    }
    
    .featured-container {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .streams-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(6, 1fr);
    }
    
    .channel-controls {
        gap: 10px;
    }
    
    .channel-toggle label {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}