* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: url("/assets/images/backgrounds/bgcolcandy.jpg") repeat;
    background-color: #330033;
    font-family: 'Arial', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Header - Gentle Pulsing Glow */
.header {
    text-align: center;
    margin-bottom: 20px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.back-link {
    color: #D4B8FF;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
    transition: color 0.2s;
    order: 2;
}

.back-link:hover {
    color: #FFA500;
}

.psychic-title {
    font-family: 'PaisleyCaps', sans-serif;
    font-size: 80px;
    font-weight: 15;
    letter-spacing: 8px;
    color: #edcdff;
    animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { 
        opacity: 1;
        text-shadow: 
            0 0 10px #a200ff,
            0 0 20px #a200ff,
            0 0 30px #a200ff;
    }
    50% { 
        opacity: 0.7;
        text-shadow: 
            0 0 5px #a200ff,
            0 0 10px #a200ff,
            0 0 15px #a200ff;
    }
}

/* Content Wrapper */
.content-wrapper {
    display: flex;
    gap: 40px;
    flex: 1;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Retro TV Set */
.tv-set {
    background: linear-gradient(135deg, #8B7355, #6B5344);
    border: 35px solid #5A4A3A;
    border-radius: 50px;
    box-shadow:
        inset 0 0 30px rgba(0, 0, 0, 0.8),
        0 25px 70px rgba(0, 0, 0, 0.9),
        0 0 50px rgba(139, 115, 85, 0.5);
    flex-shrink: 0;
    position: relative;
}

.tv-set::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 30px;
    background: linear-gradient(180deg, #6B5344, #4A3728);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.tv-bezel {
    display: flex;
    gap: 15px;
}

.tv-screen {
    width: 960px;
    height: 640px;
    background: #000;
    border: 12px solid #2a2a2a;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9);
}

/* CRT Scanlines */
.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 100;
    animation: scanlineMove 10s linear infinite;
}

@keyframes scanlineMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

/* Screen Glow Effect */
.screen-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
    pointer-events: none;
    z-index: 99;
}

.video-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.tv-speaker {
    width: 80px;
    height: 640px;
    background: linear-gradient(90deg, #4a3728, #3a2a1a);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 20px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.speaker-line {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, #5a4a3a, transparent);
    border-radius: 2px;
}

.tv-stand {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 35px;
    background: linear-gradient(180deg, #5A4A3A, #4A3728);
    border-radius: 5px 5px 15px 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

/* ── Guide Overlay (collapsible row layout) ── */
.guide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(180, 130, 255, 0.95), rgba(130, 100, 200, 0.95));
    color: #fff;
    font-family: "Courier New", monospace;
    font-size: 12px;
    padding: 15px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    z-index: 100;
}

.guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #D4B8FF;
    padding-bottom: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.guide-title {
    font-weight: bold;
    color: #D4B8FF;
    font-size: 14px;
    letter-spacing: 2px;
}

.guide-time {
    color: #E8D0FF;
}

.guide-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.guide-content::-webkit-scrollbar {
    width: 8px;
}

.guide-content::-webkit-scrollbar-track {
    background: rgba(180, 130, 255, 0.1);
}

.guide-content::-webkit-scrollbar-thumb {
    background: #D4B8FF;
    border-radius: 4px;
}

/* ── Channel Row ── */
.guide-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(180, 130, 255, 0.15);
    border-radius: 4px;
    border-left: 4px solid var(--channel-color, #B388FF);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    user-select: none;
}

.guide-row:hover {
    background: rgba(200, 160, 255, 0.25);
    border-left-width: 6px;
}

.guide-row-selected {
    background: rgba(200, 160, 255, 0.35) !important;
    border-left-width: 6px;
    box-shadow: 0 0 12px rgba(200, 160, 255, 0.4), inset 0 0 20px rgba(200, 160, 255, 0.1);
}

.guide-row-expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Channel number badge */
.guide-row-badge {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Channel name */
.guide-row-name {
    flex: 1;
    font-weight: bold;
    color: #E8D0FF;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Expand/collapse indicator */
.guide-row-indicator {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #D4B8FF;
    opacity: 0.7;
    transition: transform 0.2s;
}

.guide-row-selected .guide-row-indicator {
    opacity: 1;
    color: #fff;
}

/* ── Programs Wrapper (shown below expanded row) ── */
.guide-programs-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0 4px 42px;  /* indent under the channel badge */
    border-left: 2px solid rgba(180, 130, 255, 0.2);
    margin-left: 12px;
    margin-bottom: 2px;
    animation: guideExpand 0.2s ease-out;
}

@keyframes guideExpand {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* Individual program entry */
.guide-program {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    background: rgba(180, 130, 255, 0.1);
    border-radius: 3px;
    border-left: 3px solid rgba(180, 130, 255, 0.3);
    cursor: pointer;
    transition: all 0.12s ease;
}

.guide-program:hover {
    background: rgba(200, 160, 255, 0.2);
    border-left-color: #D4B8FF;
}

.guide-program-selected {
    background: rgba(200, 160, 255, 0.3) !important;
    border-left-color: #FFFFFF !important;
    box-shadow: inset 0 0 15px rgba(200, 160, 255, 0.15);
}

.guide-program-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.guide-program-icon {
    font-size: 11px;
    flex-shrink: 0;
}

.guide-program-text {
    color: #D4B8FF;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guide-program-info {
    flex-shrink: 0;
    font-size: 10px;
    color: #E8D0FF;
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* No Signal Screen */
.no-signal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #1a1a1a 25%, transparent 25%, transparent 75%, #1a1a1a 75%, #1a1a1a),
                linear-gradient(45deg, #1a1a1a 25%, transparent 25%, transparent 75%, #1a1a1a 75%, #1a1a1a);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    background-color: #0a0a0a;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.no-signal-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 0, 255, 0.03) 0px,
        rgba(255, 0, 255, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(2px); }
}

.no-signal-text {
    position: relative;
    color: #FF00FF;
    font-size: 48px;
    font-weight: bold;
    letter-spacing: 10px;
    text-shadow: 0 0 20px #FF00FF;
    animation: slowPulse 3s ease-in-out infinite;
}

@keyframes slowPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Remote Control */
.remote {
    width: 140px;
    background: linear-gradient(135deg, #c9c9c9, #b8b8b8);
    border-radius: 20px;
    padding: 25px 15px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    flex-shrink: 0;
    margin-left: 40px;
}

.remote-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* Power Button */
.power-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff1493, #ff0066);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 20px;
    box-shadow:
        0 4px 12px rgba(255, 0, 102, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.power-btn:hover {
    background: linear-gradient(135deg, #ff2da3, #ff1493);
    transform: scale(1.05);
}

.power-btn.on {
    box-shadow:
        0 4px 15px rgba(0, 255, 100, 0.6),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #00ff64, #00cc50);
}

/* Guide Button */
.guide-btn {
    width: 90%;
    padding: 10px;
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    font-size: 11px;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.guide-btn:hover {
    background: linear-gradient(135deg, #4a4a4a, #3a3a3a);
}

.guide-btn:active {
    transform: scale(0.98);
}

/* D-Pad */
.dpad-container {
    position: relative;
    width: 110px;
    height: 110px;
}

.dpad-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
    border-radius: 50%;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.1);
}

.dpad-btn {
    position: absolute;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #4a4a4a, #3a3a3a);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.1s;
}

.dpad-btn:hover {
    background: linear-gradient(135deg, #5a5a5a, #4a4a4a);
}

.dpad-btn:active {
    transform: scale(0.98);
}

.dpad-up {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 8px 8px 3px 3px;
}

.dpad-down {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 3px 3px 8px 8px;
}

.dpad-left {
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 8px 3px 3px 8px;
}

.dpad-right {
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 3px 8px 8px 3px;
}

.dpad-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #ffcc44, #ffaa00);
    border-radius: 50%;
    font-weight: bold;
    font-size: 11px;
    color: #2a2a2a;
    box-shadow:
        0 3px 8px rgba(255, 170, 0, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.dpad-center:hover {
    background: linear-gradient(135deg, #ffd555, #ffbb11);
}

/* Button Row */
.button-row {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

/* Volume Buttons */
.volume-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.vol-btn {
    width: 45px;
    height: 35px;
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vol-btn:hover {
    background: linear-gradient(135deg, #4a4a4a, #3a3a3a);
}

.vol-btn:active {
    transform: scale(0.98);
}

/* Playback Buttons */
.playback-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.play-btn, .pause-btn {
    width: 45px;
    height: 35px;
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn:hover, .pause-btn:hover {
    background: linear-gradient(135deg, #4a4a4a, #3a3a3a);
}

.play-btn:active, .pause-btn:active {
    transform: scale(0.98);
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .tv-screen {
        width: 720px;
        height: 480px;
    }
    .tv-speaker {
        height: 480px;
    }
    .psychic-title {
        font-size: 36px;
        letter-spacing: 6px;
    }
}

@media (max-width: 1100px) {
    .tv-screen {
        width: 600px;
        height: 400px;
    }
    .tv-speaker {
        height: 400px;
        width: 60px;
    }
}

/* Retro Segmented Volume Bar */
.volume-osd {
    position: absolute;
    bottom: 40px;
    right: 30px;
    background: rgba(0, 0, 0, 0.9);
    color: #00FFFF;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s;
    border: 2px solid #00FFFF;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    min-width: 180px;
}

.volume-osd.visible {
    opacity: 1;
}

.volume-osd-label {
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 12px;
    text-align: center;
    font-size: 11px;
    color: #FFFF00;
}

.volume-osd-bar {
    width: 100%;
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00FFFF;
    border-radius: 3px;
    justify-content: center;
}

.volume-segment {
    width: 12px;
    height: 20px;
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid #00FFFF;
    border-radius: 2px;
    transition: all 0.1s;
}

.volume-segment.filled {
    background: linear-gradient(180deg, #00FFFF, #FF00FF);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.6), inset 0 0 4px rgba(255, 0, 255, 0.3);
}

.volume-osd-value {
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    color: #FFFF00;
    letter-spacing: 2px;
}

/* OSD Notifications */
.osd {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #00FFFF;
    padding: 15px 25px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    border: 2px solid #00FFFF;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.osd.visible {
    opacity: 1;
}

.osd-channel {
    font-weight: bold;
    color: #FFFF00;
    letter-spacing: 2px;
    font-size: 13px;
}

.osd-title {
    color: #00FFFF;
    margin-top: 5px;
    font-size: 11px;
}

.osd-counter {
    color: #FF00FF;
    margin-top: 3px;
    font-size: 10px;
    font-weight: bold;
}

/* Commercial Break Indicator */
.commercial-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.85);
    color: #FFFF00;
    padding: 10px 16px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    z-index: 200;
    text-align: center;
    border: 2px solid #FFFF00;
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.4);
    animation: commercialBlink 1.5s ease-in-out infinite;
    line-height: 1.5;
}

.commercial-hint {
    font-size: 9px;
    color: #FFA500;
    font-weight: normal;
    letter-spacing: 0;
}

@keyframes commercialBlink {
    0%, 100% { opacity: 1; box-shadow: 0 0 20px rgba(255, 255, 0, 0.4); }
    50% { opacity: 0.85; box-shadow: 0 0 10px rgba(255, 255, 0, 0.2); }
}

/* Playback Indicator */
.playback-indicator {
    position: absolute;
    bottom: 80px;
    right: 30px;
    background: rgba(0, 0, 0, 0.85);
    color: #FFFFFF;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-family: 'Courier New', sans-serif;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.playback-indicator.visible {
    opacity: 1;
}