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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0e0e0e 0%, #232323 100%);
    min-height: 100vh;
    padding-top: 56px;
}

/* ── Sticky header ── */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    height: 56px;
    background: rgba(14, 14, 14, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
}

.app-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    margin-right: 8px;
    white-space: nowrap;
}

.layout-btn {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.layout-btn:hover {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
}

.layout-btn.active {
    background: linear-gradient(135deg, #4b0283 0%, #850aef 100%);
    color: #fff;
    border-color: transparent;
}

/* ── Main content ── */
.main-container {
    width: 90%;
    margin: 0 auto;
    padding: 24px 0;
}

/* ── Cards ── */
.box-shadow {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.8);
}

.bg-twitch-gradient {
    background: linear-gradient(135deg, #4b0283 0%, #850aef 100%);
}

.btn-check:focus + .btn,
.btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.header-offline {
    cursor: not-allowed !important;
    opacity: 0.72;
}

/* ── Status indicators ── */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
    flex-shrink: 0;
}

.status-offline {
    background: #e53935;
}

.status-live {
    background: #43a047;
    animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% { box-shadow: 0 0 0 0 rgba(67, 160, 71, 0.6); }
    50%       { box-shadow: 0 0 0 5px rgba(67, 160, 71, 0); }
}

.status-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    vertical-align: middle;
}

/* ── Theater icon in card header ── */
.theater-icon {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: color 0.15s;
}

.theater-icon.visible {
    color: rgba(255, 255, 255, 0.75);
}

.theater-icon:hover {
    color: #fff;
}

/* ── Theater overlay ── */
.theater-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #000;
    display: flex;
}

.theater-video-wrap {
    flex: 1;
    min-width: 0;
    height: 100vh;
    position: relative;
}

#theater-video,
.theater-video-wrap .op-wrapper {
    width: 100% !important;
    height: 100% !important;
}

.theater-chat {
    width: 340px;
    flex-shrink: 0;
    background: #0e0e0e;
    overflow: hidden;
    transition: width 0.25s ease;
}

.theater-chat.hidden {
    width: 0;
}

.theater-controls {
    position: absolute;
    top: 14px;
    right: 354px;
    display: flex;
    gap: 8px;
    z-index: 2100;
    transition: right 0.25s ease;
}

.theater-controls.chat-hidden {
    right: 14px;
}

.theater-ctrl-btn {
    background: rgba(0, 0, 0, 0.75);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    padding: 6px 13px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.theater-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
}
